chenrui 4 年之前
父节点
当前提交
761f9f5eb2
共有 2 个文件被更改,包括 46 次插入25 次删除
  1. 8 0
      src/api/stockOut.js
  2. 38 25
      src/views/salesManagement/outboundOrder/list.vue

+ 8 - 0
src/api/stockOut.js

@@ -11,3 +11,11 @@ export const stockOutList = (params) => {
     method: 'post'
   })
 }
+//  出库 出库
+export const stockOutOut = (params) => {
+  return axios({
+    url: '/stockOut/out',
+    data: params,
+    method: 'post'
+  })
+}

+ 38 - 25
src/views/salesManagement/outboundOrder/list.vue

@@ -19,10 +19,10 @@
           <a-col :md="6" :sm="24">
             <a-form-item label="客户名称">
               <a-select
-                id="outboundOrderList-bundleName"
+                id="outboundOrderList-demanderName"
                 placeholder="请选择"
                 allowClear
-                v-model="queryParam.dataSourceNo"
+                v-model="queryParam.demanderName"
                 :showSearch="true"
                 option-filter-prop="children"
                 :filter-option="filterOption">
@@ -33,9 +33,9 @@
           <a-col :md="6" :sm="24">
             <a-form-item label="出库类型">
               <v-select
-                v-model="queryParam.outType"
-                ref="outType"
-                id="outboundOrderList-outType"
+                v-model="queryParam.outBizType"
+                ref="outBizType"
+                id="outboundOrderList-outBizType"
                 code="OUT_STOCK_TYPE"
                 placeholder="请选择出库类型"
                 allowClear></v-select>
@@ -45,9 +45,9 @@
             <a-col :md="6" :sm="24">
               <a-form-item label="单据状态">
                 <v-select
-                  v-model="queryParam.billStatus"
-                  ref="billStatus"
-                  id="outboundOrderList-billStatus"
+                  v-model="queryParam.state"
+                  ref="state"
+                  id="outboundOrderList-state"
                   code="OUT_STATE"
                   placeholder="请选择单据状态"
                   allowClear></v-select>
@@ -81,14 +81,14 @@
       :columns="columns"
       :data="loadData"
       :showPagination="false"
-      :scroll="{ x: 1550 }"
+      :scroll="{ x: 1700 }"
       bordered>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
         <a-button
           size="small"
           type="primary"
-          v-if="record.state=='OUT_STATE'"
+          v-if="record.state=='WAIT'"
           class="button-warning"
           @click="handleOutbound(record)"
           id="outboundOrderList-out-btn">出库</a-button>
@@ -104,26 +104,28 @@
 </template>
 
 <script>
+import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import { custAllList } from '@/api/customer'
-import { stockOutList } from '@/api/stockOut'
+import { stockOutList, stockOutOut } from '@/api/stockOut'
 export default {
   components: { STable, VSelect },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
-        bundleName: '', //  供应商名称
+        demanderName: undefined, //  客户名称
+        outBizType: undefined, //  出库类型
         state: undefined //  状态
       },
       disabled: false, //  查询、重置按钮是否可操作
       dateFormat: 'YYYY-MM-DD',
-      time: [], //  创建时间
+      time: [], //  审核时间
       custAllList: [], //  客户下拉数据
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
-        { title: '关联单号', dataIndex: 'outBizNo', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '关联单号', dataIndex: 'outBizNo', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '出库类型', dataIndex: 'outBizTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'demanderName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '总款数', dataIndex: 'productTotalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -131,7 +133,7 @@ export default {
         { title: '总售价', dataIndex: 'productTotalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '出库时间', dataIndex: 'outTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '出库状态', dataIndex: 'stateDictValue', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '出库状态', dataIndex: 'stateDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 140, align: 'center', fixed: 'right' }
       ],
       selectedRowKeys: [], // Check here to configure the default column
@@ -139,6 +141,14 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        // 审核时间
+        if (this.time && this.time.length > 0) {
+          this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
+          this.queryParam.endDate = moment(this.time[1]).format(this.dateFormat)
+        } else {
+          this.queryParam.beginDate = undefined
+          this.queryParam.endDate = undefined
+        }
         return stockOutList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -181,12 +191,10 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
+      this.queryParam.demanderName = undefined
+      this.queryParam.outBizType = undefined
+      this.queryParam.state = undefined
+      this.time = []
       this.$refs.table.refresh(true)
     },
     //  详情
@@ -211,19 +219,24 @@ export default {
         // this.$router.push({ path: `/purchasingManagement/purchaseReturn/detail/${row.outBizSn}` })
       } else if (row.outBizType == 'WAREHOUSE_CALL_OUT') { // 仓库调出
         this.$router.push({ path: `/allocationManagement/warehouseAllocation/detail/${row.outBizSn}` })
+      } else {
+        this.$message.warning('出库类型未知')
       }
     },
     // 单个出库
     handleOutbound (row) {
+      const _this = this
       this.$confirm({
         title: '提示',
         content: '确认要出库吗?',
         centered: true,
         onOk () {
-          console.log('OK')
-        },
-        onCancel () {
-          console.log('Cancel')
+          stockOutOut(Object.assign(row, { outStockEnum: row.outBizType })).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
         }
       })
     },