heshaofeng
2025-11-04 b01d33fb2262722cda8aa5b40d2fa9a5dee5b9be
提交

提交
已添加3个文件
已修改4个文件
816 ■■■■■ 文件已修改
项目代码/WIDESEA_WMSClient/src/extension/inbound/Dt_MaterielToMes.js 328 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js 166 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/router/viewGird.js 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/inbound/Dt_MaterielToMes.vue 194 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/MaterielToMesController.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/inbound/Dt_MaterielToMes.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,328 @@
import QRCode from 'qrcode'; // äºŒç»´ç ç”Ÿæˆåº“
import { ElDialog, ElButton, ElMessage ,ElImage,ElMessageBox } from 'element-plus';// å¼•å…¥ElMessage,解决提示无反应
import { h,createVNode, render  } from 'vue';
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
let extension = {
  components: {
    //查询界面扩展组件
    gridHeader: '',
    gridBody: '',
    gridFooter: '',
    //新建、编辑弹出框扩展组件
    modelHeader: '',
    modelBody: '',
    modelFooter: ''
  },
  tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
  buttons: { view: [{
 name: '生成二维码',
  type: 'success',
  value: '生成二维码',
  onClick: async function () {
    // 1. æ ¡éªŒé€‰ä¸­è¡Œ
    const selectedRows = this.$refs.table.getSelected();
    if (selectedRows.length === 0) {
      ElMessage.warning('请先选择一行数据');
      return;
    }
    if (selectedRows.length > 1) {
      ElMessage.warning('仅支持选择一行数据生成二维码');
      return;
    }
    // 2. èŽ·å–å•æ®ç¼–å·
    const newMaterialBarCode = selectedRows[0].newMaterialBarCode;
    if (!newMaterialBarCode) {
      ElMessage.error('选中的数据中未找到单据编号');
      return;
    }
    // 3. èŽ·å–å•æ®æ˜Žç»†æ•°æ®ï¼ˆæ–°å¢žï¼šé€šè¿‡å•æ®ç¼–å·èŽ·å–QtyTrans、MaterialCode、MaterialName)
    // let detailList  = [];
    // const loading = ElLoading.service({ text: '获取单据明细中...' });
    // try {
    //   const res = await http.post('/api/DocumentDetail/details', { transNo: transNo });
    //   // æ ¡éªŒè¿”回格式(必须是数组且至少有一条数据)
    //   if (!res.status || !Array.isArray(res.data) || res.data.length === 0) {
    //     throw new Error('未查询到单据明细数据');
    //   }
    //   detailList = res.data;
    //   // æ ¡éªŒæ¯æ¡æ˜Žç»†çš„必填字段
    //   detailList.forEach((item, index) => {
    //     if (!item.qtyTrans || !item.materialCode || !item.materialName) {
    //       throw new Error(`第${index + 1}条明细数据不完整`);
    //     }
    //   });
    // } catch (err) {
    //   ElMessage.error(err.message || '获取单据明细失败');
    //   loading.close();
    //   return;
    // } finally {
    //   loading.close();
    // }
    // 4. ç”ŸæˆäºŒç»´ç 
    let qrCodeUrl = '';
    try {
      qrCodeUrl = await QRCode.toDataURL(newMaterialBarCode, {
        width: 200, // äºŒç»´ç å¤§å°é€‚配布局
        margin: 1
      });
    } catch (err) {
      ElMessage.error('二维码生成失败,请重试');
      console.error('二维码生成错误:', err);
      return;
    }
    // 5. åˆ›å»ºå¼¹çª—
    const mountNode = document.createElement('div');
    document.body.appendChild(mountNode);
    // æ·»åŠ æ‰“å°ä¸“ç”¨æ ·å¼
    const addPrintStyle = () => {
      const style = document.createElement('style');
      style.id = 'qr-print-style';
      style.textContent = `
        @media print {
          body > *:not(.print-container) { display: none !important; }
          .print-container {
            position: fixed !important;
            top: 50px !important;
            left: 50px !important;
            width: 90% !important;
            height: auto !important;
          }
          /* æ‰“印内容布局 */
          .print-content {
            display: flex !important;
            flex-direction: column !important;
            gap: 20px !important;
          }
          .qr-wrapper {
            align-self: flex-start !important; /* äºŒç»´ç é å·¦ */
          }
          .detail-fields {
            display: flex !important;
            justify-content: space-around !important; /* å­—段均匀分布 */
            width: 100% !important;
            margin-top: 20px !important;
            font-size: 16px !important;
          }
          .field-item {
            text-align: center !important;
            padding: 10px !important;
            border: 1px solid #eee !important;
            border-radius: 4px !important;
            width: 30% !important; /* æ¯ä¸ªå­—段占1/3宽度 */
          }
          .field-label {
            font-weight: bold !important;
            margin-bottom: 5px !important;
            display: block !important;
          }
        }
      `;
      document.head.appendChild(style);
      return style;
    };
    // æ‰“印函数
    const printQrCode = () => {
      // åˆ›å»ºæ‰“印容器
      const printContainer = document.createElement('div');
      printContainer.className = 'print-container';
      printContainer.style = 'position:fixed; top:-9999px; left:-9999px;';
      document.body.appendChild(printContainer);
      // å¡«å……打印内容(布局:二维码左上角 + ä¸‰ä¸ªå­—段均匀分布)
      printContainer.innerHTML = `
        <div class="print-content">
          <!-- äºŒç»´ç ï¼ˆå·¦ä¸Šè§’) -->
          <div class="qr-wrapper">
            <img src="${qrCodeUrl}" style="width: 200px; height: 200px;" />
            <p style="margin-top: 10px; font-size: 16px;">单据编号:${newMaterialBarCode}</p>
          </div>
          <!-- æ˜Žç»†å­—段(均匀分布) -->
          <div class="detail-fields">
            <div class="field-item">
              <span class="field-label">交易数量</span>
              <span>${detailList[0].qtyTrans}</span>
            </div>
            <div class="field-item">
              <span class="field-label">物料编码</span>
              <span>${detailList[0].materialCode}</span>
            </div>
            <div class="field-item">
              <span class="field-label">物料名称</span>
              <span>${detailList[0].materialName}</span>
            </div>
          </div>
        </div>
      `;
      // æ·»åŠ æ‰“å°æ ·å¼
      const printStyle = addPrintStyle();
      // æ¸…理函数(防止重复移除)
      const cleanUp = () => {
        if (printContainer.parentNode === document.body) {
          document.body.removeChild(printContainer);
        }
        if (printStyle && printStyle.parentNode === document.head) {
          document.head.removeChild(printStyle);
        }
        window.removeEventListener('afterprint', cleanUp);
      };
      // ç›‘听打印完成
      window.addEventListener('afterprint', cleanUp, { once: true });
      // è§¦å‘打印
      window.print();
    };
    // å¼¹çª—组件(预览布局)
    const vnode = createVNode(ElDialog, {
      title: '单据二维码及明细',
      width: '600px',
      modelValue: true,
      appendToBody: true,
      'onUpdate:modelValue': (isVisible) => {
        if (!isVisible) {
          const printStyle = document.getElementById('qr-print-style');
          if (printStyle && printStyle.parentNode === document.head) {
            document.head.removeChild(printStyle);
          }
          render(null, mountNode);
          if (mountNode.parentNode === document.body) {
            document.body.removeChild(mountNode);
          }
        }
      }
    }, {
      default: () => [
        // é¢„览区布局(和打印布局一致)
        h('div', { style: { padding: '20px' } }, [
          // äºŒç»´ç é¢„览(左上角)
          h('div', { style: { marginBottom: '20px' } }, [
            h(ElImage, {
              src: qrCodeUrl,
              alt: '单据二维码',
              style: { width: '200px', height: '200px' }
            }),
            h('p', { style: { marginTop: '10px', fontSize: '16px' } }, `单据编号:${newMaterialBarCode}`)
          ]),
          // æ˜Žç»†å­—段预览(均匀分布)
        //   h('div', { style: { display: 'flex', justifyContent: 'space-around', gap: '10px' } }, [
        //     h('div', { style: { textAlign: 'center', padding: '10px', border: '1px solid #eee', width: '30%' } }, [
        //       h('div', { style: { fontWeight: 'bold', marginBottom: '5px' } }, '交易数量'),
        //       h('div', null, detailList[0].qtyTrans)
        //     ]),
        //     h('div', { style: { textAlign: 'center', padding: '10px', border: '1px solid #eee', width: '30%' } }, [
        //       h('div', { style: { fontWeight: 'bold', marginBottom: '5px' } }, '物料编码'),
        //       h('div', null, detailList[0].materialCode)
        //     ]),
        //     h('div', { style: { textAlign: 'center', padding: '10px', border: '1px solid #eee', width: '30%' } }, [
        //       h('div', { style: { fontWeight: 'bold', marginBottom: '5px' } }, '物料名称'),
        //       h('div', null, detailList[0].materialName)
        //     ])
        //   ])
        ])
      ],
      footer: () => h('div', null, [
        h(ElButton, {
          type: 'default',
          onClick: () => {
            const printStyle = document.getElementById('qr-print-style');
            if (printStyle) document.head.removeChild(printStyle);
            render(null, mountNode);
            if (mountNode.parentNode === document.body) {
              document.body.removeChild(mountNode);
            }
          }
        }, '关闭'),
        h(ElButton, {
          type: 'primary',
          onClick: () => {
            ElMessageBox.confirm(
              '是否打印该内容?',
              '打印确认',
              {
                confirmButtonText: '确认打印',
                cancelButtonText: '取消',
                type: 'info'
              }
            ).then(async () => {
              try {
                // æ‰§è¡Œæ‰“印并等待完成,捕获可能的错误
                await printQrCode();
                setTimeout(() => {
                  render(null, mountNode);
                  if (mountNode.parentNode === document.body) {
                    document.body.removeChild(mountNode);
                  }
                }, 500);
              } catch (printErr) {
                // æ˜¾ç¤ºçœŸå®žé”™è¯¯ï¼ˆè€Œéžâ€œå·²å–消”)
                ElMessage.error(`打印失败:${printErr.message || '未知错误'}`);
                console.error('打印错误:', printErr);
              }
            }).catch((err) => {
              // ä»…用户主动取消时才显示“已取消”
              if (err === 'cancel' || err.name === 'CanceledError') {
                ElMessage.info('已取消打印');
              }
            });
          }
        }, '打印')
      ])
    });
    vnode.appContext = this.$.appContext;
    render(vnode, mountNode);
  }
}], box: [], detail: [] }, //扩展的按钮
  methods: {
    //下面这些方法可以保留也可以删除
    onInit() {
    },
    onInited() {
      //框架初始化配置后
      //如果要配置明细表,在此方法操作
      //this.detailOptions.columns.forEach(column=>{ });
    },
    searchBefore(param) {
      //界面查询前,可以给param.wheres添加查询参数
      //返回false,则不会执行查询
      return true;
    },
    searchAfter(result) {
      //查询后,result返回的查询数据,可以在显示到表格前处理表格的值
      return true;
    },
    addBefore(formData) {
      //新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值
      return true;
    },
    updateBefore(formData) {
      //编辑保存前formData为对象,包括明细表、删除行的Id
      return true;
    },
    rowClick({ row, column, event }) {
      //查询界面点击行事件
      this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行;
    },
    modelOpenAfter(row) {
      //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据
      //(1)判断是编辑还是新建操作: this.currentAction=='Add';
      //(2)给弹出框设置默认值
      //(3)this.editFormFields.字段='xxx';
      //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值
      //看不懂就把输出看:console.log(this.editFormOptions)
    }
  }
};
export default extension;
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue
@@ -37,11 +37,11 @@
          
          <!-- æ‰˜ç›˜æ¡ç è¾“å…¥ -->
          <div class="input-wrapper custom-input-group">
    <div class="input-label">托盘条码</div>
    <div class="input-label">料箱码</div>
            <el-input
              ref="trayInput"
              v-model="trayBarcode"
              placeholder="请扫描或输入托盘条码后按回车键"
              placeholder="请扫描或输入料箱码后按回车键"
              clearable
              @keyup.enter.native="handleTraySubmit"
              @clear="handleTrayClear"
@@ -49,7 +49,7 @@
                 class="custom-input"
            >
              <template slot="prepend">
                <span>托盘条码</span>
                <span>料箱。码</span>
              </template>
              <template slot="append">
                <el-button 
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js
@@ -1,8 +1,8 @@
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
import http from '@/api/http.js'
import { defineAsyncComponent } from "vue";
import { ElMessage } from 'element-plus'; // å¼•å…¥ElMessage,解决提示无反应
import { h,createVNode, render,reactive  } from 'vue';
import { ElDialog , ElForm, ElFormItem, ElInput, ElButton, ElMessage } from 'element-plus'; // å¼•å…¥ElMessage,解决提示无反应
let extension = {
    components: {
@@ -46,6 +46,97 @@
          this.$emit('openPalletDialog', targetRow.inboundOrderNo);
        }
      },
     {
  name: '空托盘入库',
  type: 'primary',
  value: '空托盘入库',
  onClick: function () {
    const mountNode = document.createElement('div');
    document.body.appendChild(mountNode);
    // å“åº”式表单数据:料箱码改为可选填(初始空字符串)
    const formData = reactive({
      boxCode: '' // æ–™ç®±ç ï¼ˆstring类型,可空)
    });
    const vnode = createVNode(ElDialog, {
      title: '空托盘入库',
      width: '400px',
      modelValue: true,
      appendToBody: true,
      'onUpdate:modelValue': (isVisible) => {
        if (!isVisible) {
          render(null, mountNode);
          document.body.removeChild(mountNode);
        }
      }
    }, {
      default: () => h(ElForm, {
        model: formData,
        rules: {
          // æ–™ç®±ç æ ¡éªŒï¼šä»…保留字符串类型,移除必填要求(空值可通过)
          boxCode: [
            { type: 'string', message: '料箱码必须为字符串', trigger: 'blur' }
          ]
        },
        ref: 'batchInForm'
      }, [
        // æ–™ç®±ç è¾“入项(可选填)
        h(ElFormItem, { label: '料箱码', prop: 'boxCode' }, [
          h(ElInput, {
            type: 'text',
            placeholder: '可选输入料箱码,不填则默认入库', // æç¤ºå¯ç©ºè§„则
            modelValue: formData.boxCode,
            'onUpdate:modelValue': (val) => {
              formData.boxCode = val;
            }
          })
        ]),
        // åº•部按钮区(保持不变)
        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: async () => {
              const formRef = vnode.component.refs.batchInForm;
              try {
                await formRef.validate(); // ç©ºå€¼å¯é€šè¿‡æ ¡éªŒ
              } catch (err) {
                return;
              }
              // å…¥åº“接口提交:料箱码为空时传递空字符串,后端需支持该字段可选
              http.post('/api/wmsTask/BatchInboundTask', {
                boxCode: formData.boxCode // å¯ç©ºï¼šç”¨æˆ·è¾“入或空字符串
              }).then(({ data, status, message }) => {
                if (status) {
                  ElMessage.success(`入库成功${formData.boxCode ? ',料箱码:' + formData.boxCode : ''}`);
                  this.refresh();
                  render(null, mountNode);
                  document.body.removeChild(mountNode);
                } else {
                  ElMessage.error(message || data?.message || '入库失败');
                }
              }).catch(() => {
                ElMessage.error('请求失败,请稍后重试');
              });
            }
          }, '确定')
        ])
      ])
    });
    vnode.appContext = this.$.appContext;
    render(vnode, mountNode);
  }
}
    ], box: [], detail: [] }, //扩展的按钮
    methods: {
       //下面这些方法可以保留也可以删除
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js
@@ -1,8 +1,8 @@
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
import http from '@/api/http.js'
import { defineAsyncComponent } from "vue";
import { ElMessage } from 'element-plus'; // å¼•å…¥ElMessage,解决提示无反应
import { h,createVNode, render,reactive  } from 'vue';
import { ElDialog , ElForm, ElFormItem, ElInput, ElButton, ElMessage ,ElSelect, ElOption} from 'element-plus';
import gridBody from './extend/outOrderDetail.vue'
let extension = {
@@ -42,7 +42,169 @@
            createDate: selectedRows[0].createDate || new Date().toLocaleDateString()  // å‡ºåº“日期
          });
        }
      },
      {
  name: '空托盘出库',
  type: 'primary',
  value: '空托盘出库',
  onClick: function () {
    // 2. ç”Ÿæˆ3-12站台选项(默认第一个为站台3)
    const platformOptions = Array.from({ length: 10 }, (_, i) => {
      const num = i + 3;
      return { label: `站台${num}`, value: `PLATFORM${num.toString().padStart(3, '0')}` };
    });
    const mountNode = document.createElement('div');
    document.body.appendChild(mountNode);
    // 3. è¡¨å•数据(默认选中站台3)
    const formData = reactive({
      palletCode: '',
      selectedPlatform: platformOptions[0].value // é»˜è®¤ç»‘定站台3的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: {
          palletCode: [
            { type: 'string', message: '料箱号必须为字符串', trigger: 'blur' }
          ],
          selectedPlatform: [
            { required: true, message: '请选择出库站台', trigger: 'change' }
          ]
        },
        ref: 'batchOutForm',
        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(ElFormItem, {
          label: '料箱号',
          prop: 'palletCode',
          style: {
            marginBottom: '16px' // ä¸ŽæŒ‰é’®åŒºæ‹‰å¼€åˆç†é—´è·
          }
        }, [
          h(ElInput, {
            type: 'text',
            placeholder: '可选输入料箱号,不填则自动分配空料箱',
            modelValue: formData.palletCode,
            'onUpdate:modelValue': (val) => {
              formData.palletCode = val;
            },
            style: {
              width: '100%',
              height: '40px', // ä¸Žé€‰æ‹©å™¨é«˜åº¦ç»Ÿä¸€
              borderRadius: '4px',
              borderColor: '#dcdfe6'
            },
            attrs: {
              placeholderStyle: 'color: #909399;' // å ä½æ–‡å­—颜色优化,更柔和
            }
          })
        ]),
        // åº•部按钮区(样式优化)
        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.batchOutForm;
              try {
                await formRef.validate();
              } catch (err) {
                return;
              }
              http.post('/api/wmsTask/BatchOutboundTask', {
                palletCode: formData.palletCode,
                platform: formData.selectedPlatform
              }).then(({ data, status, message }) => {
                if (status) {
                  ElMessage.success(`出库成功,分配的托盘编号:${data.palletCode || formData.palletCode}`);
                  this.refresh();
                  render(null, mountNode);
                  document.body.removeChild(mountNode);
                } else {
                  ElMessage.error(message || data?.message || '出库失败');
                }
              }).catch(() => {
                ElMessage.error('请求失败,请稍后重试');
              });
            },
            style: {
              borderRadius: '4px',
              padding: '8px 20px' // æŒ‰é’®å†…边距优化,点击区域更舒适
            }
          }, '确定')
        ])
      ])
    });
    vnode.appContext = this.$.appContext;
    render(vnode, mountNode);
  }
}
    ], box: [], detail: [] }, //扩展的按钮
    methods: {
       //下面这些方法可以保留也可以删除
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/router/viewGird.js
@@ -99,7 +99,7 @@
    name: 'stockQuantityChangeRecord',
    component: () => import('@/views/record/stockQuantityChangeRecord.vue')
  }, {
    path: '/locationStatusChangeRecord',
    path: '/LocationStatusChangeRecord',
    name: 'locationStatusChangeRecord',
    component: () => import('@/views/record/locationStatusChangeRecord.vue')
  }, {
@@ -181,6 +181,11 @@
    name: 'mesOutboundOrder',
    component: () => import('@/views/outbound/mesOutboundOrder.vue')
  }
  , {
    path: '/materielToMes',
    name: 'Dt_MaterielToMes',
    component: () => import('@/views/inbound/Dt_MaterielToMes.vue')
  }
]
export default viewgird
export default viewgird
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/inbound/Dt_MaterielToMes.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,194 @@
<template>
  <view-grid
    ref="grid"
    :columns="columns"
    :detail="detail"
    :editFormFields="editFormFields"
    :editFormOptions="editFormOptions"
    :searchFormFields="searchFormFields"
    :searchFormOptions="searchFormOptions"
    :table="table"
    :extend="extend"
  >
  </view-grid>
</template>
<script>
import extend from "@/extension/inbound/Dt_MaterielToMes.js";
import { ref, defineComponent } from "vue";
export default defineComponent({
  setup() {
    const table = ref({
      key: "id",
      footer: "物料变更管理",
      cnName: "物料变更信息",
      name: "Dt_MaterielToMes",
      url: "/MaterielToMes/",
      sortOrder: "desc",
      autoIncrementKey: true
    });
    const editFormFields = ref({
      OldMaterialBarCode: "",
      NewMaterialBarCode: "",
      Unit: "",
      factoryArea: "",
      Qty: 0,
      supplyCode: "",
      warehouseCode: "",
      BatchNo: "",
      MaterielCode: ""
    });
    const searchFormFields = ref({
      OldMaterialBarCode: "",
      NewMaterialBarCode: "",
      BatchNo: "",
      MaterielCode: "",
      supplyCode: "",
      factoryArea: ""
    });
    const searchFormOptions = ref([
      [
        { title: "旧物料编号", field: "OldMaterialBarCode", type: "text", placeholder: "模糊搜索旧物料编号" },
        { title: "新物料编号", field: "NewMaterialBarCode", type: "text", placeholder: "模糊搜索新物料编号" }
      ],
      [
        { title: "批次号", field: "BatchNo", type: "text", placeholder: "模糊搜索批次号" },
        { title: "物料编号", field: "MaterielCode", type: "text", placeholder: "模糊搜索物料编号" }
      ],
      [
        { title: "供应商ID", field: "supplyCode", type: "text", placeholder: "搜索供应商ID" },
        { title: "厂区", field: "factoryArea", type: "text", placeholder: "搜索厂区" }
      ]
    ]);
    const editFormOptions = ref([
      [
        { title: "旧物料编号", field: "OldMaterialBarCode" },
        { title: "新物料编号", field: "NewMaterialBarCode" }
      ],
      [
        { title: "单位", field: "Unit" },
        { title: "厂区", field: "factoryArea" },
      ],
      [
        { title: "数量", field: "Qty" },
        { title: "供应商id", field: "supplyCode" }
      ],
      [
        { title: "仓库id", field: "warehouseCode" },
        { title: "批次号", field: "BatchNo" }
      ],
      [
        { title: "物料编号", field: "MaterielCode" }
      ]
    ]);
    const columns = ref([
      {
        field: "Id",
        title: "ID",
        type: "int",
        width: 80,
        hidden: true,
        readonly: true,
        required: false,
        edit: false, // ç¦æ­¢å‚与表单
        align: "left"
      },
      {
        field: "oldMaterialBarCode",
        title: "旧物料编号",
        type: "string",
        width: 180,
        align: "left",
        sort: true
      },
      {
        field: "newMaterialBarCode",
        title: "新物料编号",
        type: "string",
        width: 180,
        align: "left",
        sort: true
      },
      {
        field: "unit",
        title: "单位",
        type: "string",
        width: 100,
        align: "left",
        sort: true
      },
      {
        field: "factoryArea",
        title: "厂区",
        type: "string",
        width: 120,
        align: "left",
        sort: true
      },
      {
        field: "qty",
        title: "数量",
        type: "decimal",
        width: 100,
        align: "right",
        sort: true
      },
      {
        field: "supplyCode",
        title: "供应商ID",
        type: "string",
        width: 150,
        align: "left",
        sort: true
      },
      {
        field: "warehouseCode",
        title: "仓库ID",
        type: "string",
        width: 150,
        align: "left",
        sort: true
      },
      {
        field: "BatchNo",
        title: "批次号",
        type: "string",
        width: 180,
        align: "left",
        sort: true
      },
      {
        field: "MaterielCode",
        title: "物料编号",
        type: "string",
        width: 180,
        align: "left",
        sort: true
      }
    ]);
    const detail = ref({
      cnName: "物料变更详情",
      table: "MaterielChangeDetail",
      columns: [],
      sortName: "",
      key: ""
    });
    return {
      table,
      extend,
      searchFormFields,
      searchFormOptions,
      columns,
      detail,
      editFormFields,
      editFormOptions
    };
  }
});
</script>
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/MaterielToMesController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core.BaseController;
using WIDESEA_Core.BaseRepository;
using WIDESEA_IBasicService;
using WIDESEA_Model.Models.Basic;
namespace WIDESEA_WMSServer.Controllers.Basic
{
    [Route("api/MaterielToMes")]
    [ApiController]
    public class MaterielToMesController : ApiBaseController<IMaterielToMesService, Dt_MaterielToMes>
    {
        public MaterielToMesController(IMaterielToMesService service) : base(service)
        {
        }
    }
}