lilei 3 år sedan
förälder
incheckning
c6c6b5f4a3

+ 8 - 1
src/api/dispatch.js

@@ -46,7 +46,14 @@ export const dispatchQueryCount = (params) => {
     method: 'post'
   })
 }
-
+// 对单通过
+export const dispatchCheck = (params) => {
+  return axios({
+    url: `/dispatch/check/${params.dispatchBillSn}`,
+    data: params,
+    method: 'post'
+  })
+}
 // 出库
 export const dispatchStockOut = (params) => {
   return axios({

+ 9 - 1
src/views/salesManagement/examineVerify/list.vue

@@ -251,7 +251,15 @@ export default {
     },
     auditOrder (billStatus) {
       if (billStatus == 'STOCK_UP_REJECT') { // 审核不通过
-        this.visibleAuditReject = true
+        // 已对单
+        if (this.auditInfo.checkStatus == 'PASS') {
+          this.$info({
+            title: '操作提示',
+            content: '此备货单已经对单通过,不能操作备货审核不通过。'
+          })
+        } else {
+          this.visibleAuditReject = true
+        }
       } else {
         const params = {
           dispatchBillSn: this.auditInfo.dispatchBillSn,

+ 73 - 48
src/views/salesManagement/matchSendOutOrder/list.vue

@@ -28,6 +28,11 @@
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="24">
+                  <a-form-item label="收货客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+                    <dealerSubareaScopeList ref="shbuyerName" id="matchSoo-shbuyerName" @change="shcustChange" />
+                  </a-form-item>
+                </a-col>
+                <a-col :md="4" :sm="24">
                   <a-form-item label="业务状态">
                     <v-select
                       v-model="queryParam.billStatus"
@@ -38,39 +43,39 @@
                       allowClear></v-select>
                   </a-form-item>
                 </a-col>
-                <a-col :md="6" :sm="24">
+                <a-col :md="4" :sm="24">
                   <a-form-item label="单据状态">
                     <v-select
-                      v-model="queryParam.billStatus"
-                      ref="billStatus"
-                      id="matchSoo-billStatus"
-                      code="DISPATCH_BILL_STATUS"
+                      v-model="queryParam.voidFlag"
+                      ref="voidFlag"
+                      id="pushOrder-voidFlag"
+                      code="VOID_FLAG"
                       placeholder="请选择单据状态"
                       allowClear></v-select>
                   </a-form-item>
                 </a-col>
-                <a-col :md="6" :sm="24">
+                <a-col :md="4" :sm="24">
                   <a-form-item label="对单状态">
                     <v-select
-                      v-model="queryParam.billStatus"
-                      ref="billStatus"
-                      id="matchSoo-billStatus"
-                      code="DISPATCH_BILL_STATUS"
+                      v-model="queryParam.checkStatus"
+                      ref="checkStatus"
+                      id="matchSoo-checkStatus"
+                      code="CHECK_STATUS"
                       placeholder="请选择对单状态"
                       allowClear></v-select>
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="24">
                   <a-form-item label="对单时间">
-                    <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                    <rangeDate ref="checkDate" :value="checktime" @change="checkDateChange" />
                   </a-form-item>
                 </a-col>
-                <a-col :md="6" :sm="24">
+                <a-col :md="4" :sm="24">
                   <a-form-model-item label="所在区域">
                     <subarea id="matchSoo-subarea" v-model="queryParam.subareaSn"></subarea>
                   </a-form-model-item>
                 </a-col>
-                <a-col :md="6" :sm="24">
+                <a-col :md="4" :sm="24">
                   <a-form-model-item label="地区">
                     <a-form-model-item prop="shippingAddrProvinceSn">
                       <Area id="matchSoo-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
@@ -119,8 +124,10 @@
               size="small"
               type="link"
               class="button-warning"
+              v-if="record.checkStatus =='WAIT'&&record.voidFlag==0"
               @click="handleAudit(record)"
             >对单通过</a-button>
+            <span v-else>--</span>
           </template>
         </s-table>
       </a-spin>
@@ -130,14 +137,12 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import moment from 'moment'
-import getDate from '@/libs/getDate.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { STable, VSelect } from '@/components'
 import subarea from '@/views/common/subarea.js'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import Area from '@/views/common/area.js'
-import { dispatchlList, dispatchQueryCount } from '@/api/dispatch'
+import { dispatchlList, dispatchCheck } from '@/api/dispatch'
 export default {
   name: 'PushOrderManagementList',
   mixins: [commonMixin],
@@ -148,34 +153,28 @@ export default {
       advanced: true, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       tableHeight: 0,
-      time: [
-        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
-        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
-      ],
+      time: [],
+      checktime: [],
       // 查询参数
       queryParam: {
-        beginDate: getDate.getThreeMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+        beginDate: '',
+        endDate: '',
+        checkBeginDate: '',
+        checkEndDate: '',
         buyerSn: undefined, //  客户名称
+        receiverSn: undefined, // 收货客户
         salesBillNo: '', //  销售单号
         dispatchBillNo: '', //  备货单号
         billStatus: undefined, //  业务状态
         subareaSn: undefined,
-        shippingAddrProvinceSn: undefined
-      },
-      totalData: {
-        totalAmount: 0,
-        totalQty: 0,
-        totalRecord: 0
+        voidFlag: undefined,
+        shippingAddrProvinceSn: undefined,
+        checkStatus: undefined
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        // 查询总计
-        dispatchQueryCount(Object.assign(parameter, this.queryParam)).then(res => {
-          this.totalData = Object.assign(this.totalData, res.data || {})
-        })
         return dispatchlList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
@@ -199,17 +198,17 @@ export default {
         { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '14%', align: 'center' },
         { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '14%', align: 'center' },
-        { title: '发货编号', dataIndex: 'buyerName1', width: '6%', align: 'center' },
+        { title: '发货编号', dataIndex: 'sendNo', width: '6%', align: 'center' },
         { title: '客户名称', dataIndex: 'buyerName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '收货客户名称', dataIndex: 'buyerName2', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品款数', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收货客户名称', dataIndex: 'receiverName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品款数', dataIndex: 'totalCategory', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '产品数量', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '总售价', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据状态', dataIndex: 'voidFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '对单状态', dataIndex: 'checkStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '对单人员', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '对单时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '对单人员', dataIndex: 'checkPersonName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '对单时间', dataIndex: 'checkDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
       ]
       if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
@@ -224,9 +223,16 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    checkDateChange (date) {
+      this.queryParam.checkBeginDate = date[0]
+      this.queryParam.checkEndDate = date[1]
+    },
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
+    shcustChange (val) {
+      this.queryParam.receiverSn = val.key
+    },
     // 详情
     handleDetail (row, type) {
       if (type == 0) {
@@ -235,29 +241,48 @@ export default {
         this.$router.push({ name: 'pushOrderDetail', params: { sn: row.dispatchBillSn, type: 'pushOrder' } })
       }
     },
-    // 允许打印
+    // 对单
     handleAudit (row) {
+      const _this = this
       this.$confirm({
         title: '操作提示',
         content: '确认对单通过吗?',
         centered: true,
         onOk () {
-          console.log('OK')
+          _this.spinning = true
+          dispatchCheck({ dispatchBillSn: row.dispatchBillSn }).then(res => {
+            _this.$message.info(res.message)
+            if (res.status == 200) {
+              _this.$refs.table.refresh()
+            }
+            _this.spinning = false
+          })
         }
       })
     },
     // 重置
     resetSearchForm () {
+      this.time = []
       this.$refs.rangeDate.resetDate(this.time)
-      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
-      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
-      this.queryParam.buyerSn = undefined
+      this.checktime = []
+      this.$refs.checkDate.resetDate(this.checktime)
       this.$refs.dealerSubareaScopeList.resetForm()
-      this.queryParam.salesBillNo = ''
-      this.queryParam.dispatchBillNo = ''
-      this.queryParam.billStatus = undefined
-      this.queryParam.subareaSn = undefined
-      this.queryParam.shippingAddrProvinceSn = undefined
+      this.$refs.shbuyerName.resetForm()
+      this.queryParam = {
+        beginDate: '',
+        endDate: '',
+        checkBeginDate: '',
+        checkEndDate: '',
+        buyerSn: undefined, //  客户名称
+        receiverSn: undefined, // 收货客户
+        salesBillNo: '', //  销售单号
+        dispatchBillNo: '', //  备货单号
+        billStatus: undefined, //  业务状态
+        subareaSn: undefined,
+        voidFlag: undefined,
+        shippingAddrProvinceSn: undefined,
+        checkStatus: undefined
+      }
       this.$refs.table.refresh(true)
     },
     pageInit () {