ソースを参照

【修改】
1.提货管理
2.销售出库单

莫绍宝 3 年 前
コミット
23d205b050

+ 11 - 2
src/api/supply/pickup.js

@@ -12,7 +12,7 @@ export function getPickupList(params) {
 // 获取详情
 export function getDetail(params) {
   return request({
-    url: '/retreat/detail',
+    url: '/pick/detail',
     method: 'get',
     params
   })
@@ -63,7 +63,7 @@ export function getCompanyList(params) {
   })
 }
 
-// 提交提货预约
+// 新增提货预约
 export function addPickupBook(params) {
   return request({
     url: '/pick/add',
@@ -72,6 +72,15 @@ export function addPickupBook(params) {
   })
 }
 
+// 编辑提货预约
+export function editPickupBook(params) {
+  return request({
+    url: '/pick/update',
+    method: 'post',
+    data: params
+  })
+}
+
 // 获取短信验证码
 export function getCode(params) {
   return request({

+ 47 - 18
src/views/supply/pickup/components/pickup_form.vue

@@ -83,13 +83,13 @@
       <div class="table">
         <el-table v-loading="listLoading" :data="deliverList" element-loading-text="Loading" border fit highlight-current-row stripe @selection-change="handleSelectionChange">
           <el-table-column align="center" type="selection" width="55"></el-table-column>
-          <el-table-column align="center" label="发货申请单" prop="invoiceOrderId" min-width="180" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="发货申请单" prop="invoiceId" min-width="180" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="单据日期" prop="orderTime" min-width="120" show-overflow-tooltip>
             <template slot-scope="scope">
               {{ scope.row.orderTime | dateToDayFilter }}
             </template>
           </el-table-column>
-          <el-table-column align="center" label="销售订单号" prop="retailOrderId" min-width="180" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="销售订单号" prop="mainOrderId" min-width="200" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="工程编号" prop="enginOrderNo" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
@@ -114,9 +114,8 @@
 </template>
 
 <script>
-import { getWarehouseList, getDeliverList, getPickupManList, getPickupCarList, getCompanyList, addPickupBook } from "@/api/supply/pickup";
+import { getWarehouseList, getDeliverList, getPickupManList, getPickupCarList, getCompanyList, addPickupBook, editPickupBook, getDetail } from "@/api/supply/pickup";
 import { getDictList } from "@/api/common";
-import { findElem } from "@/utils/util";
 
 export default {
   name: 'PickupForm',
@@ -178,6 +177,9 @@ export default {
     this.getPickupManList();
     this.getPickupCarList();
     this.getCompanyList();
+    if(this.listItem) {
+      this.getDetail();
+    }
   },
 
   methods: {
@@ -195,6 +197,23 @@ export default {
       this.$emit('backListFormDetail');
     },
 
+    // 获取详情
+    getDetail() {
+      getDetail({id: this.listItem.id}).then(res => {
+        let data = res.data;
+        this.mainForm.warehouse = data.correspondId;
+        this.mainForm.date = data.pickTime.slice(0, 10);
+        this.mainForm.timeSlot = Number(data.pickStatus);
+        this.mainForm.pickupWay = String(data.pickType);
+        this.mainForm.pickupMan = data.takerId;
+        this.mainForm.pickupCar = data.takerCarId;
+        this.mainForm.company = data.pickLogistics;
+        this.mainForm.remark = data.remark;
+
+        this.deliverList = data.invoicePickBeans;
+      })
+    },
+
     // 获取仓库列表
     getWarehouseList() {
       getWarehouseList({
@@ -264,19 +283,18 @@ export default {
           if(this.tableSelection.length < 1) {
             return this.$errorMsg('请选择发货申请单');
           }
-
           this.formLoading = true;
-          let takerName = '';
-          if(this.mainForm.pickupMan) {
-            let index = findElem(this.pickupManList, 'id', this.mainForm.pickupMan);
-            takerName = this.pickupManList[index].takerName;
-          }
+
+          let takerName = this.pickupManList.find(o => o.id == this.mainForm.pickupMan).takerName;
+          let correspondName = this.warehouseList.find(o => o.id == this.mainForm.warehouse).name;
+
           let orderList = [];
           this.tableSelection.forEach(item => {
             orderList.push(item.invoiceOrderId);
           });
           let params = {
-            stockName: this.mainForm.warehouse,
+            correspondId: this.mainForm.warehouse,
+            correspondName,
             pickTime: this.mainForm.date + ' 00:00:00',
             pickStatus: Number(this.mainForm.timeSlot),
             pickType: Number(this.mainForm.pickupWay),
@@ -291,13 +309,24 @@ export default {
           if(this.mainForm.pickupWay == '2') {
             params.pickLogistics = this.mainForm.company;
           }
-          addPickupBook(params).then(res => {
-            this.$successMsg('提交成功');
-            this.goBack();
-            this.$parent.getList();
-          }).finally(res => {
-            this.formLoading = false;
-          })
+          if(this.listItem) {
+            params.id = this.listItem.id;
+            editPickupBook(params).then(res => {
+              this.$successMsg('提交成功');
+              this.goBack();
+              this.$parent.getList();
+            }).finally(res => {
+              this.formLoading = false;
+            })
+          }else {
+            addPickupBook(params).then(res => {
+              this.$successMsg('提交成功');
+              this.goBack();
+              this.$parent.getList();
+            }).finally(res => {
+              this.formLoading = false;
+            })
+          }
         }
       })
     },

+ 8 - 3
src/views/supply/pickup/pickup_list.vue

@@ -79,9 +79,9 @@
                 {{ scope.row.pickType == '1' ? '自提':'物流快递' }}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="单据日期" prop="orderTime" min-width="120" show-overflow-tooltip>
+            <el-table-column align="center" label="单据日期" prop="theTime" min-width="120" show-overflow-tooltip>
               <template slot-scope="scope">
-                {{ scope.row.orderTime | dateToDayFilter }}
+                {{ scope.row.theTime | dateToDayFilter }}
               </template>
             </el-table-column>
             <el-table-column align="center" label="销售订单号" prop="mainOrderId" min-width="180" show-overflow-tooltip></el-table-column>
@@ -90,8 +90,13 @@
             <el-table-column align="center" label="产品编号" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="提货总数量" prop="number" 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="remark" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="操作" width="100" fixed="right">
+              <template slot-scope="scope">
+                <el-button type="text" @click="toForm(scope.row)">编辑</el-button>
+              </template>
+            </el-table-column>
           </el-table>
         </div>
       </div>

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

@@ -167,7 +167,7 @@
         <el-table-column align="center" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="直调数量" prop="adjustNum" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
-            <el-input v-model="scope.row.adjustNum" size="small" type="number"></el-input>
+            <el-input v-model="scope.row.adjustNum" size="small" type="number" :disabled="!scope.row.isDirectTransfer"></el-input>
           </template>
         </el-table-column>
         <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
@@ -299,7 +299,7 @@ export default {
       this.$refs.deliverForm.validate((valid) => {
         if (valid) {
           for(let i=0; i<this.goodsList.length; i++) {
-            if(!this.goodsList[i].adjustNum) {
+            if(!this.goodsList[i].adjustNum && this.goodsList[i].isDirectTransfer) {
               this.$errorMsg('请输入直调数量');
               return;
             }
@@ -307,7 +307,7 @@ export default {
           let goodsList = this.goodsList.map((item) => {
             return {
               itemId: item.id,
-              qty: item.adjustNum,
+              qty: item.adjustNum || 0,
             }
           });
           let params = {

+ 2 - 2
src/views/supply/retail/components/retail_form.vue

@@ -411,7 +411,7 @@ export default {
           let oldItem = oldGoodsList[i]
           for(let j = 0; j < newGoodsList.length; j++) {
             let newItem = newGoodsList[j]
-            if(newItem.materialId === oldItem.materialId){
+            if(newItem.id === oldItem.id){
               newGoodsList[j].selected = true;
               break;
             }
@@ -499,7 +499,7 @@ export default {
       for(let i=0; i<allArr.length; i++){  // 循环allArr数组对象的内容
         let flag = true;  // 建立标记,判断数据是否重复,true为不重复
         for(let j=0; j<newArr.length; j++){  // 循环新数组的内容
-          if(allArr[i].materialId == newArr[j].materialId){ // 让allArr数组对象的内容与新数组的内容作比较,相同的话,改变标记为false
+          if(allArr[i].id == newArr[j].id){ // 让allArr数组对象的内容与新数组的内容作比较,相同的话,改变标记为false
             flag = false;
           }
         }

+ 6 - 5
src/views/supply/sales/components/sales_detail.vue

@@ -10,7 +10,7 @@
         <el-row :gutter="0">
           <el-col :span="8" class="item">
             <div class="label">出库单号</div>
-            <div class="value">{{detailData.retailOrderId}}</div>
+            <div class="value">{{detailData.id}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">单据日期</div>
@@ -18,7 +18,7 @@
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">单据状态</div>
-          <div class="value">{{detailData.status | statusFilter}}</div>
+          <div class="value">{{detailData.examineStatus | statusFilter}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">仓库</div>
@@ -99,9 +99,10 @@ export default {
   filters: {
     statusFilter(val) {
       const statusList = [
-        { label: '待审核', value: 1 },
-        { label: '审核通过', value: 2 },
-        { label: '审核驳回', value: 3 },
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
       ];
       let obj = statusList.find(o => o.value == val);
       return obj ? obj.label : ''

+ 11 - 10
src/views/supply/sales/sales_list.vue

@@ -68,14 +68,14 @@
             <!-- <el-button size="small" type="warning" icon="el-icon-close">退单</el-button> -->
           </div>
           <div class="fr">
-            <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
+            <ExportButton :exUrl="'sale/order/export'" :exParams="exParams" />
           </div>
         </div>
         <div class="table">
           <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
-            <el-table-column align="center" label="状态" prop="status" min-width="100" show-overflow-tooltip>
+            <el-table-column align="center" label="状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
-                {{scope.row.status | statusFilter}}
+                {{scope.row.examineStatus | statusFilter}}
               </template>
             </el-table-column>
             <el-table-column align="center" label="开票状态" prop="billStatus" min-width="100" show-overflow-tooltip>
@@ -83,7 +83,7 @@
                 {{scope.row.billStatus | billStatusFilter}}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="出库单号" prop="retailOrderId" min-width="180" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="出库单号" prop="id" min-width="180" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="发货单号" prop="orderNo" min-width="180" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="仓库" prop="correspondName" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="经销商" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
@@ -91,9 +91,9 @@
             <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="数量" prop="approvalNumber" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="单价" prop="price" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="订单金额" prop="totalAmount" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="备注" prop="remark" min-width="200" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="操作" width="120" fixed="right">
               <template slot-scope="scope">
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
@@ -165,9 +165,10 @@ export default {
         status: '',
       },
       statusList: [
-        { label: '待审核', value: 1 },
-        { label: '审核通过', value: 2 },
-        { label: '审核驳回', value: 3 },
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
       ],
 
       queryItem: {},