Procházet zdrojové kódy

Merge remote-tracking branch 'origin/demo_' into demo_

hfxc226 před 1 rokem
rodič
revize
eccf03d3cd

+ 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'
+    }
+  })
+}

+ 2 - 1
src/utils/dict.js

@@ -345,7 +345,8 @@ DictCache.TYPE = {
   CSR_POLICY: 'CSR_POLICY', // 供需政策
   PLAN_METHOD: 'PLAN_METHOD', // 计划方法
   ADD_SPARE_STATUS: 'ADD_SPARE_STATUS', // 存货推送状态
-  SO_TYPE: 'SO_TYPE' // 需求跟踪方式
+  SO_TYPE: 'SO_TYPE', // 需求跟踪方式,
+  LONG_YAN_PURCHASE_DETAIL_STATUS: 'LONG_YAN_PURCHASE_DETAIL_STATUS'
 
 }
 DictCache.CODE = {

+ 22 - 3
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>2&&record.status<8"
+            @click="handleViewPurchase(record)"
+          >同步</operation-button>
           <operation-button
             v-if=" record.status>=3"
             :type="2"
@@ -79,18 +83,18 @@
 
 <script>
 import { STable, Ellipsis } from '@/components'
-import { getPurchaseOrderPage2, deletePurchaseOrder2, getPurchaseOrderInfo, pushPurchaseOrder, wastePurchaseOrder } from '@/api/purchase/purchase-order'
+import { getPurchaseOrderPage2, deletePurchaseOrder2, getPurchaseOrderInfo, pushPurchaseOrder, wastePurchaseOrder,getPurchaseOrderList } from '@/api/purchase/purchase-order'
 import BaseForm from './modules/BaseForm.vue'
 import Detail from './modules/Detail.vue'
 import AddSpareForm from '@/views/store/sparestore/modules/AddSpareForm'
 export default {
-  name: 'PurchaseOrderList',
+  name: 'PurchaseOrderPage',
   components: {
     STable,
     Ellipsis,
     BaseForm,
     AddSpareForm,
-    Detail
+    Detail,
   },
   data () {
     return {
@@ -165,6 +169,12 @@ export default {
           checked: true,
           width: 150
         },
+        {
+          title: '用友单号',
+          checked: true,
+          width: 100,
+          dataIndex: 'yongYouId'
+        },
         {
           title: '需求日期',
           dataIndex: 'needDate',
@@ -189,6 +199,7 @@ export default {
           width: 100,
           dataIndex: 'remark'
         },
+
         {
           title: '状态',
           dataIndex: 'status',
@@ -310,6 +321,14 @@ export default {
         this.handleOk()
         this.$refs.table.clearSelected()
       })
+    },
+    handleViewPurchase (record) {
+      getPurchaseOrderList({yongYouId:record.yongYouId})
+          .then(res => {
+            this.$message.info('同步成功')
+        this.handleOk()
+        this.$refs.table.clearSelected()
+          })
     }
   }
 }

+ 32 - 4
src/views/purchase/purchase-order-page/modules/Detail.vue

@@ -53,47 +53,75 @@ export default {
       flagMap: {},
       invoiceUrls: [],
       moneyTypeMap: {},
+      statusMap: {},
       model: {
       },
       columns: [
         {
           title: '序号',
           dataIndex: 'index',
+          width: 70,
           customRender: (text, record, index) => {
             return index + 1
           }
         },
         {
           title: '名称',
+          width: 100,
           dataIndex: 'spareName'
         },
         {
           title: '编号',
+          width: 100,
           dataIndex: 'no'
         },
         {
           title: '规格',
+          width: 100,
           dataIndex: 'ggxh'
         },
         {
           title: '仓库',
-          dataIndex: 'storeName'
+          dataIndex: 'storeName',
+          width: 100
+
         },
         {
           title: '货架号',
-          dataIndex: 'storePosition'
+          dataIndex: 'storePosition',
+          width: 100
         },
         {
           title: '采购数量',
           dataIndex: 'num',
-          width: 150,
-          scopedSlots: { customRender: 'num' }
+          width: 100
+        },
+        {
+          title: '已采购数量',
+          width: 100,
+          dataIndex: 'purchasedNum'
+        },
+        {
+          title: '已入库数量',
+          width: 100,
+          dataIndex: 'inStoreNum'
+        },
+        {
+          title: '明细状态',
+          width: 100,
+          dataIndex: 'detailStatus',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Table.getMapText(this.statusMap, text)
+          }
         }
+
       ]
     }
   },
   created () {
     // 下拉框map
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.LONG_YAN_PURCHASE_DETAIL_STATUS)
+    console.log(this.statusMap)
     this.flagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PROJECT_NEW_AND_OLD)
     this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.LONG_YAN_PURCHASE_TYPE)
   },

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

@@ -0,0 +1,196 @@
+<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>
+    </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: 'cappState',
+          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>