Forráskód Böngészése

Merge branch 'dev' into 'purchaseDev'

Dev

See merge request new-business/drp-web!66
黄梓星 2 éve
szülő
commit
3b82a0734c
2 módosított fájl, 456 hozzáadás és 387 törlés
  1. 453 384
      src/views/material/changeApply/add.vue
  2. 3 3
      src/views/material/requisition/add.vue

+ 453 - 384
src/views/material/changeApply/add.vue

@@ -98,6 +98,21 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
+              <el-form-item label="业务线" prop="remark">
+                <el-input :disabled="disable" v-model="basicForm.businessLine"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="生产许可证/经营许可证/备案号" prop="remark">
+                <el-input :disabled="disable" v-model="basicForm.productionPermit"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="DI码" prop="remark">
+                <el-input :disabled="disable" v-model="basicForm.diCode"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
               <el-form-item label="备注" prop="remark">
                 <el-input :disabled="disable" v-model="basicForm.remark"></el-input>
               </el-form-item>
@@ -136,7 +151,7 @@
               <el-form-item label="药品" prop="drug">
                 <el-select v-model="basicForm2.drug" placeholder="请选择" clearable :disabled="disable || isControl">
                   <el-option v-for="dict in dict.type.sys_medicine" :key="dict.value" :label="dict.label"
-                    :value="dict.value" />
+                             :value="dict.value"/>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -148,9 +163,9 @@
             <el-col :span="8">
               <el-form-item label="医疗器械" prop="medicalDevices">
                 <el-select v-model="basicForm2.medicalDevices" placeholder="请选择" clearable
-                  :disabled="disable || isControl">
+                           :disabled="disable || isControl">
                   <el-option v-for="dict in dict.type.medical_instruments" :key="dict.value" :label="dict.label"
-                    :value="dict.value" />
+                             :value="dict.value"/>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -159,9 +174,18 @@
             <el-col :span="8">
               <el-form-item label="养护类型" prop="maintenanceType">
                 <el-select v-model="basicForm2.maintenanceType" placeholder="请选择" clearable
-                  :disabled="disable || isControl">
+                           :disabled="disable || isControl">
                   <el-option v-for="dict in dict.type.curing_type" :key="dict.value" :label="dict.label"
-                    :value="dict.value" />
+                             :value="dict.value"/>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="剂型" prop="dosageFrom"
+                            :rules="{ required: !isControl, message: '请选择剂型', trigger: 'change' }">
+                <el-select ref="doses" v-model="basicForm2.dosageFrom" placeholder="请选择" clearable
+                           :disabled="disable || isControl" @focus="chooseDose">
+                  <el-option v-for="item in doseOptions" :key="item.id" :label="item.name" :value="item.id"/>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -177,7 +201,7 @@
         </el-row> -->
         <!-- <el-row>
           <el-col :span="12">
-            <el-table 
+            <el-table
             :data="basicForm2.medicineTypeChanges"
             class="request-table"
             @selection-change="handleSelectionChange"
@@ -205,9 +229,9 @@
 
       <el-tab-pane label="修改记录" name="third">
         <el-table :data="basicForm.changeRecords" class="request-table">
-          <el-table-column label="字段名称" align="center" prop="pageCondtion" />
-          <el-table-column label="变更前" align="center" prop="beforeChangeValue" />
-          <el-table-column label="变更后" align="center" prop="afterChangeValue" />
+          <el-table-column label="字段名称" align="center" prop="pageCondtion"/>
+          <el-table-column label="变更前" align="center" prop="beforeChangeValue"/>
+          <el-table-column label="变更后" align="center" prop="afterChangeValue"/>
         </el-table>
       </el-tab-pane>
 
@@ -275,7 +299,8 @@
     <div class="btn_group">
       <el-col :span="1.5">
         <el-button type="primary" size="small" plain @click="save"
-          v-if="pageStu == 'add' || pageStu == 'edit'">保存</el-button>
+                   v-if="pageStu == 'add' || pageStu == 'edit'">保存
+        </el-button>
       </el-col>
       <el-col :span="1.5" style="margin: 0 10px;">
         <el-button type="primary" size="small" plain @click="submit" v-if="pageStu == 'edit'">提交</el-button>
@@ -285,404 +310,448 @@
       </el-col>
     </div>
 
-    <popDialog ref="contractSelect" @doSubmit="selectionsToInput" :selectData="selectData" :single="true" />
+    <popDialog ref="contractSelect" @doSubmit="selectionsToInput" :selectData="selectData" :single="true"/>
+
+    <factory ref="factory" @doSubmit="acceptFactory" :selectData="selectData2" :single="true"/>
 
-    <factory ref="factory" @doSubmit="acceptFactory" :selectData="selectData2" :single="true" />
+    <fourClass ref="fourClass" @doSubmit="acceptFourClass" :selectData="selectData3" :single="true"/>
 
-    <fourClass ref="fourClass" @doSubmit="acceptFourClass" :selectData="selectData3" :single="true" />
+    <dose ref="dose" @doSubmit="acceptDose" :selectData="selectData9" :single="true"/>
   </div>
 </template>
 
 <script>
-import popDialog from '@/components/PopDialog/index.vue'
-import factory from '@/components/PopDialog/productFactory.vue'
-import { addChangeList, getMaterialDetails, getChangeDetails, editChangeList } from '@/api/changeApply/basic'
-// 生产厂商/代理人调用用于回显
-import { getProductFactory } from '@/api/changeApply/basic'
-// 四级分类
-import fourClass from '@/components/PopDialog/fourClass.vue'
-// 调用物料分类详情接口用于数据回显
-import { getDetail } from '@/api/classify/basic';
-export default {
-  name: 'applyAdd',
-  dicts: ['sys_storage_condition', 'sys_conditions_carriage', 'sys_medicine', 'medical_instruments', 'curing_type'],
-  components: {
-    popDialog,
-    factory,
-    fourClass
-  },
-  props: ['pageStu', 'row', 'disable'],
-  model: {
-    prop: 'isList',
-    event: 'jugislist'
-  },
-  data() {
-    return {
-      factoryOptions: [],
-      tabValue: 'first',
-      isControl: true,
-      basicForm: {
-        code: '',
-        orgId: '德荣集团',
-        // 物料id
-        materialId: '',
-        materialCode: '',
-        materialName: '',
-        materialClassifyId: '',
-        medicineMaterial: '2',
-        oneClass: '',
-        twoClass: '',
-        threeClass: '',
-        fourClass: '',
-        specification: '',
-        model: '',
-        factory: '',
-        registrant: '',
-        storageConditions: '',
-        transportCondition: '',
-        leadTime: '',
-        remark: '',
-        // 修改记录
-        changeRecords: [],
-        // 单据信息字段
-        createBy: '',
-        applicationTime: '',
-        createTime: '',
-        updateBy: '',
-        updateTime: '',
-        approver: '',
-        approvalTime: '',
-        status: ''
-      },
-      options: [{
-        value: '0',
-        label: '是'
-      }, {
-        value: '2',
-        label: '否'
-      }],
-      statusOptions: [{
-        value: '0', label: '未提交'
-      }, {
-        value: '1', label: '审批中'
-      }, {
-        value: '2', label: '已完成'
-      }, {
-        value: '3', label: '已驳回'
-      },],
-      basicRules: {
-        materialCode: [{ required: true, message: '请选择物料编码', trigger: 'blur' }],
-        materialName: [{ required: true, message: '请填写物料名称', trigger: 'blur' }],
-        specification: [{ required: true, message: '请填写规格', trigger: 'blur' }],
-        materialClassifyId: [{ required: true, message: '请选择物料分类', trigger: 'blur' }],
-        // model: [{required: true, message: '请填写型号', trigger: 'blur'}],
-        factory: [{ required: true, message: '请选择生产厂家/代理人', trigger: 'blur' }],
-        registrant: [{ required: true, message: '请填写注册人/上市许可持有人', trigger: 'blur' }],
-        storageConditions: [{ required: true, message: '请选择存储条件', trigger: 'blur' }],
-        // transportCondition: [{required: true, message: '请选择运输条件', trigger: 'blur'}],
-        leadTime: [{ required: true, message: '请填写交货周期', trigger: 'blur' }],
-      },
-      basicForm2: {
-        drug: '',
-        registrationNo: '',
-        medicalDevices: '',
-        maintenanceType: '',
-        // 医药属性子表
-        // medicineTypeChanges:[
-        // ],
-      },
-      // tableList: [],
-      // 子表选中
-      ids: [],
-      // 弹窗
-      name: '',
-      selectData: [],
-      selectData2: [],
-      selectData3: []
-    }
-  },
-  // watch: {
-  //   value: {
-  //     handler (newVal) {
-  //       this.selectData = []
-  //       if (newVal) {
-  //         newVal.split(',').forEach((id) => { // 回显拿数据
-  //           this.contractService.queryById(id).then(({data}) => {
-  //             if (data && data.id !== '') {
-  //               this.selectData.push(data)
-  //             }
-  //           })
-  //         })
-  //       }
-  //     },
-  //     immediate: true,
-  //     deep: false
-  //   },
-  //   selectData: {
-  //     handler (newVal) {
-  //       this.name = newVal.map(contract => contract.contractName).join(',')
-  //     },
-  //     immediate: false,
-  //     deep: false
-  //   }
-  // },
-  mounted() {
-    this.$nextTick(() => {
-      // console.log('页面状态',this.pageStu)
-      if (this.pageStu == 'check') {
-        // alert('详情页面:')
-        console.log('页面状态', this.pageStu)
-        console.log('数据', this.row)
-        this.getDetails(this.row)
-        // 生产厂家代理人用于回显
-        if (this.row.factory) {
-          this.getFactoryDetails(this.row.factory)
-        }
-      } else if (this.pageStu == 'edit') {
-        // alert('修改页面')
-        console.log('页面状态', this.pageStu)
-        console.log('数据', this.row)
-        this.getDetails(this.row)
-        // 控制医药属性是否能够填写
-        if (this.row.medicineMaterial == '0') {
-          this.isControl = false
-        } else {
-          this.isControl = true
-        }
-        // 生产厂家代理人用于回显
-        if (this.row.factory) {
-          this.getFactoryDetails(this.row.factory)
-        }
-      } else if (this.pageStu == 'add') {
-        // alert('新增页面')
-        console.log('页面状态', this.pageStu)
-      }
-    })
-  },
-  methods: {
-    // 生产厂家/代理人用于回显
-    getFactoryDetails(id) {
-      getProductFactory({ id: id }).then(res => {
-        if (res.code === 200) {
-          this.factoryOptions = res.data.tableBody
-        }
-      })
-    },
-    // 选择是否医药物料时控制医药属性
-    controlMedic(val) {
-      console.log('val', val)
-      if (val == '0') {
-        this.isControl = false
-      } else {
-        this.basicForm2.drug = ''
-        this.basicForm2.registrationNo = ''
-        this.basicForm2.medicalDevices = ''
-        this.basicForm2.maintenanceType = ''
-        this.isControl = true
-      }
-    },
-    handleClick(tab, event) {
-      console.log(tab, event);
-      console.log('页面状态', this.pageStu)
-    },
-    // 如果是详情进入,则调用详情接口
-    getDetails(row) {
-      getChangeDetails(row.id).then(res => {
-        if (res.code === 200) {
-          this.basicForm = res.data
-          if (res.data.medicineChange) {
-            this.basicForm2 = res.data.medicineChange
-          }
-        }
-      })
-    },
-    save() {
-      // alert('保存传status:0')
-      let sparams = { ...this.basicForm, ...{ status: 0 } }
-      sparams.medicineChange = this.basicForm2
-      console.log('保存参数', sparams)
-      this.$refs['basic'].validate((valid) => {
-        if (valid) {
-          addChangeList(sparams).then(res => {
-            if (res.code === 200) {
-              this.$message({
-                message: res.msg,
-                type: 'success'
-              });
-              this.back()
-            }
-          })
-        }
-      })
+  import popDialog from '@/components/PopDialog/index.vue'
+  import factory from '@/components/PopDialog/productFactory.vue'
+  import {addChangeList, getMaterialDetails, getChangeDetails, editChangeList} from '@/api/changeApply/basic'
+  import {getDose} from '@/api/requisition/basic'
+  // 生产厂商/代理人调用用于回显
+  import {getProductFactory} from '@/api/changeApply/basic'
+  // 四级分类
+  import fourClass from '@/components/PopDialog/fourClass.vue'
+  import dose from '@/components/PopDialog/dose.vue'
+  // 调用物料分类详情接口用于数据回显
+  import {getDetail} from '@/api/classify/basic';
+
+  export default {
+    name: 'applyAdd',
+    dicts: ['sys_storage_condition', 'sys_conditions_carriage', 'sys_medicine', 'medical_instruments', 'curing_type'],
+    components: {
+      popDialog,
+      factory,
+      dose,
+      fourClass
     },
-    submit() {
-      // alert('提交传status:1')
-      let sparams = { ...this.basicForm, ...{ status: 1 } }
-      sparams.medicineChange = this.basicForm2
-      console.log('提交参数', sparams)
-      this.$refs['basic'].validate((valid) => {
-        if (valid) {
-          editChangeList(sparams).then(res => {
-            if (res.code === 200) {
-              this.$message({
-                message: res.msg,
-                type: 'success'
-              });
-              this.back()
-            }
-          })
-        }
-      })
+    props: ['pageStu', 'row', 'disable'],
+    model: {
+      prop: 'isList',
+      event: 'jugislist'
     },
-    back() {
-      this.$emit('jugislist', true)
-      let queryParams = {
-        pageNum: 1,
-        pageSize: 10
+    data() {
+      return {
+        factoryOptions: [],
+        // 剂型
+        doseOptions: [],
+        selectData9: [],
+        tabValue: 'first',
+        isControl: true,
+        basicForm: {
+          code: '',
+          orgId: '德荣集团',
+          // 物料id
+          materialId: '',
+          materialCode: '',
+          materialName: '',
+          materialClassifyId: '',
+          medicineMaterial: '2',
+          oneClass: '',
+          twoClass: '',
+          threeClass: '',
+          fourClass: '',
+          specification: '',
+          model: '',
+          factory: '',
+          registrant: '',
+          storageConditions: '',
+          transportCondition: '',
+          leadTime: '',
+          remark: '',
+          // 修改记录
+          changeRecords: [],
+          // 单据信息字段
+          createBy: '',
+          applicationTime: '',
+          createTime: '',
+          updateBy: '',
+          updateTime: '',
+          approver: '',
+          approvalTime: '',
+          status: '',
+          // 业务线
+          businessLine: '',
+          // 生产许可证/经营许可证/备案号
+          productionPermit: '',
+          // di码
+          diCode: ''
+        },
+        options: [{
+          value: '0',
+          label: '是'
+        }, {
+          value: '2',
+          label: '否'
+        }],
+        statusOptions: [{
+          value: '0', label: '未提交'
+        }, {
+          value: '1', label: '审批中'
+        }, {
+          value: '2', label: '已完成'
+        }, {
+          value: '3', label: '已驳回'
+        },],
+        basicRules: {
+          materialCode: [{required: true, message: '请选择物料编码', trigger: 'blur'}],
+          materialName: [{required: true, message: '请填写物料名称', trigger: 'blur'}],
+          specification: [{required: true, message: '请填写规格', trigger: 'blur'}],
+          materialClassifyId: [{required: true, message: '请选择物料分类', trigger: 'blur'}],
+          // model: [{required: true, message: '请填写型号', trigger: 'blur'}],
+          factory: [{required: true, message: '请选择生产厂家/代理人', trigger: 'blur'}],
+          registrant: [{required: true, message: '请填写注册人/上市许可持有人', trigger: 'blur'}],
+          storageConditions: [{required: true, message: '请选择存储条件', trigger: 'blur'}],
+          // transportCondition: [{required: true, message: '请选择运输条件', trigger: 'blur'}],
+          leadTime: [{required: true, message: '请填写交货周期', trigger: 'blur'}],
+        },
+        basicForm2: {
+          drug: '',
+          registrationNo: '',
+          medicalDevices: '',
+          maintenanceType: '',
+        // 剂型
+        dosageFrom: ''
+          // 医药属性子表
+          // medicineTypeChanges:[
+          // ],
+        },
+        // tableList: [],
+        // 子表选中
+        ids: [],
+        // 弹窗
+        name: '',
+        selectData: [],
+        selectData2: [],
+        selectData3: []
       }
-      this.$emit('refresh', queryParams)
     },
-    // 子表增删行
-    // handleSelectionChange(val) {
-    //   this.ids = val
-    //   console.log('this.ids',this.ids)
-    // },
-    // addLine() {
-    //   //添加行数
-    //   let newValue = {
-    //     sort:'',
-    //     medicineCode: '',
-    //     medicineName: '',
-    //   };
-    //   this.basicForm2.medicineTypeChanges.push(newValue);
-    // },
-    // handleDelete(index) {
-    //   if(this.ids.length == 0) {
-    //     this.$message({
-    //       message: '请选择删除条目',
-    //       type: 'warning'
-    //     });
-    //   } else {
-    //     // console.log('index',index)
-    //     // this.basicForm2.medicineTypeChanges.splice(index, 1);
-    //     this.basicForm2.medicineTypeChanges = this.basicForm2.medicineTypeChanges.filter(item =>
-    //      !this.ids.some(ele =>
-    //      ele.sort == item.sort))
+    // watch: {
+    //   value: {
+    //     handler (newVal) {
+    //       this.selectData = []
+    //       if (newVal) {
+    //         newVal.split(',').forEach((id) => { // 回显拿数据
+    //           this.contractService.queryById(id).then(({data}) => {
+    //             if (data && data.id !== '') {
+    //               this.selectData.push(data)
+    //             }
+    //           })
+    //         })
+    //       }
+    //     },
+    //     immediate: true,
+    //     deep: false
+    //   },
+    //   selectData: {
+    //     handler (newVal) {
+    //       this.name = newVal.map(contract => contract.contractName).join(',')
+    //     },
+    //     immediate: false,
+    //     deep: false
     //   }
     // },
-    // testsave() {
-    //   console.log('暂存表格:', this.basicForm2.medicineTypeChanges)
-    //   console.log('暂存表单1', this.basicForm)
-    //   let params = {...this.basicForm, ...this.basicForm2}
-    //   console.log('暂存总表单', params)
-    // },
-    // 设置选中
-    selectionsToInput(selections) {
-      console.log('父组件拿到的:', selections)
-      this.selectData = selections
-      this.$emit('getInfo', this.selectData)
-      getMaterialDetails(selections[0].id).then(res => {
-        console.log('res', res)
-        if (res.code === 200) {
-          let data = res.data.data
-          // 物料id
-          this.basicForm.materialId = data.id
-          // 物料分类Id
-          this.basicForm.materialClassifyId = data.classifyId
-          this.basicForm.materialCode = data.code
-          this.basicForm.materialName = data.name
-          this.basicForm.medicineMaterial = data.isMedicine
-          this.basicForm.oneClass = data.oneClass
-          this.basicForm.twoClass = data.twoClass
-          this.basicForm.threeClass = data.threeClass
-          this.basicForm.fourClass = data.fourClass
-          this.basicForm.specification = data.specification
-          this.basicForm.model = data.model
-          this.basicForm.factory = data.manufacturerId
-          this.basicForm.registrant = data.registrant
-          this.basicForm.storageConditions = data.storageCondition
-          this.basicForm.transportCondition = data.transportationCondition
-          this.basicForm.leadTime = data.deliveryPeriod
-          if (data.manufacturerId) {
-            this.getFactoryDetails(data.manufacturerId)
-          }
-          if (data.medcines.length !== 0) {
-            this.basicForm2.drug = data.medcines[0].isDrug
-            this.basicForm2.registrationNo = data.medcines[0].registrationNo
-            this.basicForm2.medicalDevices = data.medcines[0].medicalInstruments
-            this.basicForm2.maintenanceType = data.medcines[0].curingType
+    mounted() {
+      this.$nextTick(() => {
+        // console.log('页面状态',this.pageStu)
+        if (this.pageStu == 'check') {
+          // alert('详情页面:')
+          console.log('页面状态', this.pageStu)
+          console.log('数据', this.row)
+          this.getDetails(this.row)
+          // 生产厂家代理人用于回显
+          if (this.row.factory) {
+            this.getFactoryDetails(this.row.factory)
           }
+        } else if (this.pageStu == 'edit') {
+          // alert('修改页面')
+          console.log('页面状态', this.pageStu)
+          console.log('数据', this.row)
+          this.getDetails(this.row)
           // 控制医药属性是否能够填写
-          if (this.basicForm.medicineMaterial == '0') {
+          if (this.row.medicineMaterial == '0') {
             this.isControl = false
           } else {
             this.isControl = true
           }
+          // 生产厂家代理人用于回显
+          if (this.row.factory) {
+            this.getFactoryDetails(this.row.factory)
+          }
+        } else if (this.pageStu == 'add') {
+          // alert('新增页面')
+          console.log('页面状态', this.pageStu)
         }
       })
     },
-    // selectionsToInput2 (selections) {
-    //   console.log('选择的数据',selections)
-    //   this.basicForm.factory = selections[0].manufactureName
-    // },
-    // 显示列表
-    test01() {
-      console.log('测试点击')
-      this.$refs.contractSelect.init()
-    },
-    // test02() {
-    //   console.log('测试弹窗2');
-    //   this.$refs.contractSelect2.init()
-    // },
-    // 选择生产厂家/代理人
-    acceptFactory(selections) {
-      console.log('选择的数据', selections)
-      this.factoryOptions = selections
-      this.basicForm.factory = selections[0].id
-      this.getFactoryDetails(selections[0].id)
-    },
-    // 生产厂家/代理人显示列表
-    chooseFactory() {
-      this.$refs.factoryOrman.blur()
-      this.$refs.factory.init()
-    },
-    // 选择四级分类
-    acceptFourClass(selections) {
-      console.log('收到的四级分类', selections)
-      this.basicForm.materialClassifyId = selections.id
-      this.getTreeDetails(selections.id)
-    },
-    // 四级分类显示列表
-    chooseFourClass() {
-      this.$refs.fourClass.init()
-    },
-    // 选择四级分类后需要根据id再次查询一下123级分类
-    getTreeDetails(id) {
-      getDetail(id).then(res => {
-        if (res.code === 200) {
-          this.basicForm.oneClass = res.data.oneClass
-          this.basicForm.twoClass = res.data.twoClass
-          this.basicForm.threeClass = res.data.threeClass
-          this.basicForm.fourClass = res.data.fourClass
+    methods: {
+      // 剂型显示列表
+      chooseDose() {
+        this.$refs.doses.blur()
+        this.$refs.dose.init()
+      },
+      // 选择剂型-树形
+      acceptDose(selections) {
+        this.doseOptions.push(selections)
+        this.basicForm2.dosageFrom = selections.id
+        this.getDoseDetails(selections.id)
+      },
+      // 剂型回显
+      getDoseDetails(id) {
+        getDose({id: id}).then(res => {
+          console.log('剂型', res)
+          if (res.code === 200) {
+            this.doseOptions = res.data.tableBody
+          }
+        })
+      },
+      // 生产厂家/代理人用于回显
+      getFactoryDetails(id) {
+        getProductFactory({id: id}).then(res => {
+          if (res.code === 200) {
+            this.factoryOptions = res.data.tableBody
+          }
+        })
+      },
+      // 选择是否医药物料时控制医药属性
+      controlMedic(val) {
+        console.log('val', val)
+        if (val == '0') {
+          this.isControl = false
+          // 初始化剂型为其他
+          this.basicForm2.dosageFrom = '0001A11000000000BX7Z'
+          this.getDoseDetails(this.basicForm2.dosageFrom)
+        } else {
+          this.basicForm2.drug = ''
+          this.basicForm2.registrationNo = ''
+          this.basicForm2.medicalDevices = ''
+          this.basicForm2.maintenanceType = ''
+          this.isControl = true
         }
-      })
-    },
+      },
+      handleClick(tab, event) {
+        console.log(tab, event);
+        console.log('页面状态', this.pageStu)
+      },
+      // 如果是详情进入,则调用详情接口
+      getDetails(row) {
+        getChangeDetails(row.id).then(res => {
+          if (res.code === 200) {
+            this.basicForm = res.data
+            if (res.data.medicineChange) {
+              this.basicForm2 = res.data.medicineChange
+            }
+            // 剂型回显
+            if (res.data.medicineChange && res.data.medicineChange.dosageFrom) {
+              this.getDoseDetails(res.data.medicineChange.dosageFrom)
+            }
+          }
+        })
+      },
+      save() {
+        // alert('保存传status:0')
+        let sparams = {...this.basicForm, ...{status: 0}}
+        sparams.medicineChange = this.basicForm2
+        console.log('保存参数', sparams)
+        this.$refs['basic'].validate((valid) => {
+          if (valid) {
+            addChangeList(sparams).then(res => {
+              if (res.code === 200) {
+                this.$message({
+                  message: res.msg,
+                  type: 'success'
+                });
+                this.back()
+              }
+            })
+          }
+        })
+      },
+      submit() {
+        // alert('提交传status:1')
+        let sparams = {...this.basicForm, ...{status: 1}}
+        sparams.medicineChange = this.basicForm2
+        console.log('提交参数', sparams)
+        this.$refs['basic'].validate((valid) => {
+          if (valid) {
+            editChangeList(sparams).then(res => {
+              if (res.code === 200) {
+                this.$message({
+                  message: res.msg,
+                  type: 'success'
+                });
+                this.back()
+              }
+            })
+          }
+        })
+      },
+      back() {
+        this.$emit('jugislist', true)
+        let queryParams = {
+          pageNum: 1,
+          pageSize: 10
+        }
+        this.$emit('refresh', queryParams)
+      },
+      // 子表增删行
+      // handleSelectionChange(val) {
+      //   this.ids = val
+      //   console.log('this.ids',this.ids)
+      // },
+      // addLine() {
+      //   //添加行数
+      //   let newValue = {
+      //     sort:'',
+      //     medicineCode: '',
+      //     medicineName: '',
+      //   };
+      //   this.basicForm2.medicineTypeChanges.push(newValue);
+      // },
+      // handleDelete(index) {
+      //   if(this.ids.length == 0) {
+      //     this.$message({
+      //       message: '请选择删除条目',
+      //       type: 'warning'
+      //     });
+      //   } else {
+      //     // console.log('index',index)
+      //     // this.basicForm2.medicineTypeChanges.splice(index, 1);
+      //     this.basicForm2.medicineTypeChanges = this.basicForm2.medicineTypeChanges.filter(item =>
+      //      !this.ids.some(ele =>
+      //      ele.sort == item.sort))
+      //   }
+      // },
+      // testsave() {
+      //   console.log('暂存表格:', this.basicForm2.medicineTypeChanges)
+      //   console.log('暂存表单1', this.basicForm)
+      //   let params = {...this.basicForm, ...this.basicForm2}
+      //   console.log('暂存总表单', params)
+      // },
+      // 设置选中
+      selectionsToInput(selections) {
+        console.log('父组件拿到的:', selections)
+        this.selectData = selections
+        this.$emit('getInfo', this.selectData)
+        getMaterialDetails(selections[0].id).then(res => {
+          console.log('res', res)
+          if (res.code === 200) {
+            let data = res.data.data
+            // 物料id
+            this.basicForm.materialId = data.id
+            // 物料分类Id
+            this.basicForm.materialClassifyId = data.classifyId
+            this.basicForm.materialCode = data.code
+            this.basicForm.materialName = data.name
+            this.basicForm.medicineMaterial = data.isMedicine
+            this.basicForm.oneClass = data.oneClass
+            this.basicForm.twoClass = data.twoClass
+            this.basicForm.threeClass = data.threeClass
+            this.basicForm.fourClass = data.fourClass
+            this.basicForm.specification = data.specification
+            this.basicForm.model = data.model
+            this.basicForm.factory = data.manufacturerId
+            this.basicForm.registrant = data.registrant
+            this.basicForm.storageConditions = data.storageCondition
+            this.basicForm.transportCondition = data.transportationCondition
+            this.basicForm.leadTime = data.deliveryPeriod
+            if (data.manufacturerId) {
+              this.getFactoryDetails(data.manufacturerId)
+            }
+            if (data.medcines.length !== 0) {
+              this.basicForm2.drug = data.medcines[0].isDrug
+              this.basicForm2.registrationNo = data.medcines[0].registrationNo
+              this.basicForm2.medicalDevices = data.medcines[0].medicalInstruments
+              this.basicForm2.maintenanceType = data.medcines[0].curingType
+            }
+            // 控制医药属性是否能够填写
+            if (this.basicForm.medicineMaterial == '0') {
+              this.isControl = false
+            } else {
+              this.isControl = true
+            }
+          }
+        })
+      },
+      // selectionsToInput2 (selections) {
+      //   console.log('选择的数据',selections)
+      //   this.basicForm.factory = selections[0].manufactureName
+      // },
+      // 显示列表
+      test01() {
+        console.log('测试点击')
+        this.$refs.contractSelect.init()
+      },
+      // test02() {
+      //   console.log('测试弹窗2');
+      //   this.$refs.contractSelect2.init()
+      // },
+      // 选择生产厂家/代理人
+      acceptFactory(selections) {
+        console.log('选择的数据', selections)
+        this.factoryOptions = selections
+        this.basicForm.factory = selections[0].id
+        this.getFactoryDetails(selections[0].id)
+      },
+      // 生产厂家/代理人显示列表
+      chooseFactory() {
+        this.$refs.factoryOrman.blur()
+        this.$refs.factory.init()
+      },
+      // 选择四级分类
+      acceptFourClass(selections) {
+        console.log('收到的四级分类', selections)
+        this.basicForm.materialClassifyId = selections.id
+        this.getTreeDetails(selections.id)
+      },
+      // 四级分类显示列表
+      chooseFourClass() {
+        this.$refs.fourClass.init()
+      },
+      // 选择四级分类后需要根据id再次查询一下123级分类
+      getTreeDetails(id) {
+        getDetail(id).then(res => {
+          if (res.code === 200) {
+            this.basicForm.oneClass = res.data.oneClass
+            this.basicForm.twoClass = res.data.twoClass
+            this.basicForm.threeClass = res.data.threeClass
+            this.basicForm.fourClass = res.data.fourClass
+          }
+        })
+      },
+    }
   }
-}
 </script>
 
 <style lang="scss" scoped>
-.apply_add {
-  height: calc(100vh - 84px);
-  padding: 12px;
-  box-sizing: border-box;
-  overflow-y: auto;
-}
+  .apply_add {
+    height: calc(100vh - 84px);
+    padding: 12px;
+    box-sizing: border-box;
+    overflow-y: auto;
+  }
 
-.btn_group {
-  width: 100%;
-  margin: 20px 0;
-  display: flex;
-  justify-content: center;
-}
-</style>
+  .btn_group {
+    width: 100%;
+    margin: 20px 0;
+    display: flex;
+    justify-content: center;
+  }
+</style>

+ 3 - 3
src/views/material/requisition/add.vue

@@ -354,8 +354,8 @@
                 </el-form-item>
               </el-col>
               <el-col :span="8">
-                <el-form-item label="生产许可证/经营许可证/备案号" prop="productionPermit"
-                  :rules="{ required: !isControl, message: '请填写生产许可证/经营许可证/备案号', trigger: 'change' }">
+                <el-form-item label="生产许可证" prop="productionPermit"
+                  :rules="{ required: !isControl, message: '请填写生产许可证', trigger: 'change' }">
                   <el-input :disabled="disable" v-model="basicForm.productionPermit"></el-input>
                 </el-form-item>
               </el-col>
@@ -1536,4 +1536,4 @@ export default {
   display: flex;
   justify-content: center;
 }
-</style>
+</style>