第二模块
This commit is contained in:
parent
a13dbfbaa9
commit
13ff42ea68
|
@ -1,11 +1,15 @@
|
|||
<template>
|
||||
<a-card title="订单处理" :bordered="false">
|
||||
<a-collapse v-model:activeKey="activeKey" accordion>
|
||||
<template #extra>
|
||||
<a-button style="margin-left: 10px;" type="primary" @click="getTableData()">刷新</a-button>
|
||||
</template>
|
||||
<a-collapse v-model:activeKey="activeKey" accordion v-if="dataShow">
|
||||
<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 }} 部门:{{ item.sysOrgCode }}
|
||||
采购方向:{{ item.procurementDirection }}
|
||||
<a-button style="float: right;margin-left: 10px;" @click="generateOrder(item)">生成订单</a-button>
|
||||
<a-button style="float: right;" @click="receiveNO(item)">取消接单</a-button>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -16,7 +20,16 @@
|
|||
<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="审批人">{{ item.approvedBy_dictText }}</a-descriptions-item>
|
||||
<a-descriptions-item label="附件" :span="3">
|
||||
<template>
|
||||
<span v-if="!item.annex" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<a-button v-else :ghost="true" type="primary" icon="download" size="small"
|
||||
@click="downloadFile(item.annex)">
|
||||
下载
|
||||
</a-button>
|
||||
</template>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="采购详情">
|
||||
<div v-for="(item2, index2) in item.procurementContent" :key="index2.toString()">
|
||||
<a-row>
|
||||
|
@ -24,12 +37,19 @@
|
|||
<a-col :span="2">{{ item2.number }}{{ item2.unit }}</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
<a-button style="float: right;" type="primary" @click="arrange(item)">物品和供应商整理</a-button>
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</div>
|
||||
</a-collapse-panel>
|
||||
</a-collapse>
|
||||
|
||||
<a-empty v-else>
|
||||
<template #description>
|
||||
<span>
|
||||
订单为空
|
||||
</span>
|
||||
</template>
|
||||
</a-empty>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
|
@ -52,6 +72,7 @@ export default {
|
|||
sysOrgCode: Vue.ls.get(USER_INFO).orgCode,
|
||||
supplierList: [],
|
||||
tableData: [],
|
||||
dataShow: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -81,14 +102,21 @@ export default {
|
|||
})
|
||||
},
|
||||
getTableData() {
|
||||
this.dataShow = false;
|
||||
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);
|
||||
});
|
||||
//判断数据是否为空
|
||||
if (this.tableData.length == 0) {
|
||||
this.dataShow = false;
|
||||
} else {
|
||||
this.activeKey = [0];
|
||||
this.tableData.forEach(item => {
|
||||
item.procurementContent = JSON.parse(item.procurementContent);
|
||||
});
|
||||
this.dataShow = true;
|
||||
}
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
|
@ -97,7 +125,7 @@ export default {
|
|||
receiveNO(item) {
|
||||
//深拷贝一份item
|
||||
let newItem = Object.assign({}, item);
|
||||
newItem.procurementContent = String(newItem.procurementContent);
|
||||
newItem.procurementContent = JSON.stringify(newItem.procurementContent);
|
||||
postAction(this.receiveNOurl, newItem).then(res => {
|
||||
//如果为200,则获取数据
|
||||
if (res.code == 200) {
|
||||
|
@ -107,7 +135,37 @@ export default {
|
|||
this.$message.error(res.message);
|
||||
}
|
||||
})
|
||||
}, downloadFile(text) {
|
||||
if (!text) {
|
||||
this.$message.warning("未知的文件")
|
||||
return;
|
||||
}
|
||||
if (text.indexOf(",") > 0) {
|
||||
text = text.substring(0, text.indexOf(","))
|
||||
}
|
||||
let url = this.getFileAccessHttpUrl(text)
|
||||
window.open(url);
|
||||
},
|
||||
getFileAccessHttpUrl(avatar, subStr) {
|
||||
if (!subStr) subStr = 'http'
|
||||
try {
|
||||
if (avatar && avatar.startsWith(subStr)) {
|
||||
return avatar;
|
||||
} else {
|
||||
if (avatar && avatar.length > 0 && avatar.indexOf('[') == -1) {
|
||||
return window._CONFIG['staticDomainURL'] + "/" + avatar;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
return;
|
||||
}
|
||||
}, generateOrder(item) {
|
||||
console.log(item);
|
||||
this.$message.success('生成订单中');
|
||||
}, arrange(item) {
|
||||
console.log(item);
|
||||
this.$message.success('正在整理');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<template>
|
||||
<a-card title="订单接收" :bordered="false">
|
||||
<a-collapse v-model:activeKey="activeKey" accordion>
|
||||
<template #extra>
|
||||
<a-button type="primary" @click="getdata()">刷新</a-button>
|
||||
</template>
|
||||
<a-collapse v-model:activeKey="activeKey" accordion v-if="dataShow">
|
||||
<a-collapse-panel v-for="(item, index) in dataList" :key="index.toString()">
|
||||
<template slot="header">
|
||||
<div style="font-size: 18px; font-weight: bold;">
|
||||
|
@ -30,6 +33,14 @@
|
|||
</a-collapse-panel>
|
||||
</a-collapse>
|
||||
|
||||
<a-empty v-else>
|
||||
<template #description>
|
||||
<span>
|
||||
订单为空
|
||||
</span>
|
||||
</template>
|
||||
</a-empty>
|
||||
|
||||
<a-modal title="填写接收备注" :visible="receive" @ok="receiveOk" @cancel="receiveCancel">
|
||||
<a-textarea v-model="auditResults" placeholder="请输入接收备注" />
|
||||
</a-modal>
|
||||
|
@ -58,6 +69,7 @@ export default {
|
|||
auditResults: '',
|
||||
username: Vue.ls.get(USER_INFO).username,
|
||||
sysOrgCode: Vue.ls.get(USER_INFO).orgCode,
|
||||
dataShow: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -98,15 +110,21 @@ export default {
|
|||
this.receive = false;
|
||||
},
|
||||
getdata() {
|
||||
this.dataShow = false;
|
||||
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);
|
||||
});
|
||||
if (this.dataList.length == 0) {
|
||||
this.dataShow = false;
|
||||
} else {
|
||||
this.activeKey = [0];
|
||||
//将其procurementContent转为json
|
||||
this.dataList.forEach(item => {
|
||||
item.procurementContent = JSON.parse(item.procurementContent);
|
||||
});
|
||||
this.dataShow = true;
|
||||
}
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue