Prechádzať zdrojové kódy

物料分工表和收货地址档案完善

黄梓星 2 rokov pred
rodič
commit
c50234a35b

+ 2 - 0
src/views/purchase/DemandSummary/index.vue

@@ -274,6 +274,8 @@
           <el-table-column label="单位" align="center" prop="unit"/>
           <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="180px"/>
           <el-table-column label="需求单位数" align="center" prop="demandNum" width="120px"/>
+          <el-table-column label="近1月月均需求" align="center" prop="evensalesforyear" width="120px"/>
+          <el-table-column label="近3月月均需求" align="center" prop="evensalesforthrmonth" width="120px"/>
           <el-table-column label="总最终净需求量" align="center" prop="netDemandNum" width="120px"/>
           <el-table-column label="总月销量" align="center" prop="totalMonthlySales"/>
           <el-table-column label="需求可用周期" align="center" prop="demandCycle" width="180px"/>

+ 73 - 56
src/views/purchase/MaterialClassDivision/add.vue

@@ -124,12 +124,12 @@
                     style="width: 200px"
                     :disabled="disable"
                     clearable
-                    @focus="chooseOrganizations"
+                    @focus="chooseRefer('ORG_PARAM', true, '选择所属组织')"
                   >
                     <el-option
                       v-for="item in organizationsOptions"
                       :key="item.id"
-                      :label="item.label"
+                      :label="item.name"
                       :value="item.id"
                     />
                 </el-select>
@@ -145,7 +145,7 @@
                   :disabled="disable"
                   v-model="basicForm.orderPersonal"
                   clearable
-                  @focus="chooseStaff"
+                  @focus="chooseRefer('CONTACTS_PARAM', true, '订单员')"
                 >
                   <el-option
                     v-for="item in staffOptions"
@@ -177,7 +177,7 @@
                   :disabled="disable"
                   v-model="basicForm.buyer"
                   clearable
-                  @focus="chooseStaff2"
+                  @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')"
                 >
                   <el-option
                     v-for="item in staff2Options"
@@ -249,17 +249,7 @@
       :single="true"
     />
 
-    <orgs
-      ref="orgs"
-      @doSubmit="acceptOrgs"
-      :single="true"
-    />
-
-    <staff
-      ref="staff"
-      @doSubmit="acceptStaff"
-      :single="true"
-    />
+    <Refers ref="refer" @doSubmit="selectionsRefer" :single="true"/>
 
     <staff2
       ref="staff2"
@@ -278,8 +268,9 @@ import { getDetail } from '@/api/classify/basic';
 // 物料编码
 import popDialog from '@/components/PopDialog/index.vue'
 // 公用一个树形(组织部门传值不同)
-import orgs from '@/components/PopDialog/organization.vue'
-import staff from '@/components/PopDialog/staff.vue'
+import Refers from '@/components/Refers/refers.vue'
+// 用于回显参照框数据
+import { getRefer } from '@/api/purchase/basic.js'
 import staff2 from '@/components/PopDialog/staff.vue'
 // 所属组织,订单员用于回显
 import { getOrgs, getStaff} from '@/api/requisition/basic'
@@ -288,8 +279,7 @@ export default {
   components: {
     fourClass,
     popDialog,
-    orgs,
-    staff,
+    Refers,
     staff2
   },
   props: ['pageStu','row', 'disable'],
@@ -327,6 +317,11 @@ export default {
       options: [{
         value: 0, label: '仓库1'
       }],
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
       organizationsOptions: [],
       staffOptions: [],
       staff2Options: [],
@@ -362,7 +357,7 @@ export default {
       this.$emit('jugislist', true)
       let queryParams = {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
       }
       this.$emit('refresh', queryParams)
     },
@@ -371,9 +366,12 @@ export default {
       getDivisions(row.id).then(res => {
         if (res.code === 200) {
           this.basicForm = res.data
-          this.getOrgDetails(res.data.org)
-          this.getStaffDetails(res.data.orderPersonal)
-          this.getStaffDetails2(res.data.buyer)
+          if (this.basicForm.org) { this.reBackRefer('ORG_PARAM', this.basicForm.org) }
+          if (this.basicForm.orderPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.orderPersonal, '订单员') }
+          if (this.basicForm.buyer) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.buyer, '采购员') }
+          // this.getOrgDetails(res.data.org)
+          // this.getStaffDetails(res.data.orderPersonal)
+          // this.getStaffDetails2(res.data.buyer)
         }
       })
     },
@@ -412,45 +410,64 @@ export default {
       this.$refs.contractSelect.init()
     },
     // 选择默认采购组织
-    acceptOrgs (selections) {
-      console.log('接收的采购组织', selections)
-      this.basicForm.org = selections.id
-      this.getOrgDetails(selections.id)
+    chooseRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
     },
-    // 默认采购组织显示列表
-    chooseOrganizations () {
-      this.$refs.organizations.blur()
-      this.$refs.orgs.init('1')
+    selectionsRefer(selection) {
+      if (this.referCondition.title == '选择所属组织') {
+        this.organizationsOptions = selection
+        this.basicForm.org = selection[0].id
+        this.basicForm.orgName = selection[0].name
+      }
+      if (this.referCondition.title == '订单员') {
+        this.staffOptions = selection
+        this.basicForm.orderPersonal = selection[0].code
+        this.basicForm.orderPersonalName = selection[0].name
+      }
+      if (this.referCondition.title == '采购员') {
+        this.staff2Options = selection
+        this.basicForm.buyer = selection[0].code
+        this.basicForm.buyerName = selection[0].name
+      }
     },
-    // 采购组织回显
-    getOrgDetails(id) {
-      getOrgs({deptId: id}).then(res => {
-        if (res.code === 200) {
-          this.organizationsOptions = res.data
+    // 回显参照框
+    reBackRefer(type, id, title) {
+      getRefer({ type: type, id: id }).then(res => {
+        if (type == 'ORG_PARAM') {
+          this.organizationsOptions = res.rows
         }
-      })
-    },
-    // 选择订单员
-    acceptStaff (selections) {
-      this.staffOptions = selections
-      this.basicForm.orderPersonal = selections[0].code
-      this.basicForm.orderPersonalName = selections[0].name
-      this.getStaffDetails(selections[0].id)
-    },
-    // 订单员显示列表
-    chooseStaff () {
-      this.$refs.staffs.blur()
-      this.$refs.staff.init()
-    },
-    // 订单员回显
-    getStaffDetails(id) {
-      getStaff({id:id}).then(res => {
-        console.log('订单员', res)
-        if (res.code === 200 ) {
-          this.staffOptions = res.data.tableBody
+        if (type == 'CONTACTS_PARAM' && title == '订单员') {
+          this.staffOptions = res.rows
+        }
+        if (type == 'CONTACTS_PARAM' && title == '采购员') {
+          this.staff2Options = res.rows
         }
       })
     },
+    // 选择订单员
+    // acceptStaff (selections) {
+    //   this.staffOptions = selections
+    //   this.basicForm.orderPersonal = selections[0].code
+    //   this.basicForm.orderPersonalName = selections[0].name
+    //   this.getStaffDetails(selections[0].id)
+    // },
+    // // 订单员显示列表
+    // chooseStaff () {
+    //   this.$refs.staffs.blur()
+    //   this.$refs.staff.init()
+    // },
+    // // 订单员回显
+    // getStaffDetails(id) {
+    //   getStaff({id:id}).then(res => {
+    //     console.log('订单员', res)
+    //     if (res.code === 200 ) {
+    //       this.staffOptions = res.data.tableBody
+    //     }
+    //   })
+    // },
     // 选择采购员
     acceptStaff2 (selections) {
       this.staff2Options = selections

+ 44 - 58
src/views/purchase/MaterialClassDivision/index.vue

@@ -5,50 +5,42 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="物料一级大类编码">
-              <el-select v-model="queryParams.materialClassifyOne" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyOne"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料一级大类名称">
-              <el-select v-model="queryParams.materialClassifyOneName" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyOneName"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料二级大类编码">
-              <el-select v-model="queryParams.materialClassifyTwo" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyTwo"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料二级大类名称">
-              <el-select v-model="queryParams.materialClassifyTwoName" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyTwoName"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
@@ -64,26 +56,22 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="物料三级大类编码">
-              <el-select v-model="queryParams.materialClassifyThree" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyThree"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料三级大类名称">
-              <el-select v-model="queryParams.materialClassifyThreeName" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyThreeName"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
@@ -100,14 +88,12 @@
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料四级大类名称">
-              <el-select v-model="queryParams.materialClassifyFourName" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyFourName"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
         </el-row>
@@ -235,7 +221,7 @@
           <el-table-column label="物料编码" align="center" width="150" prop="material" />
           <el-table-column label="物料名称" align="center" prop="materialName" />
           <el-table-column label="生产厂商" align="center" width="150" prop="manufacturer" />
-          <el-table-column label="所属组织" align="center" width="120" prop="orgName" />
+          <el-table-column label="所属组织" align="center" width="120" prop="orgName"/>
           <el-table-column label="订单员" align="center" width="150" prop="orderPersonalName" />
           <el-table-column label="采购员" align="center" width="150" prop="buyerName" />
           <el-table-column label="订单部门" align="center" width="150" prop="orderDeptName" />
@@ -307,7 +293,7 @@ export default {
         manufacturer: '',
         remark: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
       },
       options: [{
         value: 0, label: '仓库1'

+ 2 - 0
src/views/purchase/PurchaseDemandList/add.vue

@@ -704,6 +704,7 @@ export default {
         materialCode: null,
         material: null,
         materialName: null,
+        classifyId: null,
         specification: null,
         unit: null,
         unitName: null,
@@ -942,6 +943,7 @@ export default {
       this.basicForm.puDemandItemList[this.tableIndex].materialCode = selection[0].code
       this.basicForm.puDemandItemList[this.tableIndex].material = selection[0].id
       this.basicForm.puDemandItemList[this.tableIndex].materialName = selection[0].name
+      this.basicForm.puDemandItemList[this.tableIndex].classifyId = selection[0].classifyId
       this.basicForm.puDemandItemList[this.tableIndex].materialClassifyOneName = selection[0].oneClass
       this.basicForm.puDemandItemList[this.tableIndex].materialClassifyTwoName = selection[0].twoClass
       this.basicForm.puDemandItemList[this.tableIndex].materialClassifyThreeName = selection[0].threeClass

+ 59 - 23
src/views/purchase/deliveryAddress/add.vue

@@ -28,24 +28,16 @@
 
         <el-col :span="1.5">
             <el-form-item label="仓库档案名称">
-              <el-input
-                v-model="basicForm.warehouseCode"
-                size="small"
-                :disabled="disable"
-                clearable
-                style="width: 200px"
-              />
+              <el-select size="small" v-model="basicForm.warehouseCode" :disabled="disable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '仓库档案名称')" style="width: 200px">
+                <el-option v-for="item in houseOptions" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
          </el-col>
 
          <el-col :span="1.5">
-            <el-form-item label="仓库属性">
-              <el-select v-model="basicForm.warehouseProperty" size="small" style="width: 200px" clearable :disabled="disable">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
+          <el-form-item label="仓库属性">
+              <el-select :disabled="disable" v-model="basicForm.warehouseProperty" size="small" style="width: 200px">
+                <el-option v-for="dict in dict.type.sys_warehouse_attribute" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
             </el-form-item>
@@ -65,13 +57,9 @@
 
           <el-col :span="1.5">
             <el-form-item label="联系人">
-              <el-input
-                v-model="basicForm.contactsName"
-                size="small"
-                :disabled="disable"
-                clearable
-                style="width: 200px"
-              />
+              <el-select size="small" v-model="basicForm.contactsName" :disabled="disable" @focus="chooseRefer('CONTACTS_PARAM', true, '联系人')" style="width: 200px">
+                <el-option v-for="item in contactsOptions" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
          </el-col>
 
@@ -89,13 +77,16 @@
 
           <el-col :span="1.5">
             <el-form-item label="物料分类">
-              <el-input
+              <el-select
                 v-model="basicForm.materialClassify"
                 size="small"
                 :disabled="disable"
                 clearable
+                @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-select>
             </el-form-item>
          </el-col>
 
@@ -151,14 +142,25 @@
         <el-button size="small" plain @click="back">返回</el-button>
       </el-col>
     </div>
+
+    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
+
+    <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
   </div>
 </template>
 
 <script>
+import Refers from '@/components/Refers/refers.vue'
+import TreeRefers from '@/components/Refers/treeRefer.vue'
 import {addAddress, getAddressDetail, editAddress} from '@/api/purchase/deliveryAddress.js'
 export default {
   name: 'addAddress',
+  dicts: ['sys_warehouse_attribute'],
   props: ['pageStu','row', 'disable'],
+  components: {
+    Refers,
+    TreeRefers
+  },
   model: {
     prop: 'isList',
     event: 'jugislist'
@@ -181,11 +183,19 @@ export default {
         sendStatus: '',
         remark: '',
       },
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
       options: [{
         value: '1', label: '是',
       }, {
         value: '0', label: '否'
       }],
+      houseOptions: [],
+      contactsOptions: [],
+      classOptions: [],
       basicRules: {}
     }
   },
@@ -232,6 +242,32 @@ export default {
         }
       })
     },
+    chooseRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
+    },
+    selectionsToInput(selection) {
+      if (this.referCondition.type == 'WAREHOUSE_PARAM') {
+        this.houseOptions = selection
+        this.basicForm.warehouseCode = selection[0].id
+      }
+      if (this.referCondition.type == 'CONTACTS_PARAM') {
+        this.contactsOptions = selection
+        this.basicForm.contactsName = selection[0].id
+      }
+    },
+    chooseTreeRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.tree.init(this.referCondition)
+    },
+    selectionsToInput2(selection) {
+      this.classOptions.push(selection)
+      this.basicForm.materialClassify = selection.id
+    },
   }
 }
 </script>