Explorar el Código

调拨单字段整理

黄梓星 hace 2 años
padre
commit
6411ae1b9d

+ 1 - 2
src/components/Refers/treeRefer.vue

@@ -59,6 +59,7 @@ export default {
   methods: {
     init(val) {
       this.visible = true;
+      this.filterText = ''
       this.reciveForm = val
       this.$nextTick(() => {
         this.refreshList();
@@ -81,8 +82,6 @@ export default {
       this.choosePoint = data;
     },
     filterNode(value, data) {
-      console.log("value", value);
-      console.log("data", data);
       if (!value) return true;
       return data.name.indexOf(value) !== -1;
     },

+ 0 - 1
src/views/purchase/MaterialClassDivision/add.vue

@@ -388,7 +388,6 @@ export default {
     },
     selectionsToInput (selections) {
       console.log('父组件拿到的:', selections)
-      this.selectData = selections
       this.basicForm.material = selections[0].id
       this.basicForm.materialCode = selections[0].code
       this.basicForm.materialName = selections[0].name

+ 82 - 31
src/views/purchase/MaterialClassDivision/index.vue

@@ -96,49 +96,56 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="物料编码">
-              <el-select v-model="queryParams.material" size="small" style="width: 200px" clearable>
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input style="width: 200px" size="small" readonly v-model="queryParams.material">
+                  <el-button slot="append" icon="el-icon-more" @click="test01"></el-button>
+              </el-input>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料名称">
-              <el-select v-model="queryParams.materialName" size="small" style="width: 200px" clearable>
-                <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.materialName"
+                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.orderPersonal" size="small" style="width: 200px" clearable>
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
+              <el-select
+                  ref="staffs"
+                  size="small"
+                  style="width: 200px"
+                  v-model="queryParams.orderPersonal"
+                  clearable
+                  @focus="chooseRefer('CONTACTS_PARAM', true, '订单员')"
+                >
+                  <el-option
+                    v-for="item in staffOptions"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.code"
+                  />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="采购员">
-              <el-select v-model="queryParams.buyer" size="small" style="width: 200px" clearable>
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
+              <el-select
+                  ref="staffs2"
+                  size="small"
+                  style="width: 200px"
+                  v-model="queryParams.buyer"
+                  clearable
+                  @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')"
+                >
+                  <el-option
+                    v-for="item in staff2Options"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.code"
+                  />
               </el-select>
             </el-form-item>
           </el-col>
@@ -258,6 +265,14 @@
       @doSubmit="acceptFourClass"
       :single="true"
     />
+
+    <popDialog
+      ref="contractSelect"
+      @doSubmit="selectionsToInput"
+      :single="true"
+    />
+
+    <Refers ref="refer" @doSubmit="selectionsRefer" :single="true"/>
   </div>
 </template>
 
@@ -267,12 +282,17 @@ import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 import {getDivisionList, delDivision} from '@/api/purchase/basic.js'
 // 物料分类
 import fourClass from '@/components/PopDialog/fourClass.vue'
+// 物料编码
+import popDialog from '@/components/PopDialog/index.vue'
+import Refers from '@/components/Refers/refers.vue'
 export default {
   name: 'MaterialClassDivision',
   components: {
     Add,
     CollapseTransition,
-    fourClass
+    fourClass,
+    popDialog,
+    Refers
   },
   data() {
     return {
@@ -302,6 +322,13 @@ export default {
       options: [{
         value: 0, label: '仓库1'
       }],
+      staffOptions: [],
+      staff2Options: [],
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
       tableList: [],
       total: 0,
       rowDetail: {},
@@ -398,6 +425,30 @@ export default {
       console.log('收到的四级分类', selections)
       this.queryParams.materialClassifyFour = selections.code
     },
+    // 显示物料编码列表
+    test01() {
+      this.$refs.contractSelect.init()
+    },
+    selectionsToInput(selections) {
+      this.queryParams.material = selections[0].code
+    },
+    // 选择默认采购组织
+    chooseRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
+    },
+    selectionsRefer(selection) {
+      if (this.referCondition.title == '订单员') {
+        this.staffOptions = selection
+        this.queryParams.orderPersonal = selection[0].code
+      }
+      if (this.referCondition.title == '采购员') {
+        this.staff2Options = selection
+        this.queryParams.buyer = selection[0].code
+      }
+    }
   }
 }
 </script>

+ 22 - 6
src/views/purchase/PurchaseDemandList/add.vue

@@ -191,7 +191,7 @@
         >
           <el-table-column type="selection"/>
           <el-table-column label="序号" type="index" align="center"/>
-          <el-table-column label="行状态" align="center" prop="status" />
+          <el-table-column label="行状态" align="center" prop="status" :formatter="hangStatus"/>
           <el-table-column label="行号" align="center" prop="rowNo" />
           <el-table-column label="业务部门名称" align="center" width="180px">
             <template slot-scope="scope">
@@ -453,10 +453,10 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="补单供应商名称" align="center"  prop="additionalSupplierCode" width="200px">
+          <el-table-column label="补单供应商名称" align="center"  prop="additionalSupplierName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input readonly size="small" v-model="scope.row.additionalSupplierCode"/>
+                <el-input readonly size="small" v-model="scope.row.additionalSupplierName"/>
               </el-form-item>
             </template>
           </el-table-column>
@@ -630,6 +630,22 @@ export default {
     }
   },
   methods: {
+    hangStatus(row) {
+      switch (row.status) {
+        case '0':
+          return '需补货'
+        case '1':
+          return '待采购确认'
+        case '2':
+          return '采购已确认'
+        case '3':
+          return '采购已审核'
+        case '4':
+          return '行关闭'
+        case '5':
+          return '总供应可满足'
+      }
+    },
     copy() {
       this.$modal.msgSuccess("复制成功");
       this.sonPageStu = 'add'
@@ -753,7 +769,7 @@ export default {
         availableQty: null,
         statusAllot: 'N',
         additionalSupplier: null,
-        additionalSupplierCode: null,
+        additionalSupplierName: null,
         periodUnit: null,
         demandCustomer: null,
         demandCustomerName: null,
@@ -912,8 +928,8 @@ export default {
         this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = selection[0].name
       }
       if(this.referConditionMx.title == '选择补单供应商') {
-        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].code
-        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierCode = selection[0].name
+        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].id
+        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierName = selection[0].name
       }
       if(this.referConditionMx.title == '选择收货地址') {
         this.basicForm.puDemandItemList[this.tableIndex].deliveryAddressName = selection[0].name

+ 81 - 41
src/views/purchase/deliveryAddress/index.vue

@@ -5,25 +5,16 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="仓库属性">
-              <el-select v-model="queryParams.warehouseProperty" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
+              <el-select clearable v-model="queryParams.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>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="仓库档案名称">
-              <el-select v-model="queryParams.warehouseCode" 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 clearable size="small" v-model="queryParams.warehouseName" @focus="chooseRefer('WAREHOUSE_PARAM', true, '仓库档案名称')" style="width: 200px">
+                <el-option v-for="item in houseOptions" :key="item.id" :label="item.name" :value="item.name" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -60,13 +51,14 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="物料分类">
-              <el-select v-model="queryParams.materialClassify" 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
+                v-model="queryParams.materialClassifyName"
+                size="small"
+                clearable
+                @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '物料分类')"
+                style="width: 200px"
+                >
+                <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.name" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -85,13 +77,9 @@
 
           <el-col :span="1.5">
             <el-form-item label="联系人">
-            <el-input
-              v-model="queryParams.contactsName"
-              size="small"
-              placeholder=""
-              clearable
-              style="width: 200px"
-            />
+            <el-select clearable size="small" v-model="queryParams.contactsName" clearable @focus="chooseRefer('CONTACTS_PARAM', true, '联系人')" style="width: 200px">
+              <el-option v-for="item in contactsOptions" :key="item.id" :label="item.name" :value="item.name" />
+            </el-select>
             </el-form-item>
           </el-col>
 
@@ -100,7 +88,6 @@
             <el-input
               v-model="queryParams.contactsPhone"
               size="small"
-              placeholder=""
               clearable
               style="width: 200px"
             />
@@ -114,7 +101,6 @@
             <el-input
               v-model="queryParams.remark"
               size="small"
-              placeholder=""
               clearable
               style="width: 200px"
             />
@@ -123,19 +109,20 @@
 
           <el-col :span="1.5">
             <el-form-item label="同步状态">
-            <el-input
-              v-model="queryParams.sendStatus"
-              size="small"
-              placeholder=""
-              clearable
-              style="width: 200px"
-            />
+              <el-select v-model="queryParams.sendStatus" size="small" style="width: 200px" clearable>
+                <el-option
+                  v-for="item in options2"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
 
           <el-col :span="1.5">
             <el-form-item label="启用">
-              <el-select v-model="queryParams.status" size="small" style="width: 200px" clearable placeholder="请选择">
+              <el-select v-model="queryParams.status" size="small" style="width: 200px" clearable>
                 <el-option
                   v-for="item in options"
                   :key="item.value"
@@ -229,6 +216,10 @@
       </el-card>
     </div>
     <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"/>
+
+    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
+
+    <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
   </div>
 </template>
 
@@ -236,11 +227,16 @@
 import Add from './add.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 import {getAddressList, delAddress} from '@/api/purchase/deliveryAddress.js'
+import Refers from '@/components/Refers/refers.vue'
+import TreeRefers from '@/components/Refers/treeRefer.vue'
 export default {
   name: 'deliveryAddress',
+  dicts: ['sys_warehouse_attribute'],
   components: {
     Add,
-    CollapseTransition
+    CollapseTransition,
+    Refers,
+    TreeRefers
   },
   data() {
     return {
@@ -254,6 +250,7 @@ export default {
         code: '',
         name: '',
         warehouse: '',
+        warehouseName: '',
         warehouseCode: '',
         warehouseProperty: '',
         address: '',
@@ -269,10 +266,23 @@ export default {
         pageSize: 5
       },
       options: [{
-        value: '0', label: '是',
+        value: '0', label: '启用',
+      }, {
+        value: '2', label: '停用'
+      }],
+      options2: [{
+        value: '0', label: '已同步',
       }, {
-        value: '2', label: '否'
+        value: '2', label: '未同步'
       }],
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
+      houseOptions: [],
+      classOptions: [],
+      contactsOptions: [],
       tableList: [],
       total: 0,
       rowDetail: {},
@@ -299,6 +309,7 @@ export default {
         code: '',
         name: '',
         warehouse: '',
+        warehouseName: '',
         warehouseCode: '',
         warehouseProperty: '',
         address: '',
@@ -359,7 +370,36 @@ export default {
     },
     drop() {
       this.expanded = !this.expanded
-    }
+    },
+    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.queryParams.warehouse = selection[0].id
+        this.queryParams.warehouseName = selection[0].name
+      }
+      if (this.referCondition.type == 'CONTACTS_PARAM') {
+        this.contactsOptions = selection
+        // this.queryParams.contacts = selection[0].code
+        this.queryParams.contactsName = selection[0].name
+      }
+    },
+    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.queryParams.materialClassify = selection.id
+      this.queryParams.materialClassifyName = selection.name
+    },
   }
 }
 </script>

+ 91 - 45
src/views/purchase/transferOrder/add.vue

@@ -3,6 +3,13 @@
     <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto">
       <el-row :gutter="10">
         <el-col :span="1.5">
+          <el-form-item label="调出库存组织">
+            <el-select clearable size="small" v-model="basicForm.deliveryInventoryOrg" :disabled="sonDisable" @focus="chooseRefer('ORG_PARAM', true, '调出库存组织')" style="width: 200px">
+              <el-option v-for="item in chuOrgOptions" :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.billType" size="small" style="width: 200px" clearable>
                 <el-option v-for="dict in dict.type.sys_allot_billtype" :key="dict.value" :label="dict.label" :value="dict.value">
@@ -67,57 +74,43 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调入库存组织">
-              <el-input
-                v-model="basicForm.storageInventoryOrg"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-              />
+              <el-select clearable size="small" v-model="basicForm.storageInventoryOrg" :disabled="sonDisable" @focus="chooseRefer('ORG_PARAM', true, '调入库存组织')" style="width: 200px">
+                <el-option v-for="item in ruOrgOptions" :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-input
-                v-model="basicForm.businessPersonal"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-              />
+              <el-select clearable size="small" v-model="basicForm.businessPersonal" :disabled="sonDisable" @focus="chooseRefer('CONTACTS_PARAM', true, '调出业务员')" style="width: 200px">
+                <el-option v-for="item in manOptions" :key="item.id" :label="item.name" :value="item.code" />
+              </el-select>
             </el-form-item>
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调出部门">
-              <el-input
-                v-model="basicForm.deliveryDept"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-              />
+              <el-select clearable size="small" v-model="basicForm.deliveryDept" :disabled="sonDisable" @focus="chooseRefer('DEPT_PARAM', true, '调出部门')" style="width: 200px">
+                <el-option v-for="item in deptOptions" :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-input
-                v-model="basicForm.currency"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-              />
+              <el-select clearable size="small" v-model="basicForm.currency" :disabled="sonDisable" @focus="chooseRefer('CURRENCY_PARAM', true, '币种')" style="width: 200px">
+                <el-option v-for="item in currencyOptions" :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-input
+              <el-input-number
                 v-model="basicForm.rate"
                 size="small"
-                placeholder=""
-                clearable
+                disabled
+                :precision="2" 
+                :step="0.1" 
+                :max="10"
                 style="width: 200px"
-              />
+              ></el-input-number>
             </el-form-item>
          </el-col>
         <el-col :span="1.5">
@@ -125,7 +118,6 @@
               <el-input
                 v-model="basicForm.onRouteAffilliation"
                 size="small"
-                placeholder=""
                 clearable
                 style="width: 200px"
               />
@@ -253,9 +245,9 @@
           <el-table-column label="行号" align="center" prop="rowno"/>
           <el-table-column label="物料编码" align="center" prop="material"/>
           <el-table-column label="物料名称" align="center" prop="materialName"/>
-          <el-table-column label="调拨出库单号" align="center" prop="code"/>
-          <el-table-column label="调拨入库单号" align="center" prop="code"/>
-          <el-table-column label="规格" align="center" prop="code"/>
+          <el-table-column label="调拨出库单号" align="center" prop="deliveryCode"/>
+          <el-table-column label="调拨入库单号" align="center" prop="storageCode"/>
+          <el-table-column label="规格" align="center" prop="specification"/>
           <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer"/>
           <el-table-column label="产地" align="center" prop="originPlace"/>
           <el-table-column label="型号" align="center" prop="model"/>
@@ -501,31 +493,36 @@
         <el-button size="small" plain @click="back">返回</el-button>
       </el-col>
     </div>
+
+    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
   </div>
 </template>
 
 <script>
 import {addOrder, getOrderDetail, editOrder} from '@/api/purchase/transferOrder.js'
+import Refers from '@/components/Refers/refers.vue'
 export default {
   name: 'addOder',
   dicts: ['sys_allot_billtype', 'sys_project_group'],
   props: ['pageStu','row', 'disable'],
+  components: {
+    Refers
+  },
   model: {
     prop: 'isList',
     event: 'jugislist'
   },
   data() {
     return {
-      basicForm: {},
-      options: [{
-        value: '1', label: '是',
-      }, {
-        value: '0', label: '否'
-      }],
-      basicRules: {
+      // 不能直接改变props传来的值
+      sonPageStu: this.pageStu,
+      sonDisable: this.disable,
+      basicForm: {
+        deliveryInventoryOrg: '',
+        deliveryInventoryOrgName: '',
         billType: '',
         code: '',
-        billDate	: '',
+        billDate: '',
         allotType: '',
         deliveryCode: '',
         storageCode: '',
@@ -537,7 +534,7 @@ export default {
         deliveryDeptName: '',
         currency: '',
         currencyName: '',
-        rate: '',
+        rate: 1,
         onRouteAffilliation: '',
         qty: '',
         accountPath: '',
@@ -557,6 +554,22 @@ export default {
         updateByName: '',
         delFlag: '',
       },
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: '',
+      },
+      options: [{
+        value: '1', label: '是',
+      }, {
+        value: '0', label: '否'
+      }],
+      chuOrgOptions: [],
+      ruOrgOptions:[],
+      manOptions: [],
+      deptOptions: [],
+      currencyOptions: [],
+      basicRules: {},
       materialInfo: [],
       receiveInfo: [],
       priceList: [],
@@ -622,6 +635,39 @@ export default {
       // console.log('删除行:', index)
       // this.basicForm.puDemandItemList.splice(index, 1)
     },
+    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.title == '调出库存组织') {
+        this.chuOrgOptions = selection
+        this.basicForm.deliveryInventoryOrg = selection[0].id
+        this.basicForm.deliveryInventoryOrgName = selection[0].name
+      }
+      if (this.referCondition.title == '调入库存组织') {
+        this.ruOrgOptions = selection
+        this.basicForm.storageInventoryOrg = selection[0].id
+        this.basicForm.storageInventoryOrgName = selection[0].name
+      }
+      if (this.referCondition.title == '调出业务员') {
+        this.manOptions = selection
+        this.basicForm.businessPersonal = selection[0].code
+        this.basicForm.businessPersonalName = selection[0].name
+      }
+      if (this.referCondition.title == '调出部门') {
+        this.deptOptions = selection
+        this.basicForm.deliveryDept = selection[0].id
+        this.basicForm.deliveryDeptName = selection[0].name
+      }
+      if (this.referCondition.title == '币种') {
+        this.currencyOptions = selection
+        this.basicForm.currency = selection[0].id
+        this.basicForm.currencyName = selection[0].name
+      }
+    },
   }
 }
 </script>