ソースを参照

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

002390 2 年 前
コミット
e233ab531e

+ 1 - 11
src/utils/init/index.js

@@ -33,14 +33,4 @@ export const initRules = (prop) => {
   return rules;
 };
 
-const pageSizes = [25, 50, 100];
-
-const layout = "total, prev, pager, next, sizes, jumper";
-
-const page = { pageNum: 1, pageSize: 25, total: 0 };
-
-export const initPageSizes = () => pageSizes;
-
-export const initLayout = () => layout;
-
-export const initPage = () => ({ pageNum: 1, pageSize: 25, total: 0 });
+export const initPage = () => ({ pageNum: 1, pageSize: 10, total: 0 });

+ 76 - 26
src/views/material/changeApply/add.vue

@@ -31,8 +31,8 @@
             <el-col :span="8">
               <el-form-item label="医药物料" prop="medicineMaterial">
                 <el-select v-model="basicForm.medicineMaterial" placeholder="医药物料" clearable :disabled="disable"
-                  @change="controlMedic">
-                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
+                           @change="controlMedic">
+                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"/>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -59,8 +59,8 @@
             <el-col :span="8">
               <el-form-item label="生产厂家/代理人" prop="factory">
                 <el-select ref="factoryOrman" v-model="basicForm.factory" placeholder="生产厂家/代理人" clearable
-                  :disabled="disable" @focus="chooseFactory">
-                  <el-option v-for="item in factoryOptions" :key="item.id" :label="item.name" :value="item.id" />
+                           :disabled="disable" @focus="chooseFactory">
+                  <el-option v-for="item in factoryOptions" :key="item.id" :label="item.name" :value="item.id"/>
                 </el-select>
                 <!-- <el-input :disabled="disable" v-model="basicForm.factory">
                   <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
@@ -78,7 +78,7 @@
               <el-form-item label="存储条件" prop="storageConditions">
                 <el-select v-model="basicForm.storageConditions" placeholder="存储条件" clearable :disabled="disable">
                   <el-option v-for="dict in dict.type.sys_storage_condition" :key="dict.value" :label="dict.label"
-                    :value="dict.value" />
+                             :value="dict.value"/>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -86,7 +86,7 @@
               <el-form-item label="运输条件" prop="transportCondition">
                 <el-select v-model="basicForm.transportCondition" placeholder="运输条件" clearable :disabled="disable">
                   <el-option v-for="dict in dict.type.sys_conditions_carriage" :key="dict.value" :label="dict.label"
-                    :value="dict.value" />
+                             :value="dict.value"/>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -98,8 +98,12 @@
               </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 label="业务线" prop="businessLine"
+                            :rules="{ required: isOneClass, message: '骨科、介入、检验、普耗、设备类物料产线必须输入对应的业务线', trigger: 'blur' }">
+                <el-select ref="lines" v-model="basicForm.businessLine" placeholder="请选择" clearable :disabled="disable"
+                           @focus="chooseLine">
+                  <el-option v-for="item in lineOptions" :key="item.id" :label="item.name" :value="item.id"/>
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -148,7 +152,8 @@
         <el-form :model="basicForm2" ref="basic2" label-width="160px">
           <el-row :gutter="20">
             <el-col :span="8">
-              <el-form-item label="药品" prop="drug">
+              <el-form-item label="药品" prop="drug"
+                            :rules="{ required: !isControl, message: '请选择是否药品', trigger: 'change' }">
                 <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"/>
@@ -317,6 +322,7 @@
     <fourClass ref="fourClass" @doSubmit="acceptFourClass" :selectData="selectData3" :single="true"/>
 
     <dose ref="dose" @doSubmit="acceptDose" :selectData="selectData9" :single="true"/>
+    <serviceline ref="line" @doSubmit="acceptLine" :selectData="selectData8" :single="true" />
   </div>
 </template>
 
@@ -324,12 +330,13 @@
   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 {getDose, getLine} 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 serviceline from '@/components/PopDialog/serviceline.vue'
   // 调用物料分类详情接口用于数据回显
   import {getDetail} from '@/api/classify/basic';
 
@@ -340,6 +347,7 @@
       popDialog,
       factory,
       dose,
+      serviceline,
       fourClass
     },
     props: ['pageStu', 'row', 'disable'],
@@ -353,8 +361,12 @@
         // 剂型
         doseOptions: [],
         selectData9: [],
+        selectData8: [],
         tabValue: 'first',
         isControl: true,
+        // 业务线
+        lineOptions: [],
+        isOneClass: false,
         basicForm: {
           code: '',
           orgId: '德荣集团',
@@ -427,8 +439,8 @@
           registrationNo: '',
           medicalDevices: '',
           maintenanceType: '',
-        // 剂型
-        dosageFrom: ''
+          // 剂型
+          dosageFrom: ''
           // 医药属性子表
           // medicineTypeChanges:[
           // ],
@@ -562,6 +574,10 @@
             if (res.data.medicineChange && res.data.medicineChange.dosageFrom) {
               this.getDoseDetails(res.data.medicineChange.dosageFrom)
             }
+            // 业务线回显
+            if (res.data.businessLine) {
+              this.getLineDetails(res.data.businessLine)
+            }
           }
         })
       },
@@ -572,13 +588,17 @@
         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()
+            this.$refs['basic2'].validate(valid => {
+              if (valid) {
+                addChangeList(sparams).then(res => {
+                  if (res.code === 200) {
+                    this.$message({
+                      message: res.msg,
+                      type: 'success'
+                    });
+                    this.back()
+                  }
+                })
               }
             })
           }
@@ -591,13 +611,17 @@
         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()
+            this.$refs['basic2'].validate(valid => {
+              if (valid) {
+                editChangeList(sparams).then(res => {
+                  if (res.code === 200) {
+                    this.$message({
+                      message: res.msg,
+                      type: 'success'
+                    });
+                    this.back()
+                  }
+                })
               }
             })
           }
@@ -733,6 +757,32 @@
             this.basicForm.twoClass = res.data.twoClass
             this.basicForm.threeClass = res.data.threeClass
             this.basicForm.fourClass = res.data.fourClass
+            const classjudge = res.data.oneClass
+            if (classjudge == '介入耗材5' || classjudge == '骨科耗材2' || classjudge == '普通耗材3' || classjudge == '医用设备1' || classjudge == '体外诊断4') {
+              this.isOneClass = true
+            } else {
+              this.isOneClass = false
+            }
+          }
+        })
+      },
+      // 选择业务线
+      acceptLine(selections) {
+        this.lineOptions = selections
+        this.basicForm.businessLine = selections[0].id
+        this.getLineDetails(selections[0].id)
+      },
+      // 业务线显示列表
+      chooseLine() {
+        this.$refs.lines.blur()
+        this.$refs.line.init()
+      },
+      // 业务线回显
+      getLineDetails(id) {
+        getLine({id: id}).then(res => {
+          console.log('业务线', res)
+          if (res.code === 200) {
+            this.lineOptions = res.data.tableBody
           }
         })
       },

+ 27 - 1
src/views/purchase/DemandSummary/index.vue

@@ -263,11 +263,12 @@
           :data="tableList" 
           fit
           show-summary
+          :summary-method="getSummaries"
           max-height="480"
           @selection-change="handleSelectionChange"
           :key="isUpdate"
         >
-          <el-table-column type="selection" width="55" />
+          <el-table-column type="selection" width="60" />
           <el-table-column label="行状态" align="center" prop="status" width="120px" :formatter="hangStatus"/>
           <el-table-column label="一级品类" align="center" prop="materialClassifyOneName" width="120px"/>
           <el-table-column label="物料编码" align="center" prop="materialCode" width="180px"/>
@@ -499,6 +500,31 @@ export default {
     this.getList(this.queryParams)
   },
   methods: {
+    // 指定列合计
+    getSummaries(param) {
+      const { columns, data } = param;
+      const sums = [];
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计';
+          return;
+        }
+        const values = data.map(item => Number(item[column.property]));
+        if (column.property === 'demandNum' || column.property === 'netDemandNum' || column.property === 'artificialAdjust' || column.property === 'suggestBuyQty' || column.property === 'finalBuyQty') {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          sums[index];
+
+        }
+      });
+      return sums
+    },
     // 搜索
     search() {
       this.getList(this.queryParams)

+ 40 - 14
src/views/purchase/PurchaseDemandList/add.vue

@@ -219,7 +219,7 @@
           <el-table-column label="预留数量" align="center"  prop="reservedQty" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.reservedQty"/>
+                <el-input readonly size="small" v-model="scope.row.reservedQty"/>
               </el-form-item>
             </template>
           </el-table-column>
@@ -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 :disabled="sonDisable" size="small" v-model="scope.row.deliveryWarehouseName" @focus="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库')">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryWarehouseName" @clear="clearHang(scope.$index, '选择收货仓库')" @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>
@@ -341,7 +341,7 @@
           <el-table-column label="收货货位" align="center"  prop="deliveryAllocationName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryAllocationName" @focus="choosehuoWei(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位', scope.row.deliveryWarehouse)">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryAllocationName" @clear="clearHang(scope.$index, '选择收货货位')" @focus="choosehuoWei(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位', scope.row.deliveryWarehouse)">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="choosehuoWei(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位', scope.row.deliveryWarehouse)"></el-button>
                 </el-input>
               </el-form-item>
@@ -364,7 +364,7 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="默认采购组织" align="center"  prop="purOrgName" width="200px"/>
+          <el-table-column label="默认采购组织" align="center"  prop="purOrgName" width="200px"/>yu
           <el-table-column label="默认采购组织编码" align="center"  prop="puOrg" width="200px"/>
           <!-- <el-table-column label="末级供应调拨待入量" align="center"  prop="lastStockQty" width="150px"/> -->
           <!-- <el-table-column label="上级供应中心现存量" align="center"  prop="superiorCenterQty" width="200px"/> -->
@@ -387,8 +387,8 @@
           <el-table-column label="补单供应商编码" align="center"  prop="additionalSupplier" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.additionalSupplier" @focus="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')">
-                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
+                <el-input clearable :disabled="sonDisable || BDZT" size="small" v-model="scope.row.additionalSupplier" @focus="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')">
+                  <el-button size="small" :disabled="sonDisable || BDZT" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
                 </el-input>
               </el-form-item>
             </template>
@@ -416,7 +416,7 @@
           <el-table-column label="收货地址" align="center"  prop="deliveryAddressName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryAddressName" @focus="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryAddressName" @clear="clearHang(scope.$index, '选择收货地址')" @focus="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')"></el-button>
                 </el-input>
               </el-form-item>
@@ -500,6 +500,8 @@ export default {
       // 不能直接改变props传来的值
       sonPageStu: this.pageStu,
       sonDisable: this.disable,
+      // BDZT是补单供应商是否可以编辑条件
+      BDZT: true,
       dialog: {
         config: false
       },
@@ -560,9 +562,15 @@ export default {
     // 更改业务类型调整明细行内补单或紧急标识
     changeBillType() {
       if (this.basicForm.billType == 'BDXQ' && this.basicForm.puDemandItemList.length != 0) {
+        this.BDZT = false
         this.basicForm.puDemandItemList.forEach(item => {item.isReplenishment = 'Y'})
       } else {
-        this.basicForm.puDemandItemList.forEach(item => { item.isReplenishment = 'N' })
+        this.BDZT = true
+        this.basicForm.puDemandItemList.forEach(item => { 
+          item.isReplenishment = 'N' 
+          item.additionalSupplier = null
+          item.additionalSupplierName = null
+        })
       }
       if (this.basicForm.billType == 'JJXQ' && this.basicForm.puDemandItemList.length != 0) {
         this.basicForm.puDemandItemList.forEach(item => {item.isUrgency = 'Y'})
@@ -650,8 +658,6 @@ export default {
         status: null,
         businessDept: null,
         businessDeptName: null,
-        customer: this.basicForm.customer,
-        customerName: this.basicForm.customerName,
         materialCategory: null,
         buyer: null,
         buyerName: null,
@@ -717,8 +723,8 @@ export default {
         additionalSupplier: null,
         additionalSupplierName: null,
         periodUnit: null,
-        demandCustomer: null,
-        demandCustomerName: null,
+        demandCustomer: this.basicForm.customer,
+        demandCustomerName: this.basicForm.customerName,
         lastStockOrg: null,
         lastStockOrgName: null,
         superiorStockOrg: null,
@@ -855,7 +861,7 @@ export default {
         this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = selection[0].name
       }
       if(this.referConditionMx.title == '选择补单供应商') {
-        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].id
+        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].code
         this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierName = selection[0].name
       }
       if(this.referConditionMx.title == '选择收货地址') {
@@ -958,7 +964,27 @@ export default {
       } else {
         this.$modal.msgWarning("请先选择收货仓库");
       }
-    }
+    },
+    // 明细行清空收货仓库,货位,收货地址档案等
+    clearHang(index, title) {
+      if (title == '选择收货仓库') {
+        this.basicForm.puDemandItemList[index].deliveryWarehouseName = null
+        this.basicForm.puDemandItemList[index].deliveryWarehouse = null
+        this.basicForm.puDemandItemList[index].deliveryAllocationName = null
+        this.basicForm.puDemandItemList[index].deliveryAllocation = null
+      }
+      if (title == '选择收货货位') {
+        this.basicForm.puDemandItemList[index].deliveryAllocationName = null
+        this.basicForm.puDemandItemList[index].deliveryAllocation = null
+      }
+      if (title == '选择收货地址') {
+        this.basicForm.puDemandItemList[index].deliveryAddressName = null
+        this.basicForm.puDemandItemList[index].deliveryAddress = null
+        this.basicForm.puDemandItemList[index].contacts = null
+        this.basicForm.puDemandItemList[index].contactsPhone = null
+        this.basicForm.puDemandItemList[index].address = null
+      }
+    },
   }
 }
 </script>

+ 27 - 6
src/views/purchase/contract/column.js

@@ -130,7 +130,7 @@ export const Columns = [
     inputType: "PopoverSelect",
     referName: "TAX_RATE_PARAM",
     dataMapping: {
-      invoiceTax: "name",
+      invoiceTax: "ntaxrate",
     },
     require: true,
   },
@@ -356,9 +356,8 @@ export const TabColumns = [
         inputType: "PopoverSelect",
         referName: "TAX_RATE_PARAM",
         dataMapping: {
-          tax: "name",
+          tax: "ntaxrate",
         },
-
         width: 200,
       },
       {
@@ -380,11 +379,33 @@ export const TabColumns = [
         width: 200,
         computed: (prop) => {
           const { qty, taxPrice } = prop;
-          return qty && taxPrice ? qty * taxPrice : null;
+          const taxMoney = (qty * taxPrice).toFixed(8);
+          return taxMoney === "NaN" ? null : taxMoney;
+        },
+      },
+      {
+        title: "无税单价",
+        key: "taxFreePrice",
+        inputType: "ComputedInput",
+        width: 200,
+        computed: (prop) => {
+          const { tax, taxPrice } = prop;
+          const newTax = tax === "0E-8" ? 0 : Number(tax) / 100;
+          const taxFreePrice = (taxPrice / (1 + newTax)).toFixed(8);
+          return taxFreePrice === "NaN" ? null : taxFreePrice;
+        },
+      },
+      {
+        title: "无税金额合计",
+        key: "taxFreeMoney",
+        inputType: "ComputedInput",
+        width: 200,
+        computed: (prop) => {
+          const { qty, taxFreePrice } = prop;
+          const taxFreeMoney = (qty * taxFreePrice).toFixed(8);
+          return taxFreeMoney === "NaN" ? null : taxFreeMoney;
         },
       },
-      { title: "无税单价", key: "taxFreePrice" },
-      { title: "无税金额合计", key: "taxFreeMoney", width: 200 },
       {
         title: "注册证号及备案凭证号",
         key: "registration",

+ 2 - 5
src/views/purchase/contract/delete/index.vue

@@ -15,14 +15,11 @@ export default {
         cancelButtonText: "取消",
         type: "info",
       })
-        .then(() => {
+        .then(async () => {
           try {
-            const { code, msg } = REMOVE(prop);
+            const { code } = await REMOVE(prop);
             if (code === 200) {
               this.$emit("success");
-              this.$notify.success({ title: msg });
-            } else {
-              this.$notify.warning({ title: msg });
             }
           } catch (err) {
             // catch

+ 25 - 26
src/views/purchase/contract/edit/index.vue

@@ -39,11 +39,19 @@ export default {
   },
   computed: {},
   watch: {
-    "params.contractType": function (newProp) {
-      this.tabColumns = TabColumns.filter((element) =>
-        newProp === "1" ? element.key !== "contractItemList" : element
-      );
-      this.tabName = this.tabColumns[0].key;
+    "params.contractType": {
+      handler: function (newProp) {
+        if (newProp === "1") {
+          this.params.contractItemList = [];
+          this.tabColumns = TabColumns.filter(
+            (element) => element.key !== "contractItemList"
+          );
+        } else {
+          this.tabColumns = TabColumns;
+        }
+        this.tabName = this.tabColumns[0].key;
+      },
+      immediate: true,
     },
   },
   methods: {
@@ -62,18 +70,16 @@ export default {
     async fetchItem(prop) {
       try {
         this.loading = true;
-        const { code, msg, data } = await ITEM(prop);
+        const { code, data } = await ITEM(prop);
         if (code === 200) {
           this.params = data;
-          this.$notify.success({ title: msg });
           this.tabName = this.tabColumns[0].key;
           this.fetchTable(this.params.code, this.tabName);
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        //
+        // catch
       } finally {
+        // finally
         this.loading = false;
       }
     },
@@ -81,16 +87,14 @@ export default {
     async fetchTable(prop, name) {
       try {
         this.loading = true;
-        const { code, msg, rows } = await TABLELIST({ contractId: prop }, name);
+        const { code, rows } = await TABLELIST({ contractId: prop }, name);
         if (code === 200) {
           this.params[name] = rows;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        //
+        // catch
       } finally {
+        // finally
         this.loading = false;
       }
     },
@@ -103,16 +107,14 @@ export default {
     async rowDelete(prop, { row: { id }, $index }) {
       try {
         this.loading = true;
-        const { code, msg } = await TABLEROMOVE(id, prop);
+        const { code } = await TABLEROMOVE(id, prop);
         if (code === 200) {
           this.params[prop].splice($index, 1);
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        //
+        // catch
       } finally {
+        // finally
         this.loading = false;
       }
     },
@@ -125,7 +127,7 @@ export default {
             const createByName = this.params.buyerName;
             const updateById = this.$store.state.user.id;
             const updateByName = this.$store.state.user.name;
-            const { code, msg } = await EDIT({
+            const { code } = await EDIT({
               createById,
               createByName,
               updateById,
@@ -135,14 +137,11 @@ export default {
             if (code === 200) {
               this.hide();
               this.$emit("success");
-              this.$notify.success({ title: msg });
-            } else {
-              this.$notify.warning({ title: msg });
             }
           } catch (err) {
-            //
+            // catch
           } finally {
-            //
+            // finally
           }
         } else {
           return false;

+ 42 - 57
src/views/purchase/contract/index.vue

@@ -1,7 +1,7 @@
 <script>
 import { LIST } from "@/api/business/purchase/contract";
-import { Columns as TableColumns, SearchColumns } from "./column";
 import { initPage, initDicts, initParams } from "@/utils/init";
+import { Columns as TableColumns, SearchColumns } from "./column";
 export default {
   name: "PuchaseContract",
   dicts: initDicts(TableColumns),
@@ -21,12 +21,12 @@ export default {
       params: initParams(SearchColumns),
       tableData: [],
       tableColumns: TableColumns,
-      page: initPage(),
+      page: { pageNum: 1, pageSize: 10, total: 0 },
     };
   },
   computed: {},
   created() {
-    this.queryList(this.params, this.page);
+    this.useQuery(this.params, this.page);
   },
   methods: {
     //
@@ -43,69 +43,58 @@ export default {
           this.tableData = rows;
           this.page.total = total;
           this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        //
+        // catch
       } finally {
+        // finally
         this.loading = false;
       }
     },
-    // 查询操作
-    queryList(prop, page) {
+    // 查 
+    useQuery(prop, page) {
       this.fetchList(prop, page);
     },
-    // 重置操作
-    resetList() {
+    // 重 
+    useReset() {
       this.page = initPage();
       this.params = initParams(SearchColumns);
-      this.queryList(this.params, this.page);
-    },
-    // 页大小变
-    sizeChange(prop) {
-      this.page.pageSize = prop;
-      this.queryList(this.params, this.page);
+      this.useQuery(this.params, this.page);
     },
-    // 当前页变
-    currentChange(prop) {
-      this.page.pageNum = prop;
-      this.queryList(this.params, this.page);
-    },
-    //
+    // 新 增
     async useAdd() {
       const { open } = this.$refs.AddModel;
       await open();
     },
-    //
-    async useSee(prop) {
+    // 删 除
+    async useDelete(prop) {
       const { id } = prop;
-      const { open } = this.$refs.SeeModel;
+      const { open } = this.$refs.DeleteModel;
       await open(id);
     },
-    //
+    // 编 辑
     async useEdit(prop) {
       const { id } = prop;
       const { open } = this.$refs.EditModel;
       await open(id);
     },
-    //
+    // 明 细
+    async useSee(prop) {
+      const { id } = prop;
+      const { open } = this.$refs.SeeModel;
+      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.DeleteModel;
-      await open(id);
-    },
   },
 };
 </script>
@@ -122,13 +111,13 @@ export default {
     :body-style="{ padding: 0 }"
   >
     <see-model ref="SeeModel"></see-model>
-    <add-model ref="AddModel" @success="resetList"></add-model>
-    <edit-model ref="EditModel" @success="queryList(params, page)"></edit-model>
+    <add-model ref="AddModel" @success="useReset"></add-model>
+    <edit-model ref="EditModel" @success="useQuery(params, page)"></edit-model>
     <export-model ref="ExportModel"></export-model>
     <import-model ref="ImportModel"></import-model>
     <delete-model
       ref="DeleteModel"
-      @success="queryList(params, page)"
+      @success="useQuery(params, page)"
     ></delete-model>
     <el-form
       :size="size"
@@ -148,29 +137,17 @@ export default {
             <el-input
               v-model="params[column.key]"
               :placeholder="column.placeholder"
-              @change="queryList(params, page)"
+              @change="useQuery(params, page)"
             ></el-input>
           </el-form-item>
         </el-col>
-        <el-col :span="6">
-          <el-form-item label-width="0">
-            <el-button
-              circle
-              :size="size"
-              icon="el-icon-search"
-              @click="queryList(params, page)"
-            ></el-button>
-            <el-button
-              circle
-              :size="size"
-              icon="el-icon-refresh"
-              @click="resetList"
-            ></el-button>
-          </el-form-item>
-        </el-col>
       </el-row>
     </el-form>
     <el-row style="padding: 0 20px">
+      <el-button :size="size" @click="useQuery(params, page)">
+        查 询
+      </el-button>
+      <el-button :size="size" @click="useReset"> 重 置 </el-button>
       <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>
@@ -196,22 +173,30 @@ export default {
             :value="scope.row[column.key]"
             :options="dict.type[column.referName]"
           />
+          <el-button
+            v-else-if="column.inputType === 'Upload'"
+            type="text"
+            size="small"
+            @click.native.prevent="useEdit(scope.row)"
+          >
+            点击查看
+          </el-button>
           <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="useEdit(scope.row)"
             type="text"
             size="small"
+            @click.native.prevent="useEdit(scope.row)"
           >
             编 辑
           </el-button>
           <el-button
-            @click.native.prevent="useDelete(scope.row)"
             type="text"
             size="small"
+            @click.native.prevent="useDelete(scope.row)"
           >
             删 除
           </el-button>
@@ -222,7 +207,7 @@ export default {
       :total="page.total"
       :page.sync="page.pageNum"
       :limit.sync="page.pageSize"
-      @pagination="queryList(params, page)"
+      @pagination="useQuery(params, page)"
     />
   </el-card>
 </template>

+ 17 - 1
src/views/purchase/transferOrder/add.vue

@@ -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, '调入仓库', basicForm.storageInventoryOrg, 'N', 'N')" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.storageWarehouse" :disabled="sonDisable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库', basicForm.storageInventory, '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>
@@ -309,6 +309,19 @@
             </template>
           </el-table-column>
           <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
+          <el-table-column label="调拨日期" align="center" prop="allotDate" width="230px">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-date-picker
+                  v-model="scope.row.allotDate"
+                  :readonly="sonDisable"
+                  type="date"
+                  size="small"
+                  value-format="yyyy-MM-dd">
+                </el-date-picker>
+              </el-form-item>
+            </template>
+          </el-table-column>
           <el-table-column label="批准文号" align="center" prop="ratifyCode" width="200px"/>
           <el-table-column label="注册证号" align="center" prop="registration" width="200px"/>
           <el-table-column label="商品名" align="center" prop="productCode" width="150px"/>
@@ -606,6 +619,7 @@ export default {
         deliveryCode: '',
         storageCode: '',
         storageInventoryOrg: '',
+        storageInventory: '',
         storageInventoryOrgName: '',
         businessPersonal: '',
         businessPersonalName: '',
@@ -805,6 +819,7 @@ export default {
         producBatch: null,
         manufactureDate: null,
         periodEndDate: null,
+        allotDate: null,
         ratifyCode: null,
         registration: null,
         productCode: null,
@@ -842,6 +857,7 @@ export default {
       if (this.referCondition.title == '调入库存组织') {
         this.ruOrgOptions = selection
         this.basicForm.storageInventoryOrg = selection[0].id
+        this.basicForm.storageInventory = selection[0].code
         this.basicForm.storageInventoryOrgName = selection[0].name
         this.basicForm.onRouteAffilliation = selection[0].name
         // 选择调入库存组织时判断调拨方式

+ 1 - 0
vue.config.js

@@ -46,6 +46,7 @@ module.exports = {
         // 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://127.0.0.1:8000/drp-admin`, //
         changeOrigin: true,
         pathRewrite: {
           ["^" + process.env.VUE_APP_BASE_API]: "",