Merge pull request '更新订单处理页面' (#6) from hh/Glass-ERP-Vue:test into test

Reviewed-on: http://82.157.76.162:3000/Big-Data-Lab/Glass-ERP-Vue/pulls/6
This commit is contained in:
黄晖 2023-08-15 01:06:49 +08:00
commit a13dbfbaa9
1 changed files with 114 additions and 0 deletions

View File

@ -0,0 +1,114 @@
<template>
<a-card title="订单处理" :bordered="false">
<a-collapse v-model:activeKey="activeKey" accordion>
<a-collapse-panel v-for="(item, index) in tableData" :key="index.toString()">
<template slot="header">
<div style="font-size: 18px; font-weight: bold;">
采购订单号:HL-{{ item.requirementNumber }} &nbsp;&nbsp;部门:{{ item.sysOrgCode }}
&nbsp;&nbsp;采购方向:{{ item.procurementDirection }}
<a-button style="float: right;" @click="receiveNO(item)">取消接单</a-button>
</div>
</template>
<div>
<a-descriptions title="订单详情" bordered>
<a-descriptions-item label="申请人">{{ item.createBy_dictText }}</a-descriptions-item>
<a-descriptions-item label="申请时间">{{ item.createTime }}</a-descriptions-item>
<a-descriptions-item label="申请部门">{{ item.sysOrgCode }}</a-descriptions-item>
<a-descriptions-item label="采购类型">{{ item.procurementCategory_dictText }}</a-descriptions-item>
<a-descriptions-item label="采购预算" :span="3">{{ item.procurementBudget }}</a-descriptions-item>
<a-descriptions-item label="审批人" :span="3">{{ item.approvedBy_dictText }}</a-descriptions-item>
<a-descriptions-item label="采购详情">
<div v-for="(item2, index2) in item.procurementContent" :key="index2.toString()">
<a-row>
<a-col :span="2">{{ item2.name }}</a-col>
<a-col :span="2">{{ item2.number }}{{ item2.unit }}</a-col>
</a-row>
</div>
</a-descriptions-item>
</a-descriptions>
</div>
</a-collapse-panel>
</a-collapse>
</a-card>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
import { USER_INFO } from "@/store/mutation-types"
import Vue from 'vue'
export default {
name: 'PurchaseOrderConfirmationList',
data() {
return {
url: {
getPurchaseSupplier: "Try/purchaseSupplier/list",
getdata: "/Try/purchaseRequest/receivedList",
receiveNOurl: "/Try/purchaseOrderConfirmation/cancelReceiving",
},
activeKey: [],
username: Vue.ls.get(USER_INFO).username,
sysOrgCode: Vue.ls.get(USER_INFO).orgCode,
supplierList: [],
tableData: [],
}
},
computed: {
getPurchaseSupplier: function () {
return `${window._CONFIG['domianURL']}/${this.url.getPurchaseSupplier}`;
},
getdata: function () {
return `${window._CONFIG['domianURL']}/${this.url.getdata}`;
},
receiveNOurl: function () {
return `${window._CONFIG['domianURL']}/${this.url.receiveNOurl}`;
},
},
created() {
this.getSupplierData();
this.getTableData();
},
methods: {
getSupplierData() {
getAction(this.getPurchaseSupplier).then(res => {
//200
if (res.code == 200) {
this.supplierList = res.result.records;
} else {
this.$message.error(res.message);
}
})
},
getTableData() {
getAction(this.getdata,).then(res => {
//200
if (res.code == 200) {
this.tableData = res.result.records;
this.activeKey = [0];
this.tableData.forEach(item => {
item.procurementContent = JSON.parse(item.procurementContent);
});
} else {
this.$message.error(res.message);
}
})
},
receiveNO(item) {
//item
let newItem = Object.assign({}, item);
newItem.procurementContent = String(newItem.procurementContent);
postAction(this.receiveNOurl, newItem).then(res => {
//200
if (res.code == 200) {
this.$message.success('取消成功');
this.getTableData();
} else {
this.$message.error(res.message);
}
})
},
}
}
</script>