cz il y a 9 mois
Parent
commit
90172d801d

+ 2 - 1
src/components/process/SF/Contract.vue

@@ -601,7 +601,8 @@
     </byForm>
 
     <el-dialog v-if="openProductCompany" v-model="openProductCompany" title="产品库" width="90%" append-to-body>
-      <SelectProduct @selectProduct="selectProduct" :disablePerm="'1'"></SelectProduct>
+      <SelectProduct @selectProduct="selectProduct"></SelectProduct>
+      <!-- :disablePerm="'1'" -->
       <!-- :isRawMaterial="'1'" -->
       <!-- :companyId="formData.data.companyId" -->
       <template #footer>

+ 2 - 1
src/components/process/SF/ContractChange.vue

@@ -601,7 +601,8 @@
     </byForm>
 
     <el-dialog v-if="openProductCompany" v-model="openProductCompany" title="产品库" width="90%" append-to-body>
-      <SelectProduct @selectProduct="selectProduct" :disablePerm="'1'"></SelectProduct>
+      <SelectProduct @selectProduct="selectProduct"></SelectProduct>
+      <!-- :disablePerm="'1'" -->
       <!-- :isRawMaterial="'1'" -->
       <!-- :companyId="formData.data.companyId" -->
       <template #footer>

+ 391 - 0
src/views/MES/MRPtable/index.vue

@@ -0,0 +1,391 @@
+<template>
+  <div class="pageIndexClass">
+    <div>
+      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
+               :selectConfig="selectConfig" :action-list="[
+              
+        ]" @get-list="getList" :span-method="objectSpanMethod">
+
+        <template #pic="{ item }">
+          <div v-if="item.fileUrl">
+            <img :src="item.fileUrl" class="pic" @click="openImg(item.fileUrl)" />
+          </div>
+          <div v-else></div>
+        </template>
+
+        <template #size="{ item }">
+          <div>
+            <span>{{ item.productLength }}</span>*
+            <span>{{ item.productWidth }}</span>*
+            <span>{{ item.productHeight }}</span>
+          </div>
+        </template>
+
+      </byTable>
+    </div>
+    <el-dialog :title="modalType == 'add' ? '添加店铺' : '编辑店铺'" v-model="dialogVisible" width="500px" destroy-on-close>
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom" v-loading="submitLoading">
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="defualt">取 消</el-button>
+        <el-button type="primary" @click="submitForm()" size="defualt" :loading="submitLoading">
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+const { proxy } = getCurrentInstance();
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+    produceStatus: "",
+    staDeliveryPeriod: "",
+    endDeliveryPeriod: "",
+    beginTime: "",
+    endTime: "",
+  },
+});
+const treeData = ref([]);
+const dialogVisible = ref(false);
+const modalType = ref("add");
+const selectConfig = computed(() => [
+  // {
+  //   label: "工序",
+  //   prop: "productionProcessesId",
+  //   data: processesData.value,
+  // },
+  // {
+  //   type: "time",
+  //   label: "交期",
+  //   placeholder: "开始日期",
+  //   prop: "staDeliveryPeriod",
+  //   placeholderOne: "结束日期",
+  //   propOne: "endDeliveryPeriod",
+  // },
+  // {
+  //   type: "time",
+  //   label: "下单日期",
+  //   placeholder: "开始日期",
+  //   prop: "beginTime",
+  //   placeholderOne: "结束日期",
+  //   propOne: "endTime",
+  // },
+]);
+const config = computed(() => {
+  return [
+    // {
+    //   attrs: {
+    //     label: "任务编号",
+    //     prop: "orderCode",
+    //     // width: 150,
+    //   },
+    // },
+
+    {
+      attrs: {
+        label: "订单号",
+        prop: "orderCode",
+        width: 130,
+      },
+    },
+    {
+      attrs: {
+        label: "物料图片",
+        slot: "pic",
+        width: 80,
+      },
+    },
+    {
+      attrs: {
+        label: "物料编码",
+        prop: "productCode",
+        // width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "物料名称",
+        prop: "productName",
+        // "min-width": 200,
+      },
+    },
+    {
+      attrs: {
+        label: "规格尺寸(cm)",
+        slot: "size",
+        width: 130,
+      },
+    },
+    {
+      attrs: {
+        label: "物料颜色",
+        prop: "productColor",
+        // width: 160,
+      },
+    },
+    // {
+    //   attrs: {
+    //     label: "标准用量",
+    //     prop: "productColor",
+    //   },
+    // },
+    {
+      attrs: {
+        label: "订单量",
+        prop: "orderQuantity",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "总需求",
+        prop: "demandQuantity",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "库存",
+        prop: "stockQuantity",
+        width: 100,
+      },
+    },
+    // {
+    //   attrs: {
+    //     label: "安全库存",
+    //     prop: "productColor",
+    //   },
+    // },
+    {
+      attrs: {
+        label: "已领料",
+        prop: "prodOutQuantity",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "采购在途",
+        prop: "transitQuantity",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "净需求欠量",
+        prop: "lackQuantity",
+        width: 100,
+      },
+    },
+    // {
+    //   attrs: {
+    //     label: "操作",
+    //     width: "100",
+    //     align: "center",
+    //     fixed: "right",
+    //   },
+    //   renderHTML(row) {
+    //     return [
+    //       {
+    //         attrs: {
+    //           label: "删除",
+    //           type: "danger",
+    //           text: true,
+    //         },
+    //         el: "button",
+    //         click() {
+    //           proxy
+    //             .msgConfirm()
+    //             .then((res) => {
+    //               proxy
+    //                 .post("/productionReporting/delete", {
+    //                   id: row.id,
+    //                 })
+    //                 .then((res) => {
+    //                   proxy.msgTip("操作成功", 1);
+    //                   getList();
+    //                 });
+    //             })
+    //             .catch((err) => {});
+    //         },
+    //       },
+    //     ];
+    //   },
+    // },
+  ];
+});
+const formData = reactive({
+  data: {},
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+});
+const formDom = ref(null);
+const formConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "code",
+      label: "店铺编号",
+      itemWidth: 100,
+      disabled: false,
+    },
+    {
+      type: "input",
+      prop: "name",
+      label: "店铺名称",
+      itemWidth: 100,
+      disabled: false,
+    },
+    {
+      type: "treeSelect",
+      prop: "deptId",
+      label: "负责部门",
+      data: treeData.value,
+      propsTreeLabel: "deptName",
+      propsTreeValue: "deptId",
+      itemWidth: 100,
+      disabled: false,
+    },
+  ];
+});
+const rules = ref({
+  deptId: [{ required: true, message: "请选择负责部门", trigger: "change" }],
+  name: [{ required: true, message: "请输入店铺名称", trigger: "blur" }],
+  code: [{ required: true, message: "请输入店铺编号", trigger: "blur" }],
+});
+
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/contractMrpInfo/page", sourceList.value.pagination)
+    .then((res) => {
+      sourceList.value.data = res.rows;
+      sourceList.value.pagination.total = res.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+
+      const productIds = sourceList.value.data.map((x) => x.materialId);
+      proxy.getFileData({
+        businessIdList: productIds,
+        data: sourceList.value.data,
+        att: "materialId",
+        businessType: "0",
+        fileAtt: "fileList",
+        filePathAtt: "fileUrl",
+      });
+    });
+};
+
+const openModal = () => {
+  dialogVisible.value = true;
+  modalType.value = "add";
+  formData.data = {
+    definition: "2",
+    fileList: [],
+  };
+  if (currencyData.value && currencyData.value.length > 0) {
+    formData.data.currency = currencyData.value[0].dictKey;
+    formData.data.costCurrency = currencyData.value[0].dictKey;
+  }
+};
+
+const submitForm = () => {
+  formDom.value.handleSubmit((valid) => {
+    submitLoading.value = true;
+    proxy.post("/shopInfo/" + modalType.value, formData.data).then(
+      (res) => {
+        proxy.msgTip("操作成功", 1);
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => {
+        submitLoading.value = false;
+      }
+    );
+  });
+};
+
+const getDtl = (row) => {
+  modalType.value = "edit";
+  proxy.post("/shopInfo/detail", { id: row.id }).then((res) => {
+    formData.data = res;
+    dialogVisible.value = true;
+  });
+};
+
+getList();
+
+const processesData = ref([]);
+const getProcesses = () => {
+  proxy
+    .post("/productionProcesses/page", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      processesData.value = res.rows.map((x) => ({
+        ...x,
+        label: x.name,
+        value: x.id,
+      }));
+    });
+};
+// getProcesses();
+
+const flitterData = (arr) => {
+  let spanOneArr = [];
+  let concatOne = 0;
+  arr.forEach((item, index) => {
+    if (index === 0) {
+      spanOneArr.push(1);
+    } else {
+      //注意这里的contractId是表格绑定的字段,根据自己的需求来改
+      if (item.contractId === arr[index - 1].contractId) {
+        //第一列需合并相同内容的判断条件
+        spanOneArr[concatOne] += 1;
+        spanOneArr.push(0);
+      } else {
+        spanOneArr.push(1);
+        concatOne = index;
+      }
+    }
+  });
+  return {
+    one: spanOneArr,
+  };
+};
+
+const objectSpanMethod = ({ rowIndex, columnIndex }) => {
+  if (columnIndex === 0) {
+    const _row = flitterData(sourceList.value.data).one[rowIndex];
+    const _col = _row > 0 ? 1 : 0;
+    return {
+      rowspan: _row,
+      colspan: _col,
+    };
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+::v-deep(.el-progress__text) {
+  font-size: 14px !important;
+}
+.content {
+  padding: 20px;
+}
+</style>

+ 109 - 8
src/views/MES/productionTask/index.vue

@@ -727,8 +727,10 @@
       </template>
     </el-dialog>
 
-    <el-dialog title="记录查看" v-model="recordDialog" width="70%" destroy-on-close v-if="recordDialog">
+    <el-dialog title="物料明细查看" v-model="recordDialog" width="90%" destroy-on-close v-if="recordDialog">
       <el-tabs v-model="activeName" type="card" class="demo-tabs" @tab-change="handleTabChange">
+        <el-tab-pane label="欠料查询" name="4">
+        </el-tab-pane>
         <el-tab-pane label="采购记录" name="1">
         </el-tab-pane>
         <el-tab-pane label="到货登记记录" name="3">
@@ -737,6 +739,36 @@
         </el-tab-pane>
       </el-tabs>
       <byForm :formConfig="recordFormConfig" :formOption="recordFormOption" v-model="formData.recordData">
+        <template #detail1 v-if="activeName=='4'">
+          <div style="width:100%">
+            <el-table :data="formData.recordData.oweData" :span-method="objectSpanMethod">
+              <el-table-column prop="orderCode" label="订单号" width="130" />
+              <el-table-column label="物料图片" width="80">
+                <template #default="{ row }">
+                  <div v-if="row.fileUrl">
+                    <img :src="row.fileUrl" class="pic" @click="openImg(row.fileUrl)" />
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column prop="productCode" label="物料编码" />
+              <el-table-column prop="productName" label="productName" />
+              <el-table-column label="规格尺寸(cm)" width="140">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="物料颜色" prop="productColor" width="170" />
+              <el-table-column label="订单量" prop="orderQuantity" width="100" />
+              <el-table-column label="总需求" prop="demandQuantity" width="100" />
+              <el-table-column label="库存" prop="stockQuantity" width="100" />
+              <el-table-column label="已领料" prop="prodOutQuantity" width="100" />
+              <el-table-column label="采购在途" prop="transitQuantity" width="100" />
+              <el-table-column label="净需求欠量" prop="lackQuantity" width="100" />
+            </el-table>
+          </div>
+        </template>
         <template #detail1 v-if="activeName=='1'">
           <div style="width:100%">
             <el-table :data="formData.recordData.purchaseProductList">
@@ -787,7 +819,6 @@
             </el-table>
           </div>
         </template>
-
         <template #detail2 v-if="activeName=='2'">
           <div style="width:100%">
             <el-table :data="formData.recordData.stockJournalDetailsList">
@@ -1073,7 +1104,7 @@
 
       <template #footer>
         <el-button @click="confirmDialogOne =false" size="default" v-debounce>取 消</el-button>
-        <el-button @click="submitConfirmOne(true)" type="primary" size="default" v-debounce v-if="rowDataOne.beginWorkStatus ==10">提
+        <el-button @click="submitConfirmOne(true)" type="primary" size="default" v-debounce v-if="rowDataOne.beginWorkStatus!=10">提
           交</el-button>
       </template>
 
@@ -1436,6 +1467,8 @@ const config = ref([
     render(val) {
       if (val) {
         return proxy.dictValueLabel(val, prodConfirmStatusData.value);
+      } else {
+        return "未发起";
       }
     },
   },
@@ -1777,6 +1810,8 @@ const configCopy = ref([
     render(val) {
       if (val) {
         return proxy.dictValueLabel(val, prodConfirmStatusData.value);
+      } else {
+        return "未发起";
       }
     },
   },
@@ -2697,6 +2732,17 @@ const recordFormConfig = computed(() => {
   return [
     {
       type: "title1",
+      title: "欠料查询",
+      isShow: activeName.value == "4",
+    },
+    {
+      type: "slot",
+      slotName: "detail1",
+      label: " ",
+      isShow: activeName.value == "4",
+    },
+    {
+      type: "title1",
       title: "采购记录",
       isShow: activeName.value == "1",
     },
@@ -2732,7 +2778,7 @@ const recordFormConfig = computed(() => {
 });
 const activeName = ref("1");
 const lookDetails = (item) => {
-  activeName.value = "1";
+  activeName.value = "4";
   recordDialog.value = true;
   proxy
     .post("/produceOrder/detail", {
@@ -2793,6 +2839,27 @@ const lookDetails = (item) => {
           });
         }, 1200);
       }
+
+      proxy
+        .post("/contractMrpInfo/page", {
+          pageNum: 1,
+          pageSize: 999,
+          contractId: item.contractId,
+        })
+        .then((res) => {
+          formData.recordData.oweData = res.rows;
+          const productIds = formData.recordData.oweData.map(
+            (x) => x.materialId
+          );
+          proxy.getFileData({
+            businessIdList: productIds,
+            data: formData.recordData.oweData,
+            att: "materialId",
+            businessType: "0",
+            fileAtt: "fileList",
+            filePathAtt: "fileUrl",
+          });
+        });
     });
 };
 
@@ -3211,7 +3278,7 @@ const confirmRules = ref({
 const submitConfirm = (flag) => {
   if (flag) {
     confirmFormDom.value.handleSubmit(() => {
-      confirmFormData.data.beginWorkStatus = "1";
+      // confirmFormData.data.beginWorkStatus = "1";
       formLoading.value = true;
       proxy
         .post("/produceOrderDetail/editBeginWork", confirmFormData.data)
@@ -3223,7 +3290,7 @@ const submitConfirm = (flag) => {
         });
     });
   } else {
-    confirmFormData.data.beginWorkStatus = "0";
+    // confirmFormData.data.beginWorkStatus = "0";
     formLoading.value = true;
     proxy
       .post("/produceOrderDetail/editBeginWork", confirmFormData.data)
@@ -3303,7 +3370,7 @@ const addSchedule = (row, val, date) => {
     .then(
       (res) => {},
       (err) => {
-        proxy.msgTip("排程失败,请联系管理员");
+        proxy.msgTip("排程失败,请联系管理员", 2);
       }
     );
 };
@@ -3321,7 +3388,7 @@ const scheduleBlur = (row, date) => {
       .then(
         (res) => {},
         (err) => {
-          proxy.msgTip("排程失败,请联系管理员");
+          proxy.msgTip("排程失败,请联系管理员", 2);
         }
       );
   }
@@ -3469,6 +3536,40 @@ const changeOpUser = (val) => {
     .post("/productionBeginConfirm/add", { opUserId: val })
     .then((res) => {});
 };
+
+const flitterData = (arr) => {
+  let spanOneArr = [];
+  let concatOne = 0;
+  arr.forEach((item, index) => {
+    if (index === 0) {
+      spanOneArr.push(1);
+    } else {
+      //注意这里的contractId是表格绑定的字段,根据自己的需求来改
+      if (item.contractId === arr[index - 1].contractId) {
+        //第一列需合并相同内容的判断条件
+        spanOneArr[concatOne] += 1;
+        spanOneArr.push(0);
+      } else {
+        spanOneArr.push(1);
+        concatOne = index;
+      }
+    }
+  });
+  return {
+    one: spanOneArr,
+  };
+};
+
+const objectSpanMethod = ({ rowIndex, columnIndex }) => {
+  if (columnIndex === 0) {
+    const _row = flitterData(sourceList.value.data).one[rowIndex];
+    const _col = _row > 0 ? 1 : 0;
+    return {
+      rowspan: _row,
+      colspan: _col,
+    };
+  }
+};
 </script>
 
 <style lang="scss" scoped>

+ 1 - 1
src/views/process/processApproval/index.vue

@@ -607,7 +607,7 @@ const skipPage = () => {
     sample_update_flow: "ContractSample",
     sale_quotation_flow: "Quotation",
     purchase_update_flow: "Purchased",
-    purchase_flow: "purchased",
+    purchase_flow: "Purchased",
     pay_flow: "Payment",
     purchase_back_flow: "ReturnGood",
     discuss_price_flow: "PriceSheetEHSD",