Jelajahi Sumber

Merge tag 'Hotfix-mo-31' into develop

Finish Hotfix-mo-31
莫绍宝 3 tahun lalu
induk
melakukan
66acb72d3c

+ 9 - 0
src/api/supply/reserve.js

@@ -70,4 +70,13 @@ export function checkMaterialList(params) {
     method: 'get',
     params
   })
+}
+
+// 获取仓库列表
+export function getWarehouseList(params) {
+  return request({
+    url: '/stock/manager/listStock',
+    method: 'get',
+    params
+  })
 }

+ 6 - 3
src/views/supply/engin/components/commerce_detail.vue

@@ -200,9 +200,9 @@
         <div class="footer">
           <el-button type="success" @click="toCheckOrder">联查单据</el-button>
           <el-button type="danger" @click="closeData" v-if="detailData.examineStatus === 'SAVE' || detailData.examineStatus === 'WAIT'">关闭订单</el-button>
-          <el-button type="primary" @click="openDirectDialog">提前开票</el-button>
-          <el-button type="primary" @click="overData">直调完结</el-button>
-          <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.directTransferStatus">直调发货</el-button>
+          <el-button type="primary" @click="openDirectDialog" v-if="!isDealer">提前开票</el-button>
+          <el-button type="primary" @click="overData" v-if="!isDealer">直调完结</el-button>
+          <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.directTransferStatus" v-if="!isDealer">直调发货</el-button>
           <el-button @click="goBack">返回</el-button>
         </div>
       </div>
@@ -422,6 +422,9 @@ export default {
     isExamine() {
       return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
     },
+    isDealer() {
+      return JSON.parse(localStorage.getItem("supply_user")).isCustomer
+    },
   },
 
   created() {

+ 6 - 3
src/views/supply/engin/components/home_detail.vue

@@ -200,9 +200,9 @@
         <div class="footer">
           <el-button type="success" @click="toCheckOrder">联查单据</el-button>
           <el-button type="danger" @click="closeData" v-if="detailData.examineStatus === 'SAVE' || detailData.examineStatus === 'WAIT'">关闭订单</el-button>
-          <el-button type="primary" @click="openDirectDialog">提前开票</el-button>
-          <el-button type="primary" @click="overData">直调完结</el-button>
-          <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.directTransferStatus">直调发货</el-button>
+          <el-button type="primary" @click="openDirectDialog" v-if="!isDealer">提前开票</el-button>
+          <el-button type="primary" @click="overData" v-if="!isDealer">直调完结</el-button>
+          <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.directTransferStatus" v-if="!isDealer">直调发货</el-button>
           <el-button @click="goBack">返回</el-button>
         </div>
       </div>
@@ -411,6 +411,9 @@ export default {
     isExamine() {
       return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
     },
+    isDealer() {
+      return JSON.parse(localStorage.getItem("supply_user")).isCustomer
+    },
   },
 
   created() {

+ 1 - 0
src/views/supply/reserve/components/reserve_detail.vue

@@ -59,6 +59,7 @@
           <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="预留数量" prop="reservedNum" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="订单数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="预留仓库" prop="correspondName" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="备注" prop="reservedRemark" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="修改人" prop="updateBy" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="修改时间" prop="updateTime" min-width="160" show-overflow-tooltip></el-table-column>

+ 32 - 2
src/views/supply/reserve/components/reserve_form.vue

@@ -123,6 +123,15 @@
           </template>
         </el-table-column>
         <el-table-column align="center" label="订单数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+
+        <el-table-column align="center" label="预留仓库" prop="correspondId" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.correspondId" placeholder="选择预留仓库" size="small" clearable @change="changeWarehouse(scope.$index)">
+              <el-option :label="item.name" :value="item.id" v-for="(item, index) in warehouseList" :key="index"></el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+
         <el-table-column align="center" label="备注" prop="reservedRemark" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="状态" prop="status" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
@@ -259,7 +268,7 @@
 </template>
 
 <script>
-import { getDetail, getGoodsList, addData, editData, checkDealerList, checkMaterialList } from "@/api/supply/reserve";
+import { getDetail, getGoodsList, addData, editData, checkDealerList, checkMaterialList, getWarehouseList } from "@/api/supply/reserve";
 import { getDictList } from '@/api/common'
 
 let that
@@ -323,6 +332,7 @@ export default {
 
       dealerList: [],
       materialList: [],
+      warehouseList: [],
     }
   },
 
@@ -330,7 +340,8 @@ export default {
     that = this;
   },
 
-  created() {
+  async created() {
+    await this.getWarehouseList();
     if(this.listItem) {
       this.getDetail();
     }else {
@@ -362,6 +373,15 @@ export default {
       })
     },
 
+    // 获取仓库列表
+    async getWarehouseList() {
+      const res = await getWarehouseList({
+        pageNum: 1,
+        pageSize: -1,
+      });
+      this.warehouseList = res.data.records;
+    },
+
     // 返回列表
     goBack() {
       this.$emit('backListFormDetail');
@@ -571,6 +591,16 @@ export default {
       }
     },
 
+    // 修改仓库
+    changeWarehouse(index) {
+      if(this.goodsList[index].correspondId) {
+        let obj = this.warehouseList.find(o => o.id == this.goodsList[index].correspondId);
+        this.goodsList[index].correspondName = obj.name;
+      }else {
+        this.goodsList[index].correspondName = '';
+      }
+    },
+
     // 提交
     clickSubmitForm() {
       this.$refs.mainForm.validate((valid) => {

+ 3 - 3
src/views/supply/retail/components/retail_detail.vue

@@ -150,9 +150,9 @@
       <div class="page-footer">
         <div class="footer">
           <el-button type="success" @click="toCheckOrder">联查单据</el-button>
-          <el-button type="primary" @click="openDirectDialog" :disabled="detailData.examineStatus !== 'OK'">提前开票</el-button>
-          <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.examineStatus !== 'OK' || detailData.directTransferStatus === true">直调发货</el-button>
-          <el-button type="primary" @click="handleFinish" :disabled="detailData.examineStatus !== 'OK'" v-if="isDealer">直调完成</el-button>
+          <el-button type="primary" @click="openDirectDialog" :disabled="detailData.examineStatus !== 'OK'" v-if="!isDealer">提前开票</el-button>
+          <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.examineStatus !== 'OK' || detailData.directTransferStatus === true" v-if="!isDealer">直调发货</el-button>
+          <el-button type="primary" @click="handleFinish" :disabled="detailData.examineStatus !== 'OK'" v-if="!isDealer">直调完成</el-button>
           <el-button @click="goBack">关 闭</el-button>
         </div>
       </div>