Преглед изворни кода

1.新增收货仓库、联系人电话(主表),取消收货地点(子表),增加收货客户(子表)
2.物料选择之后带出物料药品属性
3.调整收货地址参照展示
4.调整编辑修订页面对字段禁用

002390 пре 2 година
родитељ
комит
e80cf90528

+ 1 - 0
package.json

@@ -38,6 +38,7 @@
     "url": "https://gitee.com/y_project/RuoYi-Vue.git"
   },
   "dependencies": {
+    "@gby/deep-copy": "^4.0.0",
     "@riophae/vue-treeselect": "0.4.0",
     "axios": "0.24.0",
     "clipboard": "2.0.8",

+ 24 - 6
src/components/popover-select/components/ADDRESS_PARAM.js

@@ -1,20 +1,38 @@
 // 收货地址
 export default [
+  // {
+  //   key: "id",
+  //   title: "ID",
+  //   type: "Input",
+  //   search: true,
+  // },
   {
-    key: "id",
-    title: "ID",
+    key: "code",
+    title: "编码",
     type: "Input",
     search: true,
   },
   {
-    key: "code",
-    title: "编码",
+    key: "name",
+    title: "仓库",
     type: "Input",
     search: true,
   },
   {
-    key: "name",
-    title: "名称",
+    key: "address",
+    title: "地址",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "contactsName",
+    title: "联系人",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "contactsPhone",
+    title: "电话",
     type: "Input",
     search: true,
   },

+ 66 - 27
src/views/purchase/purchase-order/add/column.js

@@ -163,7 +163,7 @@ export const Columns = [
   { key: "isMarketingSource", title: "由销售订单协同生成", inputType: "Checkbox",  isShow:true,},
   {
     key: "warehouseName",
-    title: "WMS入库仓库", // 收货仓库
+    title: "WMS入库仓库", 
     inputType: "PopoverSelect",
     require: true,
     valueKey: "id",
@@ -200,21 +200,44 @@ export const Columns = [
   { key: "rebateMoney", title: "订单使用返利金额", inputType: "Input",isShow:true, },
   { key: "deductionMoney", title: "订单抵扣余款金额", inputType: "Input",isShow:true, },
   { 
-    key: "addressName",
+    key: "goodsWarehouseName",
+    title: "收货仓库",
+    inputType: "Input",
+    isShow:true,
+    disabled:true,
+  },
+  { 
+    key: "address",
     title: "收货地址",
     inputType: "PopoverSelect",
-    valueKey: "id",
+    valueKey: "address",
     referName: "ADDRESS_PARAM",
     isShow:true,
     dataMapping: {
-      address: 'id',
-      addressName: 'name',
+      // address: 'address',
+      // addressName: '',
+      goodsWarehouse:'id',
+      goodsWarehouseName:'name',
       contacts:'contactsName',
+      contactsPhone:'contactsPhone'
     },
     queryParams: () => ({}),
     width: 180
   },
-  { key: "contacts", title: "收货联系人", inputType: "Input",isShow:true, },
+  { 
+    key: "contacts", 
+    title: "收货联系人", 
+    inputType: "Input",
+    isShow:true, 
+    disabled:true,
+  },
+  { 
+    key: "contactsPhone", 
+    title: "收货联系人电话", 
+    inputType: "Input",
+    isShow:true, 
+    disabled:true,
+  },
   {
     key: "customerDeptName",
     title: "客户部门",
@@ -288,7 +311,7 @@ export const Columns = [
     queryParams: (params) => ({
       // 组织、供应商id
       pkOrg: params.puOrg,
-      supplier:params.supplier
+      supplierId:params.supplier
     }),
     require: true,
   },
@@ -391,7 +414,7 @@ export const TabColumns = [
     title: '物料信息',
     key: 'puOrderItemList',
     tableColumns: [
-      { key: "rowNo", title: "行号", inputType: "Input", },
+      { key: "rowNo", title: "行号", inputType: "Input", disabled:true},
       // { key: "orderId", title: "采购订单ID", inputType: "Input", width: 180 },
       // {key: "material",title: "物料",inputType: "Input",   },
       {
@@ -464,7 +487,7 @@ export const TabColumns = [
       { //isMedicine  isMedicineValue
         key: "isMedcine",
         title: "医药物料", 
-        inputType: "Input", 
+        inputType: "Checkbox", 
         width: 180,
         disabled:true,
         readonly:true,
@@ -480,9 +503,9 @@ export const TabColumns = [
       { 
         key: "isDrug",
          title: "物料药品属性", 
-         inputType: "Input", 
-         width: 180 
-        },
+         inputType: "Checkbox", 
+         disabled:true,
+      },
       { //unitId  unitIdName
         key: "unit", 
         title: "单位", 
@@ -515,24 +538,40 @@ export const TabColumns = [
       { key: "isPayment", title: "付款关闭", inputType: "Checkbox", },
       { key: "isGift", title: "赠品", inputType: "Checkbox", },
       {
-        key: "warehouseName",
-        title: "收货仓库", //WMS入库仓库
-        inputType: "PopoverSelect",
-        valueKey: "id",
-        referName: "WAREHOUSE_PARAM",
-        dataMapping: {
-          warehouse: 'id',
-          warehouseName: 'name'
-        },
-        queryParams: () => ({}),
+        key: "goodsWarehouseName",
+        title: "收货仓库", 
+        inputType: "Input",
         width: 200,
+        disabled:true,
       },
-      { key: "place", title: "收货地点", inputType: "Input", width: 180 },
+      // { key: "place", title: "收货地点", inputType: "Input", width: 180 },
       { 
         key: "address",
         title: "收货地址",
-        inputType: "Input",
-        width: 180
+        inputType: "PopoverSelect",
+        valueKey: "address",
+        referName: "ADDRESS_PARAM",
+        width: 180,
+        dataMapping:{
+          // address: 'address',
+          // addressName: '',
+          goodsWarehouse:'id',
+          goodsWarehouseName:'name',
+          contacts:'contactsName',
+          contactsPhone:'contactsPhone'
+        }
+      },
+      { 
+        key: "customerName",
+        title: "收货客户", 
+        inputType: "PopoverSelect",
+        valueKey: "id",
+        referName: "CUSTOMER_PARAM",
+        width: 180,
+        dataMapping:{
+          customer:'id',
+          customerName:'name',
+        },
       },
       { key: "productBatch", title: "产品批号", inputType: "Input", width: 180 },
       { key: "manufactureDate", title: "生产日期", inputType: "Input", width: 180 },
@@ -643,7 +682,7 @@ export const TabColumns = [
     key: 'puOrderExecuteList',
     tableColumns: [
       // { key: "orderId", title: "采购订单ID", inputType: "Input", width: 180 },
-      { key: "rowno", title: "行号", inputType: "Input", },
+      { key: "rowno", title: "行号", inputType: "Input", disabled:true},
       {
         key: "materialName",
         title: "物料",
@@ -667,7 +706,7 @@ export const TabColumns = [
           materialClassifyOneName:'oneClass',
           materialClassifyTwoName:'twoClass',
           materialClassifyThreeName:'threeClass',
-          materialClassifyFourName:'fourClass'
+          materialClassifyFourName:'fourClass',
         },
         queryParams: () => ({}),
         width: 180

+ 6 - 1
src/views/purchase/purchase-order/add/index.vue

@@ -266,10 +266,15 @@ export default {
       console.log(source, "source");
       console.log(type, "type");
 
-      // 触发物料参照
+      // 触发物料参照询价
       if (type == "MATERIAL_PARAM" && source.qty && source.qty != "") {
         this.handleGetPrice();
       }
+
+      if(type == "MATERIAL_PARAM"){
+        source.isDrug = val.materialMedcine.isDrug  == '0' ? 'Y' : 'N';
+        // return source;
+      }
     },
 
     // 子表inputNumber

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

@@ -4,17 +4,6 @@ import { editColumns, editTabColumns, forbidden, SelectColumns } from "./initCol
 import orderApi from "@/api/business/purchase/purchase-order";
 import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
 
-// const NewColumns = initColumns(Columns);
-// const NewTabColumns = TabColumns.map((element) => ({
-//   ...element,
-//   tableColumns: initColumns(element.tableColumns),
-// }));
-// 
-// const SelectColumns = NewColumns.filter(column => column.inputType === 'Select')
-// NewTabColumns.forEach(column => {
-//   SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.inputType === 'Select'))
-// });
-
 export default {
   name: "EditPurchaseOrderDrawer",
   dicts: initDicts(SelectColumns),
@@ -84,7 +73,7 @@ export default {
     // 判断属性是否禁用
     handleIsForbidden(status) {
       console.log(status);
-      let { editColumns: updateColumns, editTabColumns: updateTabColumns } = forbidden(status != '2');
+      let {  updateColumns,updateTabColumns } = forbidden(status != '2');
       this.columns = updateColumns;
       this.tabColumns = updateTabColumns;
     },
@@ -193,6 +182,11 @@ export default {
 
         this.handleGetPrice();
       }
+
+      if(type == "MATERIAL_PARAM"){
+        source.isDrug = val.materialMedcine.isDrug  == '0' ? 'Y' : 'N';
+        // return source;
+      }
     },
     // 子表inputNumber
     handleInputChange(row, type) {
@@ -426,7 +420,7 @@ export default {
                     :multiple="cColumn.multiple"
                     :placeholder="cColumn.placeholder" 
                     :data-mapping="cColumn.dataMapping"
-                    :query-params="cColumn.queryParams(scope.row)" 
+                    :query-params="cColumn.queryParams" 
                     size="mini" 
                     @change="handleReferChange"
                   ></dr-popover-select>

+ 10 - 32
src/views/purchase/purchase-order/edit/initColumn.js

@@ -1,5 +1,7 @@
 import { Columns, TabColumns } from "../add/column";
 import { initColumns, initParams } from "@/utils/init";
+import deepCopy from "@gby/deep-copy";
+// import {deepCopy} from "../dist/deep-copy.es"
 
 
 export const editColumns = initColumns(Columns);
@@ -18,43 +20,19 @@ editTabColumns.forEach(column => {
 });
 
 
-
 // 禁用项
 export const forbidden = (isEdit) => {
 
-  console.log(isEdit, 'isEdit');
-  if (isEdit) {
-    console.log('编辑');
-    // 编辑
-    editColumns.forEach(item => {
-
-      if(item.key == 'code' || item.key == 'status'){
-
-        item.disabled = true;
-        item.readonly = true;
-      }else{
-        item.disabled = false;
-        item.readonly = false;
-      }
-    })
-
-    editTabColumns.forEach(item => {
+  let updateColumns = deepCopy(editColumns);
+  let updateTabColumns = deepCopy(editTabColumns);
 
-      item.tableColumns.forEach(t => {
+  console.log(isEdit, 'isEdit');
+  
+  if(!isEdit){  
 
-        if(t.key == 'rowno' ||t.key == 'rowNo'){
-          t.disabled = true;
-          t.readonly = true;
-        }else{
-          t.disabled = false;
-          t.readonly = false;
-        }
-      })
-    })
-  } else {
     console.log('修订');
     // 修订
-    editColumns.forEach(item => {
+    updateColumns.forEach(item => {
 
       if (item.key == 'buyerName' || item.key == 'puDeptName' || item.key == 'deductionMoney' ||
         item.key == 'supplierContactsName' || item.key == 'agentName' || item.key == 'isInvoice' ||
@@ -67,7 +45,7 @@ export const forbidden = (isEdit) => {
       }
     })
 
-    editTabColumns.forEach(item => {
+    updateTabColumns.forEach(item => {
 
       item.tableColumns.forEach(t => {
 
@@ -88,6 +66,6 @@ export const forbidden = (isEdit) => {
 
   }
 
-  return { editColumns, editTabColumns }
+  return { updateColumns, updateTabColumns }
 
 }

+ 2 - 2
vue.config.js

@@ -37,7 +37,7 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         // target: `http://172.16.100.107:8080/drp-admin`, //测试
-        // target: `http://test-sy.derom.com/drp-admin`, //测试
+        target: `http://test-sy.derom.com/drp-admin`, //测试
         // target: `http://release-sy.derom.com/drp-admin`, //预发
         // target: `http://sy.derom.com/drp-admin`, //生产
         // target: `http://172.16.63.202:8000/drp-admin`, // D本地
@@ -46,7 +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://172.16.13.21:8000/drp-admin`, // 雪豹的本地
+        // target: `http://172.16.13.21:8000/drp-admin`, // 雪豹的本地
         changeOrigin: true,
         pathRewrite: {
           ["^" + process.env.VUE_APP_BASE_API]: "",