|  |  |  | 
|---|
|  |  |  | </PropertyDef> | 
|---|
|  |  |  | <PropertyDef name="recordStatus"> | 
|---|
|  |  |  | <Property></Property> | 
|---|
|  |  |  | <Property name="label">数据状态</Property> | 
|---|
|  |  |  | <Property name="label">单据状态</Property> | 
|---|
|  |  |  | <Property name="mapping"> | 
|---|
|  |  |  | <Property name="mapValues">${dorado.getDataProvider("dicTriggerPR#dicTrigger").getResult("RECORD_STATUS")}</Property> | 
|---|
|  |  |  | <Property name="mapValues">${dorado.getDataProvider("inoutDataPR#triggerRecordStatus1").getResult()}</Property> | 
|---|
|  |  |  | <Property name="keyProperty">code</Property> | 
|---|
|  |  |  | <Property name="valueProperty">name</Property> | 
|---|
|  |  |  | </Property> | 
|---|
|  |  |  | 
|---|
|  |  |  | <Property name="label">扣价</Property> | 
|---|
|  |  |  | </PropertyDef> | 
|---|
|  |  |  | <PropertyDef name="result"> | 
|---|
|  |  |  | <Property/> | 
|---|
|  |  |  | <Property></Property> | 
|---|
|  |  |  | <Property name="label">检验结果</Property> | 
|---|
|  |  |  | </PropertyDef> | 
|---|
|  |  |  | <PropertyDef name="operaSymbolValue"> | 
|---|
|  |  |  | <Property/> | 
|---|
|  |  |  | <Property></Property> | 
|---|
|  |  |  | </PropertyDef> | 
|---|
|  |  |  | </DataType> | 
|---|
|  |  |  | </Model> | 
|---|
|  |  |  | 
|---|
|  |  |  | //默认查询查询提条件
 | 
|---|
|  |  |  | view.get("#dsQuery").insert({
 | 
|---|
|  |  |  | type:TYPE,
 | 
|---|
|  |  |  | recordStatus:'NORMAL',
 | 
|---|
|  |  |  | deptId:deptId
 | 
|---|
|  |  |  | });
 | 
|---|
|  |  |  | 
 | 
|---|
|  |  |  | 
|---|
|  |  |  | edit = function(){
 | 
|---|
|  |  |  | var data = view.get("#dataGridMain.currentEntity");
 | 
|---|
|  |  |  | if(!data) return;
 | 
|---|
|  |  |  | 
 | 
|---|
|  |  |  | if ("RECORD" == data.get("progress")) {
 | 
|---|
|  |  |  | view.get("#btnOK").set("visible",true);
 | 
|---|
|  |  |  | }else{
 | 
|---|
|  |  |  | 
|---|
|  |  |  | });
 | 
|---|
|  |  |  | };
 | 
|---|
|  |  |  | </ClientEvent> | 
|---|
|  |  |  | <ClientEvent name="onCreate">
 | 
|---|
|  |  |  | /**
 | 
|---|
|  |  |  | * 自动计算,当前页面不自动关联扦样记录,全部由手动为准
 | 
|---|
|  |  |  | * 
 | 
|---|
|  |  |  | * 1.净重 = 毛重 - 皮重
 | 
|---|
|  |  |  | * 2.总扣重 = 现场扣重 + 其他扣重 + 扣水杂质
 | 
|---|
|  |  |  | * 3.结算重量 = 净重 - 总扣重 (含水杂增重)
 | 
|---|
|  |  |  | * 4.出/入库重量 = 净重 - 总扣重 (不含水杂增重)
 | 
|---|
|  |  |  | * 
 | 
|---|
|  |  |  | * 5.入库时:扣水杂 正数 = 扣重,负数 = 增重
 | 
|---|
|  |  |  | * 6.出库时:水分增重,正数=增重,负数=扣重
 | 
|---|
|  |  |  | */
 | 
|---|
|  |  |  | deAutoByWeight = function(name){
 | 
|---|
|  |  |  | 
 | 
|---|
|  |  |  | if(null == name) name = "1";
 | 
|---|
|  |  |  | 
 | 
|---|
|  |  |  | var curData = view.get("#dsMain.data:#");
 | 
|---|
|  |  |  | var fullWeight = curData.get("fullWeight");
 | 
|---|
|  |  |  | var emptyWeight = curData.get("emptyWeight");
 | 
|---|
|  |  |  | 
 | 
|---|
|  |  |  | if(fullWeight == 0 || emptyWeight == 0){
 | 
|---|
|  |  |  | return;
 | 
|---|
|  |  |  | }
 | 
|---|
|  |  |  | // 净重
 | 
|---|
|  |  |  | var netWeight = Number(fullWeight) - Number(emptyWeight);
 | 
|---|
|  |  |  | 
 | 
|---|
|  |  |  | if (netWeight <= 0){
 | 
|---|
|  |  |  | $notify("净重小于0,当前称重存在逻辑问题");
 | 
|---|
|  |  |  | return;
 | 
|---|
|  |  |  | }
 | 
|---|
|  |  |  | 
 | 
|---|
|  |  |  | //汇总结果
 | 
|---|
|  |  |  | var deSum = 0, addSum = 0, settleWeight = 0, recordWeight = 0;
 | 
|---|
|  |  |  | //扣水杂
 | 
|---|
|  |  |  | var deWet = 0;
 | 
|---|
|  |  |  | 
 | 
|---|
|  |  |  | var impurity = 0;
 | 
|---|
|  |  |  | 
 | 
|---|
|  |  |  | 
 | 
|---|
|  |  |  | var deBase = 0, multiple = 0;
 | 
|---|
|  |  |  | var checkItems = curData.get("checkItems");
 | 
|---|
|  |  |  | 
 | 
|---|
|  |  |  | /** 总扣重,不含增重*/
 | 
|---|
|  |  |  | deSum = Number(curData.get("deOther")) + Number(curData.get("deHandle"));
 | 
|---|
|  |  |  | 
 | 
|---|
|  |  |  | //出库
 | 
|---|
|  |  |  | if ("OUT" == curData.get("type")) {
 | 
|---|
|  |  |  | if (Number(deWet) > 0) {//增重
 | 
|---|
|  |  |  | addSum = addSum + Number(deWet);
 | 
|---|
|  |  |  | } else {
 | 
|---|
|  |  |  | deSum = deSum + Number(deWet);
 | 
|---|
|  |  |  | }
 | 
|---|
|  |  |  | 
 | 
|---|
|  |  |  | if (Number(deImpurity) > 0) {//扣重
 | 
|---|
|  |  |  | deSum = deSum + Number(deImpurity);
 | 
|---|
|  |  |  | } else {
 | 
|---|
|  |  |  | addSum = addSum + Number(deImpurity);
 | 
|---|
|  |  |  | }
 | 
|---|
|  |  |  | }else{
 | 
|---|
|  |  |  | if (Number(deWet) > 0) {//扣重
 | 
|---|
|  |  |  | deSum = deSum + Number(deWet);
 | 
|---|
|  |  |  | } else {
 | 
|---|
|  |  |  | addSum = addSum + Number(deWet);
 | 
|---|
|  |  |  | }
 | 
|---|
|  |  |  | if (Number(deImpurity) > 0) {//扣重
 | 
|---|
|  |  |  | deSum = deSum + Number(deImpurity);
 | 
|---|
|  |  |  | } else {
 | 
|---|
|  |  |  | addSum = addSum + Number(deImpurity);
 | 
|---|
|  |  |  | }
 | 
|---|
|  |  |  | }
 | 
|---|
|  |  |  | 
 | 
|---|
|  |  |  | deSum = deSum.toFixed(0);
 | 
|---|
|  |  |  | /** 增重转正数,便于计算  */
 | 
|---|
|  |  |  | addSum = Math.abs(addSum).toFixed(0);
 | 
|---|
|  |  |  | 
 | 
|---|
|  |  |  | /** 入库重量 = 净重 - 总扣重  */
 | 
|---|
|  |  |  | recordWeight = Number(netWeight) - Number(deSum);
 | 
|---|
|  |  |  | 
 | 
|---|
|  |  |  | /** 结算重量 = 净重 - 总扣重 + 增重 */
 | 
|---|
|  |  |  | settleWeight = Number(netWeight) - Number(deSum) + Number(addSum);
 | 
|---|
|  |  |  | 
 | 
|---|
|  |  |  | curData.set("netWeight",netWeight);
 | 
|---|
|  |  |  | curData.set("settleWeight",settleWeight);
 | 
|---|
|  |  |  | curData.set("recordWeight",recordWeight);
 | 
|---|
|  |  |  | };
 | 
|---|
|  |  |  | 
 | 
|---|
|  |  |  | /**
 | 
|---|
|  |  |  | * 根据化验项和传递过来的参数获取当前参数的配置信息
 | 
|---|
|  |  |  | * @param checkItems
 | 
|---|
|  |  |  | * @param code1 系统参数ID
 | 
|---|
|  |  |  | * @param code2 国标参数ID
 | 
|---|
|  |  |  | * @returns {undefined}
 | 
|---|
|  |  |  | */
 | 
|---|
|  |  |  | function getCheckItem(checkItems, code1, code2) {
 | 
|---|
|  |  |  | if (!checkItems) return null;
 | 
|---|
|  |  |  | $.each(checkItems, function (index, checkItem) {
 | 
|---|
|  |  |  | if (checkItem.get("standardId") == code1 || checkItem.get("standardId") == code2) {
 | 
|---|
|  |  |  | if (checkItem.get("ruleNum") && checkItem.get("upperLimit") > 0.0) {
 | 
|---|
|  |  |  | return checkItem;
 | 
|---|
|  |  |  | }
 | 
|---|
|  |  |  | }
 | 
|---|
|  |  |  | });
 | 
|---|
|  |  |  | return null;
 | 
|---|
|  |  |  | }</ClientEvent> | 
|---|
|  |  |  | <Property name="packages">font-awesome,css-common</Property> | 
|---|
|  |  |  | <Property name="javaScriptFile">./static/plugins/lodop/LodopFuncs.js</Property> | 
|---|
|  |  |  | <DataSet id="dsMain"> | 
|---|
|  |  |  | 
|---|
|  |  |  | </Editor> | 
|---|
|  |  |  | </AutoFormElement> | 
|---|
|  |  |  | <AutoFormElement> | 
|---|
|  |  |  | <Property name="name">userId</Property> | 
|---|
|  |  |  | <Property name="property">userId</Property> | 
|---|
|  |  |  | <Editor> | 
|---|
|  |  |  | <TextEditor> | 
|---|
|  |  |  | <Property name="blankText">-- 支持模糊 --</Property> | 
|---|
|  |  |  | </TextEditor> | 
|---|
|  |  |  | </Editor> | 
|---|
|  |  |  | </AutoFormElement> | 
|---|
|  |  |  | <AutoFormElement> | 
|---|
|  |  |  | <Property name="name">depotId</Property> | 
|---|
|  |  |  | <Property name="property">depotId</Property> | 
|---|
|  |  |  | <Property name="trigger">autoMappingDropDown2</Property> | 
|---|
|  |  |  | 
|---|
|  |  |  | <Property name="name">orderTag</Property> | 
|---|
|  |  |  | <Property name="property">orderTag</Property> | 
|---|
|  |  |  | <Property name="trigger">autoMappingDropDown1</Property> | 
|---|
|  |  |  | <Editor/> | 
|---|
|  |  |  | </AutoFormElement> | 
|---|
|  |  |  | <AutoFormElement> | 
|---|
|  |  |  | <Property name="name">recordStatus</Property> | 
|---|
|  |  |  | <Property name="property">recordStatus</Property> | 
|---|
|  |  |  | <Editor/> | 
|---|
|  |  |  | </AutoFormElement> | 
|---|
|  |  |  | <Container layout="hbox regionPadding:15"> | 
|---|
|  |  |  | 
|---|
|  |  |  | </Button> | 
|---|
|  |  |  | <Button id="btnFlushCheck" layoutConstraint="left"> | 
|---|
|  |  |  | <ClientEvent name="onClick">flushCheckList();</ClientEvent> | 
|---|
|  |  |  | <Property name="caption">获取质检项</Property> | 
|---|
|  |  |  | <Property name="caption">重新获取质检项</Property> | 
|---|
|  |  |  | <Property name="exClassName">btn-default</Property> | 
|---|
|  |  |  | <Property name="iconClass">fa fa-gavel</Property> | 
|---|
|  |  |  | <Property name="visible">false</Property> | 
|---|
|  |  |  | 
|---|
|  |  |  | <AutoFormElement> | 
|---|
|  |  |  | <Property name="name">foodLocation</Property> | 
|---|
|  |  |  | <Property name="property">foodLocation</Property> | 
|---|
|  |  |  | <Property name="trigger">ddFoodOrigin</Property> | 
|---|
|  |  |  | <Property name="trigger">ddDicArea</Property> | 
|---|
|  |  |  | <Editor/> | 
|---|
|  |  |  | </AutoFormElement> | 
|---|
|  |  |  | </AutoForm> | 
|---|
|  |  |  | 
|---|
|  |  |  | var id = self.getDom().id;
 | 
|---|
|  |  |  | var prop = id.substring(2,id.length);
 | 
|---|
|  |  |  | deAutoByWeight(prop);
 | 
|---|
|  |  |  | </ClientEvent> | 
|---|
|  |  |  | </ClientEvent> | 
|---|
|  |  |  | <Property name="name">fullWeight</Property> | 
|---|
|  |  |  | <Property name="property">fullWeight</Property> | 
|---|
|  |  |  | <Editor/> | 
|---|
|  |  |  | 
|---|
|  |  |  | <Editor/> | 
|---|
|  |  |  | </AutoFormElement> | 
|---|
|  |  |  | <AutoFormElement layoutConstraint="colSpan:2"> | 
|---|
|  |  |  | <ClientEvent name="onBlur">//id 规则 d_prop
 | 
|---|
|  |  |  | var id = self.getDom().id;
 | 
|---|
|  |  |  | var prop = id.substring(2,id.length);
 | 
|---|
|  |  |  | deAutoByWeight(prop);</ClientEvent> | 
|---|
|  |  |  | <Property name="name">deCheck</Property> | 
|---|
|  |  |  | <Property name="property">deCheck</Property> | 
|---|
|  |  |  | <Editor/> | 
|---|
|  |  |  | </AutoFormElement> | 
|---|
|  |  |  | <AutoFormElement layoutConstraint="colSpan:2"> | 
|---|
|  |  |  | <ClientEvent name="onBlur">//id 规则 d_prop
 | 
|---|
|  |  |  | var id = self.getDom().id;
 | 
|---|
|  |  |  | var prop = id.substring(2,id.length);
 | 
|---|
|  |  |  | deAutoByWeight(prop);</ClientEvent> | 
|---|
|  |  |  | <Property name="name">addCheck</Property> | 
|---|
|  |  |  | <Property name="property">addCheck</Property> | 
|---|
|  |  |  | <Editor/> | 
|---|
|  |  |  | 
|---|
|  |  |  | <Property name="titleName">单据列表</Property> | 
|---|
|  |  |  | <Property name="dataScope">currentPage</Property> | 
|---|
|  |  |  | </Export2ReportAction> | 
|---|
|  |  |  | <CustomDropDown id="ddFoodOrigin"> | 
|---|
|  |  |  | <CustomDropDown id="ddDicArea"> | 
|---|
|  |  |  | <Property name="minHeight">500</Property> | 
|---|
|  |  |  | <Property name="assignmentMap">foodLocation=name</Property> | 
|---|
|  |  |  | <Property name="minWidth">500</Property> | 
|---|
|  |  |  | <Property name="assignmentMap">foodLocation=name,foodLocationId=code</Property> | 
|---|
|  |  |  | <Container layout="regionPadding:5"> | 
|---|
|  |  |  | <DataSet id="dsFoodOrigin"> | 
|---|
|  |  |  | <Property name="dataProvider"></Property> | 
|---|
|  |  |  | <Property name="dataType">[dtFoodOrigin]</Property> | 
|---|
|  |  |  | <DataSet id="dsDicArea"> | 
|---|
|  |  |  | <Property name="dataProvider">dicAreaPR#pageList</Property> | 
|---|
|  |  |  | <Property name="parameter"></Property> | 
|---|
|  |  |  | <Property name="pageSize">30</Property> | 
|---|
|  |  |  | <Property name="dataType">[dtArea]</Property> | 
|---|
|  |  |  | <Property name="pageSize">1000</Property> | 
|---|
|  |  |  | </DataSet> | 
|---|
|  |  |  | <Container layout="hbox regionPadding:5"> | 
|---|
|  |  |  | <TextEditor id="key2"> | 
|---|
|  |  |  | <Property name="blankText"> -- 编码或者名称 --</Property> | 
|---|
|  |  |  | <Property name="blankText"> -名称或简拼,北京市  bjs -</Property> | 
|---|
|  |  |  | <Property name="width">200</Property> | 
|---|
|  |  |  | </TextEditor> | 
|---|
|  |  |  | <Button> | 
|---|
|  |  |  | <ClientEvent name="onClick">var key = view.get("#key2.value");
 | 
|---|
|  |  |  | view.get("#dsFoodOrigin").set("parameter",{key:key}).flushAsync();</ClientEvent> | 
|---|
|  |  |  | view.get("#dsDicArea").set("parameter",{key:key}).flushAsync();</ClientEvent> | 
|---|
|  |  |  | <Property name="caption">查询</Property> | 
|---|
|  |  |  | <Property name="iconClass">fa fa-search</Property> | 
|---|
|  |  |  | </Button> | 
|---|
|  |  |  | <Button> | 
|---|
|  |  |  | <ClientEvent name="onClick">var data = view.get("#dsFoodOrigin.data:#");
 | 
|---|
|  |  |  | <ClientEvent name="onClick">var data = view.get("#dsDicArea.data:#");
 | 
|---|
|  |  |  | if(data){
 | 
|---|
|  |  |  | view.get("#ddFoodOrigin").close(data.toJSON());
 | 
|---|
|  |  |  | view.get("#ddDicArea").close(data.toJSON());
 | 
|---|
|  |  |  | }</ClientEvent> | 
|---|
|  |  |  | <Property name="iconClass">fa fa-check</Property> | 
|---|
|  |  |  | <Property name="caption">确定</Property> | 
|---|
|  |  |  | </Button> | 
|---|
|  |  |  | </Container> | 
|---|
|  |  |  | <DataGrid> | 
|---|
|  |  |  | <ClientEvent name="onDataRowDoubleClick">var data = view.get("#dsFoodOrigin.data:#");
 | 
|---|
|  |  |  | <ClientEvent name="onDataRowDoubleClick">var data = view.get("#dsDicArea.data:#");
 | 
|---|
|  |  |  | if(data){
 | 
|---|
|  |  |  | view.get("#ddFoodOrigin").close(data.toJSON());
 | 
|---|
|  |  |  | view.get("#ddDicArea").close(data.toJSON());
 | 
|---|
|  |  |  | }</ClientEvent> | 
|---|
|  |  |  | <Property name="dataSet">dsFoodOrigin</Property> | 
|---|
|  |  |  | <Property name="dataSet">dsDicArea</Property> | 
|---|
|  |  |  | <Property name="readOnly">true</Property> | 
|---|
|  |  |  | <DataColumn name="code"> | 
|---|
|  |  |  | <Property name="property">code</Property> | 
|---|
|  |  |  | <Property name="readOnly">true</Property> | 
|---|
|  |  |  | <Property name="align">center</Property> | 
|---|
|  |  |  | </DataColumn> | 
|---|
|  |  |  | <DataColumn name="name"> | 
|---|
|  |  |  | <ClientEvent name="onRenderCell">arg.dom.style.fontWeight = "bold";
 | 
|---|
|  |  |  | arg.processDefault = true;</ClientEvent> | 
|---|
|  |  |  | <Property name="property">name</Property> | 
|---|
|  |  |  | <Property name="readOnly">true</Property> | 
|---|
|  |  |  | <Property name="align">center</Property> | 
|---|
|  |  |  | </DataColumn> | 
|---|
|  |  |  | <DataColumn name="code"> | 
|---|
|  |  |  | <Property name="property">code</Property> | 
|---|
|  |  |  | <Property name="readOnly">true</Property> | 
|---|
|  |  |  | <Property name="align">center</Property> | 
|---|
|  |  |  | </DataColumn> | 
|---|
|  |  |  | 
|---|
|  |  |  | </DataColumn> | 
|---|
|  |  |  | </DataGrid> | 
|---|
|  |  |  | <DataPilot layoutConstraint="bottom"> | 
|---|
|  |  |  | <Property name="dataSet">dsFoodOrigin</Property> | 
|---|
|  |  |  | <Property name="dataSet">dsDicArea</Property> | 
|---|
|  |  |  | </DataPilot> | 
|---|
|  |  |  | </Container> | 
|---|
|  |  |  | </CustomDropDown> | 
|---|
|  |  |  | <CustomDropDown id="ddNotice"> | 
|---|
|  |  |  | <Property name="minHeight">400</Property> | 
|---|
|  |  |  | <Property name="assignmentMap">noticeId=id,customerId=customerId,customerName=customerName</Property> | 
|---|
|  |  |  | <Property name="assignmentMap">noticeId=id,customerName=customerName</Property> | 
|---|
|  |  |  | <Property name="minWidth">500</Property> | 
|---|
|  |  |  | <Property name="autoOpen">true</Property> | 
|---|
|  |  |  | <Container layout="regionPadding:5"> | 
|---|