whj 1 rok pred
rodič
commit
aa29c44547

+ 15 - 0
src/api/purchase/purchase-order.js

@@ -461,3 +461,18 @@ export function exportOrderDetailByTime (parameter) {
     responseType: 'blob'
   })
 }
+/**
+ * export file
+ * parameter: { }
+ * @param parameter :
+ * @returns {*}
+ */
+export function getPurchaseOrderList (parameter) {
+  return axios({
+    url: '/yongyou/purchaseOrder/list?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}

+ 12 - 2
src/views/purchase/purchase-order-page/PurchaseOrderPage.vue

@@ -55,6 +55,10 @@
             v-if=" record.status===1"
             @click="handlePush(record)"
           >推送</operation-button>
+          <operation-button
+            v-if="record.status===3"
+            @click="handleViewPurchase(record)"
+          >请购单</operation-button>
           <operation-button
             v-if=" record.status>=3"
             :type="2"
@@ -73,6 +77,7 @@
     </div>
     <BaseForm ref="baseForm" @ok="handleOk"/>
     <Detail ref="detail" @ok="handleOk"/>
+    <PurchaseOrderList ref="purchaseOrderList" @ok="handleOk"/>
     <AddSpareForm ref="addSpareForm" />
   </a-card>
 </template>
@@ -82,15 +87,17 @@ import { STable, Ellipsis } from '@/components'
 import { getPurchaseOrderPage2, deletePurchaseOrder2, getPurchaseOrderInfo, pushPurchaseOrder, wastePurchaseOrder } from '@/api/purchase/purchase-order'
 import BaseForm from './modules/BaseForm.vue'
 import Detail from './modules/Detail.vue'
+import PurchaseOrderList from './modules/PurchaseOrderList.vue'
 import AddSpareForm from '@/views/store/sparestore/modules/AddSpareForm'
 export default {
-  name: 'PurchaseOrderList',
+  name: 'PurchaseOrderPage',
   components: {
     STable,
     Ellipsis,
     BaseForm,
     AddSpareForm,
-    Detail
+    Detail,
+    PurchaseOrderList
   },
   data () {
     return {
@@ -310,6 +317,9 @@ export default {
         this.handleOk()
         this.$refs.table.clearSelected()
       })
+    },
+    handleViewPurchase (record) {
+      this.$refs.purchaseOrderList.base(record)
     }
   }
 }

+ 191 - 0
src/views/purchase/purchase-order-page/modules/PurchaseOrderList.vue

@@ -0,0 +1,191 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="1300"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    class="ant-modal2"
+    @cancel="handleCancel"
+  >
+    <a-card :bordered="false">
+      <s-table
+        ref="table"
+        size="default"
+        rowKey="id"
+        :columns="columns"
+        :data="loadData"
+        :alert="options.alert"
+        :customRow="options.customRow"
+        :rowSelection="options.rowSelection"
+        :scroll="{ x: 1300, y: BaseTool.Constant.scrollY }"
+        showPagination="auto"
+      >
+        <span slot="status" slot-scope="text">
+          <badge :status="DictCache.COLOR.SB_INFO_STATUS[text]" :text="statusMap[text]" />
+        </span>
+      </s-table>
+    </a-card>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">取消</a-button>
+      <a-button :loading="confirmLoading" type="primary" @click="handleSelect()">选择</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import { getPurchaseOrderList } from '@/api/purchase/purchase-order'
+import { STable, Ellipsis } from '@/components'
+
+export default {
+  name: 'SbInfoSelectModal',
+  components: {
+    STable
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      modalTitle: null,
+      visible: false,
+      // 查询参数
+      queryParam: {
+      },
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          checked: true,
+          width: 70,
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '请购单号',
+          width: 100,
+          checked: true,
+          dataIndex: 'ctrackNo'
+        },
+        {
+          title: '请购单行号',
+          dataIndex: 'itrackRowNo',
+          width: 100,
+          checked: true
+        },
+        {
+          title: '业务类型',
+          width: 100,
+          checked: true,
+          dataIndex: 'cbusType'
+        },
+        {
+          title: '请购单号',
+          width: 100,
+          checked: true,
+          dataIndex: 'ccode'
+        },
+        {
+          title: '请购日期',
+          dataIndex: 'dpodate',
+          checked: true,
+          width: 100
+        },
+        {
+          title: '存货名称',
+          dataIndex: 'cinvName',
+          checked: true,
+          width: 100
+        },
+        {
+          title: '存货分类名称',
+          dataIndex: 'cinvCName',
+          checked: true,
+          width: 100
+        },
+        {
+          title: '单位',
+          dataIndex: 'ccomUnitName',
+          checked: true,
+          width: 100
+        },
+        {
+          title: '规格型号',
+          dataIndex: 'cinvStd',
+          checked: true,
+          width: 100
+        },
+        {
+          title: '请购数量',
+          dataIndex: 'iquantity',
+          checked: true,
+          width: 100
+        },
+        {
+          title: '已采购数量',
+          dataIndex: 'iposum',
+          checked: true,
+          width: 100
+        },
+        {
+          title: '入库数量',
+          dataIndex: 'irdsum',
+          checked: true,
+          width: 100
+        },
+        {
+          title: '单据审核状态',
+          dataIndex: 'istatus',
+          checked: true,
+          width: 100
+        }
+        // {
+        //   title: '操作',
+        //   key: 'action',
+        //   width: '200px',
+        //   align: 'center',
+        //   fixed: 'right',
+        //   scopedSlots: { width: 200, customRender: 'action' }
+        // }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          yongYouId: this.yongYouId
+        }
+        return getPurchaseOrderList(parameter)
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
+
+      options: {
+        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      yongYouId: ''
+    }
+  },
+  created () {
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.yongYouId = record.yongYouId
+      this.modalTitle = '请购单'
+      console.log(this.$refs)
+      console.log(this.$refs.table.refresh)
+      this.$refs.table.refresh(true)
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+    }
+  }
+}
+</script>