1
heshaofeng
2026-01-13 99ff0b03a5116df776aa2210fdb0174d688690f5
1
已修改11个文件
909 ■■■■■ 文件已修改
项目代码/WIDESEA_WMSClient/config/buttons.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/inbound/Dt_AllocateOrder.js 399 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/inbound/allocateinboundOrder.js 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/allocateOrderDetail.vue 277 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/outbound/allocateoutboundOrder.js 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/inbound/allocateinboundOrder.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/outbound/allocateoutboundOrder.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WIDESEA_WMSClient/config/buttons.js
@@ -319,7 +319,7 @@
    name: "关闭单据",
    icon: '',
    class: '',
    value: ' ',
    value: 'CloseOrder',
    type: 'warning',
    onClick: function () {
    }
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/inbound/Dt_AllocateOrder.js
@@ -17,345 +17,7 @@
      modelFooter: ''
    },
    tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
    buttons: { view: [
      //  {
      //   name: '组盘',
      //   type: 'primary',
      //   value: '组盘',
      //   onClick: function () { // ä¿®å¤1:移除无用row参数,加日志调试
      //     console.log('组盘按钮被点击,开始校验');
      //     const selectedRows = this.$refs.table.getSelected();
      //     // æ ¡éªŒ1:是否选中行
      //     if (selectedRows.length === 0) {
      //       console.log('校验不通过:未选中任何单据');
      //       ElMessage.warning('请选择一条单据');
      //       return;
      //     }
      //     // æ ¡éªŒ2:是否选中单行
      //     if (selectedRows.length > 1) {
      //       console.log('校验不通过:选中多行单据');
      //       ElMessage.warning('只能选择一条单据');
      //       return;
      //     }
      //     const targetRow = selectedRows[0];
      //     this.$emit('openPalletDialog', targetRow.orderNo);
      //   }
      // },
      {
                name: '撤销组盘',
                type: 'primary',
                value: '撤销组盘',
                onClick: function () {
                    console.log('撤销组盘按钮被点击');
                    const mountNode = document.createElement('div');
                    document.body.appendChild(mountNode);
                    // å“åº”式表单数据:托盘号(必填)
                    const formData = reactive({
                        palletCode: '' // æ‰˜ç›˜å·è¾“入框
                    });
                    // æäº¤è¡¨å•的统一逻辑
                    const submitForm = async () => {
                        const formRef = vnode.component.refs.cancelPalletForm;
                        try {
                            // æ‰§è¡Œè¡¨å•校验(托盘号必填)
                            await formRef.validate();
                        } catch (err) {
                            ElMessage.warning('请输入有效的托盘号');
                            return;
                        }
                        // å‘起撤销组盘请求
                        try {
                            //console.log('发起撤销组盘请求,托盘号:', formData.palletCode.trim());
                            const response = await http.post('/api/InboundOrder/CancelPalletGroup', {
                                palletCode: formData.palletCode.trim()
                            });
                            const { status, message, data } = response;
                            if (status) {
                                ElMessage.success(`撤销组盘成功,托盘号:${formData.palletCode.trim()}`);
                                this.refresh(); // æˆåŠŸåŽåˆ·æ–°åˆ—è¡¨
                                // å…³é—­å¯¹è¯æ¡†
                                render(null, mountNode);
                                document.body.removeChild(mountNode);
                            } else {
                                console.log('撤销组盘失败,后端提示:', message);
                                ElMessage.error(message || data?.message || '撤销组盘失败');
                                selectPalletCodeInput(); // é€‰ä¸­è¾“入框方便重新输入
                            }
                        } catch (error) {
                            console.error('撤销组盘请求异常:', error);
                            ElMessage.error('网络异常或接口错误,请稍后重试');
                            selectPalletCodeInput();
                        }
                    };
                    // é€‰ä¸­è¾“入框文本(方便重新输入)
                    const selectPalletCodeInput = () => {
                        setTimeout(() => {
                            const inputRef = vnode.component.refs.palletCodeInput;
                            if (inputRef) {
                                const targetInput = inputRef.$el?.querySelector('input') || inputRef;
                                targetInput?.focus();
                                targetInput?.select();
                            }
                        }, 100);
                    };
                    // åˆ›å»ºå¯¹è¯æ¡†VNode
                    const vnode = createVNode(ElDialog, {
                        title: '撤销组盘',
                        width: '400px',
                        modelValue: true,
                        appendToBody: true,
                        onOpened: () => {
                            // å¯¹è¯æ¡†æ‰“开后自动聚焦输入框
                            setTimeout(() => {
                                const inputRef = vnode.component.refs.palletCodeInput;
                                inputRef?.focus();
                            }, 100);
                        },
                        'onUpdate:modelValue': (isVisible) => {
                            if (!isVisible) {
                                render(null, mountNode);
                                document.body.removeChild(mountNode);
                            }
                        }
                    }, {
                        default: () => h(ElForm, {
                            model: formData,
                            rules: {
                                palletCode: [
                                    { required: true, message: '请输入托盘号', trigger: ['blur', 'enter'] },
                                    { min: 1, max: 50, message: '托盘号长度不能超过50个字符', trigger: ['blur', 'input'] }
                                ]
                            },
                            ref: 'cancelPalletForm'
                        }, [
                            // æ‰˜ç›˜å·è¾“入项
                            h(ElFormItem, { label: '托盘号', prop: 'palletCode', required: true }, [
                                h(ElInput, {
                                    type: 'text',
                                    modelValue: formData.palletCode,
                                    'onUpdate:modelValue': (val) => {
                                        formData.palletCode = val;
                                    },
                                    ref: 'palletCodeInput',
                                    placeholder: '扫码输入或手动输入托盘号',
                                    maxLength: 50,
                                    // ç›‘听回车事件(扫码枪默认会发送回车)
                                    onKeydown: (e) => {
                                        if (e.key === 'Enter') {
                                            e.preventDefault();
                                            submitForm();
                                        }
                                    }
                                })
                            ]),
                            // åº•部按钮区
                            h('div', { style: { textAlign: 'right', marginTop: '16px' } }, [
                                h(ElButton, {
                                    type: 'text',
                                    onClick: () => {
                                        render(null, mountNode);
                                        document.body.removeChild(mountNode);
                                        ElMessage.info('取消撤销组盘');
                                    }
                                }, '取消'),
                                h(ElButton, {
                                    type: 'primary',
                                    onClick: submitForm.bind(this) // ç»‘定this上下文
                                }, '确认撤销')
                            ])
                        ])
                    });
                    vnode.appContext = this.$.appContext;
                    render(vnode, mountNode);
                }
            },
     {
  name: '空托盘入库',
  type: 'primary',
  value: '空托盘入库',
  onClick: function () {
    const mountNode = document.createElement('div');
    document.body.appendChild(mountNode);
    // å“åº”式表单数据:料箱码(必填,扫码枪/手动输入)
    const formData = reactive({
      boxCode: '',
      warehouseCode:''
    });
    const warehouses = ref([]);
    const isLoadingWarehouses = ref(false);
    const getWarehouseList = async () => {
      isLoadingWarehouses.value = true;
      try {
        const { data, status } = await http.post('/api/LocationInfo/GetLocationTypes');
        if (status && Array.isArray(data)) {
          // æ ¼å¼åŒ–仓库选项:适配ElSelect的label-value格式
          warehouses.value = data.map(item => ({
            label: item.locationTypeDesc,
            value: item.locationType
          }));
        } else {
          ElMessage.error('获取区域列表失败');
          warehouses.value = [];
        }
      } catch (err) {
        ElMessage.error('区域数据请求异常,请稍后重试');
        warehouses.value = [];
      } finally {
        isLoadingWarehouses.value = false;
      }
    };
    // æäº¤è¡¨å•的统一逻辑(供回车触发和按钮点击共用)
    const submitForm = async () => {
      const formRef = vnode.component.refs.batchInForm;
      try {
        // æ‰§è¡Œè¡¨å•校验(料箱码必填)
        await formRef.validate();
      } catch (err) {
        ElMessage.warning('请输入有效的料箱码');
        return;
      }
      http.post('/api/InboundOrder/EmptyMaterielGroup', {
        palletCode: formData.boxCode.trim(),
        warehouseCode:formData.warehouseCode
      }).then(({ data, status, message }) => {
        if (status) {
          ElMessage.success(`入库成功,料箱码:${formData.boxCode.trim()}`);
          this.refresh();
          formData.boxCode = '';
          setTimeout(() => {
            const inputRef = vnode.component.refs.boxCodeInput;
            inputRef?.focus();
          }, 100);
        } else {
          ElMessage.error(message || data?.message || '入库失败');
          selectBoxCodeInput();
        }
      }).catch(() => {
        ElMessage.error('请求失败,请稍后重试');
        selectBoxCodeInput();
      });
    };
    const selectBoxCodeInput = () => {
      setTimeout(() => {
        const inputRef = vnode.component.refs.boxCodeInput;
        if (inputRef) {
          const targetInput = inputRef.$el?.querySelector('input') || inputRef;
          targetInput?.focus();
          targetInput?.select();
        }
  }, 100);
}
    const vnode = createVNode(ElDialog, {
      title: '空托盘入库',
      width: '400px',
      modelValue: true,
      appendToBody: true,
      onOpened: async () => {
        await getWarehouseList();
        const inputRef = vnode.component.refs.boxCodeInput;
        inputRef?.focus();
      },
      'onUpdate:modelValue': (isVisible) => {
        if (!isVisible) {
          render(null, mountNode);
          document.body.removeChild(mountNode);
        }
      }
    }, {
      default: () => h(ElForm, {
        model: formData,
        rules: {
          boxCode: [
            { required: true, message: '请输入料箱码', trigger: ['blur', 'enter'] }
          ],
          warehouseCode:[
            { required: true, message: '请选择区域', trigger: ['change', 'blur'] }
          ]
        },
        ref: 'batchInForm'
      }, [
        //仓库数据
        h(ElFormItem, { label: '区域', prop: 'warehouseCode', required: true }, [
          h(ElSelect, {
            modelValue: formData.warehouseCode,
            'onUpdate:modelValue': (val) => {
              formData.warehouseCode = val;
            },
            placeholder: '请选择入库区域',
            filterable: true, // æ”¯æŒæœç´¢ä»“库
            loading: isLoadingWarehouses.value, // åŠ è½½çŠ¶æ€
            style: { width: '100%' }
          }, [
            // æ¸²æŸ“仓库下拉选项
            warehouses.value.map(item => h(ElOption, {
              label: item.label,
              value: item.value
            }))
          ])
        ]),
        // æ–™ç®±ç è¾“入项(支持聚焦、回车提交)
        h(ElFormItem, { label: '料箱码', prop: 'boxCode', required: true }, [
          h(ElInput, {
            type: 'text',
            modelValue: formData.boxCode,
            'onUpdate:modelValue': (val) => {
              formData.boxCode = val;
            },
            ref: 'boxCodeInput',
            placeholder: '扫码输入或手动输入料箱码',
            // ç›‘听回车事件(扫码枪默认会发送回车)
            onKeydown: (e) => {
              if (e.key === 'Enter') {
                e.preventDefault();
                submitForm();
              }
            }
          })
        ]),
        // åº•部按钮区
        h('div', { style: { textAlign: 'right', marginTop: '16px' } }, [
          h(ElButton, {
            type: 'text',
            onClick: () => {
              render(null, mountNode);
              document.body.removeChild(mountNode);
              ElMessage.info('取消入库任务');
            }
          }, '取消'),
          h(ElButton, {
            type: 'primary',
            onClick: submitForm
          }, '确定')
        ])
      ])
    });
    vnode.appContext = this.$.appContext;
    render(vnode, mountNode);
  }
}
    ], box: [], detail: [] },
    buttons: { view: [], box: [], detail: [] },
    methods: {
       //下面这些方法可以保留也可以删除
      onInit() {  
@@ -387,7 +49,64 @@
      },
      
      onInited() {
        let BatchOrderFeedbackToMesBtn = this.buttons.find(x => x.value == 'BatchOrderFeedbackToMes');
      if (BatchOrderFeedbackToMesBtn) {
        const _this = this;
        BatchOrderFeedbackToMesBtn.onClick = function () {
          let selectedRows = _this.$refs.table.getSelected();
          // æ ¡éªŒæ˜¯å¦æœ‰é€‰ä¸­æ•°æ®
          if (!selectedRows || selectedRows.length === 0) {
            return _this.$Message.warning('请先选择需要处理的单据');
          }
          if (selectedRows.length > 1) {
            return _this.$Message.warning('请选择一条数据');
          }
          _this.http
            .post(`api/MesFeedback/OutboundFeedback?orderNo=${selectedRows[0].orderNo}`, {}, "数据处理中...")
            .then((x) => {
              if (x.status) {
                _this.$Message.success('分批出库回调完成');
                _this.refresh();
              } else {
                return _this.$Message.error('分批出库回调失败');
              }
            })
            .catch((error) => {
            });
        };
      }
       var CloseOrderBtn = this.buttons.find(
              (x) => x.value == "CloseOrder"
            );
            if (CloseOrderBtn != null) {
              CloseOrderBtn.onClick = () => {
                var rows = this.$refs.table.getSelected();
                // æ ¡éªŒæ˜¯å¦æœ‰é€‰ä¸­æ•°æ®
                if (!rows || rows.length === 0) {
                  return this.$Message.error("请先选择需要关闭的单据");
                }
                if (rows.length > 1) {
                  return this.$Message.error("请选择一条单据");
                }
                this.http.post(`api/InboundOrder/HandCloseOrder?orderIds=${rows[0].orderNo}`, {}, "数据处理中...")
                  .then((x) => {
                    if (x.status) {
                      this.$Message.success(x.message);
                      this.refresh();
                    } else {
                      return this.$Message.error(x.message);
                    }
                  })
                  .catch((error) => {
                    // å¢žåŠ å¼‚å¸¸æ•èŽ·ï¼Œå¤„ç†ç½‘ç»œé”™è¯¯ç­‰æƒ…å†µ
                    //_this.$Message.error('请求失败:' + (error.message || '未知错误'));
                  });
              };
            }
        //框架初始化配置后
        //如果要配置明细表,在此方法操作
        //this.detailOptions.columns.forEach(column=>{ });
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/inbound/allocateinboundOrder.js
@@ -131,7 +131,34 @@
      }
      },
      onInited() {
         var CloseOrderBtn = this.buttons.find(
                      (x) => x.value == "CloseOrder"
                    );
                    if (CloseOrderBtn != null) {
                      CloseOrderBtn.onClick = () => {
                        var rows = this.$refs.table.getSelected();
                        // æ ¡éªŒæ˜¯å¦æœ‰é€‰ä¸­æ•°æ®
                        if (!rows || rows.length === 0) {
                          return this.$Message.error("请先选择需要关闭的单据");
                        }
                        if (rows.length > 1) {
                          return this.$Message.error("请选择一条单据");
                        }
                        this.http.post(`api/InboundOrder/HandCloseOrder?orderIds=${rows[0].orderNo}`, {}, "数据处理中...")
                          .then((x) => {
                            if (x.status) {
                              this.$Message.success(x.message);
                              this.refresh();
                            } else {
                              return this.$Message.error(x.message);
                            }
                          })
                          .catch((error) => {
                            // å¢žåŠ å¼‚å¸¸æ•èŽ·ï¼Œå¤„ç†ç½‘ç»œé”™è¯¯ç­‰æƒ…å†µ
                            //_this.$Message.error('请求失败:' + (error.message || '未知错误'));
                          });
                      };
                    }
        //框架初始化配置后
        //如果要配置明细表,在此方法操作
        //this.detailOptions.columns.forEach(column=>{ });
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/inbound/extend/allocateOrderDetail.vue
@@ -315,149 +315,150 @@
      });
    },
    outbound() {
      // if (this.selection.length === 0) {
      //   return this.$message.error("请选择单据明细");
      // }
      // const platformOptions = [
      //   { label: "站台2", value: "2-1" },
      //   { label: "站台3", value: "3-1" },
      // ];
      // const mountNode = document.createElement("div");
      // document.body.appendChild(mountNode);
      if (this.selection.length === 0) {
        return this.$message.error("请选择单据明细");
      }
      const platformOptions = [
        { label: "站台2", value: "2-1" },
        { label: "站台3", value: "3-1" },
      ];
      const mountNode = document.createElement("div");
      document.body.appendChild(mountNode);
      // const formData = reactive({
      //   selectedPlatform: platformOptions[0].value,
      // });
      const formData = reactive({
        selectedPlatform: platformOptions[0].value,
      });
      // const vnode = createVNode(
      //   ElDialog,
      //   {
      //     title: "出库操作 - é€‰æ‹©å‡ºåº“站台",
      //     width: "500px",
      //     modelValue: true,
      //     appendToBody: true,
      //     "onUpdate:modelValue": (isVisible) => {
      //       if (!isVisible) {
      //         render(null, mountNode);
      //         document.body.removeChild(mountNode);
      //       }
      //     },
      //     style: {
      //       padding: "20px 0",
      //       borderRadius: "8px",
      //     },
      //   },
      //   {
      //     default: () =>
      //       h(
      //         ElForm,
      //         {
      //           model: formData,
      //           rules: {
      //             selectedPlatform: [
      //               { required: true, message: "请选择出库站台", trigger: "change" },
      //             ],
      //           },
      //           ref: "outboundForm",
      //           labelWidth: "100px",
      //           style: {
      //             padding: "0 30px",
      //           },
      //         },
      //         [
      //           h(ElFormItem, {
      //             label: "出库站台",
      //             prop: "selectedPlatform",
      //             style: {
      //               marginBottom: "24px",
      //             },
      //           }, [
      //             h(ElSelect, {
      //               placeholder: "请选择出库站台(3-12)",
      //               modelValue: formData.selectedPlatform,
      //               "onUpdate:modelValue": (val) => {
      //                 formData.selectedPlatform = val;
      //               },
      //               style: {
      //                 width: "100%",
      //                 height: "40px",
      //                 borderRadius: "4px",
      //                 borderColor: "#dcdfe6",
      //               },
      //             }, platformOptions.map((platform) =>
      //               h(ElOption, { label: platform.label, value: platform.value })
      //             )),
      //           ]),
      //           h("div", {
      //             style: {
      //               textAlign: "right",
      //               marginTop: "8px",
      //               paddingRight: "4px",
      //             },
      //           }, [
      //             h(ElButton, {
      //               type: "text",
      //               onClick: () => {
      //                 render(null, mountNode);
      //                 document.body.removeChild(mountNode);
      //                 ElMessage.info("取消出库操作");
      //               },
      //               style: {
      //                 marginRight: "8px",
      //                 color: "#606266",
      //               },
      //             }, "取消"),
      //             h(ElButton, {
      //               type: "primary",
      //               onClick: async () => {
      //                 const formRef = vnode.component.refs.outboundForm;
      //                 try {
      //                   await formRef.validate();
      //                 } catch (err) {
      //                   return;
      //                 }
      const vnode = createVNode(
        ElDialog,
        {
          title: "出库操作 - é€‰æ‹©å‡ºåº“站台",
          width: "500px",
          modelValue: true,
          appendToBody: true,
          "onUpdate:modelValue": (isVisible) => {
            if (!isVisible) {
              render(null, mountNode);
              document.body.removeChild(mountNode);
            }
          },
          style: {
            padding: "20px 0",
            borderRadius: "8px",
          },
        },
        {
          default: () =>
            h(
              ElForm,
              {
                model: formData,
                rules: {
                  selectedPlatform: [
                    { required: true, message: "请选择出库站台", trigger: "change" },
                  ],
                },
                ref: "outboundForm",
                labelWidth: "100px",
                style: {
                  padding: "0 30px",
                },
              },
              [
                h(ElFormItem, {
                  label: "出库站台",
                  prop: "selectedPlatform",
                  style: {
                    marginBottom: "24px",
                  },
                }, [
                  h(ElSelect, {
                    placeholder: "请选择出库站台(3-12)",
                    modelValue: formData.selectedPlatform,
                    "onUpdate:modelValue": (val) => {
                      formData.selectedPlatform = val;
                    },
                    style: {
                      width: "100%",
                      height: "40px",
                      borderRadius: "4px",
                      borderColor: "#dcdfe6",
                    },
                  }, platformOptions.map((platform) =>
                    h(ElOption, { label: platform.label, value: platform.value })
                  )),
                ]),
                h("div", {
                  style: {
                    textAlign: "right",
                    marginTop: "8px",
                    paddingRight: "4px",
                  },
                }, [
                  h(ElButton, {
                    type: "text",
                    onClick: () => {
                      render(null, mountNode);
                      document.body.removeChild(mountNode);
                      ElMessage.info("取消出库操作");
                    },
                    style: {
                      marginRight: "8px",
                      color: "#606266",
                    },
                  }, "取消"),
                  h(ElButton, {
                    type: "primary",
                    onClick: async () => {
                      const formRef = vnode.component.refs.outboundForm;
                      try {
                        await formRef.validate();
                      } catch (err) {
                        return;
                      }
      //                 const keys = this.selection.map((item) => item.id);
      //                 const requestParams = {
      //                   detailIds: keys,
      //                   outboundTargetLocation: formData.selectedPlatform,
      //                   outboundQuantity: 1,
      //                   operator: "",
      //                   orderNo: this.row.orderNo,
      //                 };
                      const keys = this.selection.map((item) => item.id);
                      const requestParams = {
                        detailIds: keys,
                        outboundTargetLocation: formData.selectedPlatform,
                        outboundQuantity: 1,
                        operator: "",
                        orderNo: this.row.orderNo,
                        stockDetailIds: []
                      };
      //                 this.http
      //                   .post(
      //                     "api/Outbound/ProcessPickingOutbound",
      //                     requestParams,
      //                     "数据处理中"
      //                   )
      //                   .then((x) => {
      //                     if (!x.status) return ElMessage.error(x.message);
      //                     ElMessage.success("操作成功");
      //                     this.showDetialBox = false;
      //                     this.$emit("parentCall", ($vue) => {
      //                       $vue.getData();
      //                     });
      //                     render(null, mountNode);
      //                     document.body.removeChild(mountNode);
      //                   })
      //                 // .catch(() => {
      //                 //   ElMessage.error("请求失败,请稍后重试");
      //                 // });
      //               },
      //               style: {
      //                 borderRadius: "4px",
      //                 padding: "8px 20px",
      //               },
      //             }, "确定出库"),
      //           ]),
      //         ]),
      //   }
      // );
                      this.http
                        .post(
                          "api/Outbound/ProcessPickingOutbound",
                          requestParams,
                          "数据处理中"
                        )
                        .then((x) => {
                          if (!x.status) return ElMessage.error(x.message);
                          ElMessage.success("操作成功");
                          this.showDetialBox = false;
                          this.$emit("parentCall", ($vue) => {
                            $vue.getData();
                          });
                          render(null, mountNode);
                          document.body.removeChild(mountNode);
                        })
                      // .catch(() => {
                      //   ElMessage.error("请求失败,请稍后重试");
                      // });
                    },
                    style: {
                      borderRadius: "4px",
                      padding: "8px 20px",
                    },
                  }, "确定出库"),
                ]),
              ]),
        }
      );
      // vnode.appContext = this.$.appContext;
      // render(vnode, mountNode);
      vnode.appContext = this.$.appContext;
      render(vnode, mountNode);
    },
    outboundbatch() {
      if (this.selection.length === 0) {
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/outbound/allocateoutboundOrder.js
@@ -85,6 +85,34 @@
      }
      },
      onInited() {
         var CloseOrderBtn = this.buttons.find(
                      (x) => x.value == "CloseOrder"
                    );
                    if (CloseOrderBtn != null) {
                      CloseOrderBtn.onClick = () => {
                        var rows = this.$refs.table.getSelected();
                        // æ ¡éªŒæ˜¯å¦æœ‰é€‰ä¸­æ•°æ®
                        if (!rows || rows.length === 0) {
                          return this.$Message.error("请先选择需要关闭的单据");
                        }
                        if (rows.length > 1) {
                          return this.$Message.error("请选择一条单据");
                        }
                        this.http.post(`api/InboundOrder/HandCloseOrder?orderIds=${rows[0].orderNo}`, {}, "数据处理中...")
                          .then((x) => {
                            if (x.status) {
                              this.$Message.success(x.message);
                              this.refresh();
                            } else {
                              return this.$Message.error(x.message);
                            }
                          })
                          .catch((error) => {
                            // å¢žåŠ å¼‚å¸¸æ•èŽ·ï¼Œå¤„ç†ç½‘ç»œé”™è¯¯ç­‰æƒ…å†µ
                            //_this.$Message.error('请求失败:' + (error.message || '未知错误'));
                          });
                      };
                    }
        //框架初始化配置后
        //如果要配置明细表,在此方法操作
        //this.detailOptions.columns.forEach(column=>{ });
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue
@@ -128,58 +128,90 @@
    ]);
    
    // const searchFormFields = ref({
    //   orderNo: "",
    //   upperOrderNo: "",
    //   orderType: "117",
    //   orderStatus: "",
    //   createType: "",
    //   fromWarehouse: "",
    //   toWarehouse: "",
    //   factoryArea: "",
    //   creater: "",
    //   createDate: "",
    // });
    // const searchFormOptions = ref([
    //   [
    //     { title: "上级单据编号", field: "upperOrderNo", type: "like" },
    //     {
    //       title: "单据状态",
    //       field: "orderStatus",
    //       type: "select",
    //       dataKey: "allocateOrderStatus",
    //       data: [],
    //     },
    //     {
    //       title: "单据类型",
    //       field: "orderType",
    //       type: "select",
    //       dataKey: "outOrderType",
    //       data: [],
    //     },
    //   ],
    //   [
    //     {
    //       title: "创建类型",
    //       field: "createType",
    //       type: "select",
    //       dataKey: "createType",
    //       data: [],
    //     },
    //     { title: "来源仓库", field: "fromWarehouse", type: "like" },
    //     { title: "目标仓库", field: "toWarehouse", type: "like" },
    //   ],
    //   [
    //     { title: "厂区", field: "factoryArea", type: "like" },
    //     { title: "创建者", field: "creater", type: "like" },
    //     { title: "创建时间", field: "createDate", type: "datetime" },
    //   ],
    // ]);
    const searchFormFields = ref({
      orderNo: "",
      upperOrderNo: "",
      supplierId: "",
      orderType: "",
      orderType: "117",
      orderStatus: "",
      createType: "",
      businessType: "",
      fromWarehouse: "",
      toWarehouse: "",
      factoryArea: "",
      creater: "",
      createDate: "",
    });
    const searchFormOptions = ref([
      [
        { title: "单据编号", field: "orderNo", type: "like" },
        { title: "上级单据编号", field: "upperOrderNo", type: "like" },
        { title: "供应商ID", field: "supplierId", type: "like" },
        {
          title: "订单类型",
          title: "单据类型",
          field: "orderType",
          type: "select",
          dataKey: "allocateOrderType",
          dataKey: "outOrderType",
          data: [],
        },
        {
          title: "单据状态",
          field: "orderStatus",
          type: "select",
          dataKey: "outboundStatusEnum",
          data: [],
        },
      ],
      [
        {
          title: "单据状态",
          field: "orderStatus",
          type: "select",
          dataKey: "allocateOrderStatus",
          data: [],
        },
        {
          title: "创建类型",
          title: "创建方式",
          field: "createType",
          type: "select",
          dataKey: "createType",
          data: [],
        },
        { title: "业务类型", field: "businessType", type: "like" },
      ],
      [
        { title: "来源仓库", field: "fromWarehouse", type: "like" },
        { title: "目标仓库", field: "toWarehouse", type: "like" },
        { title: "厂区", field: "factoryArea", type: "like" },
      ],
      [
        { title: "创建者", field: "creater", type: "like" },
        { title: "创建时间", field: "createDate", type: "datetime" },
      ],
@@ -211,19 +243,12 @@
        align: "left",
      },
      {
        field: "supplierId",
        title: "供应商ID",
        type: "string",
        width: 120,
        align: "left",
      },
      {
        field: "orderType",
        title: "订单类型",
        type: "int",
        width: 120,
        align: "left",
        bind: { key: "allocateOrderType", data: [] },
        bind: { key: "outOrderType", data: [] },
      },
      {
        field: "orderStatus",
@@ -231,7 +256,7 @@
        type: "int",
        width: 120,
        align: "left",
        bind: { key: "allocateOrderStatus", data: [] },
        bind: { key: "inboundState", data: [] },
      },
      {
        field: "createType",
@@ -241,20 +266,20 @@
        align: "left",
        bind: { key: "createType", data: [] },
      },
      {
        field: "businessType",
        title: "业务类型",
        type: "string",
        width: 120,
        align: "left",
      },
      // {
      //   field: "businessType",
      //   title: "业务类型",
      //   type: "string",
      //   width: 120,
      //   align: "left",
      //   bind: { key: "businessType", data: [] },
      // },
      {
        field: "fromWarehouse",
        title: "来源仓库",
        type: "string",
        width: 120,
        align: "left",
        bind: { key: "warehouses", data: [] },
      },
      {
        field: "toWarehouse",
@@ -262,21 +287,12 @@
        type: "string",
        width: 120,
        align: "left",
        bind: { key: "warehouses", data: [] },
      },
      {
        field: "isBatch",
        title: "是否批次",
        type: "bool",
        width: 100,
        align: "left",
      },
      {
        field: "returnToMESStatus",
        title: "回传状态",
        type: "string",
        width: 100,
        align: "left",
        title: "回传MES状态",
        width: 120,
        bind: { key: "createType", data: [{ key: 0, value: "未回传" }, { key: 1, value: "已回传成功" }, { key: 2, value: "回传失败" },{ key: 4, value: "部分回传失败" }] },
      },
      {
        field: "factoryArea",
@@ -300,7 +316,7 @@
        align: "left",
      },
      {
        field: "operator",
        field: "modifier",
        title: "修改人",
        type: "string",
        width: 100,
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/inbound/allocateinboundOrder.vue
@@ -74,7 +74,6 @@
    const searchFormOptions = ref([
      [
        { title: "请扫描单据或条码", field: "orderNo", type: "like" },
        { title: "上游单据编号", field: "upperOrderNo", type: "like" },
        {
          title: "单据类型",
          field: "orderType",
@@ -185,7 +184,7 @@
        field: "returnToMESStatus",
        title: "回传MES状态",
        width: 120,
        bind: { key: "createType", data: [{ key: 0, value: "未回传" }, { key: 1, value: "已回传成功" }, { key: 2, value: "回传失败" }] },
        bind: { key: "createType", data: [{ key: 0, value: "未回传" }, { key: 1, value: "已回传成功" }, { key: 2, value: "回传失败" },{ key: 4, value: "部分回传失败" }] },
      },
      {
        field: "creater",
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue
@@ -169,7 +169,7 @@
        field: "returnToMESStatus",
        title: "回传MES状态",
        width: 120,
        bind: { key: "createType", data: [{ key: 0, value: "未回传" }, { key: 1, value: "已回传成功" }, { key: 2, value: "回传失败" }] },
        bind: { key: "createType", data: [{ key: 0, value: "未回传" }, { key: 1, value: "已回传成功" }, { key: 2, value: "回传失败" },{ key: 4, value: "部分回传失败" }] },
      },
      {
        field: "factoryArea",
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/outbound/allocateoutboundOrder.vue
@@ -83,7 +83,6 @@
    const searchFormOptions = ref([
      [
        { title: "单据编号", field: "orderNo", type: "like" },
        { title: "上游单据编号", field: "upperOrderNo", type: "like" },
        {
          title: "单据类型",
          field: "orderType",
@@ -195,7 +194,7 @@
        field: "returnToMESStatus",
        title: "回传MES状态",
        width: 120,
        bind: { key: "createType", data: [{ key: 0, value: "未回传" }, { key: 1, value: "已回传成功" }, { key: 2, value: "回传失败" }] },
        bind: { key: "createType", data: [{ key: 0, value: "未回传" }, { key: 1, value: "已回传成功" }, { key: 2, value: "回传失败" },{ key: 4, value: "部分回传失败" }] },
      },
      {
        field: "departmentCode",
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue
@@ -196,7 +196,7 @@
        field: "returnToMESStatus",
        title: "回传MES状态",
        width: 120,
        bind: { key: "createType", data: [{ key: 0, value: "未回传" }, { key: 1, value: "已回传成功" }, { key: 2, value: "回传失败" }] },
        bind: { key: "createType", data: [{ key: 0, value: "未回传" }, { key: 1, value: "已回传成功" }, { key: 2, value: "回传失败" },{ key: 4, value: "部分回传失败" }] },
      },
      {
        field: "factoryArea",
@@ -236,7 +236,7 @@
        align: "left",
      },
      {
        field: "modifier",
        field: "operator",
        title: "修改人",
        type: "string",
        width: 100,
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs
@@ -48,9 +48,10 @@
        private readonly IRepository<Dt_LocationInfo> _locationInfoRepository;
        private readonly IBasicService _basicService;
        private readonly IRepository<Dt_AllocateOrder> _allocateOrderRepository;
        private readonly IRepository<Dt_OutboundOrder> _outboundOrderRepository;
        public IRepository<Dt_InboundOrder> Repository => BaseDal;
        public InboundOrderService(IRepository<Dt_InboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IRepository<Dt_Task> taskRepository, IStockService stockService, IInboundOrderDetailService inboundOrderDetailService, IMaterialUnitService materialUnitService, IRepository<Dt_StockInfoDetail> stockDetailRepository, IRepository<Dt_InboundOrder> inboundOrderRepository, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IRepository<Dt_StockInfo> stockRepository, IRepository<Dt_LocationType> locationTypeRepository, IMaterielInfoService materielInfoService, IBasicService basicService, IRepository<Dt_LocationInfo> locationInfoRepository, IRepository<Dt_AllocateOrder> allocateOrderRepository) : base(BaseDal)
        public InboundOrderService(IRepository<Dt_InboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IRepository<Dt_Task> taskRepository, IStockService stockService, IInboundOrderDetailService inboundOrderDetailService, IMaterialUnitService materialUnitService, IRepository<Dt_StockInfoDetail> stockDetailRepository, IRepository<Dt_InboundOrder> inboundOrderRepository, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IRepository<Dt_StockInfo> stockRepository, IRepository<Dt_LocationType> locationTypeRepository, IMaterielInfoService materielInfoService, IBasicService basicService, IRepository<Dt_LocationInfo> locationInfoRepository, IRepository<Dt_AllocateOrder> allocateOrderRepository, IRepository<Dt_OutboundOrder> outboundOrderRepository) : base(BaseDal)
        {
            _mapper = mapper;
            _unitOfWorkManage = unitOfWorkManage;
@@ -68,6 +69,7 @@
            _basicService = basicService;
            _locationInfoRepository = locationInfoRepository;
            _allocateOrderRepository = allocateOrderRepository;
            _outboundOrderRepository = outboundOrderRepository;
        }
        public async Task<WebResponseContent> ReceiveInboundOrder(List<Dt_InboundOrder> models, int operateType)
@@ -977,16 +979,32 @@
                foreach (var orderNo in orderNos)
                {
                    var inbound = _inboundOrderRepository.QueryFirst(x => x.InboundOrderNo == orderNo);
                    if(inbound == null)
                    var outbound = _outboundOrderRepository.QueryFirst(x=>x.OrderNo == orderNo);
                    if(inbound == null && outbound == null)
                    {
                        return WebResponseContent.Instance.Error($"该单据不存在,无法进行关闭");
                    }
                    if (inbound.OrderStatus != (int)InOrderStatusEnum.未开始 && inbound.OrderStatus != (int)InOrderStatusEnum.入库中)
                    if (inbound != null)
                    {
                        return WebResponseContent.Instance.Error($"该单据状态不可以关闭");
                        if (inbound.OrderStatus != (int)InOrderStatusEnum.未开始 && inbound.OrderStatus != (int)InOrderStatusEnum.入库中)
                        {
                            return WebResponseContent.Instance.Error($"该单据状态不可以关闭");
                        }
                        inbound.OrderStatus = (int)InOrderStatusEnum.手动关闭;
                        inbound.Operator = App.User.UserName;
                        _inboundOrderRepository.UpdateData(inbound);
                    }else if (outbound != null)
                    {
                        if(outbound.OrderStatus !=(int)OutOrderStatusEnum.未开始 && outbound.OrderStatus != (int)OutOrderStatusEnum.出库中)
                        {
                            return WebResponseContent.Instance.Error($"该单据状态不可以关闭");
                        }
                        outbound.OrderStatus = (int)OutOrderStatusEnum.关闭;
                        outbound.Operator = App.User.UserName;
                        _outboundOrderRepository.UpdateData(outbound);
                    }
                    inbound.OrderStatus = (int)InOrderStatusEnum.手动关闭;
                    _inboundOrderRepository.UpdateData(inbound);
                }
                return WebResponseContent.Instance.OK($"单据关闭成功");
            }