|
|
@@ -41,6 +41,19 @@ RemotePackConfig::RemotePackConfig(QObject *parent) : QObject(parent)
|
|
|
|
|
|
// parsefUNS.insert("A2000213",[this](const QJsonObject & obj){this->_config.buDingZhongTongShuFanWei = this->getConfigpAIR(obj);});
|
|
|
// parsefUNS.insert("A2000214",[this](const QJsonObject & obj){this->_config.dingZhongTongShuFanwei = this->getConfigpAIR(obj);});
|
|
|
+ parsefUNS.insert("A2000215",[this](const QJsonObject & obj){this->_config.morenRuKuMaDanFenShu = this->getConfigInt(obj);});
|
|
|
+// parsefUNS.insert("A2000216",[this](const QJsonObject & obj){this->_config.buDingZhongXianZhiFanWei = this->getConfigpAIR(obj);});
|
|
|
+ parsefUNS.insert("A2000217",[this](const QJsonObject & obj){this->_config.daBaoZhuangDaYinXiangDanFenShu = this->getConfigInt(obj);});
|
|
|
+ parsefUNS.insert("A2000218",[this](const QJsonObject & obj){this->_config.daBaoZhuangMaoZhongFanWei = this->getConfigInt(obj);});
|
|
|
+ parsefUNS.insert("A2000219",[this](const QJsonObject & obj){this->_config.ziDongDaBaoXiangZhongFanWei = this->getConfigInt(obj);});
|
|
|
+ parsefUNS.insert("A2000220",[this](const QJsonObject & obj){this->_config.zidongDaBaoMaoZhongFanWei = this->getConfigInt(obj);});
|
|
|
+ parsefUNS.insert("A3000300",[this](const QJsonObject & obj){this->_config.morenDaYinHuaMaDan = this->getConfigInt(obj);});
|
|
|
+ parsefUNS.insert("A3000301",[this](const QJsonObject & obj){this->_config.morenXiaoShouXianShiJinE = this->getConfigInt(obj);});
|
|
|
+ parsefUNS.insert("A3000302",[this](const QJsonObject & obj){this->_config.morenDayinXiaoShouMinXidan = this->getConfigInt(obj);});
|
|
|
+ parsefUNS.insert("A3000303",[this](const QJsonObject & obj){this->_config.morenDaYinXIaoShouDan = this->getConfigInt(obj);});
|
|
|
+ parsefUNS.insert("A3000304",[this](const QJsonObject & obj){this->_config.morenXianShiQianKuan = this->getConfigInt(obj);});
|
|
|
+ parsefUNS.insert("A3000305",[this](const QJsonObject & obj){this->_config.xiaoShouEJingDu = this->getConfigInt(obj);});
|
|
|
+
|
|
|
|
|
|
//TODO:http://doc.vanlai.net:3001/web/#/1?page_id=57 补全剩下
|
|
|
//http://erp.itwsw.cn/#/packageCon
|
|
|
@@ -51,11 +64,35 @@ RemotePackConfig::RemotePackConfig(QObject *parent) : QObject(parent)
|
|
|
QList<DIYPackConfig> RemotePackConfig::getDiys(const QJsonObject & data)
|
|
|
{
|
|
|
// TODO:
|
|
|
+ QJsonArray value_array = data["value"].toArray();
|
|
|
+ DIYPackConfig DTYConfig;
|
|
|
+ QList<DIYPackConfig> DTYConfigList;
|
|
|
+ for(int i = 0;i<value_array.size();i++){
|
|
|
+ QJsonObject obj = value_array.at(i).toObject();
|
|
|
+ DTYConfig.type = obj["packaging_type"].toInt();
|
|
|
+ DTYConfig.danDianXiaXian = obj["danding_lower_limit"].toInt();
|
|
|
+ DTYConfig.danDianShangXian = obj["danding_upper_limit"].toInt();
|
|
|
+ DTYConfig.jingZhongXiaXian = obj["net_weight_lower_limit"].toInt();
|
|
|
+ DTYConfig.jingZhongShangXian = obj["net_weight_upper_limit"].toInt();
|
|
|
+ DTYConfigList.append(DTYConfig);
|
|
|
+ }
|
|
|
+ return DTYConfigList;
|
|
|
}
|
|
|
|
|
|
QList<POYPackConfig> RemotePackConfig::getPoys(const QJsonObject & data)
|
|
|
{
|
|
|
// TODO:
|
|
|
+ QJsonArray value_array = data["value"].toArray();
|
|
|
+ POYPackConfig POYConfig;
|
|
|
+ QList<POYPackConfig> POYConfigList;
|
|
|
+ for(int i = 0;i<value_array.size();i++){
|
|
|
+ QJsonObject obj = value_array.at(i).toObject();
|
|
|
+ POYConfig.type = obj["packaging_type"].toInt();
|
|
|
+ POYConfig.jingZhongXiaXian = obj["net_weight_lower_limit"].toInt();
|
|
|
+ POYConfig.jingZhongShangXian = obj["net_weight_upper_limit"].toInt();
|
|
|
+ POYConfigList.append(POYConfig);
|
|
|
+ }
|
|
|
+ return POYConfigList;
|
|
|
}
|
|
|
|
|
|
void RemotePackConfig::refConfig()
|
|
|
@@ -88,12 +125,27 @@ void RemotePackConfig::result(int code, const QJsonObject & body)
|
|
|
refDengJiList();
|
|
|
} else {
|
|
|
// TODO: 解析等级列表
|
|
|
+ QJsonArray object = body.value("data").toArray();
|
|
|
+ DengJiConfigItem dengJiConfig;
|
|
|
+ for(int i = 0; i<object.size();i++){
|
|
|
+ QJsonObject obj = object.at(i).toObject();
|
|
|
+ dengJiConfig.id = obj.value("level_id").toInt();
|
|
|
+ dengJiConfig.value = obj.value("name").toString();
|
|
|
+ dengJiConfig.isEnable = obj.value("is_disable").toBool();
|
|
|
+ dengji.append(dengJiConfig);
|
|
|
+ }
|
|
|
+ emit dengJIConfigUp(dengji);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void RemotePackConfig::refDengJiList()
|
|
|
{
|
|
|
+ getDdengji = true;
|
|
|
// todo: http://doc.vanlai.net:3001/web/#/1?page_id=35
|
|
|
+ QString url = GlobalInfo::this_()->config().baseUrl+"/v1/level/list";
|
|
|
+ _request.setUserToken(QString::number(GlobalInfo::this_()->user().accountId),GlobalInfo::this_()->user().acessToken);
|
|
|
+ _request.get(url);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
bool RemotePackConfig::getConfigBool(const QJsonObject & data)
|