Explorar o código

xzt339,308,385,391,383,414

黄梓星 %!s(int64=2) %!d(string=hai) anos
pai
achega
6982bef7dc

+ 42 - 4
src/components/Refers/refers.vue

@@ -19,10 +19,18 @@
           <el-main>
             <el-table :data="dataList" v-loading="loading" size="small" border ref="contractTable"
               @select="handleSelectionChange" @row-click="rowSelect" height="calc(100% - 40px)">
-              <el-table-column type="selection" header-align="center" align="center" width="50"/>
-              <el-table-column prop="id" header-align="center" align="center" min-width="90" label="id"/>
-              <el-table-column prop="name" header-align="center" align="center" min-width="90" label="名称"/>
-              <el-table-column v-if="orgName" prop="orgName" header-align="center" align="center" min-width="90" label="所属组织"/>
+              <el-table-column show-overflow-tooltip type="selection" header-align="center" align="center" width="50"/>
+              <el-table-column show-overflow-tooltip prop="id" header-align="center" align="center" min-width="90" :label="reciveForm.title + 'id'"/>
+              <el-table-column show-overflow-tooltip prop="code" header-align="center" align="center" min-width="90" :label="reciveForm.title + '编码'"/>
+              <el-table-column show-overflow-tooltip prop="name" header-align="center" align="center" min-width="90" :label="reciveForm.title + '名称'"/>
+              <el-table-column show-overflow-tooltip v-if="orgName" prop="orgName" header-align="center" align="center" min-width="90" label="所属组织"/>
+              <el-table-column show-overflow-tooltip v-if="warehouseCode" prop="warehouseCode" header-align="center" align="center" min-width="90" label="所属仓库编码"/>
+              <el-table-column show-overflow-tooltip v-if="warehouseName" prop="warehouseName" header-align="center" align="center" min-width="90" label="所属仓库"/>
+              <el-table-column show-overflow-tooltip v-if="contactsName" prop="contactsName" header-align="center" align="center" min-width="90" label="联系人"/>
+              <el-table-column show-overflow-tooltip v-if="contactsPhone" prop="contactsPhone" header-align="center" align="center" min-width="90" label="联系人电话"/>
+              <el-table-column show-overflow-tooltip v-if="address" prop="address" header-align="center" align="center" min-width="90" label="详细地址"/>
+              <el-table-column show-overflow-tooltip v-if="materialClassifyName" prop="materialClassifyName" header-align="center" align="center" min-width="90" label="物料分类"/>
+              <el-table-column show-overflow-tooltip v-if="remark" prop="remark" header-align="center" align="center" min-width="90" label="备注"/>
             </el-table>
             <el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
               :current-page="searchForm.pageNo" :page-sizes="[5, 10, 15, 20]" :page-size="searchForm.pageSize"
@@ -55,6 +63,13 @@ export default {
       dataList: [],
       total: 0,
       orgName: false,
+      warehouseCode: false,
+      warehouseName: false,
+      contactsName: false,
+      contactsPhone: false,
+      address: false,
+      materialClassifyName: false,
+      remark: false,
       orders: [],
       loading: false,
       visible: false,
@@ -92,11 +107,34 @@ export default {
         console.log('res', res)
         this.dataList = res.rows;
         this.total = res.total
+        // 仓库里面加组织
         if(res.rows.length !== 0 && res.rows[0].orgName) {
           this.orgName = true
         } else {
           this.orgName = false
         }
+        // 选择货位里面加仓库
+        if(res.rows.length !== 0 && res.rows[0].warehouseCode) {
+          this.warehouseCode = true
+          this.warehouseName = true
+        } else {
+          this.warehouseCode = false
+          this.warehouseName = false
+        }
+        // 选择收货地址内加详细信息
+        if(res.rows.length !== 0 && res.rows[0].contactsName) {
+          this.contactsName = true
+          this.contactsPhone = true
+          this.address = true
+          this.materialClassifyName = true
+          this.remark = true
+        } else {
+          this.contactsName = false
+          this.contactsPhone = false
+          this.address = false
+          this.materialClassifyName = false
+          this.remark = false
+        }
         this.loading = false;
         this.$nextTick(() => {
           this.setSelectRow();

+ 21 - 0
src/views/purchase/DemandSummary/add.vue

@@ -4,6 +4,7 @@
       <span>采购需求处理详情</span>
       <div class="btn_grooup">
         <el-button type="primary" size="small" @click="editLine">编辑</el-button>
+        <el-button type="danger" size="small" v-if="!lineDisable" @click="cancelEdit">取消编辑</el-button>
         <el-button type="success" size="small" v-if="!lineDisable" @click="saveLine">保存</el-button>
         <el-button type="primary" size="small" @click="closeLine">行关闭</el-button>
         <el-button type="primary" size="small">重取批量</el-button>
@@ -18,6 +19,7 @@
         <el-table-column show-overflow-tooltip type="selection" width="55" />
         <el-table-column show-overflow-tooltip label="序号" align="center" type="index"/>
         <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo"/>
+        <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" width="120px" :formatter="hangStatus"/>
         <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode"/>
         <el-table-column show-overflow-tooltip label="品名" align="center" prop="materialName" width="180"/>
         <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification"/>
@@ -126,6 +128,22 @@ export default {
   },
   data() {
     return{
+      hangStatus(row) {
+        switch (row.status) {
+          case '0':
+            return '需补货'
+          case '1':
+            return '待计划确认'
+          case '2':
+            return '计划已确认'
+          case '3':
+            return '计划已审核'
+          case '4':
+            return '行关闭'
+          case '5':
+            return '总供应可满足'
+        }
+      },
       priceClass(row) {
         switch (row.priceType) {
           case 'order':
@@ -178,6 +196,9 @@ export default {
       console.log('sonList`````', this.tableList)
       this.lineDisable = false
     },
+    cancelEdit() {
+      this.lineDisable = true
+    },
     saveLine() {
       editSummaryMx(this.tableList).then(res => {
         if (res.code === 200) {

+ 13 - 8
src/views/purchase/DemandSummary/index.vue

@@ -148,7 +148,7 @@
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="末级供应库位">
-                <el-select clearable size="small" v-model="queryParams.lastAllocation" @focus="chooseRefer('ALLOCATION_PARAM', true, '末级供应库位')" style="width: 200px">
+                <el-select clearable size="small" v-model="queryParams.lastAllocation" @focus="chooseRefer('ALLOCATION_PARAM', true, '末级供应库位', queryParams.lastWarehouse)" style="width: 200px">
                   <el-option v-for="item in lastAllocationOptions" :key="item.id" :label="item.name" :value="item.id" />
                 </el-select>
               </el-form-item>
@@ -230,6 +230,7 @@
       <el-card>
         <div class="btn_grooup">
           <el-button type="primary" size="small" @click="editList">编辑</el-button>
+          <el-button type="danger" size="small" v-if="!lineDisable" @click="cancelEdit">取消编辑</el-button>
           <el-button type="success" size="small" v-if="!lineDisable" @click="saveList">保存</el-button>
           <el-button type="primary" size="small" @click="confirms">确认</el-button>
           <el-button type="primary" size="small" @click="cancels">取消</el-button>
@@ -289,14 +290,14 @@
           <el-table-column show-overflow-tooltip label="人工调整数" align="center" prop="artificialAdjust" width="100px"/>
           <el-table-column show-overflow-tooltip label="修改原因" align="center" prop="modifyReason" width="150px">
             <template slot-scope="scope">
-                <el-input :disabled="lineDisable" v-model="scope.row.modifyReason"/>
+                <el-input :disabled="scope.row.status !== '1'|| lineDisable" v-model="scope.row.modifyReason"/>
             </template>
           </el-table-column>
           <el-table-column show-overflow-tooltip label="建议采购量" align="center" prop="suggestionPurchase" width="100px"/>
           <el-table-column show-overflow-tooltip label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/>
           <el-table-column show-overflow-tooltip label="最终采购量" align="center" prop="finalBuyQty" width="150">
             <template slot-scope="scope">
-                <el-input :disabled="lineDisable" v-model="scope.row.finalBuyQty"/>
+                <el-input :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty"/>
             </template>
           </el-table-column>
           <el-table-column show-overflow-tooltip label="二级品类" align="center" prop="materialClassifyTwoName" width="150px"/>
@@ -304,15 +305,15 @@
           <el-table-column show-overflow-tooltip label="四级品类" align="center" prop="materialClassifyFourName" width="150px"/>
           <el-table-column show-overflow-tooltip label="采购员" align="center" prop="buyerName" width="150px">
             <template slot-scope="scope">
-                <el-input :disabled="lineDisable" size="small" v-model="scope.row.buyerName">
-                  <el-button size="small" :disabled="lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'CONTACTS_PARAM', true, '采购员')"></el-button>
+                <el-input :disabled="scope.row.status !== '1' || lineDisable" size="small" v-model="scope.row.buyerName">
+                  <el-button size="small" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'CONTACTS_PARAM', true, '采购员')"></el-button>
                 </el-input>
             </template>
           </el-table-column>
           <el-table-column show-overflow-tooltip label="默认采购组织" align="center" prop="purchaseOrgName" width="280px">
             <template slot-scope="scope">
-                <el-input :disabled="lineDisable" size="small" v-model="scope.row.purchaseOrgName">
-                  <el-button size="small" :disabled="lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'ORG_PARAM', true, '默认采购组织')"></el-button>
+                <el-input :disabled="scope.row.status !== '1' || lineDisable" size="small" v-model="scope.row.purchaseOrgName">
+                  <el-button size="small" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'ORG_PARAM', true, '默认采购组织')"></el-button>
                 </el-input>
             </template>
           </el-table-column>
@@ -598,6 +599,9 @@ export default {
       console.log('Lists`````',this.tableList)
       this.lineDisable = false
     },
+    cancelEdit() {
+      this.lineDisable = true
+    },
     saveList() {
       editSummaryList(this.tableList).then(res => {
         if (res.code === 200) {
@@ -657,10 +661,11 @@ export default {
       } 
     },
     // 搜索区参照选择
-    chooseRefer(type, isPage, title) {
+    chooseRefer(type, isPage, title, stordocId) {
       this.referCondition.type = type
       this.referCondition.isPage = isPage
       this.referCondition.title = title
+      this.referCondition.stordocId = stordocId
       this.$refs.refer.init(this.referCondition)
     },
     selectionsToInput(selection) {

+ 1 - 1
src/views/purchase/PurchaseDemandList/add.vue

@@ -423,7 +423,7 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip label="收货地址编码" align="center" prop="deliveryAddress" width="200px"></el-table-column>
+          <!-- <el-table-column show-overflow-tooltip label="收货地址编码" align="center" prop="deliveryAddress" width="200px"></el-table-column> -->
           <el-table-column show-overflow-tooltip label="联系人" align="center"  prop="contacts"/>
           <el-table-column show-overflow-tooltip label="联系人电话" align="center"  prop="contactsPhone" width="200px"/>
           <el-table-column show-overflow-tooltip label="详细地址" align="center"  prop="address" width="200px"/>

+ 2 - 2
src/views/purchase/PurchaseDemandList/index.vue

@@ -45,7 +45,7 @@
           <el-col :span="1.5">
             <el-form-item label="需求人员">
               <el-select clearable size="small" v-model="queryParams.demandPersonal" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
-                <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.id" />
+                <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -531,7 +531,7 @@ export default {
       }
       if (this.referCondition.type == 'CONTACTS_PARAM') {
         this.personOptions = selection
-        this.queryParams.demandPersonal = selection[0].id
+        this.queryParams.demandPersonal = selection[0].code
       }
       if (this.referCondition.type == 'DEPT_PARAM') {
         this.deptOptions = selection