jiazx0107@163.com
2023-06-25 1a47d9eef4cfe9385ce66b791de84db54a5ba87c
出入库流程优化-入库详单优化
已修改11个文件
已添加1个文件
1885 ■■■■■ 文件已修改
igds-core/src/main/java/com/ld/igds/check/CheckStandardManager.java 126 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-core/src/main/java/com/ld/igds/check/CheckStandardPR.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-core/src/main/java/com/ld/igds/common/impl/CoreDicDataServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-core/src/main/java/com/ld/igds/view/DicAreaPR.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-core/src/main/java/com/ld/igds/view/service/HDicAreaService.java 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/java/com/ld/igds/inout/manager/InoutManager.java 75 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/java/com/ld/igds/inout/service/impl/InoutServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/java/com/ld/igds/inout/view/InoutDataPR.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/java/com/ld/igds/inout/view/InoutList.view.xml 67 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/java/com/ld/igds/inout/view/InoutList202306.view.xml 1504 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/java/com/ld/igds/m/service/HInoutNoticeService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/resources/mapper/InoutRecordMapper.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-core/src/main/java/com/ld/igds/check/CheckStandardManager.java
@@ -18,76 +18,76 @@
@Component(CheckStandardManager.BEAN_ID)
public class CheckStandardManager {
    public static final String BEAN_ID = "check.checkStandardManager";
    public static final String BEAN_ID = "check.checkStandardManager";
    @Autowired
    private CoreCheckStandardService checkStandardService;
    @Autowired
    private CoreCheckStandardService checkStandardService;
    /**
     * æ ¹æ®å‚数获取化验项列表
     *
     * @param checkId
     * @param companyId
     * @param foodVariety
     * @return
     */
    public List<CheckItemData> listCheckItem(String companyId, String checkId,
            String foodVariety) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
    /**
     * æ ¹æ®å‚数获取化验项列表
     *
     * @param checkId
     * @param companyId
     * @param foodVariety
     * @return
     */
    public List<CheckItemData> listCheckItem(String companyId, String checkId,
                                             String foodVariety) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        List<CheckItemData> list = null;
        if (null != checkId)
            list = checkStandardService.getCheckItemById(checkId, companyId);
        List<CheckItemData> list = null;
        if (null != checkId)
            list = checkStandardService.getCheckItemById(checkId, companyId);
        if (list == null || list.isEmpty()) {
            list = checkStandardService.getCheckItemByStandard(companyId,checkId, foodVariety);
        }
        return list;
    }
        if (list == null || list.isEmpty()) {
            list = checkStandardService.getCheckItemByStandard(companyId, checkId, foodVariety);
        }
    public CheckUpdateResult updateCheckItems(String checkId, String companyId,
            List<CheckItemData> checkItems) {
        return list;
    }
        CheckUpdateResult result = new CheckUpdateResult();
        if (null == checkItems || checkItems.isEmpty()) {
            return result;
        }
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
    public CheckUpdateResult updateCheckItems(String checkId, String companyId,
                                              List<CheckItemData> checkItems) {
        for (CheckItemData item : checkItems) {
            if (null == item.getCheckId()) {
                item.setCheckId(checkId);
            }
            item.setCompanyId(companyId);
            if (item.getUpperLimit() == null) {
                item.setUpperLimit(0.0);
            }
        CheckUpdateResult result = new CheckUpdateResult();
        if (null == checkItems || checkItems.isEmpty()) {
            return result;
        }
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
            if (null != item.getDeNum() && item.getDeNum() > 0) {
                result.setDeSum(result.getDeSum() + item.getDeNum());
            }
            if (null != item.getAddNum() && item.getAddNum() > 0) {
                result.setAddSum(result.getAddSum() + item.getAddNum());
            }
            if (null != item.getAddPrice() && item.getAddPrice() > 0) {
                result.setAddPriceSum(result.getAddPriceSum()
                        + item.getAddPrice());
            }
            if (null != item.getDePrice() && item.getDePrice() > 0) {
                result.setDePriceSum(result.getDePriceSum() + item.getDePrice());
            }
        for (CheckItemData item : checkItems) {
            if (null == item.getCheckId()) {
                item.setCheckId(checkId);
            }
            item.setCompanyId(companyId);
            if (item.getUpperLimit() == null) {
                item.setUpperLimit(0.0);
            }
            // å…ˆæ›´æ–°ï¼Œæ›´æ–°å¤±è´¥åˆ™æ–°å¢ž
            int i = checkStandardService.updateCheckItem(item);
            if (i < 1) {
                checkStandardService.insertCheckItem(item);
            }
        }
        return result;
    }
            if (null != item.getDeNum() && item.getDeNum() > 0) {
                result.setDeSum(result.getDeSum() + item.getDeNum());
            }
            if (null != item.getAddNum() && item.getAddNum() > 0) {
                result.setAddSum(result.getAddSum() + item.getAddNum());
            }
            if (null != item.getAddPrice() && item.getAddPrice() > 0) {
                result.setAddPriceSum(result.getAddPriceSum()
                        + item.getAddPrice());
            }
            if (null != item.getDePrice() && item.getDePrice() > 0) {
                result.setDePriceSum(result.getDePriceSum() + item.getDePrice());
            }
            // å…ˆæ›´æ–°ï¼Œæ›´æ–°å¤±è´¥åˆ™æ–°å¢ž
            int i = checkStandardService.updateCheckItem(item);
            if (i < 1) {
                checkStandardService.insertCheckItem(item);
            }
        }
        return result;
    }
}
igds-core/src/main/java/com/ld/igds/check/CheckStandardPR.java
@@ -78,6 +78,7 @@
     * @return
     */
    @DataProvider
    @Expose
    public List<CheckItemData> listCheckItemsByParam(Map<String, Object> param) {
        String checkId = (String) param.get("checkId");
igds-core/src/main/java/com/ld/igds/common/impl/CoreDicDataServiceImpl.java
@@ -8,9 +8,9 @@
import com.ld.igds.models.DicArea;
import com.ld.igds.models.DicSlogan;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@@ -22,7 +22,7 @@
@Service(CoreDicService.BEAN_ID)
public class CoreDicDataServiceImpl implements CoreDicService {
    @Autowired
    @Resource
    private DicDataMapper dicDataMapper;
    @Override
igds-core/src/main/java/com/ld/igds/view/DicAreaPR.java
@@ -3,6 +3,7 @@
import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.annotation.DataResolver;
import com.bstek.dorado.annotation.Expose;
import com.bstek.dorado.data.provider.Page;
import com.ld.igds.models.DicArea;
import com.ld.igds.view.service.HDicAreaService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -32,6 +33,17 @@
        return areaService.listDicArea(type);
    }
    /**
     * dicAreaPR#pageList
     * @param key
     * @return
     */
    @DataProvider
    public void pageList(Page<DicArea> page,String key) throws Exception {
        areaService.pageList(page,key);
    }
    /**
     * dicAreaPR#saveDicArea
     *
igds-core/src/main/java/com/ld/igds/view/service/HDicAreaService.java
@@ -1,18 +1,20 @@
package com.ld.igds.view.service;
import com.bstek.bdf2.core.orm.hibernate.HibernateDao;
import com.bstek.dorado.data.provider.Page;
import com.ld.igds.models.DicArea;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.Session;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Component
public class HDicAreaService extends HibernateDao{
public class HDicAreaService extends HibernateDao {
    public List<DicArea> listDicArea(String type){
    public List<DicArea> listDicArea(String type) {
        String hql = " from " + DicArea.class.getName();
        Map<String, Object> args = new HashMap<String, Object>();
@@ -47,7 +49,7 @@
        return null;
    }
    public DicArea listDicAreaByName(String name){
    public DicArea listDicAreaByName(String name) {
        String hql = " from " + DicArea.class.getName() + " where 1=1";
        Map<String, Object> args = new HashMap<String, Object>();
@@ -58,14 +60,14 @@
        hql += " order by code";
        List<DicArea> list = this.query(hql, args);
        if(null ==list || list.isEmpty()){
        if (null == list || list.isEmpty()) {
            return null;
        }
        return list.get(0);
    }
    public DicArea listDicAreaByCode(String code){
        if(StringUtils.isEmpty(code)){
    public DicArea listDicAreaByCode(String code) {
        if (StringUtils.isEmpty(code)) {
            return null;
        }
        String hql = " from " + DicArea.class.getName() + " where code =:code";
@@ -75,9 +77,33 @@
        hql += " order by code";
        List<DicArea> list = this.query(hql, args);
        if(null ==list || list.isEmpty()){
        if (null == list || list.isEmpty()) {
            return null;
        }
        return list.get(0);
    }
    public void pageList(Page<DicArea> page, String key) throws Exception {
        String hql = " from " + DicArea.class.getName();
        Map<String, Object> args = new HashMap<>();
        List<DicArea> list;
        String countHql;
        if (StringUtils.isNotEmpty(key)) {
            hql += " where (name like :key1 or simple like:key2)";
            args.put("key1", "%" + key + "%");
            args.put("key2", "%" + key.toUpperCase() + "%");
            countHql = "select count(1) " + hql;
            hql += " order by code";
            this.pagingQuery(page, hql, countHql, args);
        } else {
            countHql = "select count(1) " + hql;
            hql += " order by code";
            this.pagingQuery(page, hql, countHql);
        }
    }
}
igds-inout/src/main/java/com/ld/igds/inout/manager/InoutManager.java
@@ -15,7 +15,6 @@
import com.ld.igds.inout.dto.InoutParam;
import com.ld.igds.inout.service.InoutService;
import com.ld.igds.m.service.InoutCommonService;
import com.ld.igds.models.Depot;
import com.ld.igds.models.InoutConf;
import com.ld.igds.models.InoutPrice;
import com.ld.igds.models.InoutSysConf;
@@ -200,27 +199,23 @@
     * @param data
     * @return
     */
    private CheckUpdateResult updateCheckItems(InoutData data) {
        CheckUpdateResult result = new CheckUpdateResult();
        if (null == data.getCheckItems())
            return result;
    private InoutData updateCheckItems(InoutData data) throws Exception {
        try {
            // æ›´æ–°æ£€éªŒé¡¹æ•°æ®
            result = checkStandardManager.updateCheckItems(data.getCheckId(),
                    data.getCompanyId(), data.getCheckItems());
        if (null == data.getCheckItems()) return data;
            // å°†åŒ–验数据存入缓存中
            inoutService.setCheckCache(data);
        // æ›´æ–°æ£€éªŒé¡¹æ•°æ®
        CheckUpdateResult checkUpdateResult = checkStandardManager.updateCheckItems(data.getCheckId(), data.getCompanyId(), data.getCheckItems());
            return result;
        } catch (Exception e) {
            log.error("后台异常:{}", e);
            result.setMsg("执行异常:" + e.getMessage());
        if (data.getDeCheck() == 0) {
            data.setDeCheck(checkUpdateResult.getDeSum());
        }
        return result;
        if (data.getAddCheck() == 0) {
            data.setAddCheck(checkUpdateResult.getAddSum());
        }
        return data;
    }
    /**
     * ä»Žç¼“存中获取下一流程
@@ -470,44 +465,17 @@
            return "系统:已经删除的数据不支持修改!";
        }
        // å¦‚果流程未结束,只更新数据
        if (!InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) {
            return inoutService.updateData(data);
        }
        // å¦‚果是已经完成的数据,先获取到修改直接的数据根据数据进行对比
        InoutParam param = new InoutParam();
        param.setId(data.getId());
        param.setCompanyId(data.getCompanyId());
        param.setType(data.getType());
        InoutData record = inoutService.inoutQueryById(param);
        if (null == record) {
            return "当前修改数据已经不存在!";
        }
        // é¿å…æ•°æ®åº“中的数据已经被其他人修改
        if (InoutConstant.RECORD_STATUS_DEL.equals(record.getRecordStatus())) {
            return "系统:已经删除的数据不支持修改!";
        if (InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) {
            return "系统:流程已经结束的数据不支持修改!";
        }
        // ä¿å­˜æ£€æµ‹é¡¹ç›®
        if (InoutConstant.TYPE_IN.equals(data.getType())) {
            // å…ˆæ‰§è¡ŒåŒ–验信息保存
            CheckUpdateResult checkResult = checkStandardManager
                    .updateCheckItems(data.getCheckId(), data.getCompanyId(),
                            data.getCheckItems());
            if (null != checkResult) {
                // if (null == data.getWet())
                // data.setWet(checkResult.getWet());
                // if (null == data.getImpurity())
                // data.setImpurity(checkResult.getImpurity());
            }
            data = updateCheckItems(data);
        }
        // æ›´æ–°æ•°æ®
        inoutService.updateData(data);
        return null;
        return inoutService.updateData(data);
    }
@@ -666,13 +634,7 @@
        data = updateBasicInfo(data, curProgress, nextProgress);
        // å…¥åº“称重可能调整质检单
        CheckUpdateResult checkUpdateResult = updateCheckItems(data);
        if (data.getDeCheck() == 0) {
            data.setDeCheck(checkUpdateResult.getDeSum());
        }
        if (data.getAddCheck() == 0) {
            data.setAddCheck(checkUpdateResult.getAddSum());
        }
        data = updateCheckItems(data);
        // æ‰§è¡Œæ•°æ®æ›´æ–°
        String msg = inoutService.updateData(data);
@@ -858,7 +820,6 @@
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                    "当前流程已经结束,不支持修改");
        }
        // æ›´æ–°åŒ–验项信息
        CheckUpdateResult checkResult = checkStandardManager.updateCheckItems(data.getCheckId(), data.getCompanyId(), data.getCheckItems());
igds-inout/src/main/java/com/ld/igds/inout/service/impl/InoutServiceImpl.java
@@ -237,6 +237,10 @@
        if (null != param.getUserId()) {
            param.setUserId("%" + param.getUserId() + "%");
        }
        if(null != param.getRecordStatus() && InoutConstant.RECORD_STATUS_NORMAL.equals(param.getRecordStatus())){
            param.setRecordStatus(null);
        }
        List<InoutData> records = inoutMapper.pageRecordData(page, param);
        //判断入库重量是否为空,为空则赋值结算重量
@@ -712,7 +716,7 @@
            data.setCompanyId(ContextUtil.subDeptId(null));
        }
        int num = inoutCheckMapper.updateSampleData(data);
         inoutCheckMapper.updateSampleData(data);
        return null;
    }
@@ -745,7 +749,8 @@
    @Override
    public String updateCheckData(InoutData data) {
        data.setUpdateTime(new Date());
        int num = inoutCheckMapper.updateCheckData(data);
         inoutCheckMapper.updateCheckData(data);
        //更新缓存
        updateInoutCache(data);
igds-inout/src/main/java/com/ld/igds/inout/view/InoutDataPR.java
@@ -1,5 +1,6 @@
package com.ld.igds.inout.view;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -14,11 +15,14 @@
import com.ld.igds.inout.manager.InoutManager;
import com.ld.igds.inout.manager.InoutReportManager;
import com.ld.igds.inout.service.InoutService;
import com.ld.igds.models.DicTrigger;
import com.ld.igds.util.ContextUtil;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**
 * å‡ºå…¥åº“详单页面管理
@@ -31,12 +35,23 @@
@Component
public class InoutDataPR {
    @Autowired
    @Resource
    private InoutService inoutService;
    @Autowired
    @Resource
    private InoutReportManager inoutReportManager;
    @Autowired
    @Resource
    private InoutManager inoutManager;
    // ${dorado.getDataProvider("inoutDataPR#triggerRecordStatus1").getResult()}
    @DataProvider
    public List<DicTrigger> triggerRecordStatus1() {
        List<DicTrigger> list = new ArrayList<DicTrigger>();
        list.add(new DicTrigger(InoutConstant.RECORD_STATUS_DEL, "作废单"));
        list.add(new DicTrigger(InoutConstant.RECORD_STATUS_NORMAL, "正常单"));
        return list;
    }
    /**
     * inoutDataPR#pageInoutData
@@ -46,8 +61,7 @@
     * @throws Exception
     */
    @DataProvider
    public void pageInoutData(Page<InoutData> page, InoutParam param)
            throws Exception {
    public void pageInoutData(Page<InoutData> page, InoutParam param) throws Exception {
        // è°ƒç”¨æ ¸å¿ƒåŒ…中方法,需要做对象转换
        param.setPage(page.getPageNo());
        param.setLimit(page.getPageSize());
@@ -165,7 +179,6 @@
    @Expose
    public InoutData initAddData(String type) {
        IUser user = ContextUtil.getLoginUser();
        InoutData data = new InoutData();
        data.setCompanyId(user.getCompanyId());
        data.setRegisterTime(new Date());
@@ -187,9 +200,7 @@
     */
    @DataProvider
    public InoutData initDataByHand(String type) {
        IUser user = ContextUtil.getLoginUser();
        InoutData data = new InoutData();
        data.setCompanyId(user.getCompanyId());
        data.setRegisterTime(new Date());
igds-inout/src/main/java/com/ld/igds/inout/view/InoutList.view.xml
@@ -56,9 +56,9 @@
      </PropertyDef>
      <PropertyDef name="recordStatus">
        <Property></Property>
        <Property name="label">数据状态</Property>
        <Property name="label">单据状态</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicTriggerPR#dicTrigger&quot;).getResult(&quot;RECORD_STATUS&quot;)}</Property>
          <Property name="mapValues">${dorado.getDataProvider(&quot;inoutDataPR#triggerRecordStatus1&quot;).getResult()}</Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
@@ -183,11 +183,11 @@
        <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>
@@ -206,6 +206,7 @@
//默认查询查询提条件&#xD;
view.get(&quot;#dsQuery&quot;).insert({&#xD;
    type:TYPE,&#xD;
    recordStatus:'NORMAL',&#xD;
    deptId:deptId&#xD;
});&#xD;
&#xD;
@@ -522,15 +523,6 @@
        </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>
@@ -546,6 +538,11 @@
        <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">
@@ -712,7 +709,7 @@
        </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>
@@ -823,7 +820,7 @@
                    <AutoFormElement>
                      <Property name="name">foodLocation</Property>
                      <Property name="property">foodLocation</Property>
                      <Property name="trigger">ddFoodOrigin</Property>
                      <Property name="trigger">ddDicArea</Property>
                      <Editor/>
                    </AutoFormElement>
                  </AutoForm>
@@ -1222,53 +1219,53 @@
      <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(&quot;#key2.value&quot;);&#xD;
view.get(&quot;#dsFoodOrigin&quot;).set(&quot;parameter&quot;,{key:key}).flushAsync();</ClientEvent>
view.get(&quot;#dsDicArea&quot;).set(&quot;parameter&quot;,{key:key}).flushAsync();</ClientEvent>
            <Property name="caption">查询</Property>
            <Property name="iconClass">fa fa-search</Property>
          </Button>
          <Button>
            <ClientEvent name="onClick">var data = view.get(&quot;#dsFoodOrigin.data:#&quot;);&#xD;
            <ClientEvent name="onClick">var data = view.get(&quot;#dsDicArea.data:#&quot;);&#xD;
if(data){&#xD;
    view.get(&quot;#ddFoodOrigin&quot;).close(data.toJSON());&#xD;
    view.get(&quot;#ddDicArea&quot;).close(data.toJSON());&#xD;
}</ClientEvent>
            <Property name="iconClass">fa fa-check</Property>
            <Property name="caption">确定</Property>
          </Button>
        </Container>
        <DataGrid>
          <ClientEvent name="onDataRowDoubleClick">var data = view.get(&quot;#dsFoodOrigin.data:#&quot;);&#xD;
          <ClientEvent name="onDataRowDoubleClick">var data = view.get(&quot;#dsDicArea.data:#&quot;);&#xD;
if(data){&#xD;
    view.get(&quot;#ddFoodOrigin&quot;).close(data.toJSON());&#xD;
    view.get(&quot;#ddDicArea&quot;).close(data.toJSON());&#xD;
}</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 = &quot;bold&quot;;&#xD;
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>
@@ -1279,13 +1276,13 @@
          </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">
igds-inout/src/main/java/com/ld/igds/inout/view/InoutList202306.view.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,1504 @@
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <Model>
    <DataType name="dtMain" parent="dtInoutRecord">
      <ClientEvent name="onDataChange">if(arg.property ==&quot;depotId&quot;){&#xD;
    autoByDepot(arg.newValue);&#xD;
}&#xD;
if(arg.property ==&quot;foodVariety&quot;){&#xD;
    checkByFood(arg.newValue);&#xD;
}</ClientEvent>
      <PropertyDef name="price">
        <Property name="dataType">Double</Property>
        <Property name="label">粮食定价</Property>
        <Property name="required">false</Property>
      </PropertyDef>
      <Reference name="checkItems">
        <Property name="parameter">
          <Entity>
            <Property name="checkId">$${this.checkId}</Property>
            <Property name="foodVariety">$${this.foodVariety}</Property>
            <Property name="deptId">$${this.deptId}</Property>
          </Entity>
        </Property>
        <Property name="dataProvider">checkStandardPR#listCheckItemsByCheckId</Property>
        <Property name="dataType">[dtCheckItems]</Property>
      </Reference>
    </DataType>
    <DataType name="dtQuery">
      <Property name="creationType">com.ld.igds.inout.dto.InoutParam</Property>
      <PropertyDef name="type">
        <Property name="label">出入库类型</Property>
      </PropertyDef>
      <PropertyDef name="deptId">
        <Property></Property>
        <Property name="label">所属分库</Property>
      </PropertyDef>
      <PropertyDef name="depotId">
        <Property></Property>
        <Property name="label">装卸仓库</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;depotPR#getAllCache&quot;).getResult()}</Property>
          <Property name="keyProperty">id</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="plateNum">
        <Property name="label">车船号</Property>
      </PropertyDef>
      <PropertyDef name="foodVariety">
        <Property></Property>
        <Property name="label">粮食品种</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicTriggerPR#dicTrigger&quot;).getResult(&quot;FOOD_VARIETY_&quot;)}</Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="progress">
        <Property></Property>
        <Property name="label">流程进度</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicTriggerPR#dicTrigger&quot;).getResult(&quot;PROCESS_STATUS_&quot;)}</Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="recordStatus">
        <Property></Property>
        <Property name="label">数据状态</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicTriggerPR#dicTrigger&quot;).getResult(&quot;RECORD_STATUS&quot;)}</Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="checkStatus">
        <Property></Property>
        <Property name="label">是否合格</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicTriggerPR#dicTrigger&quot;).getResult(&quot;CHECK_STATUS&quot;)}</Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="start">
        <Property name="label">开始时间</Property>
        <Property name="dataType">Date</Property>
      </PropertyDef>
      <PropertyDef name="end">
        <Property name="label">截止时间</Property>
        <Property name="dataType">Date</Property>
      </PropertyDef>
      <PropertyDef name="userId">
        <Property name="label">身份证</Property>
      </PropertyDef>
      <PropertyDef name="orderTag">
        <Property name="defaultValue">DESC</Property>
        <Property name="label">排序规则</Property>
        <Property name="mapping">
          <Property name="mapValues">
            <Collection>
              <Entity>
                <Property name="code">DESC</Property>
                <Property name="name">时间降序</Property>
              </Entity>
              <Entity>
                <Property name="code">ASC</Property>
                <Property name="name">时间升序</Property>
              </Entity>
            </Collection>
          </Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
    </DataType>
    <DataType name="dtCheckItems">
      <Property name="creationType">com.ld.igds.check.dto.CheckItemData</Property>
      <PropertyDef name="updateTime">
        <Property name="dataType">Date</Property>
      </PropertyDef>
      <PropertyDef name="checkId">
        <Property></Property>
        <Property name="label">检测编码</Property>
      </PropertyDef>
      <PropertyDef name="companyId">
        <Property></Property>
        <Property name="label">组织编码</Property>
      </PropertyDef>
      <PropertyDef name="standardId">
        <Property></Property>
        <Property name="label">检测项编码</Property>
      </PropertyDef>
      <PropertyDef name="standardName">
        <Property></Property>
        <Property name="label">化验项</Property>
      </PropertyDef>
      <PropertyDef name="unit">
        <Property></Property>
        <Property name="label">单位</Property>
      </PropertyDef>
      <PropertyDef name="upperLimit">
        <Property name="dataType">Double</Property>
        <Property name="label">标准上限</Property>
      </PropertyDef>
      <PropertyDef name="standardValue">
        <Property></Property>
        <Property name="label">合格说明</Property>
      </PropertyDef>
      <PropertyDef name="value">
        <Property></Property>
        <Property name="label">检测值</Property>
      </PropertyDef>
      <PropertyDef name="remarks">
        <Property></Property>
        <Property name="label">化验结果</Property>
      </PropertyDef>
      <PropertyDef name="ruleNum">
        <Property name="dataType">Double</Property>
        <Property name="label">扣重系数</Property>
      </PropertyDef>
      <PropertyDef name="ruleAdd">
        <Property name="dataType">Double</Property>
        <Property name="label">增重%</Property>
      </PropertyDef>
      <PropertyDef name="ruleAddEnd">
        <Property name="dataType">Double</Property>
        <Property name="label">增重上限%</Property>
      </PropertyDef>
      <PropertyDef name="ruleReduce">
        <Property name="dataType">Double</Property>
        <Property name="label">扣重值%</Property>
      </PropertyDef>
      <PropertyDef name="standardPrice">
        <Property name="dataType">Double</Property>
        <Property name="label">标准单价(元/斤)</Property>
      </PropertyDef>
      <PropertyDef name="rulePrice">
        <Property name="dataType">Double</Property>
        <Property name="label">扣费系数</Property>
      </PropertyDef>
      <PropertyDef name="ruleReducePrice">
        <Property name="dataType">Double</Property>
        <Property name="label">扣费</Property>
      </PropertyDef>
      <PropertyDef name="operaSymbol">
        <Property></Property>
        <Property name="label">运算符号</Property>
      </PropertyDef>
    </DataType>
  </Model>
  <View layout="padding:5;regionPadding:5">
    <ClientEvent name="onReady">var TYPE = &quot;${request.getParameter('type')}&quot;;&#xD;
var EDIT = &quot;${request.getParameter('edit')}&quot;;&#xD;
&#xD;
var deptId = window.parent.DEPT_ID;//父页面中的分库编码&#xD;
&#xD;
//如果edit有值表示隐藏ADD和编辑按钮&#xD;
if(EDIT){&#xD;
    view.get(&quot;#btnEdit&quot;).set(&quot;visible&quot;,false);&#xD;
    view.get(&quot;#btnDel&quot;).set(&quot;visible&quot;,false);&#xD;
    view.get(&quot;#btn2End&quot;).set(&quot;visible&quot;,false);&#xD;
}&#xD;
&#xD;
//类型切换&#xD;
if(&quot;OUT&quot; == TYPE){&#xD;
    view.get(&quot;#dataGridCheckItem&quot;).set(&quot;visible&quot;,false);&#xD;
    view.get(&quot;#deWet&quot;).set(&quot;label&quot;,&quot;水分增重&quot;);&#xD;
}else{&#xD;
    view.get(&quot;#deWet&quot;).set(&quot;label&quot;,&quot;水分扣重&quot;);&#xD;
    view.get(&quot;#dataGridCheckItem&quot;).set(&quot;visible&quot;,true);&#xD;
}&#xD;
&#xD;
//默认查询查询提条件&#xD;
view.get(&quot;#dsQuery&quot;).insert({&#xD;
    type:TYPE,&#xD;
    deptId:deptId&#xD;
});&#xD;
&#xD;
//查询&#xD;
query = function(){&#xD;
    var data = view.get(&quot;#dsQuery.data&quot;);&#xD;
    view.get(&quot;#dsMain&quot;).set(&quot;parameter&quot;,data).flushAsync();&#xD;
};&#xD;
query();&#xD;
&#xD;
&#xD;
//编辑,只有流程结束的才可以修改&#xD;
edit = function(){&#xD;
    var data = view.get(&quot;#dataGridMain.currentEntity&quot;);&#xD;
    if(!data) return;&#xD;
    &#xD;
    if (&quot;RECORD&quot; == data.get(&quot;progress&quot;)) {&#xD;
        view.get(&quot;#btnOK&quot;).set(&quot;visible&quot;,true);&#xD;
    }else{&#xD;
        view.get(&quot;#btnOK&quot;).set(&quot;visible&quot;,false);&#xD;
    }&#xD;
    view.get(&quot;#dialogMain&quot;).show();&#xD;
};&#xD;
&#xD;
//主信息窗口关闭&#xD;
cancelMain = function(){&#xD;
    view.get(&quot;#dsMain.data:#&quot;).cancel();&#xD;
    view.get(&quot;#btnComplete&quot;).set(&quot;visible&quot;,false);&#xD;
    view.get(&quot;#btnOK&quot;).set(&quot;visible&quot;,true);&#xD;
    view.get(&quot;#dialogMain&quot;).hide();&#xD;
};&#xD;
&#xD;
//异常操作&#xD;
showAbnormal = function(){&#xD;
    var data = view.get(&quot;#dataGridMain.currentEntity&quot;);&#xD;
    if(!data) return;&#xD;
    view.get(&quot;#dialogAbnormal&quot;).show();&#xD;
    view.get(&quot;#textAbnormal&quot;).set(&quot;value&quot;,null);&#xD;
};&#xD;
&#xD;
//删除&#xD;
del = function(){&#xD;
    var data = view.get(&quot;#dataGridMain.currentEntity&quot;);&#xD;
    if(!data) return;&#xD;
    &#xD;
    var textDel = view.get(&quot;#textAbnormal.text&quot;);&#xD;
    if(!textDel){&#xD;
        $notify(&quot;请填写异常删除原因!&quot;);&#xD;
        return;&#xD;
    }&#xD;
    data.set(&quot;remarks&quot;,textDel);&#xD;
    view.get(&quot;#ajaxDel&quot;).execute(function(result){&#xD;
        if(result){&#xD;
            $alert(result);&#xD;
            return;&#xD;
        }else{&#xD;
            data.remove();&#xD;
            view.get(&quot;#dialogAbnormal&quot;).close();&#xD;
        }&#xD;
    });&#xD;
};&#xD;
&#xD;
//追踪&#xD;
showImg = function(){&#xD;
    var data = view.get(&quot;#dataGridMain.currentEntity&quot;);&#xD;
    if (!data) return;&#xD;
    var user = encodeURIComponent(data.get(&quot;userName&quot;));&#xD;
    var plateNum = encodeURIComponent(data.get(&quot;plateNum&quot;));&#xD;
    &#xD;
    view.get(&quot;#iFrameImg&quot;).set(&quot;path&quot;, &quot;./basic/inout/inout-img?id=&quot; + data.get(&quot;id&quot;)+&quot;&amp;plateNum=&quot;+plateNum+&quot;&amp;user=&quot;+user);&#xD;
    view.get(&quot;#dialogImg&quot;).show();&#xD;
};&#xD;
&#xD;
todoError = function(){&#xD;
    var data = view.get(&quot;#dataGridMain.currentEntity&quot;);&#xD;
    if(!data) return;&#xD;
    &#xD;
    var textError = view.get(&quot;#textAbnormal.text&quot;);&#xD;
    if(!textError){&#xD;
        $alert(&quot;请说明异常终止原因!!&quot;);&#xD;
        return;&#xD;
    }&#xD;
    data.set(&quot;remarks&quot;,textError);&#xD;
    view.get(&quot;#ajaxError&quot;).execute(function(result){&#xD;
        if(result){&#xD;
            $alert(result);&#xD;
            return;&#xD;
        }else{&#xD;
            view.get(&quot;#dialogAbnormal&quot;).close();&#xD;
            query();&#xD;
            $alert(&quot;执行成功,自动刷新数据!&quot;);&#xD;
        }&#xD;
    });&#xD;
};&#xD;
&#xD;
//流程完成-开始&#xD;
completeStart = function(){&#xD;
    var data = view.get(&quot;#dataGridMain.currentEntity&quot;);&#xD;
    if(!data) return;&#xD;
    &#xD;
    if( data.validate() != 'ok'){&#xD;
        $notify(&quot;请填写完整信息!!&quot;);&#xD;
    }&#xD;
    &#xD;
    view.get(&quot;#btnComplete&quot;).set(&quot;visible&quot;,true);&#xD;
    view.get(&quot;#btnOK&quot;).set(&quot;visible&quot;,false);&#xD;
    view.get(&quot;#dialogMain&quot;).show();&#xD;
};&#xD;
//流程完成-执行&#xD;
completeExe = function(){&#xD;
    var data = view.get(&quot;#dataGridMain.currentEntity&quot;);&#xD;
    if(!data) return;&#xD;
    &#xD;
    if (data.validate() != 'ok') {&#xD;
        $notify(&quot;请填写完整信息!!&quot;);&#xD;
        return;&#xD;
    }&#xD;
    &#xD;
    view.get(&quot;#ajaxComplete&quot;).set(&quot;parameter&quot;,data).execute(function(result){&#xD;
        if(result){&#xD;
            $alert(result);&#xD;
            return;&#xD;
        }else{&#xD;
            $alert(&quot;执行成功,自动刷新数据!&quot;);&#xD;
            view.get(&quot;#btnComplete&quot;).set(&quot;visible&quot;,false);&#xD;
            view.get(&quot;#dialogMain&quot;).hide();&#xD;
        }&#xD;
    });&#xD;
};&#xD;
&#xD;
//根据仓库自动回填粮食品种,登记,产地新&#xD;
autoByDepot = function(depotId){&#xD;
    view.get(&quot;#ajaxGetDepot&quot;).set(&quot;parameter&quot;,depotId).execute(function(result){&#xD;
        if(result){&#xD;
            var data = view.get(&quot;#dataGridMain.currentEntity&quot;);&#xD;
            data.set(&quot;foodLocation&quot;,result.foodLocation);&#xD;
            data.set(&quot;foodLevel&quot;,result.foodLevel);&#xD;
            data.set(&quot;foodVariety&quot;,result.foodVariety);&#xD;
            data.set(&quot;foodYear&quot;,result.foodYear);&#xD;
        }&#xD;
    });&#xD;
};&#xD;
&#xD;
//根据粮食品种查询化验项并回显&#xD;
checkByFood = function(foodVariety){&#xD;
    if(TYPE == &quot;IN&quot;){&#xD;
        view.get(&quot;#ajaxGetCheck&quot;).set(&quot;parameter&quot;,{foodVariety:foodVariety,deptId:deptId}).execute(function(result){&#xD;
            if(result){&#xD;
            var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
            data.set(&quot;checkItems&quot;,result);&#xD;
            }&#xD;
        });&#xD;
    }&#xD;
};&#xD;
</ClientEvent>
    <ClientEvent name="onCreate">&#xD;
/**&#xD;
 * è‡ªåŠ¨è®¡ç®—ï¼Œå½“å‰é¡µé¢ä¸è‡ªåŠ¨å…³è”æ‰¦æ ·è®°å½•ï¼Œå…¨éƒ¨ç”±æ‰‹åŠ¨ä¸ºå‡†&#xD;
 * &#xD;
 * 1.净重 = æ¯›é‡ - çš®é‡&#xD;
 * 2.总扣重 = çŽ°åœºæ‰£é‡ + å…¶ä»–扣重 + æ‰£æ°´æ‚è´¨&#xD;
 * 3.结算重量 = å‡€é‡ - æ€»æ‰£é‡ ï¼ˆå«æ°´æ‚增重)&#xD;
 * 4.出/入库重量 = å‡€é‡ - æ€»æ‰£é‡ ï¼ˆä¸å«æ°´æ‚增重)&#xD;
 * &#xD;
 * 5.入库时:扣水杂 æ­£æ•° = æ‰£é‡ï¼Œè´Ÿæ•° = å¢žé‡&#xD;
 * 6.出库时:水分增重,正数=增重,负数=扣重&#xD;
 */&#xD;
deAutoByWeight = function(name){&#xD;
    &#xD;
    if(null == name) name = &quot;1&quot;;&#xD;
    &#xD;
    var curData = view.get(&quot;#dsMain.data:#&quot;);&#xD;
    var fullWeight = curData.get(&quot;fullWeight&quot;);&#xD;
    var emptyWeight = curData.get(&quot;emptyWeight&quot;);&#xD;
    &#xD;
    if(fullWeight == 0 || emptyWeight == 0){&#xD;
        return;&#xD;
    }&#xD;
    // å‡€é‡&#xD;
    var netWeight = Number(fullWeight) - Number(emptyWeight);&#xD;
    &#xD;
    if (netWeight &lt;= 0){&#xD;
        $notify(&quot;净重小于0,当前称重存在逻辑问题&quot;);&#xD;
        return;&#xD;
    }&#xD;
    &#xD;
     //汇总结果&#xD;
    var deSum = 0, addSum = 0, settleWeight = 0, recordWeight = 0;&#xD;
    //扣水杂&#xD;
    var deWet = curData.get(&quot;deWet&quot;), deImpurity = curData.get(&quot;deImpurity&quot;);&#xD;
    &#xD;
    var impurity = curData.get(&quot;impurity&quot;), wet = curData.get(&quot;wet&quot;);&#xD;
    &#xD;
    &#xD;
     var deBase = 0, multiple = 0;&#xD;
     var checkItems = curData.get(&quot;checkItems&quot;);&#xD;
    //水分杂质,更改比例并且水分扣重还没计算情况下&#xD;
    if (&quot;wet&quot; == name) {&#xD;
        var checkItem = this.getCheckItem(checkItems,&quot;C01&quot;, &quot;C020101&quot;);&#xD;
        if (checkItem) {&#xD;
            deBase = Number(wet) - Number(checkItem.get(&quot;upperLimit&quot;));&#xD;
            if (deBase == 0) return;&#xD;
            multiple = parseInt(deBase / checkItem.get(&quot;ruleNum&quot;));//倍数&#xD;
            deWet = (netWeight * multiple * checkItem.get(&quot;ruleReduce&quot;) / 100.00).toFixed(0);&#xD;
        }&#xD;
    }&#xD;
    &#xD;
    //杂质&#xD;
    if (&quot;impurity&quot; == name) {&#xD;
        checkItem = this.getCheckItem(recordData.checkItems, &quot;C02&quot;,&quot;C01010301&quot;);&#xD;
        if (checkItem) {&#xD;
            deBase = Number(impurity) - Number(checkItem.get(&quot;upperLimit&quot;));&#xD;
            if (deBase == 0) return;&#xD;
            multiple = parseInt(deBase / checkItem.get(&quot;ruleNum&quot;));&#xD;
            deImpurity = (netWeight * multiple * checkItem.get(&quot;ruleReduce&quot;) / 100.00).toFixed(0);&#xD;
        }&#xD;
    }&#xD;
&#xD;
    /** æ€»æ‰£é‡ï¼Œä¸å«å¢žé‡*/&#xD;
    deSum = Number(curData.get(&quot;deOther&quot;)) + Number(curData.get(&quot;deHandle&quot;));&#xD;
    &#xD;
    //出库&#xD;
    if (&quot;OUT&quot; == curData.get(&quot;type&quot;)) {&#xD;
        if (Number(deWet) > 0) {//增重&#xD;
            addSum = addSum + Number(deWet);&#xD;
        } else {&#xD;
            deSum = deSum + Number(deWet);&#xD;
        }&#xD;
&#xD;
        if (Number(deImpurity) > 0) {//扣重&#xD;
            deSum = deSum + Number(deImpurity);&#xD;
            } else {&#xD;
            addSum = addSum + Number(deImpurity);&#xD;
        }&#xD;
    }else{&#xD;
        if (Number(deWet) > 0) {//扣重&#xD;
            deSum = deSum + Number(deWet);&#xD;
        } else {&#xD;
            addSum = addSum + Number(deWet);&#xD;
        }&#xD;
        if (Number(deImpurity) > 0) {//扣重&#xD;
            deSum = deSum + Number(deImpurity);&#xD;
        } else {&#xD;
            addSum = addSum + Number(deImpurity);&#xD;
        }&#xD;
    }&#xD;
    &#xD;
    deSum = deSum.toFixed(0);&#xD;
    /** å¢žé‡è½¬æ­£æ•°ï¼Œä¾¿äºŽè®¡ç®—  */&#xD;
    addSum = Math.abs(addSum).toFixed(0);&#xD;
    &#xD;
    /** å…¥åº“重量 = å‡€é‡ - æ€»æ‰£é‡  */&#xD;
    recordWeight = Number(netWeight) - Number(deSum);&#xD;
    &#xD;
    /** ç»“算重量 = å‡€é‡ - æ€»æ‰£é‡ + å¢žé‡ */&#xD;
    settleWeight = Number(netWeight) - Number(deSum) + Number(addSum);&#xD;
    &#xD;
    curData.set(&quot;impurity&quot;,impurity);&#xD;
    curData.set(&quot;wet&quot;,wet);&#xD;
    curData.set(&quot;deImpurity&quot;,deImpurity);&#xD;
    curData.set(&quot;deWet&quot;,deWet);&#xD;
    curData.set(&quot;deSum&quot;,deSum);&#xD;
    curData.set(&quot;netWeight&quot;,netWeight);&#xD;
    curData.set(&quot;settleWeight&quot;,settleWeight);&#xD;
    curData.set(&quot;recordWeight&quot;,recordWeight);&#xD;
};&#xD;
&#xD;
&#xD;
/**&#xD;
 * æ ¹æ®åŒ–验项和传递过来的参数获取当前参数的配置信息&#xD;
 * @param checkItems&#xD;
 * @param code1 ç³»ç»Ÿå‚æ•°ID&#xD;
 * @param code2 å›½æ ‡å‚æ•°ID&#xD;
 * @returns {undefined}&#xD;
 */&#xD;
function getCheckItem(checkItems, code1, code2) {&#xD;
    if (!checkItems) return null;&#xD;
    $.each(checkItems, function (index, checkItem) {&#xD;
        if (checkItem.get(&quot;standardId&quot;) == code1 || checkItem.get(&quot;standardId&quot;) == code2) {&#xD;
            if (checkItem.get(&quot;ruleNum&quot;) &amp;&amp; checkItem.get(&quot;upperLimit&quot;) > 0.0) {&#xD;
                return checkItem;&#xD;
            }&#xD;
        }&#xD;
    });&#xD;
    return null;&#xD;
}</ClientEvent>
    <Property name="packages">font-awesome,css-common</Property>
    <Property name="javaScriptFile">./static/plugins/lodop/LodopFuncs.js</Property>
    <DataSet id="dsMain">
      <Property name="dataType">[dtMain]</Property>
      <Property name="pageSize">20</Property>
      <Property name="dataProvider">inoutDataPR#pageInoutData</Property>
      <Property name="loadMode">manual</Property>
    </DataSet>
    <DataSet id="dsQuery">
      <Property name="dataType">dtQuery</Property>
    </DataSet>
    <Container layout="regionPadding:10" layoutConstraint="top">
      <Property name="exClassName">bg-color</Property>
      <Property name="contentOverflow">hidden</Property>
      <Property name="height">55</Property>
      <Label layoutConstraint="left">
        <Property name="text">菜单栏:</Property>
      </Label>
      <Button id="btnEdit" layoutConstraint="left">
        <ClientEvent name="onClick">edit();</ClientEvent>
        <Property name="caption">编辑</Property>
        <Property name="exClassName">btn-warm</Property>
        <Property name="iconClass">fa fa-pencil</Property>
        <Property name="hideMode">display</Property>
      </Button>
      <Button id="btnDel" layoutConstraint="left">
        <ClientEvent name="onClick">showAbnormal();</ClientEvent>
        <Property name="caption">异常操作</Property>
        <Property name="exClassName">btn-warn</Property>
        <Property name="iconClass">fa fa-minus</Property>
        <Property name="hideMode">display</Property>
      </Button>
      <Button layoutConstraint="left">
        <ClientEvent name="onClick">showImg();</ClientEvent>
        <Property name="caption">过程追踪</Property>
        <Property name="exClassName">btn-normal</Property>
        <Property name="iconClass">fa fa-picture-o</Property>
      </Button>
      <Button id="btn2End" layoutConstraint="left">
        <ClientEvent name="onClick">completeStart();</ClientEvent>
        <Property name="caption">快速结束</Property>
        <Property name="exClassName">btn-default</Property>
        <Property name="iconClass">fa fa-gavel</Property>
        <Property name="hideMode">display</Property>
      </Button>
      <Button layoutConstraint="left">
        <Property name="caption">单据打印</Property>
        <Property name="exClassName">btn-warm</Property>
        <Property name="iconClass">fa fa-print</Property>
        <Property name="menu">menuEdit</Property>
      </Button>
      <Button layoutConstraint="left">
        <Property name="caption">导出EXCEL</Property>
        <Property name="exClassName">btn-normal</Property>
        <Property name="iconClass">fa fa-file-excel-o</Property>
        <Property name="action">exportExcel</Property>
      </Button>
    </Container>
    <AutoForm layoutConstraint="top">
      <Property name="cols">*,*,*,*</Property>
      <Property name="dataSet">dsQuery</Property>
      <Property name="exClassName">bg-color</Property>
      <Property name="labelAlign">right</Property>
      <AutoFormElement>
        <Property name="name">start</Property>
        <Property name="property">start</Property>
        <Property name="trigger">defaultDateDropDown</Property>
        <Editor/>
      </AutoFormElement>
      <AutoFormElement>
        <Property name="name">end</Property>
        <Property name="property">end</Property>
        <Property name="trigger">defaultDateDropDown</Property>
        <Editor/>
      </AutoFormElement>
      <AutoFormElement>
        <Property name="name">plateNum</Property>
        <Property name="property">plateNum</Property>
        <Editor>
          <TextEditor>
            <Property name="blankText">-- æ”¯æŒæ¨¡ç³Š --</Property>
          </TextEditor>
        </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>
        <Editor/>
      </AutoFormElement>
      <AutoFormElement>
        <Property name="name">foodVariety</Property>
        <Property name="property">foodVariety</Property>
        <Property name="trigger">autoOpenMappingDropDown2</Property>
        <Editor/>
      </AutoFormElement>
      <AutoFormElement>
        <Property name="name">orderTag</Property>
        <Property name="property">orderTag</Property>
        <Property name="trigger">autoMappingDropDown1</Property>
        <Editor/>
      </AutoFormElement>
      <Container layout="hbox regionPadding:15">
        <Button>
          <ClientEvent name="onClick">query();&#xD;
</ClientEvent>
          <Property name="caption">查询</Property>
          <Property name="exClassName">btn-normal</Property>
          <Property name="iconClass">fa fa-search</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">var type =&quot;${request.getParameter('type')}&quot;;&#xD;
var deptId = window.parent.DEPT_ID;//父页面中的分库编码&#xD;
view.get(&quot;#dsQuery&quot;).setData({type:type,deptId:deptId});</ClientEvent>
          <Property name="exClassName">btn-warn</Property>
          <Property name="iconClass">fa fa-refresh</Property>
          <Property name="caption">重置</Property>
        </Button>
      </Container>
    </AutoForm>
    <Container layoutConstraint="center">
      <Property name="exClassName">bg-color</Property>
      <DataGrid id="dataGridMain" layoutConstraint="center">
        <ClientEvent name="onDataRowDoubleClick">edit();</ClientEvent>
        <ClientEvent name="onDataRowClick">//实现点击即选中&#xD;
//self.set(&quot;selection&quot;,arg.data);
        </ClientEvent>
        <Property name="dataSet">dsMain</Property>
        <Property name="readOnly">true</Property>
        <Property name="dynaRowHeight">false</Property>
        <Property name="selectionMode">multiRows</Property>
        <RowSelectorColumn/>
        <DataColumn name="id">
          <ClientEvent name="onRenderCell">arg.dom.style.fontWeight = &quot;bold&quot;;&#xD;
arg.dom.style.color = &quot;#f67d06&quot;;&#xD;
arg.processDefault = true;</ClientEvent>
          <Property name="property">id</Property>
          <Property name="align">center</Property>
          <Property name="width">150</Property>
        </DataColumn>
        <DataColumn name="plateNum">
          <ClientEvent name="onRenderCell">arg.dom.style.fontWeight = &quot;bold&quot;;&#xD;
arg.processDefault = true;</ClientEvent>
          <Property name="property">plateNum</Property>
          <Property name="align">center</Property>
          <Property name="width">150</Property>
        </DataColumn>
        <DataColumn>
          <Property name="property">userName</Property>
          <Property name="align">center</Property>
          <Property name="width">120</Property>
          <Property name="name">userName</Property>
        </DataColumn>
        <DataColumn>
          <Property name="property">customerName</Property>
          <Property name="width">250</Property>
          <Property name="name">customerName</Property>
          <Property name="align">center</Property>
          <Property name="caption">客户名称</Property>
        </DataColumn>
        <DataColumn name="foodVariety">
          <Property name="property">foodVariety</Property>
          <Property name="align">center</Property>
          <Property name="width">120</Property>
        </DataColumn>
        <DataColumn name="depotId">
          <ClientEvent name="onRenderCell">arg.dom.style.fontWeight = &quot;bold&quot;;&#xD;
arg.processDefault = true;</ClientEvent>
          <Property name="property">depotId</Property>
          <Property name="align">center</Property>
          <Property name="width">120</Property>
        </DataColumn>
        <DataColumn name="fullWeight">
          <Property name="property">fullWeight</Property>
          <Property name="caption">毛重</Property>
          <Property name="align">center</Property>
          <Property name="width">100</Property>
        </DataColumn>
        <DataColumn name="emptyWeight">
          <Property name="property">emptyWeight</Property>
          <Property name="caption">皮重</Property>
          <Property name="align">center</Property>
          <Property name="width">100</Property>
        </DataColumn>
        <DataColumn name="netWeight">
          <Property name="property">netWeight</Property>
          <Property name="align">center</Property>
          <Property name="caption">净重</Property>
          <Property name="width">100</Property>
        </DataColumn>
        <DataColumn id="columnDeSum">
          <Property name="property">deSum</Property>
          <Property name="width">100</Property>
          <Property name="caption">总扣重</Property>
          <Property name="align">center</Property>
          <Property name="name">deSum</Property>
        </DataColumn>
        <DataColumn name="settleWeight">
          <ClientEvent name="onRenderCell">arg.dom.style.fontWeight = &quot;bold&quot;;&#xD;
arg.processDefault = true;</ClientEvent>
          <Property name="property">settleWeight</Property>
          <Property name="align">center</Property>
          <Property name="width">100</Property>
        </DataColumn>
        <DataColumn>
          <ClientEvent name="onRenderCell">arg.dom.style.fontWeight = &quot;bold&quot;;&#xD;
arg.processDefault = true;</ClientEvent>
          <Property name="property">recordWeight</Property>
          <Property name="align">center</Property>
          <Property name="width">100</Property>
          <Property name="visible">true</Property>
          <Property name="name">recordWeight</Property>
        </DataColumn>
        <DataColumn name="progress">
          <ClientEvent name="onRenderCell">arg.dom.style.fontWeight = &quot;bold&quot;;&#xD;
arg.processDefault = true;</ClientEvent>
          <Property name="property">progress</Property>
          <Property name="align">center</Property>
          <Property name="width">100</Property>
        </DataColumn>
        <DataColumn name="recordStatus">
          <Property name="property">recordStatus</Property>
          <Property name="align">center</Property>
          <Property name="width">100</Property>
          <Property name="visible">false</Property>
        </DataColumn>
        <DataColumn name="completeTime">
          <Property name="property">completeTime</Property>
          <Property name="align">center</Property>
          <Property name="width">150</Property>
        </DataColumn>
      </DataGrid>
    </Container>
    <Container layoutConstraint="bottom">
      <Property name="exClassName">bg-color</Property>
      <DataPilot layoutConstraint="right">
        <Property name="itemCodes">pageSize,pages</Property>
        <Property name="dataSet">dsMain</Property>
      </DataPilot>
    </Container>
    <Dialog id="dialogMain">
      <Property name="closeable">false</Property>
      <Property name="caption">表单信息</Property>
      <Property name="width">1200</Property>
      <Property name="iconClass">fa fa-tasks</Property>
      <Property name="showCaptionBar">false</Property>
      <Buttons>
        <Button id="btnOK">
          <ClientEvent name="onClick">var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
if(data.validate() != 'ok'){&#xD;
    $notify(&quot;数据校验失败!!&quot;);&#xD;
    return;&#xD;
}&#xD;
view.get(&quot;#uaSave&quot;).execute(function(result){&#xD;
    if(result){&#xD;
        $alert(result);&#xD;
        return;&#xD;
    }&#xD;
    $notify(&quot;数据执行完成!!&quot;);&#xD;
    self.get(&quot;parent&quot;).hide();&#xD;
});</ClientEvent>
          <Property name="caption">确定保存</Property>
          <Property name="iconClass">fa fa-check</Property>
          <Property name="exClassName">btn-normal</Property>
        </Button>
        <Button id="btnComplete" layoutConstraint="left">
          <ClientEvent name="onClick">completeExe();</ClientEvent>
          <Property name="caption">结束流程</Property>
          <Property name="exClassName">btn-default</Property>
          <Property name="iconClass">fa fa-gavel</Property>
          <Property name="hideMode">display</Property>
          <Property name="visible">false</Property>
        </Button>
        <Button id="btnAddCheck">
          <ClientEvent name="onClick">var data = view.get(&quot;#dataGridMain.currentEntity&quot;);&#xD;
var list = data.get(&quot;checkItems&quot;);&#xD;
&#xD;
list.insert({});&#xD;
console.log(list);&#xD;
</ClientEvent>
          <Property name="caption">新增化验项</Property>
          <Property name="iconClass">fa fa-plus</Property>
          <Property name="hideMode">display</Property>
          <Property name="visible">true</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">cancelMain();</ClientEvent>
          <Property name="caption">取消操作</Property>
          <Property name="iconClass">fa fa-times</Property>
        </Button>
      </Buttons>
      <Children>
        <TabControl>
          <ClientEvent name="onTabChange">if(arg.newTab.get(&quot;name&quot;) == &quot;tabCheck&quot;){&#xD;
    view.get(&quot;#btnAddCheck&quot;).set(&quot;visible&quot;,true);&#xD;
}else{&#xD;
    view.get(&quot;#btnAddCheck&quot;).set(&quot;visible&quot;,false);&#xD;
}</ClientEvent>
          <ControlTab>
            <Property name="caption">基础信息</Property>
            <Property name="iconClass">fa fa-download</Property>
            <Property name="width">150</Property>
            <Property name="name">tabCommon</Property>
            <Container>
              <FieldSet layout="regionPadding:5" layoutConstraint="padding:10">
                <Property name="caption">基本信息</Property>
                <Buttons/>
                <Children>
                  <AutoForm>
                    <Property name="dataSet">dsMain</Property>
                    <Property name="cols">*,*,*</Property>
                    <Property name="labelAlign">right</Property>
                    <Property name="labelSeparator">:</Property>
                    <Property name="labelWidth">100</Property>
                    <AutoFormElement>
                      <Property name="name">plateNum</Property>
                      <Property name="property">plateNum</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement>
                      <Property name="name">userName</Property>
                      <Property name="property">userName</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement>
                      <Property name="name">userId</Property>
                      <Property name="property">userId</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement>
                      <Property name="name">userContact</Property>
                      <Property name="property">userContact</Property>
                      <Property name="label">联系电话</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement>
                      <Property name="label">客户名称</Property>
                      <Property name="property">customerName</Property>
                      <Property name="editable">false</Property>
                      <Property name="trigger">ddNotice</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement>
                      <Property name="name">transType</Property>
                      <Property name="property">transType</Property>
                      <Editor>
                        <RadioGroup>
                          <RadioButton>
                            <Property name="text">汽车</Property>
                            <Property name="value">1</Property>
                          </RadioButton>
                          <RadioButton>
                            <Property name="text">火车</Property>
                            <Property name="value">2</Property>
                          </RadioButton>
                          <RadioButton>
                            <Property name="text">轮船</Property>
                            <Property name="value">3</Property>
                          </RadioButton>
                          <RadioButton>
                            <Property name="text">其他</Property>
                            <Property name="value">4</Property>
                          </RadioButton>
                        </RadioGroup>
                      </Editor>
                    </AutoFormElement>
                    <AutoFormElement>
                      <Property name="name">depotId</Property>
                      <Property name="property">depotId</Property>
                      <Property name="label">装卸仓库</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement>
                      <Property name="name">foodVariety</Property>
                      <Property name="property">foodVariety</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement>
                      <Property name="name">specType</Property>
                      <Property name="property">specType</Property>
                      <Editor>
                        <RadioGroup>
                          <RadioButton>
                            <Property name="text">散粮</Property>
                            <Property name="value">散粮</Property>
                          </RadioButton>
                            <RadioButton>
                                <Property name="text">25kg</Property>
                                <Property name="value">25kg</Property>
                            </RadioButton>
                          <RadioButton>
                            <Property name="text">50kg</Property>
                            <Property name="value">50kg</Property>
                          </RadioButton>
                        </RadioGroup>
                      </Editor>
                    </AutoFormElement>
                    <AutoFormElement>
                      <Property name="name">foodLevel</Property>
                      <Property name="property">foodLevel</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement>
                      <Property name="name">foodYear</Property>
                      <Property name="property">foodYear</Property>
                      <Property name="trigger">yearDropDown</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement>
                      <Property name="name">registerTime</Property>
                      <Property name="property">registerTime</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement>
                      <Property name="name">foodLocation</Property>
                      <Property name="property">foodLocation</Property>
                      <Property name="trigger">ddFoodOrigin</Property>
                      <Editor/>
                    </AutoFormElement>
                  </AutoForm>
                </Children>
              </FieldSet>
              <FieldSet layout="regionPadding:5" layoutConstraint="padding:10">
                <Property name="caption">称重信息(单位:KG)</Property>
                <Buttons/>
                <Children>
                  <AutoForm>
                    <Property name="dataSet">dsMain</Property>
                    <Property name="cols">*,*,*,*,*,*</Property>
                    <Property name="labelAlign">right</Property>
                    <Property name="labelWidth">100</Property>
                    <Property name="labelSeparator">:</Property>
                    <AutoFormElement layoutConstraint="colSpan:2">
                      <ClientEvent name="onBlur">//id è§„则 d_prop&#xD;
var id = self.getDom().id;&#xD;
var prop = id.substring(2,id.length);&#xD;
deAutoByWeight(prop);</ClientEvent>
                      <Property name="name">emptyWeight</Property>
                      <Property name="property">emptyWeight</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement layoutConstraint="colSpan:2">
                      <ClientEvent name="onBlur">//id è§„则 d_prop&#xD;
var id = self.getDom().id;&#xD;
var prop = id.substring(2,id.length);&#xD;
deAutoByWeight(prop);&#xD;
                                            </ClientEvent>
                      <Property name="name">fullWeight</Property>
                      <Property name="property">fullWeight</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement layoutConstraint="colSpan:2">
                      <Property name="name">netWeight</Property>
                      <Property name="property">netWeight</Property>
                      <Property name="readOnly">true</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement>
                      <ClientEvent name="onBlur">//id è§„则 d_prop&#xD;
var id = self.getDom().id;&#xD;
var prop = id.substring(2,id.length);&#xD;
deAutoByWeight(prop);</ClientEvent>
                      <Property name="name">deImpurity</Property>
                      <Property name="property">deImpurity</Property>
                      <Property name="showHint">false</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement>
                      <Property name="name">impurity</Property>
                      <Property name="property">impurity</Property>
                      <Property name="showLabel">false</Property>
                      <Editor>
                        <TextEditor>
                          <Property name="blankText"> -- % --</Property>
                        </TextEditor>
                      </Editor>
                    </AutoFormElement>
                    <AutoFormElement id="deWet">
                      <ClientEvent name="onBlur">//id è§„则 d_prop&#xD;
var id = self.getDom().id;&#xD;
var prop = id.substring(2,id.length);&#xD;
deAutoByWeight(prop);</ClientEvent>
                      <Property name="name">deWet</Property>
                      <Property name="property">deWet</Property>
                      <Property name="showHint">false</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement>
                      <Property name="name">wet</Property>
                      <Property name="property">wet</Property>
                      <Property name="showLabel">false</Property>
                      <Editor>
                        <TextEditor>
                          <Property name="blankText"> -- % --</Property>
                        </TextEditor>
                      </Editor>
                    </AutoFormElement>
                    <AutoFormElement layoutConstraint="colSpan:2">
                      <ClientEvent name="onBlur">//id è§„则 d_prop&#xD;
var id = self.getDom().id;&#xD;
var prop = id.substring(2,id.length);&#xD;
deAutoByWeight(prop);</ClientEvent>
                      <Property name="name">deHandle</Property>
                      <Property name="property">deHandle</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement layoutConstraint="colSpan:2">
                      <ClientEvent name="onBlur">//id è§„则 d_prop&#xD;
var id = self.getDom().id;&#xD;
var prop = id.substring(2,id.length);&#xD;
deAutoByWeight(prop);</ClientEvent>
                      <Property name="name">deOther</Property>
                      <Property name="property">deOther</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement layoutConstraint="colSpan:2">
                      <Property name="name">deSum</Property>
                      <Property name="property">deSum</Property>
                      <Property name="readOnly">true</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement layoutConstraint="colSpan:2">
                      <Property name="name">settleWeight</Property>
                      <Property name="property">settleWeight</Property>
                      <Property name="readOnly">true</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement layoutConstraint="colSpan:2">
                      <Property name="name">fullWeightTime</Property>
                      <Property name="property">fullWeightTime</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement layoutConstraint="colSpan:2">
                      <Property name="name">emptyWeightTime</Property>
                      <Property name="property">emptyWeightTime</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement layoutConstraint="colSpan:2">
                      <Property name="name">recordWeight</Property>
                      <Property name="property">recordWeight</Property>
                      <Property name="readOnly">true</Property>
                      <Editor/>
                    </AutoFormElement>
                    <AutoFormElement layoutConstraint="colSpan:2">
                      <Property name="name">completeTime</Property>
                      <Property name="property">completeTime</Property>
                      <Editor/>
                    </AutoFormElement>
                    <Label layoutConstraint="colSpan:4">
                      <Property name="style">
                        <Property name="color">blue</Property>
                        <Property name="padding-left">80px</Property>
                      </Property>
                      <Property name="text">说明:结算重量=净重-扣重+增重;入库重量=净重-扣重;扣水杂:正数=扣重,负数=增重</Property>
                    </Label>
                  </AutoForm>
                </Children>
              </FieldSet>
              <FieldSet layout="regionPadding:5" layoutConstraint="padding:10">
                <Property name="caption">备注说明</Property>
                <Buttons/>
                <Children>
                  <AutoForm>
                    <Property name="dataSet">dsMain</Property>
                    <Property name="cols">*,*</Property>
                    <Property name="labelAlign">right</Property>
                    <Property name="labelSeparator">:</Property>
                    <Property name="labelWidth">100</Property>
                    <AutoFormElement layoutConstraint="colSpan:2">
                      <Property name="name">remarks</Property>
                      <Property name="property">remarks</Property>
                      <Property name="editorType">TextArea</Property>
                      <Property name="showLabel">false</Property>
                      <Editor/>
                    </AutoFormElement>
                  </AutoForm>
                </Children>
              </FieldSet>
            </Container>
          </ControlTab>
          <ControlTab id="tabCheck">
            <Property name="caption">扦样化验</Property>
            <Property name="iconClass">fa fa-gavel</Property>
            <Property name="width">150</Property>
            <Property name="name">tabCheck</Property>
            <Container layout="padding:10">
              <AutoForm>
                <Property name="dataSet">dsMain</Property>
                <Property name="cols">*,*,*,*</Property>
                <Property name="labelAlign">right</Property>
                <Property name="labelWidth">100</Property>
                <Property name="labelSeparator">:</Property>
                <AutoFormElement>
                  <Property name="name">depotId</Property>
                  <Property name="property">depotId</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="name">foodVariety</Property>
                  <Property name="property">foodVariety</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="name">foodLevel</Property>
                  <Property name="property">foodLevel</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="name">foodYear</Property>
                  <Property name="property">foodYear</Property>
                  <Property name="trigger">yearDropDown</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="name">checkUser</Property>
                  <Property name="property">checkUser</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="name">price</Property>
                  <Property name="property">price</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="name">checkStatus</Property>
                  <Property name="property">checkStatus</Property>
                  <Property name="label">化验结果</Property>
                  <Editor/>
                </AutoFormElement>
              </AutoForm>
              <DataGrid id="dataGridCheckItem" layoutConstraint="padding:10">
                <ClientEvent name="onCellValueEdit">//实现化验项目调整,更新主表中值&#xD;
var entity = arg.entity;&#xD;
var inoutData = view.get(&quot;#dsMain.data:#&quot;);&#xD;
&#xD;
if(entity.get(&quot;standardId&quot;) ==&quot;C01&quot;){//水分&#xD;
    inoutData.set(&quot;wet&quot;,entity.get(&quot;value&quot;));&#xD;
}&#xD;
&#xD;
if(entity.get(&quot;standardId&quot;) ==&quot;C02&quot;){//雜志&#xD;
    inoutData.set(&quot;impurity&quot;,entity.get(&quot;value&quot;));&#xD;
}</ClientEvent>
                <Property name="dataSet">dsMain</Property>
                <Property name="dataPath">#.checkItems</Property>
                <Property name="highlightCurrentRow">false</Property>
                <Property name="visible">true</Property>
                <Property name="hideMode">display</Property>
                <RowNumColumn/>
                <DataColumn name="standardName">
                  <Property name="property">standardName</Property>
                  <Property name="align">center</Property>
                  <Property name="readOnly">true</Property>
                </DataColumn>
                <DataColumn name="value">
                  <Property name="property">value</Property>
                  <Property name="align">center</Property>
                  <Property name="caption">检测值(可编辑)</Property>
                  <Editor/>
                </DataColumn>
                <DataColumn name="unit">
                  <Property name="property">unit</Property>
                  <Property name="width">80</Property>
                  <Property name="readOnly">true</Property>
                </DataColumn>
                <DataColumn name="standardValue">
                  <Property name="property">standardValue</Property>
                  <Property name="readOnly">true</Property>
                  <Property name="align">center</Property>
                </DataColumn>
                <DataColumn name="remarks">
                  <Property name="property">remarks</Property>
                </DataColumn>
              </DataGrid>
            </Container>
          </ControlTab>
        </TabControl>
      </Children>
      <Tools/>
    </Dialog>
    <Dialog id="dialogImg">
      <Property name="width">1000</Property>
      <Property name="height">95%</Property>
      <Property name="iconClass">fa fa-tasks</Property>
      <Property name="caption">流程追溯展示</Property>
      <Buttons/>
      <Children>
        <IFrame id="iFrameImg">
          <Property name="width">100%</Property>
        </IFrame>
      </Children>
      <Tools/>
    </Dialog>
    <Dialog id="dialogAbnormal" layout="regionPadding:5">
      <Property name="width">450</Property>
      <Property name="iconClass">fa fa-tasks</Property>
      <Property name="caption">异常操作原因</Property>
      <Property name="closeable">false</Property>
      <Buttons>
        <Button>
          <ClientEvent name="onClick">del();</ClientEvent>
          <Property name="caption">确定删除</Property>
          <Property name="iconClass">fa fa-check</Property>
          <Property name="exClassName">btn-warn</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">todoError();</ClientEvent>
          <Property name="caption">异常终止</Property>
          <Property name="iconClass">fa fa-check</Property>
          <Property name="exClassName">btn-warn</Property>
          <Property name="hideMode">visibility</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">self.get(&quot;parent&quot;).close();</ClientEvent>
          <Property name="caption">取消操作</Property>
          <Property name="iconClass">fa fa-times</Property>
        </Button>
      </Buttons>
      <Children>
        <TextArea id="textAbnormal">
          <Property name="height">165</Property>
        </TextArea>
        <AutoForm>
          <Property name="cols">*</Property>
          <Label layoutConstraint="colSpan:1">
            <Property name="style">
              <Property name="color">blue</Property>
            </Property>
            <Property name="text">异常终止:业务数据流程结束,重量信息不进行统计计算。</Property>
          </Label>
          <Label layoutConstraint="colSpan:1">
            <Property name="style">
              <Property name="color">blue</Property>
            </Property>
            <Property name="text">删除操作:业务数据被删除且不统计,只保留日志记录。</Property>
          </Label>
        </AutoForm>
      </Children>
      <Tools/>
    </Dialog>
    <UpdateAction id="uaSave">
      <Property name="dataResolver">inoutDataPR#saveInoutData</Property>
      <UpdateItem>
        <Property name="dataSet">dsMain</Property>
        <Property name="dataPath">[#current]</Property>
        <Property name="validateData">false</Property>
      </UpdateItem>
    </UpdateAction>
    <UpdateAction id="ajaxDel">
      <Property name="dataResolver">inoutDataPR#delInoutData</Property>
      <Property name="confirmMessage">确定要执行删除么?</Property>
      <UpdateItem>
        <Property name="dataSet">dsMain</Property>
        <Property name="dataPath">[#current]</Property>
        <Property name="validateData">false</Property>
      </UpdateItem>
    </UpdateAction>
    <UpdateAction id="ajaxError">
      <Property name="dataResolver">inoutDataPR#errorInoutData</Property>
      <UpdateItem>
        <Property name="dataSet">dsMain</Property>
        <Property name="dataPath">[#current]</Property>
        <Property name="validateData">false</Property>
      </UpdateItem>
    </UpdateAction>
    <UpdateAction id="ajaxComplete">
      <Property name="dataResolver">inoutDataPR#completeInoutData</Property>
      <Property name="confirmMessage">确定要结束流程么?</Property>
      <UpdateItem>
        <Property name="dataSet">dsMain</Property>
        <Property name="dataPath">[#current]</Property>
      </UpdateItem>
    </UpdateAction>
    <AjaxAction id="ajaxPrint">
      <Property name="service">inoutDataPR#printWeightBill</Property>
      <Property name="executingMessage">正在执行打印……</Property>
      <Property name="async">false</Property>
    </AjaxAction>
    <AjaxAction id="ajaxShipPrint">
      <Property name="service">inoutDataPR#printShipBill</Property>
      <Property name="executingMessage">正在执行打印……</Property>
      <Property name="async">false</Property>
    </AjaxAction>
    <AjaxAction id="ajaxPrintCheck">
      <Property name="service">inoutDataPR#printCheckBill</Property>
      <Property name="executingMessage">正在执行打印……</Property>
      <Property name="async">false</Property>
    </AjaxAction>
    <AjaxAction id="ajaxInitAdd">
      <Property name="service">inoutDataPR#initAddData</Property>
    </AjaxAction>
    <AjaxAction id="ajaxGetDepot">
      <Property name="service">depotPR#getDepot</Property>
    </AjaxAction>
    <AjaxAction id="ajaxGetCheck">
      <Property name="service">checkStandardPR#listCheckItemsByFoodVariety</Property>
    </AjaxAction>
    <Export2ReportAction id="exportExcel">
      <Property name="extension">xls</Property>
      <Property name="template">dataGridMain</Property>
      <Property name="maxSize">3000</Property>
      <Property name="fileName">单据列表</Property>
      <Property name="showTitle">true</Property>
      <Property name="titleName">单据列表</Property>
      <Property name="dataScope">currentPage</Property>
    </Export2ReportAction>
    <CustomDropDown id="ddFoodOrigin">
      <Property name="minHeight">500</Property>
      <Property name="assignmentMap">foodLocation=name</Property>
      <Property name="minWidth">500</Property>
      <Container layout="regionPadding:5">
        <DataSet id="dsFoodOrigin">
          <Property name="dataProvider"></Property>
          <Property name="dataType">[dtFoodOrigin]</Property>
          <Property name="parameter"></Property>
          <Property name="pageSize">30</Property>
        </DataSet>
        <Container layout="hbox regionPadding:5">
          <TextEditor id="key2">
            <Property name="blankText"> -- ç¼–码或者名称 --</Property>
            <Property name="width">200</Property>
          </TextEditor>
          <Button>
            <ClientEvent name="onClick">var key = view.get(&quot;#key2.value&quot;);&#xD;
view.get(&quot;#dsFoodOrigin&quot;).set(&quot;parameter&quot;,{key:key}).flushAsync();</ClientEvent>
            <Property name="caption">查询</Property>
            <Property name="iconClass">fa fa-search</Property>
          </Button>
          <Button>
            <ClientEvent name="onClick">var data = view.get(&quot;#dsFoodOrigin.data:#&quot;);&#xD;
if(data){&#xD;
    view.get(&quot;#ddFoodOrigin&quot;).close(data.toJSON());&#xD;
}</ClientEvent>
            <Property name="iconClass">fa fa-check</Property>
            <Property name="caption">确定</Property>
          </Button>
        </Container>
        <DataGrid>
          <ClientEvent name="onDataRowDoubleClick">var data = view.get(&quot;#dsFoodOrigin.data:#&quot;);&#xD;
if(data){&#xD;
    view.get(&quot;#ddFoodOrigin&quot;).close(data.toJSON());&#xD;
}</ClientEvent>
          <Property name="dataSet">dsFoodOrigin</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 = &quot;bold&quot;;&#xD;
arg.processDefault = true;</ClientEvent>
            <Property name="property">name</Property>
            <Property name="readOnly">true</Property>
            <Property name="align">center</Property>
          </DataColumn>
          <DataColumn name="simple">
            <Property name="property">simple</Property>
            <Property name="readOnly">true</Property>
            <Property name="align">center</Property>
          </DataColumn>
        </DataGrid>
        <DataPilot layoutConstraint="bottom">
          <Property name="dataSet">dsFoodOrigin</Property>
        </DataPilot>
      </Container>
    </CustomDropDown>
    <CustomDropDown id="ddNotice">
      <Property name="minHeight">400</Property>
      <Property name="assignmentMap">noticeId=id,customerId=customerId,customerName=customerName</Property>
      <Property name="minWidth">500</Property>
      <Property name="autoOpen">true</Property>
      <Container layout="regionPadding:5">
        <DataSet id="dsNotice">
          <Property name="dataProvider">inoutNoticePR#queryNoticeByKey</Property>
          <Property name="parameter">
            <Entity>
              <Property name="type">${request.getParameter('type')}</Property>
            </Entity>
          </Property>
          <Property name="dataType">[dtNoticeDto]</Property>
        </DataSet>
        <Container layout="hbox regionPadding:5">
          <TextEditor id="key3">
            <Property name="blankText"> -- å®¢æˆ·åç§°æˆ–编码 --</Property>
            <Property name="width">200</Property>
          </TextEditor>
          <Button>
            <ClientEvent name="onClick">var key = view.get(&quot;#key3.value&quot;);&#xD;
var type = &quot;${request.getParameter('type')}&quot;;&#xD;
view.get(&quot;#dsNotice&quot;).set(&quot;parameter&quot;,{key: key,type: type}).flushAsync();</ClientEvent>
            <Property name="caption">查询</Property>
            <Property name="iconClass">fa fa-search</Property>
          </Button>
          <Button>
            <ClientEvent name="onClick">var data = view.get(&quot;#dsNotice.data:#&quot;);&#xD;
if(data){&#xD;
    view.get(&quot;#ddNotice&quot;).close(data.toJSON());&#xD;
}</ClientEvent>
            <Property name="iconClass">fa fa-check</Property>
            <Property name="caption">确定</Property>
          </Button>
        </Container>
        <DataGrid>
          <ClientEvent name="onDataRowDoubleClick">var data = view.get(&quot;#dsNotice.data:#&quot;);&#xD;
if(data){&#xD;
    view.get(&quot;#ddNotice&quot;).close(data.toJSON());&#xD;
}</ClientEvent>
          <Property name="dataSet">dsNotice</Property>
          <Property name="readOnly">true</Property>
          <DataColumn>
            <Property name="property">customerName</Property>
            <Property name="align">center</Property>
            <Property name="name">customerName</Property>
          </DataColumn>
          <DataColumn name="name">
            <Property name="property">name</Property>
          </DataColumn>
        </DataGrid>
      </Container>
    </CustomDropDown>
    <YearDropDown id="yearDropDown"/>
    <Dialog id="dialogSelfPrint">
      <Property name="height">300</Property>
      <Property name="width">600</Property>
      <Property name="caption">自定义打印</Property>
      <Buttons>
        <Button>
          <ClientEvent name="onClick">var html = view.get(&quot;#textAreaPrint.text&quot;);&#xD;
&#xD;
self.get(&quot;parent&quot;).hide();&#xD;
printBill(html);</ClientEvent>
          <Property name="caption">确定</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">self.get(&quot;parent&quot;).hide();&#xD;
</ClientEvent>
          <Property name="caption">取消</Property>
        </Button>
      </Buttons>
      <Children>
        <TextArea id="textAreaPrint"/>
      </Children>
      <Tools/>
    </Dialog>
    <Menu id="menuEdit">
      <MenuItem>
        <ClientEvent name="onClick">var data = view.get(&quot;#dataGridMain.currentEntity&quot;);&#xD;
if (!data) {&#xD;
    $alert(&quot;请先选择数据!&quot;);&#xD;
    return;&#xD;
}&#xD;
&#xD;
var transType = data.get(&quot;transType&quot;);&#xD;
if(transType == &quot;3&quot;){&#xD;
    printShipWeight();&#xD;
}else{&#xD;
    printWeight();&#xD;
}</ClientEvent>
        <Property name="caption">打印过磅单</Property>
        <Property name="iconClass">fa fa-print</Property>
      </MenuItem>
      <MenuItem>
        <ClientEvent name="onClick">printCheck();</ClientEvent>
        <Property name="caption">打印检验单</Property>
        <Property name="iconClass">fa fa-print</Property>
      </MenuItem>
      <MenuItem>
        <ClientEvent name="onClick">printPay();</ClientEvent>
        <Property name="caption">打印结算单</Property>
        <Property name="iconClass">fa fa-print</Property>
        <Property name="disabled">true</Property>
      </MenuItem>
      <Separator/>
      <MenuItem>
        <ClientEvent name="onClick">printBatchWeight();</ClientEvent>
        <Property name="caption">批量过磅单</Property>
        <Property name="iconClass">fa fa-print</Property>
      </MenuItem>
      <MenuItem>
        <ClientEvent name="onClick">printBatchCheck();</ClientEvent>
        <Property name="caption">批量化验单</Property>
        <Property name="iconClass">fa fa-print</Property>
      </MenuItem>
      <MenuItem>
        <ClientEvent name="onClick">view.get(&quot;#dialogSelfPrint&quot;).show();</ClientEvent>
        <Property name="caption">自定义打印</Property>
        <Property name="iconClass">fa fa-print</Property>
      </MenuItem>
    </Menu>
  </View>
</ViewConfig>
igds-inout/src/main/java/com/ld/igds/m/service/HInoutNoticeService.java
@@ -276,7 +276,7 @@
        }
        hql += " where companyId =:companyId and deptId =:deptId";
        Map<String, Object> args = new HashMap<String, Object>();
        Map<String, Object> args = new HashMap<>();
        args.put("companyId", ContextUtil.getCompanyId());
        args.put("deptId", ContextUtil.subDeptId(null));
@@ -302,11 +302,10 @@
        str = (String) parameter.get("key");
        if (StringUtils.isNoneEmpty(str)) {
            hql += " and (customerId like:customerId or customerName like:customerName) ";
            args.put("customerId", "%" + str + "%");
            hql += " and (name like:name or customerName like:customerName) ";
            args.put("name", "%" + str + "%");
            args.put("customerName", "%" + str + "%");
        }
        hql += " order by id ";
igds-inout/src/main/resources/mapper/InoutRecordMapper.xml
@@ -447,7 +447,16 @@
            <if test="param.checkStatus != null and param.checkStatus == 'NONE' ">AND CHECK_STATUS_ = 'NONE'</if>
        </where>
        AND RECORD_STATUS_ != 'DEL'
        <choose>
            <when test="param.recordStatus != null and param.recordStatus == 'DEL' ">
                AND RECORD_STATUS_ = 'DEL'
            </when>
            <otherwise>
                AND RECORD_STATUS_ != 'DEL'
            </otherwise>
        </choose>
        <choose>
            <when test="param.orderTag != null and param.orderTag == 'ASC' ">