浏览代码

对接散件入库列表接口

chenrui 4 年之前
父节点
当前提交
78dc9e9fc9
共有 2 个文件被更改,包括 57 次插入63 次删除
  1. 13 0
      src/api/sparePartsPur.js
  2. 44 63
      src/views/bulkManagement/bulkWarehousingOrder/list.vue

+ 13 - 0
src/api/sparePartsPur.js

@@ -0,0 +1,13 @@
+import { axios } from '@/utils/request'
+
+//  散件采购(入库)列表  分页
+export const sparePartsPurList = (params) => {
+  const url = `/sparePartsPur/findPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 44 - 63
src/views/bulkManagement/bulkWarehousingOrder/list.vue

@@ -6,18 +6,18 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
-              <a-range-picker v-model="queryParam.creatDate" id="bulkWarehousingOrderList-creatDate"/>
+              <a-range-picker v-model="creatDate" id="bulkWarehousingOrderList-creatDate"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="散件单号">
-              <a-input id="bulkWarehousingOrderList-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入散件单号"/>
+              <a-input id="bulkWarehousingOrderList-sparePartsPurchaseNo" v-model.trim="queryParam.sparePartsPurchaseNo" allowClear placeholder="请输入散件单号"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="供应商" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-            	<a-select id="bulkWarehousingOrderList-customeName" placeholder="请选择供应商" allowClear v-model="queryParam.dataSourceNo" :showSearch="true" option-filter-prop="children" :filter-option="filterOption">
-            		<a-select-option v-for="item in customeList" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
+            	<a-select id="bulkWarehousingOrderList-supplierName" placeholder="请选择供应商" allowClear v-model="queryParam.supplierName" :showSearch="true" option-filter-prop="children" :filter-option="filterOption">
+            		<a-select-option v-for="item in supplierList" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
             	</a-select>
             </a-form-item>
           </a-col>
@@ -25,9 +25,9 @@
             <a-col :md="6" :sm="24">
               <a-form-item label="单据状态">
                 <v-select
-                  v-model="queryParam.billStatus"
-                  ref="billStatus"
-                  id="bulkWarehousingOrderList-billStatus"
+                  v-model="queryParam.state"
+                  ref="state"
+                  id="bulkWarehousingOrderList-state"
                   code="PAYMENT_TYPE"
                   placeholder="请选择单据状态"
                   allowClear></v-select>
@@ -36,9 +36,9 @@
             <a-col :md="6" :sm="24">
               <a-form-item label="结算状态">
                 <v-select
-                  v-model="queryParam.billStatus"
-                  ref="billStatus"
-                  id="bulkWarehousingOrderList-billStatus"
+                  v-model="queryParam.settleState"
+                  ref="settleState"
+                  id="bulkWarehousingOrderList-settleState"
                   code="PAYMENT_TYPE"
                   placeholder="请选择结算状态"
                   allowClear></v-select>
@@ -77,8 +77,8 @@
       :data="loadData"
       bordered>
       <!-- 散件单号 -->
-      <template slot="purchaseNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;">{{record.purchaseNo}}</span>
+      <template slot="sparePartsPurchaseNo" slot-scope="text, record">
+        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{record.sparePartsPurchaseNo}}</span>
       </template>
       <!-- 状态 -->
       <template slot="state" slot-scope="text, record">
@@ -101,59 +101,48 @@
 import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
-// import { getRoleList, getServiceList } from '@/api/manage'
+import { sparePartsPurList } from '@/api/sparePartsPur'
 export default {
   components: { STable, VSelect, basicInfoModal },
   data () {
     return {
-      // 高级搜索 展开/关闭
-      advanced: false,
+      advanced: false,  // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
       openModal: false, // 基本信息弹框是否显示
-      customeList:[],
+      supplierList:[],  //  供应商列表数据
+      creatDate: undefined,  //  创建时间
       // 查询参数
-      queryParam: {},
+      queryParam: {
+        sparePartsPurchaseNo: '',  //  散件单号
+        supplierName: undefined,  //  供应商
+        state: undefined,  //  单据状态
+        settleState: undefined,  //  结算状态
+      },
       // 表头
       columns: [
-        { title: '散件单号', scopedSlots: { customRender: 'purchaseNo' }, align: 'center' },
-        { title: '创建时间', dataIndex: 'creatDate', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '供应商', dataIndex: 'custName', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品款数', dataIndex: 'totalP', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总数量', dataIndex: 'totalNums', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总金额', dataIndex: 'totalPrice', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单据状态', dataIndex: 'payType', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '结算状态', dataIndex: 'mementPay', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '散件单号', scopedSlots: { customRender: 'sparePartsPurchaseNo' }, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商', dataIndex: 'supplierName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品款数', dataIndex: 'productTotalCategory', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总数量', dataIndex: 'productTotalQty', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总金额', dataIndex: 'productTotalCost', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单据状态', dataIndex: 'state', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '结算状态', dataIndex: 'settleState', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 270, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-        //   const data = res.data
-        //   const no = (data.pageNo - 1) * data.pageSize
-        //   for (var i = 0; i < data.list.length; i++) {
-        //     data.list[i].no = no + i + 1
-        //   }
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function(resolve, reject){
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-            ],
-            count: 10
-          }
+        this.queryParam = {}
+        return sparePartsPurList( Object.assign(parameter, this.queryParam) ).then(res => {
+          const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          return data
         })
       },
     }
@@ -187,7 +176,7 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         okText: '确定',
         cancelText: '取消',
-		centered: true,
+        centered: true,
         onOk () {
           // delectRolePower({
           //   id: row.id
@@ -203,12 +192,11 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
+      this.queryParam.sparePartsPurchaseNo = ''
+      this.queryParam.supplierName = undefined
+      this.queryParam.state = undefined
+      this.queryParam.settleState = undefined
+      this.creatDate = undefined
       this.$refs.table.refresh(true)
     },
     filterOption(input, option) {
@@ -219,16 +207,9 @@ export default {
     //  导出
     handleExport () {
       const params = this.queryParam
-      if (this.oldTime && this.oldTime.length > 0) {
-        params.beginOldExpiryDate = moment(this.oldTime[0]).format('YYYY-MM-DD')
-        params.endOldExpirydDate = moment(this.oldTime[1]).format('YYYY-MM-DD')
-      } else {
-        params.beginOldExpiryDate = ''
-        params.endOldExpirydDate = ''
-      }
-      if (this.newTime && this.newTime.length > 0) {
-        params.beginDate = moment(this.newTime[0]).format('YYYY-MM-DD')
-        params.endDate = moment(this.newTime[1]).format('YYYY-MM-DD')
+      if (this.creatDate && this.creatDate.length > 0) {
+        params.beginDate = moment(this.creatDate[0]).format('YYYY-MM-DD')
+        params.endDate = moment(this.creatDate[1]).format('YYYY-MM-DD')
       } else {
         params.beginDate = ''
         params.endDate = ''