Просмотр исходного кода

OA详情添加解析表单组和动态表格的解析逻辑/修改原材料采购部分按钮显示逻辑

lph 1 год назад
Родитель
Сommit
f9173086bd

+ 171 - 24
zkqy-ui/src/components/FormGroup/FormDetail.vue

@@ -2,12 +2,24 @@
   <div class="list-wrap">
     <div class="list-item" v-for="(item, index) in myFormList" :key="index">
       <k-form-build
+        v-if="item.type == 'single'"
         :dynamicData="item.template.dfFormSql || {}"
         :defaultValue="item.template.defaultValue"
         class="formBuild"
         ref="addFromRef"
         :value="item.template.dfVueTemplate"
       />
+      <div v-else>
+        <k-form-build
+          v-for="(form, index) in item.templateArr"
+          :key="index"
+          :dynamicData="form.template.dfFormSql || {}"
+          :defaultValue="form.template.defaultValue"
+          class="formBuild"
+          ref="addFromRef"
+          :value="form.template.dfVueTemplate"
+        />
+      </div>
     </div>
     <el-divider></el-divider>
     <!-- <div class="log-list"></div> -->
@@ -52,11 +64,6 @@ export default {
   components: {},
   data() {
     return {
-      // formList: [
-      //   {
-      //     formJson: formList,
-      //   },
-      // ],
       form: {
         approvalStatus: "", //审批结果
         approvalRemark: "", //审批备注
@@ -102,11 +109,6 @@ export default {
   computed: {
     myFormList() {
       return this.disableHandler(this.formList);
-      // this.formList.forEach((item) => {
-      //   item.template.dfFormSql = JSON.parse(item.template.dfFormSql);
-      //   item.template.dfVueTemplate = JSON.parse(item.template.dfVueTemplate);
-      // });
-      // return this.formList;
     },
   },
   methods: {
@@ -120,24 +122,169 @@ export default {
       this.resetForm();
       if (formList.length == 0) return [];
       formList.forEach((item) => {
-        item.template.dfFormSql = JSON.parse(item.template.dfFormSql);
-        item.template.dfVueTemplate = disableFormItem(
-          JSON.parse(item.template.dfVueTemplate)
-        );
-        item.template.defaultValue = item.template.resultMap[0]?.resultMap
-          ? item.template.resultMap[0].resultMap
-          : {};
-        for (const key of Object.keys(item.template.defaultValue)) {
-          item.template.defaultValue[toUnderline(key)] =
-            item.template.defaultValue[key];
+        if (item.template.mainForm) {
+          //表单组
+          item.type = "group";
+          let { mainForm, subFormList } = item.template;
+          console.log(mainForm);
+          item.templateArr = [];
+          let mainData = { template: {} };
+          mainData.template.dfFormSql = JSON.parse(
+            mainForm.showTemplate.dfFormSql
+          ); //下拉框数据
+          mainData.template.dfVueTemplate = disableFormItem(
+            JSON.parse(mainForm.showTemplate.dfVueTemplate)
+          ); //禁用表单
+          mainData.template.defaultValue = mainForm.showValue[0]?.resultMap
+            ? mainForm.showValue[0]?.resultMap
+            : {};
+          for (const key of Object.keys(mainData.template.defaultValue)) {
+            mainData.template.defaultValue[toUnderline(key)] =
+              mainData.template.defaultValue[key];
+          }
+          item.templateArr.push(mainData); //添加主表单数据
+          // 处理子表单
+          subFormList.forEach((subItem) => {
+            let subData = { template: {} };
+            subData.template.dfFormSql = JSON.parse(
+              subItem.showTemplate.dfFormSql
+            ); //下拉框数据
+            subData.template.dfVueTemplate = disableFormItem(
+              JSON.parse(subItem.showTemplate.dfVueTemplate)
+            ); //禁用表单
+            if (subItem.showTemplate.spare == "2") {
+              //动态表单
+              subData.template.defaultValue = this.getTableShowData(subItem);
+              console.log(subData.template.defaultValue);
+            } else {
+              subData.template.defaultValue = subItem.showValue[0]?.resultMap
+                ? subItem.showValue[0]?.resultMap
+                : {};
+              for (const key of Object.keys(subData.template.defaultValue)) {
+                subData.template.defaultValue[toUnderline(key)] =
+                  subData.template.defaultValue[key];
+              }
+            }
+
+            item.templateArr.push(subData);
+          });
+        } else {
+          item.type = "single";
+          //单个表单
+          item.template.dfFormSql = JSON.parse(item.template.dfFormSql);
+          item.template.dfVueTemplate = disableFormItem(
+            JSON.parse(item.template.dfVueTemplate)
+          );
+          item.template.defaultValue = item.template.resultMap[0]?.resultMap
+            ? item.template.resultMap[0].resultMap
+            : {};
+          for (const key of Object.keys(item.template.defaultValue)) {
+            item.template.defaultValue[toUnderline(key)] =
+              item.template.defaultValue[key];
+          }
         }
-        // this.$nextTick(() => {
-        //   Object.assign(this.defaultValue, item.template.defaultValue);
-        // });
-        // item.formInfo.jsonData = disableFormItem(item.formInfo.jsonData);
       });
+      console.log(JSON.parse(JSON.stringify(formList)), "formList");
       return formList;
     },
+    // 获取动态表格的回显数据
+    getTableShowData(data) {
+      let batch = {},
+        tableName = data.formItem?.split(".")?.[0];
+      batch[tableName] = data.showValue.map((item) => item.resultMap);
+      // 所有字段驼峰转下划线
+      batch[tableName].forEach((i) => {
+        for (const key of Object.keys(i)) {
+          i[toUnderline(key)] = i[key];
+          if (toUnderline(key) != key) {
+            delete i[key];
+          }
+        }
+      });
+      return { batch };
+    },
+    transformDataFormat(data) {
+      this.FormNameList = [];
+      let { mainForm, subFormList } = data;
+      this.formList = [];
+      let showValue = null;
+      if (mainForm.showValue) {
+        showValue = mainForm.showValue[0]?.resultMap;
+      }
+
+      if (showValue) {
+        for (const key of Object.keys(showValue)) {
+          showValue[toUnderline(key)] = showValue[key];
+          delete showValue[key];
+        }
+        mainForm.showTemplate.resultMap = [showValue];
+      }
+
+      this.formList.push({
+        template: mainForm.showTemplate,
+        tableName: mainForm.mainFormTable,
+      });
+      this.FormNameList.push({
+        tableName: mainForm.mainFormTable,
+        formItem: mainForm.mainFormItem,
+        relateFormItem: null,
+        formType: mainForm.showTemplate.spare == "2" ? "batch" : "normal",
+        defaultValue: mainForm.showValue ? mainForm.showValue[0].resultMap : {},
+      });
+      if (subFormList && subFormList.length > 0) {
+        subFormList.forEach((item) => {
+          let showValue = null;
+          if (item.showValue) {
+            showValue = item.showValue[0];
+          }
+          let defaultValue = {};
+          if (showValue) {
+            if (item.showTemplate.spare == "2") {
+              //动态表格表单
+              let batch = {},
+                tableName = item.formItem?.split(".")?.[0];
+              batch[tableName] = item.showValue.map((item) => item.resultMap);
+              defaultValue = JSON.parse(JSON.stringify(batch));
+              console.log(JSON.parse(JSON.stringify(batch)));
+              // 所有字段驼峰转下划线
+              batch[tableName].forEach((i) => {
+                for (const key of Object.keys(i)) {
+                  i[toUnderline(key)] = i[key];
+                  if (toUnderline(key) != key) {
+                    delete i[key];
+                  }
+                }
+              });
+              item.showTemplate.resultMap = [
+                {
+                  batch,
+                },
+              ];
+            } else {
+              for (const key of Object.keys(item.showValue[0].resultMap)) {
+                item.showValue[0].resultMap[toUnderline(key)] =
+                  item.showValue[0].resultMap[key];
+                delete item.showValue[0].resultMap[key];
+              }
+
+              item.showTemplate.resultMap = [item.showValue[0].resultMap];
+            }
+          }
+          this.formList.push({
+            template: item.showTemplate,
+            tableName: item.formItem?.split(".")?.[0],
+          });
+          this.FormNameList.push({
+            tableName: item.formItem?.split(".")?.[0],
+            formItem: item.formItem,
+            relateFormItem: item.relateMainItem,
+            formType: item.showTemplate.spare == "2" ? "batch" : "normal",
+            defaultValue,
+            insertMap: item.insertMap,
+          });
+        });
+      }
+    },
     // 获取表单信息
     getformInfo() {
       let res = {

+ 0 - 4
zkqy-ui/src/views/bussiness/detail/index.vue

@@ -20,10 +20,6 @@
         <el-tab-pane label="表单信息" name="1">
           <el-col :span="16" :offset="4">
             <div class="test-form">
-              <!-- <FormList :formList="formList"></FormList>
-               -->
-              <!-- <Approve></Approve> -->
-              <!-- <formGroup /> -->
               <FormDetail
                 :formList="formList"
                 :nodeLogList="nodeLogList"

+ 4 - 2
zkqy-ui/src/views/orderMange/index.vue

@@ -1350,7 +1350,8 @@ export default {
               btnName: "打印出库单",
               btnType: "printOutBound",
               btnIcon: "",
-              btnShowCondition:'[{"fieldName":"sale_order.status","mark":"6","refValue":"5"}]',
+              // btnShowCondition:'[{"fieldName":"sale_order.status","mark":"6","refValue":"5"}]',
+              btnShowCondition: "[]",
               btnHasPermi: "huaxian:xsglddgl:INSERT",
               children: [],
             },
@@ -1358,7 +1359,8 @@ export default {
               btnName: "出库发货",
               btnType: "deliver",
               btnIcon: "",
-              btnShowCondition:'[{"fieldName":"sale_order.status","mark":"6","refValue":"5"}]',
+              btnShowCondition: "[]",
+              // btnShowCondition:'[{"fieldName":"sale_order.status","mark":"6","refValue":"5"}]',
               btnHasPermi: "huaxian:xsglddgl:INSERT",
               children: [],
             },

+ 227 - 187
zkqy-ui/src/views/orderMange/purchase/listInfoTwo.vue

@@ -337,11 +337,20 @@
       width="800px"
     >
       <div style="width: 800px">
-        <el-form ref="form" :label-position="labelPosition" label-width="100px"  :model="insertFormData">
+        <el-form
+          ref="form"
+          :label-position="labelPosition"
+          label-width="100px"
+          :model="insertFormData"
+        >
           <el-row>
             <el-col :span="12">
               <el-form-item label="供应商:" prop="supplier">
-                <el-select v-model="insertFormData.supplierNo" style="width: 200px;" placeholder="请选择供应商">
+                <el-select
+                  v-model="insertFormData.supplierNo"
+                  style="width: 200px"
+                  placeholder="请选择供应商"
+                >
                   <el-option
                     v-for="(option, index) in suppliers"
                     :key="option.id"
@@ -353,7 +362,10 @@
             </el-col>
             <el-col :span="12">
               <el-form-item label="批号:" prop="lotNumber">
-                <el-input v-model="insertFormData.lotNumber" style="width: 200px;"></el-input>
+                <el-input
+                  v-model="insertFormData.lotNumber"
+                  style="width: 200px"
+                ></el-input>
               </el-form-item>
             </el-col>
           </el-row>
@@ -361,36 +373,44 @@
           <el-row>
             <el-col :span="12">
               <el-form-item label="使用部门:" prop="useDepartment">
-                <el-input v-model="insertFormData.useDepartment"  style="width: 200px;"></el-input>
+                <el-input
+                  v-model="insertFormData.useDepartment"
+                  style="width: 200px"
+                ></el-input>
               </el-form-item>
             </el-col>
 
             <el-col :span="12">
               <el-form-item label="备注:" prop="remark">
-                <el-input v-model="insertFormData.remark"  style="width: 200px;"></el-input>
+                <el-input
+                  v-model="insertFormData.remark"
+                  style="width: 200px"
+                ></el-input>
               </el-form-item>
             </el-col>
           </el-row>
         </el-form>
       </div>
-      <el-table
-        :data="insertTable"
-        style="width: 100%"
-      >
-<!--        -->
-<!--        <el-table-column-->
-<!--          align="center"-->
-<!--          prop="id"-->
-<!--          label="序号"-->
-<!--          width="80">-->
-<!--        </el-table-column>-->
+      <el-table :data="insertTable" style="width: 100%">
+        <!--        -->
+        <!--        <el-table-column-->
+        <!--          align="center"-->
+        <!--          prop="id"-->
+        <!--          label="序号"-->
+        <!--          width="80">-->
+        <!--        </el-table-column>-->
         <el-table-column
           align="center"
           prop="materielId"
           label="物料信息"
-          width="180">
+          width="180"
+        >
           <template v-slot:default="scope">
-            <el-select v-model="scope.row.materielId" size="small" placeholder="请选择物料">
+            <el-select
+              v-model="scope.row.materielId"
+              size="small"
+              placeholder="请选择物料"
+            >
               <el-option
                 v-for="(option, index) in materiels"
                 :key="index"
@@ -404,15 +424,13 @@
           align="center"
           prop="quantity"
           label="数量/重量"
-          width="180">
+          width="180"
+        >
           <template v-slot:default="scope">
             <el-input v-model="scope.row.quantity" size="small"></el-input>
           </template>
         </el-table-column>
-        <el-table-column
-          align="center"
-          prop="remark"
-          label="备注">
+        <el-table-column align="center" prop="remark" label="备注">
           <template v-slot:default="scope">
             <el-input v-model="scope.row.remark" size="small"></el-input>
           </template>
@@ -422,7 +440,9 @@
             <el-button
               size="mini"
               type="danger"
-              @click="handleRowDelete(scope.$index, scope.row)">删除</el-button>
+              @click="handleRowDelete(scope.$index, scope.row)"
+              >删除</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -432,79 +452,85 @@
         class="buttonAdd"
         icon="el-icon-plus"
         @click="addRow"
-      >添加一行</el-button>
+        >添加一行</el-button
+      >
 
       <span slot="footer" class="dialog-footer">
-            <el-button @click="insertFrom=false">取 消</el-button>
-            <el-button type="primary" @click="insertTableRequest">确 定</el-button>
-           </span>
+        <el-button @click="insertFrom = false">取 消</el-button>
+        <el-button type="primary" @click="insertTableRequest">确 定</el-button>
+      </span>
     </el-dialog>
 
     <!-- 打印弹窗 -->
-    <el-dialog title="采购单详情" :visible.sync="viewPurchaseOrderDetailsShow" width="1000px">
-       <div class="titleDiv">
-<!--            <h3><i>采购单编号:</i><span>{{particularsOfSalesNote.purchaseOrderNumber}}</span></h3>-->
-            <h3><i>供应商:</i><span>{{particularsOfSalesNote.supplierName}}</span></h3>
-            <h3><i>采购批号:</i><span>{{particularsOfSalesNote.purchaseLotNumber}}</span></h3>
-            <h3><i>采购时间:</i><span>{{particularsOfSalesNote.purchaseTiem }}</span></h3>
-       </div>
-       <div class="tableDiv">
-         <el-table
-           :data="purchaseInfo"
-           style="width: 100%">
-           <el-table-column
-             prop="materielCode"
-             align="center"
-             label="物料编码">
-           </el-table-column>
-           <el-table-column
-             prop="materielName"
-             align="center"
-             label="物料名称">
-           </el-table-column>
-           <el-table-column
-             prop="materieEncoding"
-             align="center"
-             label="转码名称">
-           </el-table-column>
-           <el-table-column
-             prop="materieColorNumber"
-             align="center"
-             label="色号">
-           </el-table-column>
-           <el-table-column
-             prop="specificationModel"
-             align="center"
-             label="规格型号">
-           </el-table-column>
-           <el-table-column
-             prop="units"
-             align="center"
-             label="单位">
-           </el-table-column>
-           <el-table-column
-             prop="quantity"
-             align="center"
-             label="数量/重量">
-           </el-table-column>
-<!--           <el-table-column-->
-<!--             prop="totalAmount"-->
-<!--             align="center"-->
-<!--             label="总金额">-->
-<!--           </el-table-column>-->
-           <el-table-column label="操作" width="100px" align="center">
-             <template slot-scope="scope">
-               <el-button
-                 size="mini"
-                 type="danger"
-                 @click.stop.prevent="toPrint(scope.$index, scope.row)">打印</el-button>
-             </template>
-           </el-table-column>
-         </el-table>
-       </div>
+    <el-dialog
+      title="采购单详情"
+      :visible.sync="viewPurchaseOrderDetailsShow"
+      width="1000px"
+    >
+      <div class="titleDiv">
+        <!--            <h3><i>采购单编号:</i><span>{{particularsOfSalesNote.purchaseOrderNumber}}</span></h3>-->
+        <h3>
+          <i>供应商:</i><span>{{ particularsOfSalesNote.supplierName }}</span>
+        </h3>
+        <h3>
+          <i>采购批号:</i
+          ><span>{{ particularsOfSalesNote.purchaseLotNumber }}</span>
+        </h3>
+        <h3>
+          <i>采购时间:</i
+          ><span>{{ particularsOfSalesNote.purchaseTiem }}</span>
+        </h3>
+      </div>
+      <div class="tableDiv">
+        <el-table :data="purchaseInfo" style="width: 100%">
+          <el-table-column prop="materielCode" align="center" label="物料编码">
+          </el-table-column>
+          <el-table-column prop="materielName" align="center" label="物料名称">
+          </el-table-column>
+          <el-table-column
+            prop="materieEncoding"
+            align="center"
+            label="转码名称"
+          >
+          </el-table-column>
+          <el-table-column
+            prop="materieColorNumber"
+            align="center"
+            label="色号"
+          >
+          </el-table-column>
+          <el-table-column
+            prop="specificationModel"
+            align="center"
+            label="规格型号"
+          >
+          </el-table-column>
+          <el-table-column prop="units" align="center" label="单位">
+          </el-table-column>
+          <el-table-column prop="quantity" align="center" label="数量/重量">
+          </el-table-column>
+          <!--           <el-table-column-->
+          <!--             prop="totalAmount"-->
+          <!--             align="center"-->
+          <!--             label="总金额">-->
+          <!--           </el-table-column>-->
+          <el-table-column label="操作" width="100px" align="center">
+            <template slot-scope="scope">
+              <el-button
+                size="mini"
+                type="danger"
+                @click.stop.prevent="toPrint(scope.$index, scope.row)"
+                >打印</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
       <span slot="footer" class="dialog-footer">
-        <el-button @click="printShow = false">取 消</el-button>
-        <el-button type="primary">确认</el-button>
+        <el-button @click="viewPurchaseOrderDetailsShow = false"
+          >取 消</el-button
+        >
+        <!-- <el-button type="primary">确认</el-button> -->
       </span>
     </el-dialog>
 
@@ -523,7 +549,13 @@ import {
   addTableData,
   batchEdit,
 } from "@/api/tablelist/commonTable";
-import {getListSupplier, getListMateriel, addPurchase, getPurchaseInfos, updatePurchase} from "@/api/supplier/supplier";
+import {
+  getListSupplier,
+  getListMateriel,
+  addPurchase,
+  getPurchaseInfos,
+  updatePurchase,
+} from "@/api/supplier/supplier";
 import { listData } from "@/api/system/tenant/data";
 import { getPurchaseInfo } from "@/api/tablelist/purchaseInfo";
 import { getToken } from "@/utils/auth";
@@ -537,7 +569,7 @@ import DialogTemplate from "@/views/dialogTemplate/components/index.vue";
 import FormList from "@/components/FormGroup/formList.vue";
 import { v4 as uuidv4 } from "uuid";
 import printHtml from "./print";
-import { Base64 } from 'js-base64'
+import { Base64 } from "js-base64";
 import qrCodeList from "@/utils/print/qrCodeList";
 
 export default {
@@ -546,21 +578,21 @@ export default {
   data() {
     return {
       insertTable: [],
-      labelPosition: 'right',
-      insertFromTitle:'',
-      insertFormData:{},
-      suppliers:[{"id":1,"name":"供应商1"}],
-      insertFrom:false,
-      materiels:[],
-      particularsOfSalesNote:{
-         purchaseOrderNumber:"",
-         supplierName:"",
-         purchaseLotNumber:"",
-         purchaseTiem:"采购时间"
+      labelPosition: "right",
+      insertFromTitle: "",
+      insertFormData: {},
+      suppliers: [{ id: 1, name: "供应商1" }],
+      insertFrom: false,
+      materiels: [],
+      particularsOfSalesNote: {
+        purchaseOrderNumber: "",
+        supplierName: "",
+        purchaseLotNumber: "",
+        purchaseTiem: "采购时间",
       },
-      purchaseInfo:[],
+      purchaseInfo: [],
       //是否显示销售单详情表单
-      viewPurchaseOrderDetailsShow:false,
+      viewPurchaseOrderDetailsShow: false,
       // 顶部按钮数据
       topBtnArr: [], //顶部按钮数据
       selection: [], //选中数组
@@ -697,7 +729,6 @@ export default {
     };
   },
   created() {
-
     // 得到当前展示的table的唯一标识
     this.tableKey = this.$route.query.tableKey;
   },
@@ -718,127 +749,137 @@ export default {
     // },
   },
   methods: {
-    caiGouUpdate(btnInfo,row){
+    caiGouUpdate(btnInfo, row) {
       this.insertFromTitle = "修改采购信息";
       this.insertFrom = true;
-      this.insertFormData={}
-      this.insertTable=[];
+      this.insertFormData = {};
+      this.insertTable = [];
       this.getListMateriel();
       this.getListSupplier();
-      console.log(row)
+      console.log(row);
       // row.purchaseId getInfoEditPurchaseId PurchaseId
-      getPurchaseInfos(row.purchaseSerialNumber).then(res=>{
-        this.insertFormData=res.data;
-        this.insertTable=res.data.purchaseInfos;
-      })
+      getPurchaseInfos(row.purchaseSerialNumber).then((res) => {
+        this.insertFormData = res.data;
+        this.insertTable = res.data.purchaseInfos;
+      });
     },
-    insertTableRequest(){
-      if(this.insertFromTitle=="新增采购信息"){
-        console.log(this.insertFormData.supplierNo)
-        if(this.insertFormData.supplierNo!=undefined&&this.insertFormData.lotNumber!=undefined&&this.insertFormData.useDepartment!=undefined&&this.insertFormData.remark!=undefined){
+    insertTableRequest() {
+      if (this.insertFromTitle == "新增采购信息") {
+        console.log(this.insertFormData.supplierNo);
+        if (
+          this.insertFormData.supplierNo != undefined &&
+          this.insertFormData.lotNumber != undefined &&
+          this.insertFormData.useDepartment != undefined &&
+          this.insertFormData.remark != undefined
+        ) {
           //携带表格数据
-          this.insertFormData.purchaseInfos=this.insertTable;
-          addPurchase(this.insertFormData).then(res=>{
-            if(res.code==200){
+          this.insertFormData.purchaseInfos = this.insertTable;
+          addPurchase(this.insertFormData).then((res) => {
+            if (res.code == 200) {
               this.$message({
-                message: '添加成功',
-                type: 'success'
+                message: "添加成功",
+                type: "success",
               });
               this.insertFrom = false;
-            }else {
+            } else {
               this.$message({
-                message: '添加失败',
-                type: 'warning'
+                message: "添加失败",
+                type: "warning",
               });
             }
-          })
-        }else {
+          });
+        } else {
           this.$message({
-            message: '请完善表单',
-            type: 'warning'
+            message: "请完善表单",
+            type: "warning",
           });
         }
-      }else {
-        console.log(this.insertFormData.supplierNo)
-        if(this.insertFormData.supplierNo!=undefined&&this.insertFormData.lotNumber!=undefined&&this.insertFormData.useDepartment!=undefined&&this.insertFormData.remark!=undefined){
+      } else {
+        console.log(this.insertFormData.supplierNo);
+        if (
+          this.insertFormData.supplierNo != undefined &&
+          this.insertFormData.lotNumber != undefined &&
+          this.insertFormData.useDepartment != undefined &&
+          this.insertFormData.remark != undefined
+        ) {
           //携带表格数据
-          this.insertFormData.purchaseInfos=this.insertTable;
-          updatePurchase(this.insertFormData).then(res=>{
-            if(res.code==200){
+          this.insertFormData.purchaseInfos = this.insertTable;
+          updatePurchase(this.insertFormData).then((res) => {
+            if (res.code == 200) {
               this.$message({
-                message: '修改成功',
-                type: 'success'
+                message: "修改成功",
+                type: "success",
               });
               this.insertFrom = false;
-            }else {
+            } else {
               this.$message({
-                message: '修改失败',
-                type: 'warning'
+                message: "修改失败",
+                type: "warning",
               });
             }
-          })
-        }else {
+          });
+        } else {
           this.$message({
-            message: '请完善表单',
-            type: 'warning'
+            message: "请完善表单",
+            type: "warning",
           });
         }
       }
       this.getList();
     },
     //原材料信息
-    getListMateriel(){
-      getListMateriel().then(res=>{
-        this.materiels=res.data;
-      })
+    getListMateriel() {
+      getListMateriel().then((res) => {
+        this.materiels = res.data;
+      });
     },
     //供应商信息
-    getListSupplier(){
-      getListSupplier().then(res=>{
-        this.suppliers=res.data
-      })
+    getListSupplier() {
+      getListSupplier().then((res) => {
+        this.suppliers = res.data;
+      });
     },
     //删除一行
-    handleRowDelete($index,rwo){
-      this.insertTable.splice($index,1)
+    handleRowDelete($index, rwo) {
+      this.insertTable.splice($index, 1);
     },
     //添加一行
-    addRow(){
+    addRow() {
       // 添加一行数据 id materielId quantity remark
       const newRow = {
-        id: this.insertTable.length+1,
+        id: this.insertTable.length + 1,
         materielId: undefined,
         quantity: undefined,
-        remark:undefined,
+        remark: undefined,
         disableInput: false,
       };
       this.insertTable.push(newRow);
     },
     //关闭逻辑
-    insertFromClose(){
+    insertFromClose() {
       this.insertFrom = false;
     },
-    insertFromHander(){
+    insertFromHander() {
       this.insertFromTitle = "新增采购信息";
       // this.insertFormData.supplierNo=undefined
       // this.insertFormData.lotNumber=undefined
       // this.insertFormData.useDepartment=undefined
       // this.insertFormData.remark=undefined
-      this.insertFormData={};
-      this.insertTable=[];
+      this.insertFormData = {};
+      this.insertTable = [];
       this.insertFrom = true;
       this.getListSupplier();
       this.getListMateriel();
     },
     //打印逻辑方法
-    toPrint(rwoIndex,row){
-      console.log(rwoIndex,row);
+    toPrint(rwoIndex, row) {
+      console.log(rwoIndex, row);
       //拼接码内容 采购单号,编码号,单位,规格型号,数量,
-      let stringInner =this.particularsOfSalesNote.purchaseLotNumber
-      let timeCode= new Date().getTime().toString();
+      let stringInner = this.particularsOfSalesNote.purchaseLotNumber;
+      let timeCode = new Date().getTime().toString();
       //二维码内容
       //                 时间戳        批号                 母粒id
-      let codeString= timeCode+"@"+ stringInner +"@"+ row.materielId
+      let codeString = timeCode + "@" + stringInner + "@" + row.materielId;
       // const encodePwd = Base64.encode(codeString);//加密
       // const encodePwd = encodeURIComponent(codeString)
       //声明一个数组对象
@@ -847,25 +888,25 @@ export default {
       allPringtData.push({
         codeData: codeString,
         showMsg: [
-          {label: "批号", value: stringInner},
-          {label: "母粒编码", value: row.materieEncoding},
-          {label: "色号", value: row.materieColorNumber},
+          { label: "批号", value: stringInner },
+          { label: "母粒编码", value: row.materieEncoding },
+          { label: "色号", value: row.materieColorNumber },
         ],
       });
       qrCodeList(allPringtData, "printDom");
     },
-    viewPurchaseOrderDetails(btnData, row){
-      console.log(this.currentRow,btnData,row);
-      this.particularsOfSalesNote.purchaseOrderNumber=row.purchaseId
-      this.particularsOfSalesNote.supplierName=row.supplierSupplierName
-      this.particularsOfSalesNote.purchaseLotNumber=row.purchaseLotNumber
-      this.particularsOfSalesNote.purchaseTiem=row.purchaseCreateTime
-      this.viewPurchaseOrderDetailsShow=true;
+    viewPurchaseOrderDetails(btnData, row) {
+      console.log(this.currentRow, btnData, row);
+      this.particularsOfSalesNote.purchaseOrderNumber = row.purchaseId;
+      this.particularsOfSalesNote.supplierName = row.supplierSupplierName;
+      this.particularsOfSalesNote.purchaseLotNumber = row.purchaseLotNumber;
+      this.particularsOfSalesNote.purchaseTiem = row.purchaseCreateTime;
+      this.viewPurchaseOrderDetailsShow = true;
       // console.log(row,"行数据");
-      getPurchaseInfo({"purchaseId":row.purchaseSerialNumber}).then(resp=>{
-        this.purchaseInfo=resp.data
-        console.log(this.purchaseInfo)
-      })
+      getPurchaseInfo({ purchaseId: row.purchaseSerialNumber }).then((resp) => {
+        this.purchaseInfo = resp.data;
+        console.log(this.purchaseInfo);
+      });
     },
     // test
     showValue() {
@@ -927,7 +968,7 @@ export default {
           this.topBtnArr = res.data.resultMap.button?.filter(
             (item) => item.btnGroupType == "top"
           );
-          console.log(this.topBtnArr,"dddddddddd");
+          console.log(this.topBtnArr, "dddddddddd");
           this.calcuteExcuteCol();
           this.$nextTick(() => {
             this.$refs.tableRef.doLayout();
@@ -2489,13 +2530,13 @@ export default {
 </script>
 
 <style scoped lang="scss">
-.tableDiv{
+.tableDiv {
   margin-top: 20px;
 }
-.titleDiv{
+.titleDiv {
   display: flex;
   justify-content: space-between;
-  i{
+  i {
     font-style: normal;
     font-weight: 900;
     color: #000000;
@@ -2504,5 +2545,4 @@ export default {
 ::v-deep .el-dialog:not(.is-fullscreen) {
   min-width: 610px !important;
 }
-
 </style>