瀏覽代碼

【新增】直调发货单

莫绍宝 3 年之前
父節點
當前提交
eab8402d24

+ 2 - 2
src/api/supply/adjust.js

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 // 获取列表
 export function getList(params) {
   return request({
-    url: '/transfer/list',
+    url: '/direct/list',
     method: 'get',
     params
   })
@@ -12,7 +12,7 @@ export function getList(params) {
 // 获取详情
 export function getDetail(params) {
   return request({
-    url: '/transfer/detail',
+    url: '/direct/detail',
     method: 'get',
     params
   })

+ 8 - 2
src/api/supply/retail.js

@@ -117,5 +117,11 @@ export function checkStock(params) {
   })
 }
 
-
-
+// 直调发货
+export function adjustDeliver(params) {
+  return request({
+    url: '/retail/direct/deliver',
+    method: 'post',
+    data: params
+  })
+}

+ 57 - 67
src/views/supply/adjust/adjust_list.vue

@@ -3,26 +3,29 @@
     <div v-show="!isShowDetail">
       <!-- 筛选条件 -->
       <div class="screen-container">
-        <el-form ref="screenForm" :model="screenForm" label-width="100px" size="small" label-position="left">
+        <el-form ref="screenForm" :model="screenForm" label-width="70px" size="small" label-position="left">
           <el-row :gutter="20">
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="订单号" prop="orderNum">
-                <el-input v-model="screenForm.orderNum" placeholder="请输入订单号"></el-input>
+              <el-form-item label="发货单号" prop="deliverNum">
+                <el-input v-model="screenForm.deliverNum" placeholder="请输入发货单号"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="销售政策编号" prop="wlName">
-                <el-input v-model="screenForm.wlName" placeholder="请输入销售政策编号"></el-input>
+              <el-form-item label="订单号" prop="orderNum">
+                <el-input v-model="screenForm.orderNum" placeholder="请输入订单号"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="销售政策说明" prop="wlName">
-                <el-input v-model="screenForm.wlName" placeholder="请输入销售政策说明"></el-input>
+              <el-form-item label="订单类型" prop="type">
+                <el-select v-model="screenForm.type" placeholder="请选择订单类型">
+                  <el-option label="全部" value=""></el-option>
+                  <el-option :label="item.label" :value="item.value" v-for="(item, index) in typeList" :key="index"></el-option>
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="经销商" prop="wlName">
-                <el-input v-model="screenForm.wlName" placeholder="请输入经销商"></el-input>
+              <el-form-item label="经销商" prop="dealer">
+                <el-input v-model="screenForm.dealer" placeholder="请输入经销商"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
@@ -38,18 +41,8 @@
                 </el-date-picker>
               </el-form-item>
             </el-col>
-            <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="制表人" prop="wlName">
-                <el-input v-model="screenForm.wlName" placeholder="请输入制表人"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="审核人" prop="wlName">
-                <el-input v-model="screenForm.wlName" placeholder="请输入审核人"></el-input>
-              </el-form-item>
-            </el-col>
             
-            <el-col :xs="24" :sm="12" :lg="6" class="tr">
+            <el-col :xs="24" :sm="12" :lg="18" class="tr">
               <el-form-item label="">
                 <el-button size="small" @click="resetScreenForm">清空</el-button>
                 <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
@@ -67,32 +60,30 @@
         </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="billNo" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="单据类型" prop="billType" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="调拨类型" prop="transferBizType" min-width="120" show-overflow-tooltip>
-              <template slot-scope="scope">
-                {{ scope.row.transferBizType | allotTypeFilter }}
-              </template>
-            </el-table-column>
-            <el-table-column align="center" label="申请日期" prop="fDate" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="单据状态" prop="documentStatus" min-width="100" show-overflow-tooltip>
+            <el-table-column align="center" label="发货单号" prop="deliverNo" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="发货日期" prop="deliverDate" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="仓库" prop="correspondName" min-width="120" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="订单类型" prop="orderType" min-width="120" show-overflow-tooltip>
               <template slot-scope="scope">
-                {{ scope.row.documentStatus | orderStatusFilter }}
+                {{ scope.row.orderType | typeFilter }}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="关闭状态" prop="cancelStatus" min-width="100" show-overflow-tooltip>
+            <el-table-column align="center" label="订单号" prop="orderNo" min-width="120" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="经销商" prop="customerName" 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="100" 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="qty" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="价税合计" prop="mustTotalAmount" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="无税金额" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
-                {{ scope.row.cancelStatus | closeStatusFilter }}
+                {{ scope.row.qty * scope.row.afterTaxPrice }}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="物料编码" prop="materialNumber" min-width="120" 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="model" min-width="240" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="辅助属性" prop="auxPropId" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="单位" prop="baseUnitId" 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="srcStockId" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="调入仓库" prop="destStockId" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="无税单价" prop="afterTaxPrice" 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="制表人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="制表日期" prop="createTime" min-width="160" 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="toDetail(scope.row)">详情</el-button>
@@ -125,31 +116,16 @@
 import { getList } from "@/api/supply/adjust";
 import AdjustDetail from "@/views/supply/adjust/components/adjust_detail";
 
+let that
 export default {
   components: {
     AdjustDetail,
   },
   filters: {
-    allotTypeFilter(val) {
-      const MAP = {
-        InnerOrgTransfer: '组织内调拨',
-        OverOrgTransfer: '跨组织调拨',
-      }
-      return MAP[val];
-    },
-    closeStatusFilter(val) {
-      const MAP = {
-        A: '正常',
-        B: '作废',
-      }
-      return MAP[val];
-    },
-    orderStatusFilter(val) {
-      const MAP = {
-        C: '审核',
-      }
-      return MAP[val];
-    },
+    typeFilter(val) {
+      let obj = that.typeList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    }
   },
   data() {
     return {
@@ -160,11 +136,20 @@ export default {
       listLoading: false, // 列表加载loading
       screenForm: { // 筛选表单数据
         orderNum: '',
-        wlName: '',
+        deliverNum: '',
+        type: '',
+        dealer: '',
         date: '',
       },
-
+      typeList: [
+        { label: '商用工程订单', value: 'TRADE' },
+        { label: '家用工程订单', value: 'HOME' },
+        { label: '零售订单', value: 'RETAIL' },
+        { label: '销售政策订单', value: 'RETAIL_POLICY' },
+      ],
+      
       queryItem: {},
+      isShowDetail: false,
     }
   },
 
@@ -177,9 +162,10 @@ export default {
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
       }
     },
-    isShowDetail() {
-      return this.queryItem.hasOwnProperty('id');
-    },
+  },
+
+  beforeCreate() {
+    that = this;
   },
 
   created() {
@@ -203,8 +189,10 @@ export default {
       let params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        billNo: this.screenForm.orderNum,
-        materialName: this.screenForm.wlName,
+        orderNo: this.screenForm.orderNum,
+        deliverNo: this.screenForm.deliverNum,
+        customerName: this.screenForm.dealer,
+        orderType: this.screenForm.type,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
       };
@@ -244,10 +232,12 @@ export default {
     // 进入详情
     toDetail(item) {
       this.queryItem = item;
+      this.isShowDetail = true;
     },
 
     backList() {
       this.queryItem = {};
+      this.isShowDetail = false;
     },
   }
 }

+ 81 - 25
src/views/supply/adjust/components/adjust_detail.vue

@@ -4,52 +4,96 @@
 
     <div id="printData">
       <div class="main-title">
-        <div class="title">调拨单</div>
+        <div class="title">发货单信息</div>
       </div>
 
       <div class="diy-table-1">
         <el-row>
           <el-col :span="8" class="item">
-            <div class="label">单据编号:</div>
-            <div class="value">{{detailData.billNo}}</div>
+            <div class="label">直调发货单</div>
+            <div class="value">{{detailData.id}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">日期</div>
-            <div class="value">{{detailData.fdate}}</div>
+            <div class="label">发货日期</div>
+            <div class="value">{{detailData.deliverDate}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">转出仓库:</div>
-            <div class="value">{{detailData.srcStockId}}</div>
+            <div class="label">单据状态</div>
+            <div class="value">已受理</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">转入仓库:</div>
-            <div class="value">{{detailData.destStockId}}</div>
+            <div class="label">订单号</div>
+            <div class="value">{{detailData.orderNo}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">审核日期:</div>
-            <div class="value">{{detailData.approveDate}}</div>
+            <div class="label">订单类型</div>
+            <div class="value">{{detailData.orderType | typeFilter}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">审核人:</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="label">经销商名称</div>
+            <div class="value">{{detailData.customerName}}</div>
           </el-col>
-          <el-col :span="24" class="item">
-            <div class="label">备注:</div>
-            <div class="value">{{detailData.note}}</div>
+          <el-col :span="8" class="item">
+            <div class="label">业务员</div>
+            <div class="value">{{detailData.serviceName}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">工程编号</div>
+            <div class="value">{{detailData.projectNo}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">币种</div>
+            <div class="value">{{detailData.amountType}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">仓库</div>
+            <div class="value">{{detailData.correspondName}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">仓位</div>
+            <div class="value">{{detailData.stockName}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">台账备注</div>
+            <div class="value">{{detailData.aaa}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">项目名称</div>
+            <div class="value">{{detailData.projectName}}</div>
+          </el-col>
+          <el-col :span="16" class="item">
+            <div class="label">备注</div>
+            <div class="value">{{detailData.remark}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">厂工程编码</div>
+            <div class="value">{{detailData.factoryNo}}</div>
+          </el-col>
+          <el-col :span="16" class="item">
+            <div class="label">文件编号</div>
+            <div class="value">{{detailData.fileNo}}</div>
           </el-col>
         </el-row>
       </div>
 
+      <div class="main-title">
+        <div class="title">货品信息</div>
+      </div>
+
       <div class="table" style="margin-top: 20px">
-        <el-table :data="detailData.kingDeeTransferItems" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+        <el-table :data="detailData.items" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
           <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-          <el-table-column align="center" label="物料编号" prop="materialNumber" 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="model" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="主计量单位" prop="baseUnitId" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="数量" prop="qty" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="单价" prop="consignPrice" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="金额" prop="consignAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品编号" prop="materialNumber" 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="baseUnitId" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="申请数量" prop="directTransferQty" min-width="100" 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="afterTaxPrice" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="价税合计" prop="mustTotalAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="税率(%)" prop="taxRate" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="折扣额" prop="discAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="厂产品代码" prop="consignAmount" min-width="100" show-overflow-tooltip></el-table-column>
         </el-table>
       </div>
       
@@ -78,6 +122,18 @@ export default {
   directives: {
     print
   },
+  filters: {
+    typeFilter(val) {
+      const typeList = [
+        { label: '商用工程订单', value: 'TRADE' },
+        { label: '家用工程订单', value: 'HOME' },
+        { label: '零售订单', value: 'RETAIL' },
+        { label: '销售政策订单', value: 'RETAIL_POLICY' },
+      ];
+      let obj = typeList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    }
+  },
   data() {
     return {
       printObj: {
@@ -111,7 +167,7 @@ export default {
 
     // 获取详情
     getDetail() {
-      getDetail({id: this.listItem.id}).then(res => {
+      getDetail({id: this.listItem.deliverNo}).then(res => {
         this.detailData = res.data;
       })
     },

+ 29 - 24
src/views/supply/retail/components/retail_detail.vue

@@ -118,7 +118,7 @@
     
     <div class="page-footer">
       <div class="footer" :class="classObj">
-        <el-button type="primary" @click="openDeliverDialog">直调发货</el-button>
+        <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.examineStatus !== 'OK'">直调发货</el-button>
         <el-button @click="goBack">关 闭</el-button>
       </div>
     </div>
@@ -126,12 +126,7 @@
     <el-dialog title="直调发货" :visible.sync="isShowDeliverDialog" width="80%">
       <el-form ref="deliverForm" :model="deliverForm" :rules="deliverFormRules" label-width="80px" size="small" label-position="left">
         <el-row :gutter="20">
-          <el-col :xs="12" :sm="6" :lg="6">
-            <el-form-item label="发货单号" prop="orderNum">
-              <el-input v-model="deliverForm.orderNum" placeholder="请输入发货单号"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="12" :sm="6" :lg="6" style="height: 51px;">
+          <el-col :xs="8" :sm="8" :lg="8" style="height: 51px;">
             <el-form-item label="发货日期" prop="date">
               <el-date-picker
                 v-model="deliverForm.date"
@@ -142,17 +137,17 @@
               </el-date-picker>
             </el-form-item>
           </el-col>
-          <el-col :xs="12" :sm="6" :lg="6">
+          <el-col :xs="8" :sm="8" :lg="8">
             <el-form-item label="发货仓库" prop="warehouse">
               <el-select v-model="deliverForm.warehouse" placeholder="请选择发货仓库" style="width: 100%" filterable @change="changeWarehouse">
                 <el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :xs="12" :sm="6" :lg="6">
+          <el-col :xs="8" :sm="8" :lg="8">
             <el-form-item label="选择仓位" prop="position">
               <el-select v-model="deliverForm.position" placeholder="请选择仓位" style="width: 100%" filterable>
-                <el-option v-for="item in positionList" :key="item.value" :label="item.label" :value="item.value"></el-option>
+                <el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
@@ -170,7 +165,7 @@
         <el-table-column align="center" label="数量" prop="qty" 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"></el-input>
+            <el-input v-model="scope.row.adjustNum" size="small" type="number"></el-input>
           </template>
         </el-table-column>
         <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
@@ -190,7 +185,7 @@
 </template>
 
 <script>
-import { getDetail, getWarehouseList } from "@/api/supply/retail";
+import { getDetail, getWarehouseList, adjustDeliver } from "@/api/supply/retail";
 
 export default {
   name: 'RetailDetail',
@@ -214,15 +209,11 @@ export default {
 
       isShowDeliverDialog: false,
       deliverForm: {
-        orderNum: '',
         date: '',
         warehouse: '',
         position: '',
       },
       deliverFormRules: {
-        orderNum: [
-          { required: true, message: '请输入发货单号', trigger: 'blur' }
-        ],
         date: [
           { required: true, message: '请选择发货日期', trigger: 'change' }
         ],
@@ -288,18 +279,16 @@ export default {
 
     // 更改仓库
     changeWarehouse() {
-      getPositionList({
-        correspondId: this.deliverForm.warehouse
-      }).then(res => {
-        this.positionList = res.data;
-      })
+      this.deliverForm.position = '';
+      let obj = this.warehouseList.find(o => o.id == this.deliverForm.warehouse);
+      this.positionList = obj.kingDeeStocks;
     },
 
     // 打开 直调发货
     openDeliverDialog() {
       this.isShowDeliverDialog = true;
       this.goodsList = this.detailData.retailOrderItemList;
-      // this.getWarehouseList();
+      this.getWarehouseList();
     },
 
     // 关闭 直调发货
@@ -317,8 +306,24 @@ export default {
               return;
             }
           }
-
-
+          let goodsList = this.goodsList.map((item) => {
+            return {
+              itemId: item.id,
+              qty: item.adjustNum,
+            }
+          });
+          let params = {
+            orderNo: this.listItem.id,
+            orderDate: this.deliverForm.date + ' 00:00:00',
+            correspondId: this.deliverForm.warehouse,
+            stockId: this.deliverForm.position,
+            directItems: goodsList
+          }
+          adjustDeliver(params).then(res => {
+            this.$successMsg();
+            this.isShowDeliverDialog = false;
+            this.getDetail();
+          })
         }
       })
     },

+ 2 - 2
src/views/supply/retail/retail_list.vue

@@ -93,9 +93,9 @@
                 {{scope.row.isDirectTransfer ? '是':'否'}}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="总数量" prop="totalQty" 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="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="出库数量" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="出库数量" prop="hasSendQty" min-width="100" 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="rebateRate" min-width="110" show-overflow-tooltip></el-table-column>