瀏覽代碼

新增委托

yuhan 1 年之前
父節點
當前提交
f0dc1695f8

+ 9 - 1
itdmWeb/src/views/module-iTDM/weituo/modules/ItdmWeituoInfoForm.vue

@@ -114,7 +114,14 @@ export default {
       // 触发表单验证
       this.weituomodel = JSON.parse(sessionStorage.getItem('data'))
       this.weituomodel.yangpins = JSON.parse(sessionStorage.getItem('yangpin'))
-      this.weituomodel.pinShiYans = JSON.parse(sessionStorage.getItem('yangpinkz'))
+      // this.weituomodel.pinShiYans = JSON.parse(sessionStorage.getItem('yangpinkz'))
+      // console.log(JSON.parse(sessionStorage.getItem('yangpinkz')))
+      var pinShiYans = JSON.parse(sessionStorage.getItem('yangpinkz'))
+      this.weituomodel.pinShiYans = pinShiYans.map(item => {
+        item.standardRequirement = item.standardRequirement.toString()
+        return item
+      })
+      
 
       that.confirmLoading = true
       let httpurl = ''
@@ -130,6 +137,7 @@ export default {
 
       }
 
+      console.log(this.weituomodel)
       httpAction(httpurl, this.weituomodel, method).then((res) => {
         if (res.success) {
           that.$message.success(res.message)

+ 4 - 1
itdmWeb/src/views/module-iTDM/weituo/modules/ItdmWeituoInfoModal.vue

@@ -69,9 +69,11 @@ import { postAction  } from '@api/manage'
       // 临时保存
       temporarySave () {
         var weituoInfo = {}
+        // console.log(this.$refs.realForm.model.id)
+        var weituoId = this.$refs.realForm.model.id
         switch (this.$refs.realForm.currentTab) {
           case 0:
-            console.log(this.$refs.realForm.$refs.data001.model)
+            // console.log(this.$refs.realForm.$refs.data001.model)
             weituoInfo = this.$refs.realForm.$refs.data001.model
             break;
           case 1:
@@ -89,6 +91,7 @@ import { postAction  } from '@api/manage'
           default:
             break;
         }
+        weituoInfo.id = weituoId ? weituoId : null
         console.log(weituoInfo)
         postAction('/weituo/itdmWeituoInfo/staging', weituoInfo ).then((res) => {
           if (res.success) {

+ 50 - 3
itdmWeb/src/views/module-iTDM/weituo/modules/step/Step3.vue

@@ -4,6 +4,7 @@
       :columns="columns"
       :dataSource="model.list"
       :pagination="false"
+      :customRow="clickThenCheck"
     >
 
 
@@ -23,6 +24,12 @@
         </a-form-model-item>
       </template>
 
+      <template slot="sampleModelSpecification" slot-scope="text, record,index">
+        <a-form-model-item :prop="'list.'+index+'.sampleModelSpecification'">
+          <a-input disabled v-model="record.sampleModelSpecification" />
+        </a-form-model-item>
+      </template>
+
       <template slot="testItems" slot-scope="text, record,index">
         <a-form-model-item :prop="'list.'+index+'.testItems'" :rules="validatorRules.testItems">
           <a-input :disabled="formDisabled" v-model="record.testItems" />
@@ -34,8 +41,16 @@
         <a-form-model-item :prop="'list.'+index+'.standardRequirement'" :rules="validatorRules.standardRequirement">
           <!-- <j-multi-select-tag :disabled="formDisabled" v-model="record.standardRequirement" :dropdownMatchSelectWidth="false" dictCode="itdm_weituo_yiju,name,name" /> -->
           <!-- 为了解决下拉框显示不全的问题,原来的没有对应参数配置 -->
-          <a-select :disabled="formDisabled" v-model="record.standardRequirement" allowClear :dropdownMatchSelectWidth="false" mode="multiple">
-            <a-select-option v-for="(item, index) in yijuLists" :key="index">
+          <a-select
+            :disabled="formDisabled"
+            v-model="record.standardRequirement"
+            allowClear
+            optionFilterProp="label"
+            :dropdownMatchSelectWidth="false"
+            @change="handleDescCate"
+            mode="multiple"
+          >
+            <a-select-option v-for="(item) in yijuLists" :key="item.name">
               {{ item.name }}
             </a-select-option>
           </a-select>
@@ -112,6 +127,8 @@ export default {
     return {
       yangpins: {},
       count: 1,
+      // 当前点击的是第几行
+      clickIndex: -1,
       model: {
         list: []
       },
@@ -138,6 +155,14 @@ export default {
           scopedSlots: { customRender: 'yangpinKeyId' }
         },
         {
+          title: '规格型号',
+          dataIndex: 'sampleModelSpecification',
+          key: 'sampleModelSpecification',
+          align: 'center',
+          width: '15%',
+          scopedSlots: { customRender: 'sampleModelSpecification' }
+        },
+        {
           title: '检测项目',
           dataIndex: 'testItems',
           key: 'testItems',
@@ -195,9 +220,12 @@ export default {
   },
   created() {
     this.getYijuLists()
+    console.log(JSON.parse(sessionStorage.getItem('yangpin')))
+    console.log(JSON.parse(sessionStorage.getItem('yangpinkz')))
     const data = JSON.parse(sessionStorage.getItem('yangpinkz'))
     if (data != null) {
       this.model.list=data
+
     }else{
       this.newMember()
     }
@@ -221,12 +249,30 @@ export default {
         this.yijuLists = res.result
       })
     },
+    // 获取当前点击行是哪儿一行
+    clickThenCheck(record, index){
+      return {
+        on: {
+          click: () => {
+            // console.log(record, index)
+            this.clickIndex = index
+          }
+        }
+      }
+    },
 
     // 获得选中项信息
     handleChange2(value,optipn) {
       console.log(777,value,optipn);
       const a = optipn.data.attrs.channel
       console.log(a)
+      this.model.list[this.clickIndex].sampleModelSpecification = a.sampleModelSpecification
+      console.log(this.model)
+    },
+
+    // 多选依据
+    handleDescCate(item) {
+      console.log(item)
     },
 
     newMember() {
@@ -234,7 +280,7 @@ export default {
         key: this.count + '',
         yangpinKeyId: '',
         testItems: '',
-        standardRequirement: '',
+        standardRequirement: [],
         judgementBasis: '',
         yijufile: '',
         beizhu: '',
@@ -267,6 +313,7 @@ export default {
     },
     submitForm() {
       sessionStorage.setItem('yangpinkz', JSON.stringify(this.model.list))
+      // sessionStorage.setItem('yangpin', JSON.stringify(this.model.list))
 
       this.$refs.form.validate(valid => {
         if (valid) {