yusheng 1 year ago
parent
commit
593ae8bddc
1 changed files with 501 additions and 480 deletions
  1. 501 480
      src/views/bpm/handleTask/components/inquiryManage/inventoryTable.vue

+ 501 - 480
src/views/bpm/handleTask/components/inquiryManage/inventoryTable.vue

@@ -11,129 +11,129 @@
       class="time-form"
       :selection.sync="selection"
     >
-<!--      <template v-slot:productName="{ row, $index }">-->
-<!--        <el-form-item-->
-<!--          style="margin-bottom: 20px"-->
-<!--          :prop="'datasource.' + $index + '.productName'"-->
-<!--          :rules="{-->
-<!--            required: true,-->
-<!--            message: '请输入',-->
-<!--            trigger: 'change'-->
-<!--          }"-->
-<!--        >-->
-<!--          <el-input-->
-<!--            v-model="row.productName"-->
-<!--            placeholder="请输入"-->
-<!--            disabled-->
-<!--          ></el-input>-->
-<!--        </el-form-item>-->
-<!--      </template>-->
-<!--      <template v-slot:productCode="scope">-->
-<!--        <el-form-item-->
-<!--          style="margin-bottom: 20px"-->
-<!--          :prop="'datasource.' + scope.$index + '.productCode'"-->
+      <!--      <template v-slot:productName="{ row, $index }">-->
+      <!--        <el-form-item-->
+      <!--          style="margin-bottom: 20px"-->
+      <!--          :prop="'datasource.' + $index + '.productName'"-->
+      <!--          :rules="{-->
+      <!--            required: true,-->
+      <!--            message: '请输入',-->
+      <!--            trigger: 'change'-->
+      <!--          }"-->
+      <!--        >-->
+      <!--          <el-input-->
+      <!--            v-model="row.productName"-->
+      <!--            placeholder="请输入"-->
+      <!--            disabled-->
+      <!--          ></el-input>-->
+      <!--        </el-form-item>-->
+      <!--      </template>-->
+      <!--      <template v-slot:productCode="scope">-->
+      <!--        <el-form-item-->
+      <!--          style="margin-bottom: 20px"-->
+      <!--          :prop="'datasource.' + scope.$index + '.productCode'"-->
 
-<!--        >-->
-<!--          <el-input v-model="scope.row.productCode" disabled></el-input>-->
-<!--        </el-form-item>-->
-<!--      </template>-->
-<!--      <template v-slot:productCategoryName="scope">-->
-<!--        <el-form-item-->
-<!--          style="margin-bottom: 20px"-->
-<!--          :prop="'datasource.' + scope.$index + '.productCategoryName'"-->
+      <!--        >-->
+      <!--          <el-input v-model="scope.row.productCode" disabled></el-input>-->
+      <!--        </el-form-item>-->
+      <!--      </template>-->
+      <!--      <template v-slot:productCategoryName="scope">-->
+      <!--        <el-form-item-->
+      <!--          style="margin-bottom: 20px"-->
+      <!--          :prop="'datasource.' + scope.$index + '.productCategoryName'"-->
 
-<!--        >-->
-<!--          <el-input v-model="scope.row.productCategoryName" disabled></el-input>-->
-<!--        </el-form-item>-->
-<!--      </template>-->
-<!--      <template v-slot:totalCount="scope">-->
-<!--        <el-form-item-->
-<!--          style="margin-bottom: 20px"-->
-<!--          :prop="'datasource.' + scope.$index + '.totalCount'"-->
-<!--          :rules="{-->
-<!--            required: true,-->
-<!--            pattern: numberReg,-->
-<!--            message: '请输入数字',-->
-<!--            trigger: 'blur'-->
-<!--          }"-->
-<!--        >-->
-<!--          <el-input-->
-<!--            v-model="scope.row.totalCount"-->
-<!--            disabled-->
-<!--            placeholder="请输入"-->
-<!--          ></el-input>-->
-<!--        </el-form-item>-->
-<!--      </template>-->
+      <!--        >-->
+      <!--          <el-input v-model="scope.row.productCategoryName" disabled></el-input>-->
+      <!--        </el-form-item>-->
+      <!--      </template>-->
+      <!--      <template v-slot:totalCount="scope">-->
+      <!--        <el-form-item-->
+      <!--          style="margin-bottom: 20px"-->
+      <!--          :prop="'datasource.' + scope.$index + '.totalCount'"-->
+      <!--          :rules="{-->
+      <!--            required: true,-->
+      <!--            pattern: numberReg,-->
+      <!--            message: '请输入数字',-->
+      <!--            trigger: 'blur'-->
+      <!--          }"-->
+      <!--        >-->
+      <!--          <el-input-->
+      <!--            v-model="scope.row.totalCount"-->
+      <!--            disabled-->
+      <!--            placeholder="请输入"-->
+      <!--          ></el-input>-->
+      <!--        </el-form-item>-->
+      <!--      </template>-->
 
-<!--      <template v-slot:productBrand="scope">-->
-<!--        <el-form-item-->
-<!--          style="margin-bottom: 20px"-->
-<!--          :prop="'datasource.' + scope.$index + '.productBrand'"-->
-<!--        >-->
-<!--          <el-input v-model="scope.row.productBrand" disabled></el-input>-->
-<!--        </el-form-item>-->
-<!--      </template>-->
+      <!--      <template v-slot:productBrand="scope">-->
+      <!--        <el-form-item-->
+      <!--          style="margin-bottom: 20px"-->
+      <!--          :prop="'datasource.' + scope.$index + '.productBrand'"-->
+      <!--        >-->
+      <!--          <el-input v-model="scope.row.productBrand" disabled></el-input>-->
+      <!--        </el-form-item>-->
+      <!--      </template>-->
 
-<!--      <template v-slot:modelType="scope">-->
-<!--        <el-form-item-->
-<!--          style="margin-bottom: 20px"-->
-<!--          :prop="'datasource.' + scope.$index + '.modelType'"-->
-<!--        >-->
-<!--          <el-input v-model="scope.row.modelType" disabled></el-input>-->
-<!--        </el-form-item>-->
-<!--      </template>-->
+      <!--      <template v-slot:modelType="scope">-->
+      <!--        <el-form-item-->
+      <!--          style="margin-bottom: 20px"-->
+      <!--          :prop="'datasource.' + scope.$index + '.modelType'"-->
+      <!--        >-->
+      <!--          <el-input v-model="scope.row.modelType" disabled></el-input>-->
+      <!--        </el-form-item>-->
+      <!--      </template>-->
 
-<!--      <template v-slot:specification="scope">-->
-<!--        <el-form-item-->
-<!--          style="margin-bottom: 20px"-->
-<!--          :prop="'datasource.' + scope.$index + '.specification'"-->
-<!--        >-->
-<!--          <el-input v-model="scope.row.specification" disabled></el-input>-->
-<!--        </el-form-item>-->
-<!--      </template>-->
-<!--      <template v-slot:measuringUnit="scope">-->
-<!--        <el-form-item-->
-<!--          style="margin-bottom: 20px"-->
-<!--          :prop="'datasource.' + scope.$index + '.measuringUnit'"-->
-<!--        >-->
-<!--          <el-input-->
-<!--            v-model="scope.row.measuringUnit"-->
-<!--            placeholder="请输入"-->
-<!--            disabled-->
-<!--          ></el-input>-->
-<!--        </el-form-item>-->
-<!--      </template>-->
-<!--      <template v-slot:remark="scope">-->
-<!--        <el-form-item-->
-<!--          style="margin-bottom: 20px"-->
-<!--          :prop="'datasource.' + scope.$index + '.remark'"-->
-<!--        >-->
-<!--          <el-input-->
-<!--            v-model="scope.row.remark"-->
-<!--            disabled-->
-<!--            type="textarea"-->
-<!--            placeholder="请输入"-->
-<!--          ></el-input>-->
-<!--        </el-form-item>-->
-<!--      </template>-->
+      <!--      <template v-slot:specification="scope">-->
+      <!--        <el-form-item-->
+      <!--          style="margin-bottom: 20px"-->
+      <!--          :prop="'datasource.' + scope.$index + '.specification'"-->
+      <!--        >-->
+      <!--          <el-input v-model="scope.row.specification" disabled></el-input>-->
+      <!--        </el-form-item>-->
+      <!--      </template>-->
+      <!--      <template v-slot:measuringUnit="scope">-->
+      <!--        <el-form-item-->
+      <!--          style="margin-bottom: 20px"-->
+      <!--          :prop="'datasource.' + scope.$index + '.measuringUnit'"-->
+      <!--        >-->
+      <!--          <el-input-->
+      <!--            v-model="scope.row.measuringUnit"-->
+      <!--            placeholder="请输入"-->
+      <!--            disabled-->
+      <!--          ></el-input>-->
+      <!--        </el-form-item>-->
+      <!--      </template>-->
+      <!--      <template v-slot:remark="scope">-->
+      <!--        <el-form-item-->
+      <!--          style="margin-bottom: 20px"-->
+      <!--          :prop="'datasource.' + scope.$index + '.remark'"-->
+      <!--        >-->
+      <!--          <el-input-->
+      <!--            v-model="scope.row.remark"-->
+      <!--            disabled-->
+      <!--            type="textarea"-->
+      <!--            placeholder="请输入"-->
+      <!--          ></el-input>-->
+      <!--        </el-form-item>-->
+      <!--      </template>-->
 
-<!--      <template v-slot:technicalParams="scope">-->
-<!--        <el-form-item-->
-<!--          style="margin-bottom: 20px"-->
-<!--          :prop="'datasource.' + scope.$index + '.technicalParams'"-->
-<!--          :rules="{-->
-<!--            required: false,-->
-<!--            message: '请输入',-->
-<!--            trigger: 'change'-->
-<!--          }"-->
-<!--        >-->
-<!--          <el-input-->
-<!--            type="textarea"-->
-<!--            v-model="scope.row.technicalParams"-->
-<!--            placeholder="请输入"-->
-<!--          ></el-input>-->
-<!--        </el-form-item>-->
-<!--      </template>-->
+      <!--      <template v-slot:technicalParams="scope">-->
+      <!--        <el-form-item-->
+      <!--          style="margin-bottom: 20px"-->
+      <!--          :prop="'datasource.' + scope.$index + '.technicalParams'"-->
+      <!--          :rules="{-->
+      <!--            required: false,-->
+      <!--            message: '请输入',-->
+      <!--            trigger: 'change'-->
+      <!--          }"-->
+      <!--        >-->
+      <!--          <el-input-->
+      <!--            type="textarea"-->
+      <!--            v-model="scope.row.technicalParams"-->
+      <!--            placeholder="请输入"-->
+      <!--          ></el-input>-->
+      <!--        </el-form-item>-->
+      <!--      </template>-->
       <template v-slot:files="scope">
         <el-form-item prop="files">
           <el-link
@@ -144,36 +144,47 @@
             @click="downloadFile(link)"
           >
             {{ link.name }}
-          </el-link
-          >
+          </el-link>
         </el-form-item>
       </template>
-<!--      <template v-slot:expectReceiveDate="scope">-->
-<!--        <el-form-item-->
-<!--          style="margin-bottom: 20px"-->
-<!--          :prop="'datasource.' + scope.$index + '.expectReceiveDate'"-->
-<!--          :rules="{-->
-<!--            required: true,-->
-<!--            message: '请选择日期',-->
-<!--            trigger: 'blur'-->
-<!--          }"-->
-<!--        >-->
-<!--          <el-date-picker-->
-<!--            style="width: 100%"-->
-<!--            clearable-->
-<!--            v-model="scope.row.expectReceiveDate"-->
-<!--            type="date"-->
-<!--            value-format="yyyy-MM-dd"-->
-<!--            placeholder="请选择日期"-->
-<!--            disabled-->
-<!--          >-->
-<!--          </el-date-picker>-->
-<!--        </el-form-item>-->
-<!--      </template>-->
+      <!--      <template v-slot:expectReceiveDate="scope">-->
+      <!--        <el-form-item-->
+      <!--          style="margin-bottom: 20px"-->
+      <!--          :prop="'datasource.' + scope.$index + '.expectReceiveDate'"-->
+      <!--          :rules="{-->
+      <!--            required: true,-->
+      <!--            message: '请选择日期',-->
+      <!--            trigger: 'blur'-->
+      <!--          }"-->
+      <!--        >-->
+      <!--          <el-date-picker-->
+      <!--            style="width: 100%"-->
+      <!--            clearable-->
+      <!--            v-model="scope.row.expectReceiveDate"-->
+      <!--            type="date"-->
+      <!--            value-format="yyyy-MM-dd"-->
+      <!--            placeholder="请选择日期"-->
+      <!--            disabled-->
+      <!--          >-->
+      <!--          </el-date-picker>-->
+      <!--        </el-form-item>-->
+      <!--      </template>-->
       <template v-slot:supplierIds="scope">
         <el-form-item prop="supplierIds">
-          <el-select v-model="scope.row['supplierIds']" clearable filterable multiple collapse-tags @change="handleSupplierSelect(scope.row)">
-            <el-option v-for="i in scope.row.supplierList" :key="i.id" :value="i.id" :label="i.name"></el-option>
+          <el-select
+            v-model="scope.row['supplierIds']"
+            clearable
+            filterable
+            multiple
+            collapse-tags
+        
+          >
+            <el-option
+              v-for="i in scope.row.supplierList"
+              :key="i.id"
+              :value="i.id"
+              :label="i.name"
+            ></el-option>
           </el-select>
         </el-form-item>
       </template>
@@ -213,12 +224,12 @@
           <!-- <div style="display: flex"> -->
           <span>{{ item.label }}</span>
           <fileMain v-model="item.files"></fileMain>
-<!--          <fileUpload-->
-<!--            v-model="item.files"-->
-<!--            module="main"-->
-<!--            :showLib="false"-->
-<!--            :limit="1"-->
-<!--          />-->
+          <!--          <fileUpload-->
+          <!--            v-model="item.files"-->
+          <!--            module="main"-->
+          <!--            :showLib="false"-->
+          <!--            :limit="1"-->
+          <!--          />-->
           <!-- </div> -->
         </el-form-item>
       </template>
@@ -249,70 +260,70 @@
   </el-form>
 </template>
 <script>
-import {numberReg} from 'ele-admin';
-import dictMixins from '@/mixins/dictMixins';
-import fileUpload from '@/components/upload/fileUpload';
-import {getFile} from "@/api/system/file";
-import {getByCode} from "@/api/system/dictionary-data";
-import {getInventoryTotalAPI} from "@/api/bpm/components/wms";
-import fileMain from "@/components/addDoc/index.vue";
-// import headList from '@/views/saleManage/businessOpportunity/components/headList.vue';
-export default {
-  mixins: [dictMixins],
-  components: {
-    fileMain,
-    fileUpload
-    // headList
-  },
-  props: {
-    acceptUnpack: {
-      default: ''
-    }
-  },
-  data() {
-    const defaultForm = {
-      key: null,
-      endTime: '',
-      isFirst: 0,
-      name: ''
-    };
-
-    return {
-      numberReg,
-      defaultForm,
-      supplierList: [],
-      selection: [],
-      // resultList:'',
-      form: {
-        datasource: []
-      },
-      dictList: {},
-      files: [],
-      rules: {},
-    };
-  },
-  computed: {
-    canHandl() {
-      return this.form.datasource.length;
+  import { numberReg } from 'ele-admin';
+  import dictMixins from '@/mixins/dictMixins';
+  import fileUpload from '@/components/upload/fileUpload';
+  import { getFile } from '@/api/system/file';
+  import { getByCode } from '@/api/system/dictionary-data';
+  import { getInventoryTotalAPI } from '@/api/bpm/components/wms';
+  import fileMain from '@/components/addDoc/index.vue';
+  // import headList from '@/views/saleManage/businessOpportunity/components/headList.vue';
+  export default {
+    mixins: [dictMixins],
+    components: {
+      fileMain,
+      fileUpload
+      // headList
     },
-    columns() {
-      return [
-        {
-          width: 50,
-          label: '序号',
-          type: 'index',
-          columnKey: 'index',
-          align: 'center',
-          fixed: 'left'
-        },
-        {
-          width: 45,
-          type: 'selection',
-          columnKey: 'selection',
-          align: 'center',
-          fixed: 'left'
+    props: {
+      acceptUnpack: {
+        default: ''
+      }
+    },
+    data() {
+      const defaultForm = {
+        key: null,
+        endTime: '',
+        isFirst: 0,
+        name: ''
+      };
+
+      return {
+        numberReg,
+        defaultForm,
+        supplierList: [],
+        selection: [],
+        // resultList:'',
+        form: {
+          datasource: []
         },
-        {
+        dictList: {},
+        files: [],
+        rules: {}
+      };
+    },
+    computed: {
+      canHandl() {
+        return this.form.datasource.length;
+      },
+      columns() {
+        return [
+          {
+            width: 50,
+            label: '序号',
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
             minWidth: 180,
             slot: 'add',
             label: '新增报价',
@@ -333,196 +344,201 @@ export default {
             },
             align: 'center'
           },
-        {
-          minWidth: 100,
-          prop: 'productCategoryName',
-          label: '分类',
-          slot: 'productCategoryName',
-          showOverflowTooltip: true,
-          align: "center"
-        },
-        {
-          minWidth: 100,
-          prop: 'productCode',
-          label: '编码',
-          slot: 'productCode',
-          showOverflowTooltip: true,
-          align: "center"
-        },
-        {
-          minWidth: 140,
-          prop: 'productName',
-          label: '名称',
-          slot: 'productName',
-          headerSlot: 'productNameHeader',
-          showOverflowTooltip: true,
-          align: "center"
-        },
-        {
-          minWidth: 200,
-          prop: 'supplierIds',
-          label: '供应商选择',
-          slot: 'supplierIds',
-          align: "center"
-        },
-        {
-          minWidth: 100,
-          prop: 'productBrand',
-          label: '牌号',
-          slot: 'productBrand',
-          showOverflowTooltip: true,
-          align: "center"
-        },
-        {
-          minWidth: 80,
-          prop: 'totalCount',
-          label: '数量',
-          slot: 'totalCount',
-          align: "center"
-        },
-        {
-          minWidth: 80,
-          prop: 'availableCountBase',
-          label: '库存数量',
-          slot: 'availableCountBase',
-          align: "center"
-        },
-        {
+          {
+            minWidth: 100,
+            prop: 'productCategoryName',
+            label: '分类',
+            slot: 'productCategoryName',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 100,
+            prop: 'productCode',
+            label: '编码',
+            slot: 'productCode',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 140,
+            prop: 'productName',
+            label: '名称',
+            slot: 'productName',
+            headerSlot: 'productNameHeader',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 200,
+            prop: 'supplierIds',
+            label: '供应商选择',
+            slot: 'supplierIds',
+            align: 'center'
+          },
+          {
+            minWidth: 100,
+            prop: 'productBrand',
+            label: '牌号',
+            slot: 'productBrand',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 80,
+            prop: 'totalCount',
+            label: '数量',
+            slot: 'totalCount',
+            align: 'center'
+          },
+          {
+            minWidth: 80,
+            prop: 'availableCountBase',
+            label: '库存数量',
+            slot: 'availableCountBase',
+            align: 'center'
+          },
+          {
             width: 120,
             prop: 'totalWeight',
             label: '重量',
             slot: 'totalWeight',
             align: 'center'
           },
-        {
-          minWidth: 80,
-          prop: 'measuringUnit',
-          label: '单位',
-          slot: 'measuringUnit',
-          showOverflowTooltip: true,
-          align: "center"
-        },
-        {
-          minWidth: 130,
-          prop: 'modelType',
-          label: '型号',
-          slot: 'modelType',
-          showOverflowTooltip: true,
-          align: "center"
-        },
+          {
+            minWidth: 80,
+            prop: 'measuringUnit',
+            label: '单位',
+            slot: 'measuringUnit',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 130,
+            prop: 'modelType',
+            label: '型号',
+            slot: 'modelType',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
 
-        {
-          minWidth: 120,
-          prop: 'specification',
-          label: '规格',
-          slot: 'specification',
-          showOverflowTooltip: true,
-          align: "center"
-        },
-        {
-          minWidth: 120,
-          prop: 'imgCode',
-          align: 'center',
-          label: '图号/件号',
-          showOverflowTooltip: true
-        },
-        {
-          minWidth: 120,
-          prop: 'produceType',
-          align: 'center',
-          label: '生产类型',
-          showOverflowTooltip: true,
-          formatter: (row, column) => {
-            return row.produceType && row.produceType.length ? row.produceType.map(item => this.getDictV('productionType', item)).join(',') : ''
+          {
+            minWidth: 120,
+            prop: 'specification',
+            label: '规格',
+            slot: 'specification',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'imgCode',
+            align: 'center',
+            label: '图号/件号',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 120,
+            prop: 'produceType',
+            align: 'center',
+            label: '生产类型',
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.produceType && row.produceType.length
+                ? row.produceType
+                    .map((item) => this.getDictV('productionType', item))
+                    .join(',')
+                : '';
+            }
+          },
+          {
+            minWidth: 120,
+            prop: 'approvalNumber',
+            align: 'center',
+            label: '批准文号',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 120,
+            prop: 'packingSpecification',
+            align: 'center',
+            label: '包装规格',
+            showOverflowTooltip: true
+          },
+          // {
+          //   width: 130,
+          //   prop: 'brand',
+          //   label: '品牌',
+          //   slot: 'brand'
+          // },
+          {
+            minWidth: 170,
+            prop: 'expectReceiveDate',
+            label: '到货日期',
+            slot: 'expectReceiveDate',
+            align: 'center'
+          },
+          {
+            minWidth: 140,
+            prop: 'files',
+            label: '附件',
+            slot: 'files',
+            align: 'center'
+          },
+          {
+            minWidth: 220,
+            prop: 'remark',
+            label: '备注',
+            slot: 'remark',
+            align: 'center'
           }
-        },
-        {
-          minWidth: 120,
-          prop: 'approvalNumber',
-          align: 'center',
-          label: '批准文号',
-          showOverflowTooltip: true
-        },
-        {
-          minWidth: 120,
-          prop: 'packingSpecification',
-          align: 'center',
-          label: '包装规格',
-          showOverflowTooltip: true
-        },
-        // {
-        //   width: 130,
-        //   prop: 'brand',
-        //   label: '品牌',
-        //   slot: 'brand'
-        // },
-        {
-          minWidth: 170,
-          prop: 'expectReceiveDate',
-          label: '到货日期',
-          slot: 'expectReceiveDate',
-          align: "center"
-        },
-        {
-          minWidth: 140,
-          prop: 'files',
-          label: '附件',
-          slot: 'files',
-          align: "center"
-        },
-        {
-          minWidth: 220,
-          prop: 'remark',
-          label: '备注',
-          slot: 'remark',
-          align: "center"
-        },
-        // {
-        //   columnKey: 'action',
-        //   label: '操作',
-        //   width: 120,
-        //   align: 'center',
-        //   resizable: false,
-        //   slot: 'action',
-        //   fixed: 'right',
-        //   showOverflowTooltip: true
-        // }
-      ]
-    }
-  },
-  created() {
-    this.getDictList('productionType')
-  },
-  methods: {
-    getDictV(code, val) {
-      if (!this.dictList[code]) return '';
-      return this.dictList[code].find(item => item.value == val)?.label
-    },
-    async getDictList(code) {
-      let {data: res} = await getByCode(code)
-      this.dictList[code] = res.map(item => {
-        let values = Object.keys(item)
-        return {
-          value: values[0],
-          label: item[values[0]]
-        }
-      })
+          // {
+          //   columnKey: 'action',
+          //   label: '操作',
+          //   width: 120,
+          //   align: 'center',
+          //   resizable: false,
+          //   slot: 'action',
+          //   fixed: 'right',
+          //   showOverflowTooltip: true
+          // }
+        ];
+      }
     },
-    downloadFile(file) {
-      getFile({objectName: file.storePath}, file.name);
+    created() {
+      this.getDictList('productionType');
     },
-    // 返回列表数据
-    getTableValue() {
-      let comitDatasource = this.form.datasource;
-      if (comitDatasource.length === 0) return [];
-      comitDatasource.forEach((v) => {
-        v.totalPrice = (v.totalCount * v.singlePrice)?.toFixed(2) || 0;
+    methods: {
+      getDictV(code, val) {
+        if (!this.dictList[code]) return '';
+        return this.dictList[code].find((item) => item.value == val)?.label;
+      },
+      async getDictList(code) {
+        let { data: res } = await getByCode(code);
+        this.dictList[code] = res.map((item) => {
+          let values = Object.keys(item);
+          return {
+            value: values[0],
+            label: item[values[0]]
+          };
+        });
+      },
+      downloadFile(file) {
+        getFile({ objectName: file.storePath }, file.name);
+      },
+      // 返回列表数据
+      getTableValue() {
+        let comitDatasource = this.form.datasource;
+        if (comitDatasource.length === 0) return [];
+        comitDatasource.forEach((v) => {
+          v.totalPrice = (v.totalCount * v.singlePrice)?.toFixed(2) || 0;
 
-        v.files = v.files || null;
-      });
-      return comitDatasource;
-    },
-    setIsInquiry(list) {
+          v.files = v.files || null;
+        });
+        return comitDatasource;
+      },
+      setIsInquiry(list) {
+        return;
         this.form.datasource.forEach((productItem, index) => {
           //产品清单
           let isInquiry = 0,
@@ -533,17 +549,17 @@ export default {
               //供应商产品
               if (val.productCode == productItem.productCode) {
                 totalCountS.push(
-                  Number(val.totalCount||0) + Number(productItem.doneTotalCount||0)
+                  Number(val.totalCount || 0) +
+                    Number(productItem.doneTotalCount || 0)
                 );
               }
             });
           });
           if (totalCountS.length > 0) {
-        
             this.$set(
               this.form.datasource[index],
               'isInquiry',
-            
+
               Math.max(...totalCountS) >= productItem.totalCount ? 2 : 1
             );
           } else {
@@ -552,110 +568,115 @@ export default {
           console.log(totalCountS, 'codeS');
         });
       },
-    //修改回显
-    async putTableValue(data) {
-      if (data && data?.length) {
-        this.form.datasource = data;
-        let codeList = this.form.datasource.map(item => item.productCode)
-        //获取仓库库存
-        let inventoryTotalList = await getInventoryTotalAPI(codeList);
-        this.form.datasource.forEach((item,index) => {
-          let find = inventoryTotalList.find((key) => key.code == item.productCode) || {};
-          // item.availableCountBase = find.availableCountBase;
-          this.$set(this.form.datasource[index], 'availableCountBase', find.availableCountBase);
-        });
-        this.$refs.table.reload()
-      }
-
-    },
-    handleSupplierSelect(row) {
-      this.$emit('supplierSelect', row);
-    },
-    //选择产品
-    handParent() {
-      this.$refs.productListRef.open();
-    },
-    //选择产品回调
-    changeParent(obj, idx) {
-      obj['productBrand'] = obj.brandNum;
-      obj['productCode'] = obj.code;
-      obj['productName'] = obj.name;
-      obj['productCategoryName'] = obj.categoryLevelPath;
-      obj['productCategoryId'] = obj.categoryLevelId;
-      this.form.datasource.push(obj);
-    },
-    remove(i, productCode) {
-      if (!this.acceptUnpack) {
-        this.$message.warning('本采购计划不能拆单');
-        return;
-      }
+      //修改回显
+      async putTableValue(data) {
+        if (data && data?.length) {
+          this.form.datasource = data;
+          let codeList = this.form.datasource.map((item) => item.productCode);
+          //获取仓库库存
+          let inventoryTotalList = await getInventoryTotalAPI(codeList);
+          this.form.datasource.forEach((item, index) => {
+            let find =
+              inventoryTotalList.find((key) => key.code == item.productCode) ||
+              {};
+            // item.availableCountBase = find.availableCountBase;
+            this.$set(
+              this.form.datasource[index],
+              'availableCountBase',
+              find.availableCountBase
+            );
+          });
+          this.$refs.table.reload();
+        }
+      },
+      handleSupplierSelect(row) {
+        this.$emit('supplierSelect', row);
+      },
+      //选择产品
+      handParent() {
+        this.$refs.productListRef.open();
+      },
+      //选择产品回调
+      changeParent(obj, idx) {
+        obj['productBrand'] = obj.brandNum;
+        obj['productCode'] = obj.code;
+        obj['productName'] = obj.name;
+        obj['productCategoryName'] = obj.categoryLevelPath;
+        obj['productCategoryId'] = obj.categoryLevelId;
+        this.form.datasource.push(obj);
+      },
+      remove(i, productCode) {
+        if (!this.acceptUnpack) {
+          this.$message.warning('本采购计划不能拆单');
+          return;
+        }
 
-      this.form.datasource.splice(i, 1);
+        this.form.datasource.splice(i, 1);
 
-      this.$emit('delList', productCode);
-    },
-    // 清空表格
-    restTable() {
-      this.form.datasource = [];
-    },
-    openSupplier(row) {
+        this.$emit('delList', productCode);
+      },
+      // 清空表格
+      restTable() {
+        this.form.datasource = [];
+      },
+      openSupplier(row) {
         this.$emit('supplierSelect', row);
       },
-    // 添加
-    handlAdd() {
-      let item = JSON.parse(JSON.stringify(this.defaultForm));
-      item.key = this.form.datasource.length + 1;
-      this.form.datasource.push(item);
-    },
+      // 添加
+      handlAdd() {
+        let item = JSON.parse(JSON.stringify(this.defaultForm));
+        item.key = this.form.datasource.length + 1;
+        this.form.datasource.push(item);
+      },
 
-    validateForm(callback) {
-      //开始表单校验
-      this.$refs.form.validate((valid) => {
-        callback(valid);
-      });
+      validateForm(callback) {
+        //开始表单校验
+        this.$refs.form.validate((valid) => {
+          callback(valid);
+        });
+      }
     }
-  }
-};
+  };
 </script>
 <style lang="scss" scoped>
-.headbox {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
+  .headbox {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
 
-  .amount {
-    font-size: 14px;
-    font-weight: bold;
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+    }
   }
-}
 
-.time-form .el-form-item {
-  margin-bottom: 0 !important;
-}
+  .time-form .el-form-item {
+    margin-bottom: 0 !important;
+  }
 
-::v-deep .period {
-  display: flex;
+  ::v-deep .period {
+    display: flex;
 
-  .borderleftnone {
-    .el-input--medium .el-input__inner {
-      border-top-right-radius: 0;
-      border-bottom-right-radius: 0;
+    .borderleftnone {
+      .el-input--medium .el-input__inner {
+        border-top-right-radius: 0;
+        border-bottom-right-radius: 0;
+      }
     }
-  }
 
-  .borderrightnone {
-    .el-input--medium .el-input__inner {
-      border-top-left-radius: 0;
-      border-bottom-left-radius: 0;
+    .borderrightnone {
+      .el-input--medium .el-input__inner {
+        border-top-left-radius: 0;
+        border-bottom-left-radius: 0;
+      }
     }
   }
-}
 
-::v-deep .time-form tbody > tr:hover > td {
-  background-color: transparent !important;
-}
+  ::v-deep .time-form tbody > tr:hover > td {
+    background-color: transparent !important;
+  }
 
-::v-deep .time-form .el-table tr {
-  background-color: #ffffff;
-}
+  ::v-deep .time-form .el-table tr {
+    background-color: #ffffff;
+  }
 </style>