更新采购管理的第二模块
This commit is contained in:
parent
d760ac5c5c
commit
a74e76fea2
|
@ -47,10 +47,17 @@
|
|||
</a-button>
|
||||
</template>
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a-button type="primary" @click="pass(record)">通过</a-button>
|
||||
<a-divider type="vertical" />
|
||||
<a-button type="primary" @click="NoPass(record)">不通过</a-button>
|
||||
<span slot="action" slot-scope="text, record" v-if="record.isReceiving == 0">
|
||||
<a-button v-if="record.demandStatus == 3" type="primary" @click="pass(record)">通过</a-button>
|
||||
<a-button v-else-if="record.demandStatus == 2" type="primary" @click="openNoPassModal(record)">不通过</a-button>
|
||||
<div v-else>
|
||||
<a-button type="primary" @click="pass(record)">通过</a-button>
|
||||
<a-divider type="vertical" />
|
||||
<a-button type="primary" @click="openNoPassModal(record)">不通过</a-button>
|
||||
</div>
|
||||
</span>
|
||||
<span v-else>
|
||||
<a>已被接单,不可修改</a>
|
||||
</span>
|
||||
|
||||
</a-table>
|
||||
|
@ -58,6 +65,9 @@
|
|||
<a-table :columns="contentColumns" :dataSource="content" rowKey="name"></a-table>
|
||||
</a-modal>
|
||||
|
||||
<a-modal title="不通过原因" :visible="noPassSee" @ok="noPassOk" @cancel="noPassCancel">
|
||||
<a-textarea v-model="tempRecord.auditResults" placeholder="请输入不通过原因" />
|
||||
</a-modal>
|
||||
|
||||
<purchase-request-modal ref="modalForm" @ok="modalFormOk"></purchase-request-modal>
|
||||
</a-card>
|
||||
|
@ -85,6 +95,7 @@ export default {
|
|||
description: '采购表管理页面',
|
||||
// 表头
|
||||
see: false,
|
||||
noPassSee: false,
|
||||
columns: [
|
||||
{
|
||||
title: '审批状态',
|
||||
|
@ -173,20 +184,31 @@ export default {
|
|||
{
|
||||
name: '',
|
||||
number: '',
|
||||
unit: '',
|
||||
},
|
||||
],
|
||||
contentColumns: [
|
||||
{
|
||||
title: '物品名称',
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name'
|
||||
key: 'name',
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
title: '物品数量',
|
||||
title: '数量',
|
||||
dataIndex: 'number',
|
||||
key: 'number'
|
||||
key: 'number',
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
title: '单位',
|
||||
dataIndex: 'unit',
|
||||
key: 'unit',
|
||||
width: 80
|
||||
}
|
||||
],
|
||||
//暂存表单
|
||||
tempRecord: {},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -200,6 +222,30 @@ export default {
|
|||
methods: {
|
||||
initDictConfig() {
|
||||
},
|
||||
openNoPassModal(record) {
|
||||
this.noPassSee = true
|
||||
this.tempRecord = Object.assign({}, record);
|
||||
this.tempRecord.auditResults = '';
|
||||
},
|
||||
noPassOk() {
|
||||
this.noPassSee = false
|
||||
//保存的逻辑
|
||||
let record = Object.assign({}, this.tempRecord);
|
||||
record.demandStatus = 3;
|
||||
record.approvedBy = Vue.ls.get(USER_INFO).username;
|
||||
record.auditResults = this.tempRecord.auditResults;
|
||||
postAction(this.url.edit, record).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success('重新审批成功');
|
||||
this.loadData();
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
noPassCancel() {
|
||||
this.noPassSee = false
|
||||
},
|
||||
handleOk() {
|
||||
this.see = false
|
||||
},
|
||||
|
@ -209,6 +255,7 @@ export default {
|
|||
this.content = {
|
||||
name: '',
|
||||
number: '',
|
||||
unit: '',
|
||||
}
|
||||
} else {
|
||||
this.content = JSON.parse(record.procurementContent)
|
||||
|
@ -234,18 +281,7 @@ export default {
|
|||
pass(record) {
|
||||
record.demandStatus = 2;
|
||||
record.approvedBy = Vue.ls.get(USER_INFO).username;
|
||||
postAction(this.url.edit, record).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success('重新提交成功');
|
||||
this.loadData();
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
NoPass(record) {
|
||||
record.demandStatus = 3;
|
||||
record.approvedBy = Vue.ls.get(USER_INFO).username;
|
||||
record.auditResults = '通过';
|
||||
postAction(this.url.edit, record).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success('重新提交成功');
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
<template>
|
||||
<a-card title="订单接收" :bordered="false">
|
||||
<a-collapse v-model:activeKey="activeKey" accordion>
|
||||
<a-collapse-panel v-for="(item, index) in dataList" :key="index.toString()">
|
||||
<template slot="header">
|
||||
<div style="font-size: 18px; font-weight: bold;">
|
||||
采购订单号:HL-{{ item.requirementNumber }} 部门:{{ item.sysOrgCode }}
|
||||
采购方向:{{ item.procurementDirection }}
|
||||
<a-button style="float: right;" @click="receiveData(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-modal title="填写接收备注" :visible="receive" @ok="receiveOk" @cancel="receiveCancel">
|
||||
<a-textarea v-model="auditResults" placeholder="请输入接收备注" />
|
||||
</a-modal>
|
||||
|
||||
</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 {
|
||||
description: '采购订单确认管理页面',
|
||||
dataList: [],
|
||||
activeKey: [],
|
||||
url: {
|
||||
list: "/Try/purchaseRequest/waitForReceiveList",
|
||||
acceptReceiving: "Try/purchaseOrderConfirmation/acceptReceiving",
|
||||
},
|
||||
receive: false,
|
||||
tempNO: '',
|
||||
auditResults: '',
|
||||
username: Vue.ls.get(USER_INFO).username,
|
||||
sysOrgCode: Vue.ls.get(USER_INFO).orgCode,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
list: function () {
|
||||
return `${window._CONFIG['domianURL']}/${this.url.list}`;
|
||||
},
|
||||
acceptReceiving: function () {
|
||||
return `${window._CONFIG['domianURL']}/${this.url.acceptReceiving}`;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getdata();
|
||||
},
|
||||
methods: {
|
||||
receiveData(item) {
|
||||
this.tempNO = item.requirementNumber;
|
||||
this.receive = true;
|
||||
},
|
||||
receiveOk() {
|
||||
let data = {
|
||||
associationNumber: this.tempNO,
|
||||
receiver: this.username,
|
||||
notes: this.auditResults,
|
||||
receivingTime: new Date(),
|
||||
}
|
||||
postAction(this.acceptReceiving, data).then(res => {
|
||||
//如果为200,则获取数据
|
||||
if (res.code == 200) {
|
||||
this.$message.success('接收成功');
|
||||
this.getdata();
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
})
|
||||
this.receive = false;
|
||||
},
|
||||
receiveCancel() {
|
||||
this.receive = false;
|
||||
},
|
||||
getdata() {
|
||||
getAction(this.list, {}).then(res => {
|
||||
//如果为200,则获取数据
|
||||
if (res.code == 200) {
|
||||
this.dataList = res.result.records;
|
||||
this.activeKey = [0];
|
||||
//将其procurementContent转为json
|
||||
this.dataList.forEach(item => {
|
||||
item.procurementContent = JSON.parse(item.procurementContent);
|
||||
});
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -66,8 +66,7 @@
|
|||
下载
|
||||
</a-button>
|
||||
</template>
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<span slot="action" slot-scope="text, record" v-if="record.demandStatus == 3">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
|
@ -76,6 +75,12 @@
|
|||
<a-divider type="vertical" v-if="record.demandStatus == 3" />
|
||||
<a-button type="primary" v-if="record.demandStatus == 3" @click="reSubmit(record)">重新提交</a-button>
|
||||
</span>
|
||||
<span v-else-if="record.demandStatus == 2">
|
||||
<a>已通过申请不可修改</a>
|
||||
</span>
|
||||
<span v-else-if="record.demandStatus == 1">
|
||||
<a>审核中不可修改</a>
|
||||
</span>
|
||||
|
||||
</a-table>
|
||||
</div>
|
||||
|
@ -199,14 +204,22 @@ export default {
|
|||
],
|
||||
contentColumns: [
|
||||
{
|
||||
title: '物品名称',
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name'
|
||||
key: 'name',
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
title: '物品数量',
|
||||
title: '数量',
|
||||
dataIndex: 'number',
|
||||
key: 'number'
|
||||
key: 'number',
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
title: '单位',
|
||||
dataIndex: 'unit',
|
||||
key: 'unit',
|
||||
width: 80
|
||||
}
|
||||
],
|
||||
dictOptions: {},
|
||||
|
|
|
@ -19,11 +19,14 @@
|
|||
<!-- 循环渲染 content 数组中的每个对象 -->
|
||||
<div v-for="(item, index) in content" :key="index">
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="10">
|
||||
<a-col :span="8">
|
||||
<a-input v-model="item.name" placeholder="物品名称" />
|
||||
</a-col>
|
||||
<a-col :span="10">
|
||||
<a-input v-model="item.number" placeholder="物品数量" />
|
||||
<a-col :span="6">
|
||||
<a-input v-model="item.number" placeholder="数量" />
|
||||
</a-col>
|
||||
<a-col :span="6">
|
||||
<a-input v-model="item.unit" placeholder="单位" />
|
||||
</a-col>
|
||||
<a-col :span="2">
|
||||
<!-- 通过点击按钮触发新增行 -->
|
||||
|
@ -119,6 +122,7 @@ export default {
|
|||
{
|
||||
name: '',
|
||||
number: '',
|
||||
unit: '',
|
||||
},
|
||||
]
|
||||
}
|
||||
|
@ -140,6 +144,7 @@ export default {
|
|||
this.content.splice(index + 1, 0, {
|
||||
name: '',
|
||||
number: '',
|
||||
unit: '',
|
||||
});
|
||||
},
|
||||
// 移除指定索引位置的行
|
||||
|
|
Loading…
Reference in New Issue