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

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002201 2 лет назад
Родитель
Сommit
190d3b58f3

+ 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>

+ 1 - 1
src/views/purchase/DemandSummary/add.vue

@@ -185,7 +185,7 @@ export default {
         let param = this.ids.join()
         shutDownSummary(param).then(res => {
           if (res.code === 200) {
-            this.$modal.msgSuccess("取消成功");
+            this.$modal.msgSuccess("操作成功");
             this.getDetails(this.row)
           }
         })

+ 5 - 3
src/views/purchase/DemandSummary/index.vue

@@ -27,7 +27,7 @@
               @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '选择品类')"
               style="width: 200px"
               >
-              <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
+              <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.name" />
             </el-select>
             </el-form-item>
           </el-col>
@@ -506,6 +506,7 @@ export default {
     reset() {
       this.queryParams = {
         rowStatus: [],
+        buyer: '',
         buyerName: '',
         materialName: '',
         manufacturer: '',
@@ -640,7 +641,8 @@ export default {
     selectionsToInput(selection) {
       if (this.referCondition.title == '采购员') {
         this.personOptions = selection
-        this.queryParams.buyerName = selection[0].code
+        this.queryParams.buyer = selection[0].code
+        this.queryParams.buyerName = selection[0].name
       }
       if (this.referCondition.title == '业务部门') {
         this.deptOptions = selection
@@ -686,7 +688,7 @@ export default {
     },
     selectionsToInput2(selection) {
       this.classOptions.push(selection)
-      this.queryParams.materialName = selection.id
+      this.queryParams.materialName = selection.name
     },
     // 搜索区物料编码
     chooseMaterial() {

+ 1 - 1
src/views/purchase/PurchaseDemandList/add.vue

@@ -332,7 +332,7 @@
           <el-table-column label="收货仓库" align="center"  prop="deliveryWarehouseName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable readonly size="small" v-model="scope.row.deliveryWarehouseName">
+                <el-input clearable size="small" v-model="scope.row.deliveryWarehouseName" @focus="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库')">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库')"></el-button>
                 </el-input>
               </el-form-item>

+ 8 - 0
src/views/purchase/purchase-order/add/column.js

@@ -138,6 +138,7 @@ export const Columns = [
     title: "单据状态",
     inputType: "Select",
     referName: "sys_status", // 字典名
+    disabled: true,
   },
   { key: "freezeCause", title: "冻结原因", inputType: "Checkbox", },
   { key: "isBack", title: "退货", inputType: "Input", inputType: "Checkbox", },
@@ -321,6 +322,13 @@ export const Columns = [
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
   },
+  {
+    key: "sysFileRecordList",
+    title: "附件",
+    inputType: "Upload",
+    // fileType: ["pdf",""],
+    span: 24
+  },
 
 ];
 

+ 13 - 20
src/views/purchase/purchase-order/add/index.vue

@@ -15,12 +15,13 @@ NewTabColumns.forEach((column) => {
     ...column.tableColumns.filter((cColumn) => cColumn.inputType === "Select")
   );
 });
-console.log(SelectColumns, 'SelectColumns');
 
 export default {
   name: "AddPurchaseOrderDrawer",
   dicts: initDicts(SelectColumns),
-  components: {},
+  components: {
+    FileUploadCenter: () => import('../components/FileUploadCenter/index.vue'),
+  },
 
   data() {
     return {
@@ -87,7 +88,7 @@ export default {
       this.params.buyerName = nickName;
       this.params.puDept = deptId;
       this.params.puDeptName = deptName;
-      this.params.status = '0';
+      // this.params.status = '0';
 
     },
     setVisible(prop) {
@@ -195,16 +196,18 @@ export default {
     // 保存
     async handleSava() {
       // orderAddForm
-      console.log(this.params, "params");
+      console.log(this.params.sysFileRecordList, "params");
+
+      this.params.sysFileRecordList.forEach(item => {
+
+        item['']
+      })
       // this.$refs['orderAddForm'].validate(async (valid) => {
       //   if (valid) {
       try {
         const { code, msg } = await orderApi.create(this.params);
         if (code === 200) {
-          this.$notify.success({ title: msg });
           this.setVisible(false);
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
         //
@@ -234,10 +237,7 @@ export default {
               ...this.params,
             });
             if (code === 200) {
-              this.$notify.success({ title: msg });
               this.setVisible(false);
-            } else {
-              this.$notify.warning({ title: msg });
             }
           } catch (err) {
             this.$notify.error({ title: "error", message: err });
@@ -361,16 +361,9 @@ export default {
               <el-checkbox v-if="column.inputType === 'Checkbox'" v-model="params[column.key]" true-label="Y"
                 false-label="N">
               </el-checkbox>
-              <el-upload v-if="column.inputType === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled"
-                drag action="https://jsonplaceholder.typicode.com/posts/" multiple>
-                <i class="el-icon-upload"></i>
-                <div class="el-upload__text">
-                  将文件拖到此处,或<em>点击上传</em>
-                </div>
-                <div class="el-upload__tip" slot="tip">
-                  只能上传jpg/png文件,且不超过500kb
-                </div>
-              </el-upload>
+              <file-upload-center v-if="column.inputType === 'Upload'" v-model="params[column.key]"
+                :file-type="column.fileType">
+              </file-upload-center>
             </el-form-item>
           </el-col>
         </el-row>

+ 225 - 0
src/views/purchase/purchase-order/components/FileUploadCenter/index.vue

@@ -0,0 +1,225 @@
+<template>
+  <div class="upload-file">
+    <el-upload multiple :action="uploadFileUrl" :before-upload="handleBeforeUpload" :file-list="fileList" :limit="limit"
+      :on-error="handleUploadError" :on-exceed="handleExceed" :on-success="handleUploadSuccess" :show-file-list="false"
+      class="upload-file-uploader" ref="fileUpload">
+      <!-- 上传按钮 -->
+      <el-button size="mini" type="primary">选取文件</el-button>
+      <!-- 上传提示 -->
+      <div class="el-upload__tip" slot="tip" v-if="showTip">
+        请上传
+        <template v-if="fileSize">
+          大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
+        </template>
+        <template v-if="fileType">
+          格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
+        </template>
+        的文件
+      </div>
+    </el-upload>
+
+    <!-- 文件列表 -->
+    <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
+
+      <li :key="file.fileUrl" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
+        <el-link :href="`${baseUrl}${file.fileUrl}`" :underline="false" target="_blank">
+          <!-- <span class="el-icon-document"> {{ getFileName(file.name) }} </span> -->
+          <span class="el-icon-document"> {{ file.fileName }} </span>
+        </el-link>
+        <div class="ele-upload-list__item-content-action">
+          <el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
+        </div>
+      </li>
+    </transition-group>
+  </div>
+</template>
+
+<script>
+import { getToken } from "@/utils/auth";
+
+export default {
+  name: "FileUploadCenter",
+  props: {
+    // 值
+    value: [String, Object, Array],
+    // 数量限制
+    limit: {
+      type: Number,
+      default: 5,
+    },
+    // 大小限制(MB)
+    fileSize: {
+      type: Number,
+      default: 5,
+    },
+    // 文件类型, 例如['png', 'jpg', 'jpeg']
+    fileType: {
+      type: Array,
+      default: () => ["doc", "xls", "ppt", "txt", "pdf"],
+    },
+    // 是否显示提示
+    isShowTip: {
+      type: Boolean,
+      default: true,
+    },
+  },
+  data() {
+    console.log(process.env, 'process.env');
+    return {
+      number: 0,
+      uploadList: [],
+      baseUrl: '/file',
+      uploadFileUrl: '/file' + "/document-center/fastdfs/upload", // 上传文件服务器地址
+      fileList: [],
+    };
+  },
+  watch: {
+    value: {
+      handler(val) {
+        this.fileList = val ? val : [];
+
+        return this.fileList;
+        // if (val) {
+        //   let temp = 1;
+        //   // 首先将值转为数组
+        //   const list = Array.isArray(val) ? val : this.value.split(",");
+        //   console.log("list", list);
+        //   // 然后将数组转为对象数组
+        //   this.fileList = list.map((item) => {
+        //     if (typeof item === "string") {
+        //       item = { name: item, url: item };
+        //     }
+        //     item.uid = item.uid || new Date().getTime() + temp++;
+        //     return item;
+        //   });
+        // } else {
+        //   this.fileList = [];
+        //   return [];
+        // }
+      },
+      deep: true,
+      immediate: true,
+    },
+  },
+  computed: {
+    // 是否显示提示
+    showTip() {
+      return this.isShowTip && (this.fileType || this.fileSize);
+    },
+  },
+  methods: {
+    // 上传前校检格式和大小
+    handleBeforeUpload(file) {
+      // 校检文件类型
+      if (this.fileType) {
+        const fileName = file.name.split(".");
+        const fileExt = fileName[fileName.length - 1];
+        const isTypeOk = this.fileType.indexOf(fileExt) >= 0;
+        if (!isTypeOk) {
+          this.$modal.msgError(
+            `文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
+          );
+          return false;
+        }
+      }
+      // 校检文件大小
+      if (this.fileSize) {
+        const isLt = file.size / 1024 / 1024 < this.fileSize;
+        if (!isLt) {
+          this.$modal.msgError(`上传文件大小不能超过 ${this.fileSize} MB!`);
+          return false;
+        }
+      }
+      this.$modal.loading("正在上传文件,请稍候...");
+      this.number++;
+      return true;
+    },
+    // 文件个数超出
+    handleExceed() {
+      this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
+    },
+    // 上传失败
+    handleUploadError(err) {
+      this.$modal.msgError("上传文件失败,请重试");
+      this.$modal.closeLoading();
+    },
+    // 上传成功回调
+    handleUploadSuccess(res, file) {
+      if (res.code == 200) {
+        console.log(res, 'res--------------');
+        this.uploadList.push({
+          fileName: res.filename,
+          fileUrl: `/${res.group}/${res.filepath}`,
+          fileFastId: res.id,
+        });
+        this.uploadedSuccessfully();
+      } else {
+        this.number--;
+        this.$modal.closeLoading();
+        this.$modal.msgError(res.msg);
+        this.$refs.fileUpload.handleRemove(file);
+        this.uploadedSuccessfully();
+      }
+    },
+    // 删除文件
+    handleDelete(index) {
+      this.fileList.splice(index, 1);
+      // this.$emit("input", this.listToString(this.fileList));
+      this.$emit("input", this.fileList);
+    },
+    // 上传结束处理
+    uploadedSuccessfully() {
+      if (this.number > 0 && this.uploadList.length === this.number) {
+        this.fileList = this.fileList.concat(this.uploadList);
+        console.log(this.fileList, 'this.fileList***************');
+        this.uploadList = [];
+        this.number = 0;
+        // this.$emit("input", this.listToString(this.fileList));
+        this.$emit("input", this.fileList);
+        this.$modal.closeLoading();
+      }
+    },
+    // 获取文件名称
+    // getFileName(name) {
+    //   if (name.lastIndexOf("/") > -1) {
+    //     return name.slice(name.lastIndexOf("/") + 1);
+    //   } else {
+    //     return "";
+    //   }
+    // },
+    // 对象转成指定字符串分隔
+    // listToString(list, separator) {
+    //   let strs = "";
+    //   separator = separator || ",";
+    //   for (let i in list) {
+    //     strs += list[i].url + separator;
+    //   }
+    //   return strs != "" ? strs.substr(0, strs.length - 1) : "";
+    // },
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.upload-file-uploader {
+  margin-bottom: 5px;
+}
+
+.upload-file-list .el-upload-list__item {
+  border: 1px solid #e4e7ed;
+  line-height: 2;
+  margin-bottom: 10px;
+  position: relative;
+}
+
+.upload-file-list .ele-upload-list__item-content {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  color: inherit;
+}
+
+.ele-upload-list__item-content-action .el-link {
+  margin-right: 10px;
+}
+</style>

+ 7 - 19
src/views/purchase/purchase-order/edit/index.vue

@@ -19,7 +19,7 @@ export default {
   name: "EditPurchaseOrderDrawer",
   dicts: initDicts(SelectColumns),
   components: {
-
+    FileUploadCenter: () => import('../components/FileUploadCenter/index.vue'),
   },
   data() {
     return {
@@ -95,9 +95,6 @@ export default {
           this.params = { ...this.params, ...data };
           console.log(this.params, 'this.params----------123');
           this.handleIsForbidden(this.params.status);
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
         //
@@ -157,9 +154,6 @@ export default {
         )
         if (code === 200) {
           this.setVisible(false);
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
         //
@@ -287,16 +281,9 @@ export default {
               <el-checkbox v-if="column.inputType === 'Checkbox'" v-model="params[column.key]" :disabled="column.disabled"
                 true-label="Y" false-label="N">
               </el-checkbox>
-              <el-upload v-if="column.inputType === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled"
-                drag action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
-                <i class="el-icon-upload"></i>
-                <div class="el-upload__text">
-                  将文件拖到此处,或<em>点击上传</em>
-                </div>
-                <!-- <div class="el-upload__tip" slot="tip">
-                  只能上传jpg/png文件,且不超过500kb
-                </div> -->
-              </el-upload>
+              <file-upload-center v-if="column.inputType === 'Upload'" v-model="params[column.key]"
+                :file-type="column.fileType">
+              </file-upload-center>
             </el-form-item>
           </el-col>
         </el-row>
@@ -360,7 +347,7 @@ export default {
               编辑:自制:可删可增 -->
               <el-table-column fixed="right" label="操作" width="120">
                 <template slot-scope="scope">
-                  <el-button  v-if="params.source == '3'&& !handleIsRevise(params.status)" @click.native.prevent="
+                  <el-button v-if="params.source == '3' && !handleIsRevise(params.status)" @click.native.prevent="
                     delTableRow(params[tabName], scope.$index)
                     " type="text" size="small">
                     删行
@@ -371,7 +358,8 @@ export default {
           </el-tab-pane>
         </el-tabs>
         <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button v-if="params.source == '3'&& !handleIsRevise(params.status)" :size="size" @click="addTableRow(params[tabName])">增行</el-button>
+          <el-button v-if="params.source == '3' && !handleIsRevise(params.status)" :size="size"
+            @click="addTableRow(params[tabName])">增行</el-button>
         </el-row>
       </el-card>
     </el-form>

+ 18 - 24
src/views/purchase/purchase-order/index.vue

@@ -40,7 +40,6 @@ export default {
         puOrderExecuteList: [],
       },
       checkedList: [],
-      checkedTabList: [],
     };
   },
   computed: {
@@ -63,7 +62,6 @@ export default {
         if (code === 200) {
           this.page.total = total;
           this.tableData = rows;
-          this.$notify.success({ title: msg });
         }
       } catch (err) {
         //
@@ -73,9 +71,9 @@ export default {
     },
     handleSearchChange() {
       this.isSimpleSearch = !this.isSimpleSearch;
-      this.$notify.info({
-        title: this.isSimpleSearch ? "Simple Search" : "All Search",
-      });
+      // this.$notify.info({
+      //   title: this.isSimpleSearch ? "Simple Search" : "All Search",
+      // });
     },
     // 页大小变
     handleSizeChange(prop) {
@@ -146,7 +144,6 @@ export default {
           for (const key in this.tabTableDatas) {
             this.tabTableDatas[key] = data[key];
           }
-          this.$notify.success({ title: msg });
         }
       } catch (err) {
         //
@@ -190,18 +187,17 @@ export default {
     },
     // 判断“退回”按钮
     judgeIsAllSendBack() {
-
       if (this.checkedList.length == 1) {
 
         // 非手工、状态非审批通过  
-        if (this.checkedList[0].source != 3 && this.checkedList[0].status != 2) {
+        if (this.checkedList[0].source != 3 && (this.checkedList[0].status == 0 || this.checkedList[0].status == 3)) {
 
           return false
         }
       }
       return true;
     },
-    //  退回
+    //  整单退回
     handleAllSendBack() {
       let data = {
         id: this.checkedList[0].id,
@@ -211,7 +207,7 @@ export default {
       console.log(data);
       try {
         this.loading = true;
-        // let { code, msg } = orderApi.documentsReturn(data);
+        let { code, msg } = orderApi.documentsReturn(data);
 
       } catch (error) {
 
@@ -268,9 +264,6 @@ export default {
 
     },
 
-    handleTabSelect(selection, row) {
-      this.checkedTabList = selection; 
-    },
 
 
   },
@@ -311,22 +304,24 @@ export default {
     <el-row :gutter="24" style="padding: 0 20px">
       <!-- <el-col :span="6">123</el-col> -->
       <el-col :span="24" style="text-align: right;margin: 0 10px 0 0">
+
+        <!-- <el-button-group style="margin-left: 10px"> -->
+        <el-button size="mini" type="primary" plain @click="handleOpenAddDrawer"
+          v-hasPermi="['material:order:add']">新增</el-button>
+        <!-- </el-button-group> -->
+
         <el-button-group style="margin-left: 10px">
-          <el-button size="mini" type="danger" @click="handleOpenAddDrawer"
-            v-hasPermi="['material:order:add']">新增</el-button>
           <el-button size="mini" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
-
         </el-button-group>
 
-        <!-- <el-button-group style="margin-left: 10px">
-          <el-button size="mini" @click="handleAllSendBack" :key="checkedList.length"
-            :disabled="judgeIsAllSendBack()">整单退回</el-button>
-        </el-button-group> -->
+        <el-button-group style="margin-left: 10px" :key="checkedList.length + 1">
+          <el-button size="mini" @click="handleAllSendBack" :disabled="judgeIsAllSendBack()">整单退回</el-button>
+          <el-button size="mini" @click="handleAllClose" :disabled="judgeIsAllClose()">整单关闭</el-button>
+        </el-button-group>
 
         <el-button-group style="margin-left: 10px">
           <!-- <el-button size="mini">采购退货</el-button> -->
-          <el-button size="mini" @click="handleAllClose" :key="checkedList.length"
-            :disabled="judgeIsAllClose()">整单关闭</el-button>
+
           <!-- <el-button size="mini">附件管理</el-button>
           <el-button size="mini">单据追溯</el-button> -->
         </el-button-group>
@@ -373,9 +368,8 @@ export default {
     <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px">
       <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
 
-        <el-table :data="tabTableDatas[column.key]" style="width: 100%" highlight-current-row @select="handleTabSelect"
+        <el-table :data="tabTableDatas[column.key]" style="width: 100%" highlight-current-row
           :height="tabTableDatas[column.key].length ? 300 : 100">
-          <el-table-column type="selection" width="45"></el-table-column>
           <el-table-column type="index" width="50" label="序号"></el-table-column>
           <el-table-column v-for="(cColumn, cIndex)  in column.tableColumns" :key="cIndex" :prop="cColumn.key"
             :label="cColumn.title" :width="cColumn.width || 180"

+ 1 - 4
src/views/purchase/purchase-order/see/index.vue

@@ -53,10 +53,7 @@ export default {
         const { code, msg, data } = await orderApi.details(prop);
         if (code === 200) {
           this.params = data;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
-        }
+        } 
       } catch (err) {
         //
       } finally {

+ 26 - 15
src/views/purchase/transferOrder/add.vue

@@ -87,7 +87,7 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调出部门">
-              <el-select clearable size="small" v-model="basicForm.deliveryDept" :disabled="sonDisable" @focus="chooseRefer('DEPT_PARAM', true, '调出部门')" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.deliveryDept" :disabled="sonDisable" @focus="chooseRefer('DEPT_PARAM', true, '调出部门', basicForm.deliveryInventoryOrg)" style="width: 200px">
                 <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -158,7 +158,7 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调入仓库">
-              <el-select clearable size="small" v-model="basicForm.storageWarehouse" :disabled="sonDisable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库')" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.storageWarehouse" :disabled="sonDisable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库', basicForm.storageInventoryOrg, 'N', 'N')" style="width: 200px">
                 <el-option v-for="item in ruHouseOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -186,11 +186,12 @@
             </el-form-item>
         </el-col>
         <el-col :span="1.5">
-            <el-form-item label="是否已同步WMS">
-              <el-select clearable size="small" v-model="basicForm.isSendWms" :disabled="sonDisable" style="width: 200px">
-                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
-              </el-select>
-            </el-form-item>
+          <el-form-item label="单据状态">
+            <el-select disabled v-model="basicForm.status" size="small" style="width: 200px" clearable>
+              <el-option v-for="dict in dict.type.sys_status" :key="dict.value" :label="dict.label" :value="dict.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
         </el-col>
         <el-col :span="1.5">
             <el-form-item label="备注">
@@ -203,13 +204,20 @@
               />
             </el-form-item>
         </el-col>
-        <el-col :span="1.5">
-            <el-form-item label="单据状态">
-              <el-select disabled v-model="basicForm.status" size="small" style="width: 200px" clearable>
-                <el-option v-for="dict in dict.type.sys_status" :key="dict.value" :label="dict.label" :value="dict.value">
-                </el-option>
-              </el-select>
-            </el-form-item>
+      </el-row>
+
+      <el-row>
+        <el-col :span="20">
+          <el-form-item label="同步NC结果">
+              <el-input
+                v-model="basicForm.isSendWms"
+                type="textarea"
+                :rows="3"
+                size="small"
+                disabled
+                clearable
+              />
+          </el-form-item>
         </el-col>
       </el-row>
 
@@ -793,10 +801,13 @@ export default {
       console.log('删除行:', index)
       this.materialInfo.splice(index, 1)
     },
-    chooseRefer(type, isPage, title) {
+    chooseRefer(type, isPage, title, pkOrg, isDirectStore, gubFlag) {
       this.referCondition.type = type
       this.referCondition.isPage = isPage
       this.referCondition.title = title
+      this.referCondition.pkOrg = pkOrg
+      this.referCondition.isDirectStore = isDirectStore
+      this.referCondition.gubFlag = gubFlag
       this.$refs.refer.init(this.referCondition)
     },
     selectionsToInput(selection) {

+ 1 - 1
src/views/purchase/transferOrder/index.vue

@@ -110,7 +110,7 @@
           <el-table-column label="调入仓库" align="center" prop="storageWarehouseName" width="150px"/>
           <el-table-column label="物流项目组" align="center" prop="materialProject" width="150px"/>
           <el-table-column label="利润中心" align="center" prop="liacenterName" width="150px"/>
-          <el-table-column label="已同步WMS" align="center" prop="isSendWms" width="150px"/>
+          <!-- <el-table-column label="已同步WMS" align="center" prop="isSendWms" width="150px"/> -->
           <el-table-column label="备注" align="center" prop="remark" width="150px"/>
           <el-table-column label="单据状态" align="center" prop="status" width="150px"/>
           <el-table-column label="制单人" align="center" prop="createByName" width="150px"/>

+ 6 - 1
vue.config.js

@@ -45,7 +45,7 @@ module.exports = {
         // target: `http://172.16.13.152:8000/drp-admin`, //豪哥本地
         // target: `http://172.16.13.47:8000/drp-admin`, //石杨本地
         // target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
-        target: `http://172.16.13.77:8000/drp-admin`, //TQ本地
+        // target: `http://172.16.13.77:8000/drp-admin`, //TQ本地
         changeOrigin: true,
         pathRewrite: {
           ["^" + process.env.VUE_APP_BASE_API]: "",
@@ -56,6 +56,11 @@ module.exports = {
         changeOrigin: true,
         pathRewrite: { [`^/drp-file`]: "" },
       },
+      "/file": {
+        target: process.env.NODE_ENV == "development" ? `https://test-sy.derom.com` : `https://sy.derom.com`,
+        changeOrigin: true,
+        pathRewrite: { [`^/file`]: "" },
+      },
     },
     disableHostCheck: true,
   },