Parcourir la source

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

002390 il y a 2 ans
Parent
commit
be221b979f

+ 8 - 0
src/api/business/purchase/contract.js

@@ -16,6 +16,14 @@ export function ADD(data) {
   });
 }
 
+export function EXPORT(data) {
+  return request({
+    url: "/pu/contract/export",
+    method: "POST",
+    data: data,
+  });
+}
+
 export function EDIT(data) {
   return request({
     url: "/pu/contract/edit",

+ 1 - 0
src/components/computed-input/index.vue

@@ -60,6 +60,7 @@ export default {
         this.$emit("input", computed(newProp));
       },
       deep: true,
+      immediate: true,
     },
   },
   methods: {},

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

+ 4 - 5
src/views/material/requisition/add.vue

@@ -152,8 +152,7 @@
             <el-row :gutter="20">
               <el-col :span="8">
                 <el-form-item label="序列号管理" prop="serialNoManager">
-                  <el-select v-model="basicForm.serialNoManager" placeholder="序列号管理" @change="stockControl"
-                    :disabled="disable">
+                  <el-select v-model="basicForm.serialNoManager" placeholder="序列号管理" :disabled="disable || isStock">
                     <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
                   </el-select>
                 </el-form-item>
@@ -355,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>
@@ -1537,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() {

+ 25 - 11
src/views/purchase/PurchaseDemandList/add.vue

@@ -16,7 +16,7 @@
 
         <el-col :span="1.5">
             <el-form-item label="组织">
-              <el-select size="small" v-model="basicForm.org" :disabled="sonDisable" @focus="chooseOrg('ORG_PARAM', true, '选择组织')" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.org" :disabled="sonDisable" @focus="chooseOrg('ORG_PARAM', true, '选择组织')" style="width: 200px">
                 <el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -42,7 +42,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="需求客户">
-              <el-select size="small" v-model="basicForm.customer" :disabled="sonDisable" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.customer" :disabled="sonDisable" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
                 <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -62,7 +62,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="需求人员">
-                <el-select size="small" v-model="basicForm.demandPersonal" :disabled="sonDisable" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
+                <el-select clearable size="small" v-model="basicForm.demandPersonal" :disabled="sonDisable" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
                   <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
                 </el-select>
             </el-form-item>
@@ -70,7 +70,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="需求部门">
-              <el-select v-model="basicForm.demandDept" size="small" :disabled="sonDisable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
+              <el-select clearable v-model="basicForm.demandDept" size="small" :disabled="sonDisable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
                 <el-option
                   v-for="item in deptOptions"
                   :key="item.id"
@@ -86,6 +86,7 @@
               <el-date-picker
                 v-model="basicForm.demandDate"
                 :disabled="sonDisable"
+                clearable
                 type="date"
                 value-format="yyyy-MM-dd"
                 size="small"
@@ -106,7 +107,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="业务类型">
-              <el-select v-model="basicForm.billType" :disabled="sonDisable" size="small" style="width: 200px">
+              <el-select clearable v-model="basicForm.billType" @change="changeBillType" :disabled="sonDisable" size="small" style="width: 200px">
                 <el-option v-for=" dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
@@ -115,7 +116,7 @@
 
           <el-col :span="1.5">
             <el-form-item label="是否客户指定">
-              <el-select v-model="basicForm.isSpeical" :disabled="sonDisable" size="small" style="width: 200px">
+              <el-select clearable v-model="basicForm.isSpeical" :disabled="sonDisable" size="small" style="width: 200px">
                 <el-option v-for=" item in options" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
@@ -288,7 +289,7 @@
               <el-form-item class="hang">
                 <el-switch
                   v-model="scope.row.isReplenishment"
-                  :disabled="sonDisable"
+                  disabled
                   active-value="Y"
                   inactive-value="N"
                   active-color="#13ce66"
@@ -331,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>
@@ -354,7 +355,7 @@
               <el-form-item class="hang">
                 <el-switch
                   v-model="scope.row.isUrgency"
-                  :disabled="sonDisable"
+                  disabled
                   active-value="Y"
                   inactive-value="N"
                   active-color="#13ce66"
@@ -556,6 +557,19 @@ export default {
     }
   },
   methods: {
+    // 更改业务类型调整明细行内补单或紧急标识
+    changeBillType() {
+      if (this.basicForm.billType == 'BDXQ' && this.basicForm.puDemandItemList.length != 0) {
+        this.basicForm.puDemandItemList.forEach(item => {item.isReplenishment = 'Y'})
+      } else {
+        this.basicForm.puDemandItemList.forEach(item => { item.isReplenishment = 'N' })
+      }
+      if (this.basicForm.billType == 'JJXQ' && this.basicForm.puDemandItemList.length != 0) {
+        this.basicForm.puDemandItemList.forEach(item => {item.isUrgency = 'Y'})
+      } else {
+        this.basicForm.puDemandItemList.forEach(item => { item.isUrgency = 'N' })
+      }
+    },
     hangStatus(row) {
       switch (row.status) {
         case '0':
@@ -677,8 +691,8 @@ export default {
         demandPeriod: null,
         forecastClassify: null,
         deliveryDate: null,
-        isUrgency: 'N',
-        isReplenishment: 'N',
+        isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
+        isReplenishment: this.basicForm.billType == 'BDXQ'? 'Y': 'N',
         isBatchLock: 'N',
         remark: null,
         puRemark: null,

+ 0 - 514
src/views/purchase/apply/add/column.js

@@ -1,514 +0,0 @@
-export const Columns = [
-  {
-    key: "puOrgName",
-    title: "采购组织",
-    type: "InputDialog",
-    config: {
-      componentName: "ORG_PARAM",
-      dataMapping: {
-        puOrg: "code",
-        puOrgName: "name",
-      },
-    },
-    require: true,
-  },
-  { key: "code", title: "合同编码", type: "Input" },
-  {
-    key: "lastPuMoney",
-    title: "上年度采购额",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "buyerName",
-    title: "采购员",
-    type: "InputDialog",
-    config: {
-      componentName: "ORG_PARAM",
-      dataMapping: {
-        buyer: "userId",
-        buyerName: "userName",
-        puDept: "deptId",
-        puDeptName: "deptName",
-      },
-    },
-    require: true,
-  },
-  {
-    key: "supplierName",
-    title: "供应商",
-    type: "InputDialog",
-    config: {
-      componentName: "SUPPLIER_PARAM",
-      dataMapping: {
-        supplier: "code",
-        supplierName: "name",
-      },
-    },
-    require: true,
-  },
-  {
-    key: "contractType",
-    title: "合同类型",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_contract_type",
-    },
-  },
-  {
-    key: "puMoneyYear",
-    title: "本年度采购额",
-    type: "InputNumber",
-    require: true,
-  },
-  {
-    key: "puDeptName",
-    title: "采购部门",
-    type: "InputDialog",
-    config: {
-      componentName: "DEPT_PARAM",
-      dataMapping: {
-        puDept: "code",
-        puDeptName: "name",
-      },
-    },
-    require: true,
-  },
-  {
-    key: "supplierTier",
-    title: "供应商层级",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_supplier_tier",
-    },
-  },
-  { key: "contractName", title: "合同名称", type: "Input", require: true },
-  {
-    key: "grossRateAverage",
-    title: "平均毛利率",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "approveFlow",
-    title: "审批流程",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_approve_flow",
-    },
-  },
-  {
-    key: "consumableClass",
-    title: "耗材类别",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_consumable_class",
-    },
-  },
-  {
-    key: "effectiveDate",
-    title: "合同生效日期",
-    type: "DatePicker",
-    require: true,
-  },
-  {
-    key: "brandGrossRate",
-    title: "同类品牌及毛利率",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "contractFormat",
-    title: "合同格式",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "productName",
-    title: "产品类别&名称",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "endDate",
-    title: "合同终止日期",
-    type: "DatePicker",
-    require: true,
-  },
-  {
-    key: "invoiceTax",
-    title: "发票税率",
-    type: "InputDialog",
-    config: {
-      componentName: "ORG_PARAM",
-      dataMapping: {
-        invoiceTax: "mattaxesname",
-      },
-    },
-    require: true,
-  },
-  {
-    key: "emergencyDegree",
-    title: "紧急程度",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_emergency_degree",
-    },
-  },
-  { key: "project", title: "项目医院", type: "Input", require: true },
-  {
-    key: "signDate",
-    title: "合同签订日期",
-    type: "DatePicker",
-    require: true,
-  },
-  {
-    key: "deliveryType",
-    title: "交货方式",
-    type: "Select",
-    config: {
-      optionsName: "purchase_contract_delivery_type",
-    },
-  },
-  {
-    key: "source",
-    title: "合同来源",
-    type: "Input",
-    value: "自制",
-    disabled: true,
-  },
-  {
-    key: "contractPartycName",
-    title: "合同丙方",
-    type: "InputDialog",
-    config: {
-      componentName: "SUPPLIER_PARAM",
-      dataMapping: {
-        contractPartyc: "code",
-        contractPartycName: "name",
-      },
-    },
-  },
-  {
-    key: "guaranteePeriodEnd",
-    title: "质保期限",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "freightMethods",
-    title: "运费承担方式",
-    type: "Select",
-    config: {
-      optionsName: "purchase_contract_freight_methods",
-    },
-  },
-  {
-    key: "signDate",
-    title: "合同创建时间",
-    type: "DatePicker",
-    disabled: true,
-  },
-  {
-    key: "isTarget",
-    title: "是否有指标",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_is_target",
-    },
-  },
-  {
-    key: "contractTarget",
-    title: "合同指标",
-    type: "Input",
-    require: true,
-    placeholder: '当【是否有指标】="有"时,必填',
-  },
-  {
-    key: "exemptionPostageCondtion",
-    title: "包邮条件",
-    type: "Input",
-    placeholder:
-      "当运费承担方式为供应商有条件承担时,该字段必填,填写要求,写明什么条件下供应商承担全部,什么条件下我方承担,什么条件下分别承担",
-    span: 12,
-  },
-  {
-    key: "isRebate",
-    title: "是否有返利",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_is_rebate",
-    },
-  },
-  {
-    key: "rebatePolicy",
-    title: "返利政策",
-    type: "Input",
-    placeholder: '当【是否有返利】="有"时,必填',
-    span: 18,
-  },
-  { key: "externalContract", title: "外部合同号", type: "Input" },
-  {
-    key: "rollbackPolicy",
-    title: "退换货政策",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "contractContent",
-    title: "合同主要内容",
-    type: "Textarea",
-    require: true,
-    span: 24,
-  },
-  { key: "refusalReasons", title: "拒绝理由", type: "Input", span: 24 },
-  { key: "enquiryCode", title: "询价单号", type: "Input" },
-  { key: "externalFile", title: "对外附件", type: "Upload", span: 24 },
-  { key: "puFile", title: "采购商盖章合同附件", type: "Upload", span: 24 },
-  {
-    key: "supplierFile",
-    title: "供应商盖章合同附件",
-    type: "Upload",
-    span: 24,
-  },
-  { key: "projectCode", title: "项目编号", type: "Input" },
-  { key: "projectName", title: "项目名称", type: "Input" },
-  { key: "area", title: "区域", type: "Input" },
-  { key: "consigneePhone", title: "收货人联系方式", type: "Input" },
-  {
-    key: "paymentAgreementName",
-    title: "付款协议",
-    type: "InputDialog",
-    config: {
-      componentName: "PAYAGREEMENT_PARAM",
-      dataMapping: {
-        paymentAgreement: "code",
-        paymentAgreementName: "name",
-      },
-    },
-    require: true,
-  },
-  {
-    key: "taxPrice",
-    title: "价税合计",
-    type: "InputNumber",
-  },
-  {
-    key: "currencyName",
-    title: "币种",
-    type: "InputDialog",
-    config: {
-      componentName: "CURRENCY_PARAM",
-      dataMapping: {
-        currency: "code",
-        currencyName: "name",
-      },
-    },
-    require: true,
-  },
-  { key: "guaranteePeriod", title: "质保期", type: "Input" },
-
-  // { key: "buyerName", title: "采购员名称" },
-  // { key: "supplierName", title: "供应商名称" },
-
-  // { key: "puDeptName", title: "采购部门名称" },
-
-  // { key: "contractPartycName", title: "合同丙方名称" },
-
-  // { key: "currencyName", title: "币种名称" },
-  // { key: "tenantId", title: "租户号" },
-  // { key: "revision", title: "乐观锁" },
-  // { key: "createByName", title: "创建人" },
-  // { key: "updateByName", title: "创建人名称" },
-  // { key: "delFlag", title: "删除标记" },
-];
-
-export const TabColumns = [
-  {
-    show: {
-      contractType: [1, 2],
-    },
-    title: "物料基本信息",
-    key: "contractItemList",
-    tableColumns: [
-      { title: "物料编码", key: "material", width: 200 },
-      {
-        title: "物料名称",
-        key: "materialName",
-        type: "InputDialog",
-        width: 200,
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-      },
-      {
-        title: "规格",
-        key: "specification",
-        width: 200,
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-      },
-      {
-        title: "品牌",
-        key: "brand",
-        type: "InputDialog",
-        width: 200,
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-      },
-      { title: "生产厂家", key: "manufacturer", type: "Input", width: 200 },
-      {
-        title: "采购单位",
-        key: "puUnit",
-        type: "InputDialog",
-        width: 200,
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-      },
-      {
-        title: "税率%",
-        key: "tax",
-        type: "InputDialog",
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-        width: 200,
-      },
-      {
-        title: "采购数量",
-        key: "qty",
-        type: "InputNumber",
-
-        width: 200,
-      },
-      {
-        title: "含税单价",
-        key: "taxPrice",
-        type: "InputNumber",
-
-        width: 200,
-      },
-      { title: "含税金额合计", key: "taxMoney", width: 200 },
-      { title: "无税单价", key: "taxFreePrice" },
-      { title: "无税金额合计", key: "taxFreeMoney", width: 200 },
-      {
-        title: "注册证号及备案凭证号",
-        key: "registration",
-        type: "Input",
-        width: 200,
-      },
-      {
-        title: "收货客户",
-        key: "customerName",
-        type: "InputDialog",
-        width: 200,
-        config: {
-          componentName: "SUPPLIER_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-      },
-      { title: "备注", key: "remark", type: "Input", width: 200 },
-    ],
-  },
-  {
-    title: "合同条款",
-    key: "contractClauseList",
-    tableColumns: [
-      { title: "条款编码", key: "code", type: "Input" },
-      { title: "条款名称", key: "name", type: "Input" },
-      { title: "条款内容", key: "content", type: "Input" },
-      { title: "变量序号", key: "variableRowno" },
-      { title: "变量内容", key: "variableContent", type: "Input" },
-      { title: "备注", key: "remark", type: "Input" },
-    ],
-  },
-  {
-    title: "合同费用",
-    key: "contractExpenseList",
-    tableColumns: [
-      { title: "费用编码", key: "code", type: "Input" },
-      { title: "费用名称", key: "name", type: "Input" },
-      {
-        title: "费用金额",
-        key: "money",
-        type: "InputNumber",
-        width: 200,
-      },
-      { title: "备注", key: "remark", type: "Input" },
-    ],
-  },
-  {
-    title: "付款协议信息",
-    key: "contractAgreementList",
-    tableColumns: [
-      {
-        title: "付款阶段",
-        key: "satge",
-        type: "InputNumber",
-        width: 200,
-      },
-      {
-        title: "付款起点",
-        key: "origin",
-        type: "InputDialog",
-        width: 200,
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-      },
-      { title: "账期天数", key: "paymetDays", type: "Input", width: 200 },
-      { title: "付款比例%", key: "ratio", type: "Input", width: 200 },
-      { title: "付款金额", key: "money", type: "Input", width: 200 },
-      { title: "是否预付款", key: "isAdvance", width: 200 },
-      { title: "是否质保金", key: "isQuality", width: 200 },
-      { title: "结算方式", key: "paymentMeans", type: "Input", width: 200 },
-      { title: "备注", key: "remark", type: "Input", width: 200 },
-      { title: "需进度确认", key: "schedule", type: "Select", width: 200 },
-    ],
-  },
-  {
-    title: "合同执行组织范围",
-    key: "contractApplyOrgList",
-    tableColumns: [
-      { title: "组织名称", key: "orgName", type: "Input" },
-      { title: "组织编码", key: "org", type: "Input" },
-    ],
-  },
-];

+ 16 - 6
src/views/purchase/apply/add/index.vue

@@ -46,12 +46,13 @@ export default {
       this.$refs[prop].validate(async (valid) => {
         if (valid) {
           try {
+            this.params.id = undefined;
             const { code, msg } = await ADD({
               ...this.params,
             });
             if (code === 200) {
               this.hide();
-              this.$emit("submit-success");
+              this.$emit("success");
               this.$notify.success({ title: msg });
             } else {
               this.$notify.warning({ title: msg });
@@ -113,13 +114,22 @@ export default {
               style="width: 100%"
             >
             </dr-popover-select>
-            <el-switch
-              v-if="column.inputType === 'Switch'"
+            <el-select
+              v-if="column.inputType === 'Select'"
               v-model="params[column.key]"
-              active-value="1"
-              inactive-value="0"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
             >
-            </el-switch>
+              <el-option
+                v-for="item in dict.type[column.referName]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
             <file-upload
               v-if="column.inputType === 'Upload'"
               v-model="params[column.key]"

+ 8 - 4
src/views/purchase/apply/column.js

@@ -128,7 +128,12 @@ export const TableColumns = [
     disabled: true,
     readonly: true,
   },
-  { key: "isEffective", title: "是否已推价格", inputType: "Switch" },
+  {
+    key: "isEffective",
+    title: "是否已推价格",
+    inputType: "Select",
+    referName: "sys_yes_no",
+  },
   {
     key: "effectiveDate",
     title: "生效日期",
@@ -210,8 +215,7 @@ export const SearchColumns = [
   {
     key: "isEffective",
     title: "是否已推价格",
-    inputType: "Switch",
-    activeValue: "1",
-    inactiveValue: "0",
+    inputType: "Select",
+    referName: "sys_yes_no",
   },
 ];

+ 0 - 268
src/views/purchase/apply/edit/index.vue

@@ -1,268 +0,0 @@
-<script>
-import { Columns, TabColumns } from "../add/column";
-import {
-  edit,
-  item,
-  itemTableList,
-} from "@/api/business/purchase/contract";
-import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
-
-const NewColumns = initColumns(Columns);
-const NewTabColumns = TabColumns.map((element) => ({
-  ...element,
-  tableColumns: initColumns(element.tableColumns),
-}));
-
-export default {
-  name: "EditDrawer",
-  dicts: initDicts(NewColumns),
-  components: {
-   
-  },
-  data() {
-    return {
-      size: "mini",
-      visible: false,
-      loading: false,
-      columns: NewColumns,
-      rules: initRules(NewColumns),
-      params: {
-        ...initParams(NewColumns),
-        contractItemList: [],
-        contractClauseList: [],
-        contractExpenseList: [],
-        contractAgreementList: [],
-        contractApplyOrgList: [],
-      },
-
-      tabColumns: NewTabColumns,
-      tabName: "contractItemList",
-    };
-  },
-  computed: {},
-  watch: {
-    "params.contractType": function (newProp) {
-      this.tabColumns = NewTabColumns.filter((element) =>
-        newProp === "1" ? element.key !== "contractItemList" : element
-      );
-      this.tabName = this.tabColumns[0].key;
-    },
-    tabName: function (newProp) {
-      const { id } = this.params;
-      this.fetchTable(id, newProp);
-    },
-  },
-  methods: {
-    setVisible(prop) {
-      this.visible = prop;
-    },
-    // 查询详细
-    async fetchItem(prop) {
-      try {
-        this.loading = true;
-        const { code, msg, data } = await item(prop);
-        if (code === 200) {
-          this.params = data;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        //
-      } finally {
-        this.loading = false;
-      }
-    },
-    // 查询详情关联TABLE
-    async fetchTable(prop, name) {
-      try {
-        this.loading = true;
-        const { code, msg, rows } = await itemTableList({ id: prop }, name);
-        if (code === 200) {
-          this.params[name] = rows;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        //
-      } finally {
-        this.loading = false;
-      }
-    },
-    // 新增行
-    addTableRow(prop) {
-      const arr = this.tabColumns.find(
-        (element) => element.key === this.tabName
-      ).tableColumns;
-      prop.push(initParams(arr, "key", "value"));
-    },
-    // 删除行
-    delTableRow(prop, index) {
-      prop.splice(index, 1);
-    },
-    // 取消
-    handleCancel() {
-      this.setVisible(false);
-      this.params = initParams(this.columns, "key", "value");
-    },
-    // 保存
-    handleSava() {
-      this.setVisible(false);
-    },
-    // 保存并新增
-    async handleSubmit() {
-      try {
-        const createById = this.params.buyer;
-        const createByName = this.params.buyerName;
-        const updateById = this.$store.state.user.id;
-        const updateByName = this.$store.state.user.name;
-        const { code, msg } = await edit({
-          createById,
-          createByName,
-          updateById,
-          updateByName,
-          ...this.params,
-        });
-        if (code === 200) {
-          this.$notify.success({ title: msg });
-          this.setVisible(false);
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        //
-      } finally {
-        // this.setVisible(false);
-      }
-    },
-    beforeOpen() { },
-  },
-  created() {
-    console.log("ADD CREATED");
-  },
-  mounted() { },
-  destroyed() { },
-};
-</script>
-<template>
-  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
-    @close="$emit('close')">
-    <el-form v-loading="loading" :size="size" label-position="right" label-width="135px" :model="params" :rules="rules">
-      <el-card :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-      }" style="margin: 10px">
-        <div slot="header" style="
-            display: flex;
-            justify-content: space-between;
-            align-items: center;
-          ">
-          <h3>编辑</h3>
-          <div style="text-align: right">
-            <el-button :size="size" @click="handleCancel">取 消</el-button>
-            <el-button :size="size" type="danger" @click="handleSava">更 新</el-button>
-          </div>
-        </div>
-        <el-row>
-          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
-            <el-form-item :prop="column.key" :label="column.title">
-              <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input>
-              <dr-popover-select v-if="column.type === 'InputDialog'" v-model="params[column.key]" :source.sync="params"
-                :type="column.config.componentName" :data-mapping="column.config.dataMapping" :title="column.title"
-                :disabled="column.disabled" :readonly="column.readonly" :clearable="column.clearable"
-                :placeholder="column.placeholder">
-              </dr-popover-select>
-              <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%"></el-input>
-              <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input-number>
-              <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
-                <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
-              <el-select v-if="column.type === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%">
-                <template #prefix>
-                  <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
-                </template>
-                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
-                </el-option>
-              </el-select>
-              <el-date-picker v-if="column.type === 'DatePicker'" v-model="params[column.key]" :type="column.config.type"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                :picker-options="column.pickerOptions" style="width: 100%">
-              </el-date-picker>
-              <el-upload v-if="column.type === '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>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-card>
-      <el-card :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-        position: 'relative',
-      }" style="margin: 10px">
-        <el-tabs v-model="tabName" style="width: 100%">
-          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
-            <el-table :data="params[column.key]" style="width: 100%">
-              <el-table-column label="序号">
-                <template slot-scope="scope">
-                  {{ scope.$index + 1 }}
-                </template>
-              </el-table-column>
-              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
-                :label="cColumn.title" :width="cColumn.width">
-                <template slot-scope="scope">
-                  <span v-if="!cColumn.type">
-                    {{ scope.row[cColumn.key] }}</span>
-                  <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    :size="size" style="width: 100%"></el-input>
-                  <dr-popover-select v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
-                    :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" :size="size">
-                  </dr-popover-select>
-                  <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size"
-                    style="width: 100%"></el-input-number>
-                </template>
-              </el-table-column>
-              <el-table-column fixed="right" label="操作" width="120">
-                <template slot-scope="scope">
-                  <el-button @click.native.prevent="
-                    delTableRow(params[tabName], scope.$index)
-                    " type="text" size="small">
-                    删行
-                  </el-button>
-                </template>
-              </el-table-column>
-            </el-table>
-          </el-tab-pane>
-        </el-tabs>
-        <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button :size="size" @click="addTableRow(params[tabName])">增行</el-button>
-        </el-row>
-      </el-card>
-    </el-form>
-  </el-drawer>
-</template>

+ 23 - 9
src/views/purchase/apply/index.vue

@@ -1,13 +1,19 @@
 <script>
 import { TableColumns, SearchColumns } from "./column";
 import { LIST, REMOVE } from "@/api/business/purchase/apply";
-import { initPage, initLayout, initPageSizes, initParams } from "@/utils/init";
+import {
+  initPage,
+  initDicts,
+  initLayout,
+  initPageSizes,
+  initParams,
+} from "@/utils/init";
 export default {
   name: "PuchaseApply",
+  dicts: [...initDicts(SearchColumns), ...initDicts(TableColumns)],
   components: {
     AddDialog: () => import("./add/index.vue"),
     SeeDialog: () => import("./see/index.vue"),
-    // Editdialog: () => import("./edit/index.vue"),
   },
   data() {
     return {
@@ -117,8 +123,7 @@ export default {
     :body-style="{ padding: 0 }"
   >
     <see-dialog ref="SeeDialog"></see-dialog>
-    <add-dialog ref="AddDialog" @submit-success="resetList"></add-dialog>
-    <!-- <edit-dialog ref="EditdialogFef" @close="resetList"></edit-dialog> -->
+    <add-dialog ref="AddDialog" @success="resetList"></add-dialog>
     <el-form
       :size="size"
       :model="params"
@@ -139,13 +144,22 @@ export default {
               :placeholder="column.placeholder"
               style="width: 100%"
             ></el-input>
-            <el-switch
-              v-if="column.inputType === 'Switch'"
+            <el-select
+              v-if="column.inputType === 'Select'"
               v-model="params[column.key]"
-              active-value="1"
-              inactive-value="0"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
             >
-            </el-switch>
+              <el-option
+                v-for="item in dict.type[column.referName]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
             <dr-popover-select
               v-if="column.inputType === 'PopoverSelect'"
               v-model="params[column.key]"

+ 1 - 1
src/views/purchase/catalogue/edit/index.vue

@@ -51,7 +51,7 @@ export default {
             });
             if (code === 200) {
               this.hide();
-              this.$emit("submit-success");
+              this.$emit("success");
               this.$notify.success({ title: msg });
             } else {
               this.$notify.warning({ title: msg });

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

@@ -88,7 +88,7 @@ export default {
   >
     <!-- <see-drawer ref="SeeDrawerFef"></see-drawer> -->
     <!-- <add-drawer ref="AddDrawerFef" @close="resetList"></add-drawer> -->
-    <edit-dialog ref="Editdialog" @submit-success="resetList"></edit-dialog>
+    <edit-dialog ref="Editdialog" @success="resetList"></edit-dialog>
     <el-form
       :size="size"
       :model="params"

+ 1 - 1
src/views/purchase/contract/add/index.vue

@@ -111,7 +111,7 @@ export default {
             });
             if (code === 200) {
               this.hide();
-              this.$emit("submit-success");
+              this.$emit("success");
               this.$notify.success({ title: msg });
             } else {
               this.$notify.warning({ title: msg });

+ 43 - 0
src/views/purchase/contract/delete/index.vue

@@ -0,0 +1,43 @@
+<script>
+import { REMOVE } from "@/api/business/purchase/contract";
+export default {
+  name: "DeleteDialog",
+  data() {
+    return {};
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    //
+    open(prop) {
+      this.$confirm("是否删除数据项?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "info",
+      })
+        .then(() => {
+          try {
+            const { code, msg } = REMOVE(prop);
+            if (code === 200) {
+              this.$emit("success");
+              this.$notify.success({ title: msg });
+            } else {
+              this.$notify.warning({ title: msg });
+            }
+          } catch (err) {
+            // catch
+          } finally {
+            // finally
+          }
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template></template>

+ 9 - 1
src/views/purchase/contract/edit/index.vue

@@ -134,7 +134,7 @@ export default {
             });
             if (code === 200) {
               this.hide();
-              this.$emit("submit-success");
+              this.$emit("success");
               this.$notify.success({ title: msg });
             } else {
               this.$notify.warning({ title: msg });
@@ -283,6 +283,14 @@ export default {
                     :placeholder="cColumn.placeholder"
                     style="width: 100%"
                   ></el-input>
+                  <dr-computed-input
+                    v-if="cColumn.inputType === 'ComputedInput'"
+                    v-model="scope.row[cColumn.key]"
+                    :source="scope.row"
+                    :computed="cColumn.computed"
+                    :placeholder="cColumn.placeholder"
+                    style="width: 100%"
+                  ></dr-computed-input>
                   <dr-popover-select
                     v-else-if="cColumn.inputType === 'PopoverSelect'"
                     v-model="scope.row[cColumn.key]"

+ 34 - 0
src/views/purchase/contract/export/index.vue

@@ -0,0 +1,34 @@
+<script>
+export default {
+  name: "ExportDialog",
+  data() {
+    return {};
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    //
+    open(prop) {
+      this.$confirm("是否确认导出所有数据项?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "info",
+      })
+        .then(() => {
+          this.download(
+            "pu/contract/export",
+            { ...prop },
+            `contract_${new Date().getTime()}.xlsx`
+          );
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template></template>

+ 95 - 0
src/views/purchase/contract/import/index.vue

@@ -0,0 +1,95 @@
+<script>
+import { REMOVE } from "@/api/business/purchase/contract";
+export default {
+  name: "ImportDialog",
+  data() {
+    return {
+      visible: false,
+      upload: {
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: {
+          // Authorization: "Bearer " + getToken()
+        },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/system/user/importData",
+      },
+    };
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    //
+    open(prop) {
+      this.visible = true;
+    },
+    //
+    hide() {
+      this.visible = false;
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      importTemplate().then((response) => {
+        this.download(response.msg);
+      });
+    },
+    // 文件上传中处理
+    progress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    success(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+      this.getList();
+    },
+    //
+    confirm() {
+      this.$refs.upload.submit();
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <el-dialog title="导入" width="fit-content" :visible.sync="visible">
+    <el-upload
+      ref="upload"
+      :limit="1"
+      accept=".xlsx, .xls"
+      :headers="upload.headers"
+      :action="upload.url + '?updateSupport=' + upload.updateSupport"
+      :disabled="upload.isUploading"
+      :on-progress="progress"
+      :on-success="success"
+      :auto-upload="false"
+      drag
+    >
+      <i class="el-icon-upload"></i>
+      <div class="el-upload__text">
+        将文件拖到此处,或
+        <em>点击上传</em>
+      </div>
+      <div class="el-upload__tip" slot="tip">
+        <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+        <el-link type="info" style="font-size: 12px" @click="importTemplate"
+          >下载模板</el-link
+        >
+      </div>
+      <div class="el-upload__tip" style="color: red" slot="tip">
+        提示:仅允许导入“xls”或“xlsx”格式文件!
+      </div>
+    </el-upload>
+    <div slot="footer" class="dialog-footer">
+      <el-button type="primary" @click="confirm">确 定</el-button>
+      <el-button @click="hide">取 消</el-button>
+    </div>
+  </el-dialog>
+</template>

+ 73 - 55
src/views/purchase/contract/index.vue

@@ -1,13 +1,17 @@
 <script>
-import { LIST, REMOVE } from "@/api/business/purchase/contract";
+import { LIST } from "@/api/business/purchase/contract";
 import { Columns as TableColumns, SearchColumns } from "./column";
-import { initPage, initParams, initLayout, initPageSizes } from "@/utils/init";
+import { initPage, initDicts, initParams } from "@/utils/init";
 export default {
   name: "PuchaseContract",
+  dicts: initDicts(TableColumns),
   components: {
-    AddDialog: () => import("./add/index.vue"),
-    SeeDialog: () => import("./see/index.vue"),
-    EditDialog: () => import("./edit/index.vue"),
+    AddModel: () => import("./add/index.vue"),
+    SeeModel: () => import("./see/index.vue"),
+    EditModel: () => import("./edit/index.vue"),
+    ExportModel: () => import("./export/index.vue"),
+    ImportModel: () => import("./import/index.vue"),
+    DeleteModel: () => import("./delete/index.vue"),
   },
   data() {
     return {
@@ -18,8 +22,6 @@ export default {
       tableData: [],
       tableColumns: TableColumns,
       page: initPage(),
-      layout: initLayout(),
-      pageSizes: initPageSizes(),
     };
   },
   computed: {},
@@ -60,24 +62,6 @@ export default {
       this.params = initParams(SearchColumns);
       this.queryList(this.params, this.page);
     },
-    // 删除操作
-    async deleteItem(prop) {
-      try {
-        this.loading = true;
-        const { id } = prop;
-        const { code, msg } = await REMOVE(id);
-        if (code === 200) {
-          this.$notify.success({ title: msg });
-          this.queryList(this.params, this.page);
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        //
-      } finally {
-        this.loading = false;
-      }
-    },
     // 页大小变
     sizeChange(prop) {
       this.page.pageSize = prop;
@@ -88,21 +72,38 @@ export default {
       this.page.pageNum = prop;
       this.queryList(this.params, this.page);
     },
-    // 打开新增drawer
-    async openAddDialog() {
-      const { open } = this.$refs.AddDialog;
+    //
+    async useAdd() {
+      const { open } = this.$refs.AddModel;
       await open();
     },
-    // 打开查看drawer
-    async openSeeDialog(prop) {
+    //
+    async useSee(prop) {
       const { id } = prop;
-      const { open } = this.$refs.SeeDialog;
+      const { open } = this.$refs.SeeModel;
       await open(id);
     },
-    // 打开编辑drawer
-    async openEditDialog(prop) {
+    //
+    async useEdit(prop) {
+      const { id } = prop;
+      const { open } = this.$refs.EditModel;
+      await open(id);
+    },
+    //
+    async useExport(prop) {
+      const { pageNum, pageSize } = this.page;
+      const { open } = this.$refs.ExportModel;
+      await open({ ...prop, pageNum, pageSize });
+    },
+    //
+    async useImport() {
+      const { open } = this.$refs.ImportModel;
+      await open();
+    },
+    //
+    async useDelete(prop) {
       const { id } = prop;
-      const { open } = this.$refs.EditDialog;
+      const { open } = this.$refs.DeleteModel;
       await open(id);
     },
   },
@@ -112,18 +113,30 @@ export default {
 <template>
   <el-card
     v-loading="loading"
-    style="width: calc(100% - 24px); height: 100%; margin: 10px"
+    style="
+      width: calc(100% - 20px);
+      height: 100%;
+      margin: 10px;
+      padding: 0 20px 20px 0;
+    "
     :body-style="{ padding: 0 }"
   >
-    <see-dialog ref="SeeDialog"></see-dialog>
-    <add-dialog ref="AddDialog" @submit-success="resetList"></add-dialog>
-    <edit-dialog ref="EditDialog" @submit-success="resetList"></edit-dialog>
+    <see-model ref="SeeModel"></see-model>
+    <add-model ref="AddModel" @success="resetList"></add-model>
+    <edit-model ref="EditModel" @success="queryList(params, page)"></edit-model>
+    <export-model ref="ExportModel"></export-model>
+    <import-model ref="ImportModel"></import-model>
+    <delete-model
+      ref="DeleteModel"
+      @success="queryList(params, page)"
+    ></delete-model>
     <el-form
       :size="size"
       :model="params"
       label-width="75px"
       label-position="right"
       style="padding: 20px 20px 0"
+      @submit.native.prevent
     >
       <el-row :gutter="20" style="display: flex; flex-wrap: wrap">
         <el-col
@@ -135,6 +148,7 @@ export default {
             <el-input
               v-model="params[column.key]"
               :placeholder="column.placeholder"
+              @change="queryList(params, page)"
             ></el-input>
           </el-form-item>
         </el-col>
@@ -156,15 +170,15 @@ export default {
         </el-col>
       </el-row>
     </el-form>
-    <el-row :gutter="24" style="padding: 0 20px">
-      <el-col :span="6">
-        <el-button :size="size" @click="openAddDialog"> 新 增 </el-button>
-      </el-col>
+    <el-row style="padding: 0 20px">
+      <el-button :size="size" @click="useAdd"> 新 增 </el-button>
+      <el-button :size="size" @click="useExport(params)"> 导 出 </el-button>
+      <el-button :size="size" @click="useImport"> 导 入 </el-button>
     </el-row>
     <el-table
       :size="size"
       :data="tableData"
-      @row-dblclick="openSeeDialog"
+      @row-dblclick="useSee"
       style="width: 100%; margin: 20px 0 0 0"
     >
       <el-table-column
@@ -175,18 +189,27 @@ export default {
         :width="column.width || 180"
         :show-overflow-tooltip="column.showOverflowTooltip || true"
       >
+        <template slot-scope="scope">
+          <dict-tag
+            v-if="column.inputType === 'Select'"
+            :size="size"
+            :value="scope.row[column.key]"
+            :options="dict.type[column.referName]"
+          />
+          <span v-else>{{ scope.row[column.key] }}</span>
+        </template>
       </el-table-column>
       <el-table-column fixed="right" label="操作" width="120">
         <template slot-scope="scope">
           <el-button
-            @click.native.prevent="openEditDialog(scope.row)"
+            @click.native.prevent="useEdit(scope.row)"
             type="text"
             size="small"
           >
             编 辑
           </el-button>
           <el-button
-            @click.native.prevent="deleteItem(scope.row)"
+            @click.native.prevent="useDelete(scope.row)"
             type="text"
             size="small"
           >
@@ -195,16 +218,11 @@ export default {
         </template>
       </el-table-column>
     </el-table>
-    <el-pagination
-      @size-change="sizeChange"
-      @current-change="currentChange"
+    <pagination
       :total="page.total"
-      :page-sizes="pageSizes"
-      :page-size="page.pageSize"
-      :current-page="page.pageNum"
-      :layout="layout"
-      style="margin: 16px 0"
-    >
-    </el-pagination>
+      :page.sync="page.pageNum"
+      :limit.sync="page.pageSize"
+      @pagination="queryList(params, page)"
+    />
   </el-card>
 </template>

+ 1 - 1
src/views/purchase/task/documents-return/index.vue

@@ -37,7 +37,7 @@ export default {
         });
         if (code === 200) {
           this.hide();
-          this.$emit("submit-success");
+          this.$emit("success");
           this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });

+ 1 - 1
src/views/purchase/task/first-direct/index.vue

@@ -58,7 +58,7 @@ export default {
         const { code, msg } = await ADD(params);
         if (code === 200) {
           this.hide();
-          this.$emit("submit-success");
+          this.$emit("success");
           this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });

+ 4 - 3
src/views/purchase/task/index.vue

@@ -149,15 +149,15 @@ export default {
     <see-dialog ref="SeeDialog"></see-dialog>
     <first-direct-dialog
       ref="FirstDirectDialog"
-      @submit-success="resetList"
+      @success="resetList"
     ></first-direct-dialog>
     <doc-return-dialog
       ref="DocReturnDialog"
-      @submit-success="resetList"
+      @success="resetList"
     ></doc-return-dialog>
     <modify-buyer-dialog
       ref="ModifyBuyerDialog"
-      @submit-success="resetList"
+      @success="resetList"
     ></modify-buyer-dialog>
     <el-backtop target=".el-scrollbar__wrap"></el-backtop>
     <el-form
@@ -166,6 +166,7 @@ export default {
       label-width="auto"
       label-position="right"
       style="padding: 20px 20px 0"
+      @submit.native.prevent
     >
       <el-row :gutter="20" style="display: flex; flex-wrap: wrap">
         <el-col

+ 1 - 1
src/views/purchase/task/modify-buyer/index.vue

@@ -40,7 +40,7 @@ export default {
         ]);
         if (code === 200) {
           this.hide();
-          this.$emit("submit-success");
+          this.$emit("success");
           this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });

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