Merge pull request 'test' (#7) from hh/Glass-ERP-Vue:test into test
Reviewed-on: http://82.157.76.162:3000/Big-Data-Lab/Glass-ERP-Vue/pulls/7
This commit is contained in:
commit
7159dce862
|
@ -1,11 +1,19 @@
|
||||||
<template>
|
<template>
|
||||||
<a-card title="订单处理" :bordered="false">
|
<a-card title="订单处理" :bordered="false">
|
||||||
<a-collapse v-model:activeKey="activeKey" accordion>
|
<template #extra>
|
||||||
|
<a-button style="margin-left: 10px;" type="primary" @click="Refresh()">刷新</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()">
|
<a-collapse-panel v-for="(item, index) in tableData" :key="index.toString()">
|
||||||
<template slot="header">
|
<template slot="header">
|
||||||
<div style="font-size: 18px; font-weight: bold;">
|
<div style="font-size: 18px; font-weight: bold;">
|
||||||
采购订单号:HL-{{ item.requirementNumber }} 部门:{{ item.sysOrgCode }}
|
采购订单号:HL-{{ item.requirementNumber }} 部门:{{ item.sysOrgCode }}
|
||||||
采购方向:{{ item.procurementDirection }}
|
采购方向:{{ item.procurementDirection }}
|
||||||
|
|
||||||
|
<a-button type="primary" style="float: right;margin-left: 10px;"
|
||||||
|
@click="finish(item)">开始采购</a-button>
|
||||||
|
<a-button style="float: right;margin-left: 10px;" @click="GenerateQRcode(item)">生成二维码</a-button>
|
||||||
|
<a-button style="float: right;margin-left: 10px;" @click="generateOrder(item)">生成订单</a-button>
|
||||||
<a-button style="float: right;" @click="receiveNO(item)">取消接单</a-button>
|
<a-button style="float: right;" @click="receiveNO(item)">取消接单</a-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -16,20 +24,124 @@
|
||||||
<a-descriptions-item label="申请部门">{{ item.sysOrgCode }}</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="采购类型">{{ item.procurementCategory_dictText }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="采购预算" :span="3">{{ item.procurementBudget }}</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="采购详情">
|
<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="采购详情(未整理)"
|
||||||
|
v-if="item.supplierSelection == null || item.supplierSelection == ''">
|
||||||
<div v-for="(item2, index2) in item.procurementContent" :key="index2.toString()">
|
<div v-for="(item2, index2) in item.procurementContent" :key="index2.toString()">
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="2">{{ item2.name }}</a-col>
|
<a-col :span="2">{{ item2.name }}</a-col>
|
||||||
<a-col :span="2">{{ item2.number }}{{ item2.unit }}</a-col>
|
<a-col :span="2">{{ item2.number }}{{ item2.unit }}</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</div>
|
</div>
|
||||||
|
<a-button style="float: right;" type="primary" @click="arrangeOpen(item)">物品和供应商整理</a-button>
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item label="采购详情" v-else>
|
||||||
|
|
||||||
|
<a-card style="margin-top: 20px;margin-right: 20px;"
|
||||||
|
v-for="(item2, index2) in item.supplierSelection" :key="index2.toString()">
|
||||||
|
<template #title>
|
||||||
|
{{ item2.supplier }}
|
||||||
|
</template>
|
||||||
|
<div v-for="(item3, index3) in item2.goods" :key="index3.toString()">
|
||||||
|
<a-row :gutter="16" style="margin-top: 5px;">
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-input v-model="item3.name" placeholder="物品名称" disabled />
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="6">
|
||||||
|
<a-input v-model="item3.number" placeholder="数量" disabled />
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="6">
|
||||||
|
<a-input v-model="item3.unit" placeholder="单位" disabled />
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</div>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<a-button style="margin-top: 10px;float: right;" type="primary"
|
||||||
|
@click="arrangeOpen(item)">物品和供应商整理</a-button>
|
||||||
|
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
</a-descriptions>
|
</a-descriptions>
|
||||||
</div>
|
</div>
|
||||||
</a-collapse-panel>
|
</a-collapse-panel>
|
||||||
</a-collapse>
|
</a-collapse>
|
||||||
|
<a-empty v-else>
|
||||||
|
<template #description>
|
||||||
|
<span>
|
||||||
|
订单为空
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</a-empty>
|
||||||
|
|
||||||
|
<a-modal title="采购整理" :visible="arrange" @ok="arrangeOk" @cancel="arrangeCancel">
|
||||||
|
<div v-if="classifyData.length == 0">
|
||||||
|
暂无数据
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<div>
|
||||||
|
<a-card style="margin-top: 20px;margin-right: 20px;" v-for="(item, index) in classifyData"
|
||||||
|
:key="index.toString()">
|
||||||
|
<template #title>
|
||||||
|
{{ item.supplier }}
|
||||||
|
<a-button style="float: right;" type="primary" @click="delSupplier(item)">删除公司</a-button>
|
||||||
|
</template>
|
||||||
|
<div style="margin-bottom: 20px;">
|
||||||
|
<a-select v-model:value="selectedFoods" mode="multiple" style="width: 60%"
|
||||||
|
placeholder="Please select">
|
||||||
|
<a-select-option v-for="food in classFood" :key="food.name" :value="food.name">
|
||||||
|
{{ food.name }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
|
||||||
|
<a-button style="float: right;" @click="importFoods(index)">导入</a-button>
|
||||||
|
<br>
|
||||||
|
</div>
|
||||||
|
<div v-for="(item2, index2) in item.goods" :key="index2.toString()">
|
||||||
|
<a-row :gutter="16" style="margin-top: 5px;">
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-input v-model="item2.name" placeholder="物品名称" />
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="6">
|
||||||
|
<a-input v-model="item2.number" placeholder="数量" />
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="6">
|
||||||
|
<a-input v-model="item2.unit" placeholder="单位" />
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="2">
|
||||||
|
<!-- 通过点击按钮触发新增行 -->
|
||||||
|
<a-icon type="plus-circle" @click="addRow(item2, index)" />
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="2">
|
||||||
|
<!-- 通过点击按钮触发删除行 -->
|
||||||
|
<a-icon type="minus-circle" @click="removeRow(index, index2)" />
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</a-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<a-select mode="default" v-model="selectedSuppliers" style="width: 160px;">
|
||||||
|
<a-select-option v-for="supplier in classSupplier" :key="supplier.id" :value="supplier.id">
|
||||||
|
{{ supplier.name }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
<a-button type="primary" style="margin-top: 20px;margin-left: 20px;" @click="addSupplier()">添加供应商</a-button>
|
||||||
|
</div>
|
||||||
|
</a-modal>
|
||||||
|
<a-modal title="生成二维码" :visible="QRvis" @ok="QRvis = false" @cancel="QRvis = false">
|
||||||
|
生成失败
|
||||||
|
</a-modal>
|
||||||
</a-card>
|
</a-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -42,16 +154,30 @@ export default {
|
||||||
name: 'PurchaseOrderConfirmationList',
|
name: 'PurchaseOrderConfirmationList',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
QRvis: false,
|
||||||
url: {
|
url: {
|
||||||
getPurchaseSupplier: "Try/purchaseSupplier/list",
|
getPurchaseSupplier: "Try/purchaseSupplier/list",
|
||||||
getdata: "/Try/purchaseRequest/receivedList",
|
getdata: "/Try/purchaseOrderConfirmation/joinList",
|
||||||
receiveNOurl: "/Try/purchaseOrderConfirmation/cancelReceiving",
|
receiveNOurl: "/Try/purchaseOrderConfirmation/cancelReceiving",
|
||||||
|
editUrl: '/Try/purchaseOrderConfirmation/edit',
|
||||||
|
finshUrl: '/Try/purchaseOrderConfirmation/finish'
|
||||||
},
|
},
|
||||||
activeKey: [],
|
activeKey: [],
|
||||||
username: Vue.ls.get(USER_INFO).username,
|
username: Vue.ls.get(USER_INFO).username,
|
||||||
sysOrgCode: Vue.ls.get(USER_INFO).orgCode,
|
sysOrgCode: Vue.ls.get(USER_INFO).orgCode,
|
||||||
supplierList: [],
|
supplierList: [],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
dataShow: false,
|
||||||
|
arrange: false,
|
||||||
|
|
||||||
|
classifyData: [],
|
||||||
|
classSupplier: [],
|
||||||
|
selectedSuppliers: '',
|
||||||
|
classFood: [],
|
||||||
|
selectedFoods: [],
|
||||||
|
poenNmber: '',
|
||||||
|
|
||||||
|
QRcode: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -64,12 +190,43 @@ export default {
|
||||||
receiveNOurl: function () {
|
receiveNOurl: function () {
|
||||||
return `${window._CONFIG['domianURL']}/${this.url.receiveNOurl}`;
|
return `${window._CONFIG['domianURL']}/${this.url.receiveNOurl}`;
|
||||||
},
|
},
|
||||||
|
editUrl: function () {
|
||||||
|
return `${window._CONFIG['domianURL']}/${this.url.editUrl}`;
|
||||||
|
},
|
||||||
|
finshUrl: function () {
|
||||||
|
return `${window._CONFIG['domianURL']}/${this.url.finshUrl}`;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getSupplierData();
|
this.getSupplierData();
|
||||||
this.getTableData();
|
this.getTableData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
finish(item) {
|
||||||
|
let newItem = Object.assign({}, item);
|
||||||
|
newItem.procurementContent = JSON.stringify(newItem.procurementContent);
|
||||||
|
if (newItem.supplierSelection != null && newItem.supplierSelection != '') {
|
||||||
|
newItem.supplierSelection = JSON.stringify(newItem.supplierSelection);
|
||||||
|
} else {
|
||||||
|
newItem.supplierSelection = '';
|
||||||
|
}
|
||||||
|
// 新增procurementLog为
|
||||||
|
newItem.procurementLog = {
|
||||||
|
'0': newItem.supplierSelection
|
||||||
|
}
|
||||||
|
newItem.procurementLog = JSON.stringify(newItem.procurementLog);
|
||||||
|
//将newItem将requirementNumber修改associationNumber
|
||||||
|
newItem.associationNumber = newItem.requirementNumber;
|
||||||
|
postAction(this.finshUrl, newItem).then(res => {
|
||||||
|
//如果为200,则获取数据
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.$message.success('完成订单成功');
|
||||||
|
this.getTableData();
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
getSupplierData() {
|
getSupplierData() {
|
||||||
getAction(this.getPurchaseSupplier).then(res => {
|
getAction(this.getPurchaseSupplier).then(res => {
|
||||||
//如果为200,则获取数据
|
//如果为200,则获取数据
|
||||||
|
@ -81,14 +238,28 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getTableData() {
|
getTableData() {
|
||||||
getAction(this.getdata,).then(res => {
|
this.dataShow = false;
|
||||||
|
getAction(this.getdata).then(res => {
|
||||||
//如果为200,则获取数据
|
//如果为200,则获取数据
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.tableData = res.result.records;
|
this.tableData = res.result.records;
|
||||||
this.activeKey = [0];
|
//判断数据是否为空
|
||||||
this.tableData.forEach(item => {
|
if (this.tableData.length == 0) {
|
||||||
item.procurementContent = JSON.parse(item.procurementContent);
|
this.dataShow = false;
|
||||||
});
|
} else {
|
||||||
|
this.activeKey = [''];
|
||||||
|
//将采购详情转化为对象
|
||||||
|
this.tableData.forEach(item => {
|
||||||
|
item.procurementContent = JSON.parse(item.procurementContent);
|
||||||
|
});
|
||||||
|
//将supplierSelection转化为对象
|
||||||
|
this.tableData.forEach(item => {
|
||||||
|
if (item.supplierSelection != null && item.supplierSelection != '') {
|
||||||
|
item.supplierSelection = JSON.parse(item.supplierSelection);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.dataShow = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.message);
|
this.$message.error(res.message);
|
||||||
}
|
}
|
||||||
|
@ -97,7 +268,8 @@ export default {
|
||||||
receiveNO(item) {
|
receiveNO(item) {
|
||||||
//深拷贝一份item
|
//深拷贝一份item
|
||||||
let newItem = Object.assign({}, item);
|
let newItem = Object.assign({}, item);
|
||||||
newItem.procurementContent = String(newItem.procurementContent);
|
newItem.procurementContent = JSON.stringify(newItem.procurementContent);
|
||||||
|
newItem.supplierSelection = JSON.stringify(newItem.supplierSelection);
|
||||||
postAction(this.receiveNOurl, newItem).then(res => {
|
postAction(this.receiveNOurl, newItem).then(res => {
|
||||||
//如果为200,则获取数据
|
//如果为200,则获取数据
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
|
@ -108,7 +280,201 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
}
|
Refresh() {
|
||||||
|
this.getSupplierData();
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
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) {
|
||||||
|
this.$message.success('生成订单成功');
|
||||||
|
},
|
||||||
|
//整理弹窗的确认提交
|
||||||
|
arrangeOk() {
|
||||||
|
this.classifyData.forEach((item, index) => {
|
||||||
|
//遍历item中的goods
|
||||||
|
item.goods.forEach((item2, index2) => {
|
||||||
|
//如果有一项为空,则删除这一项
|
||||||
|
let flag1 = item2.name == null || item2.name == '' || item2.name == undefined;
|
||||||
|
let flag2 = item2.number == null || item2.number == '' || item2.number == undefined;
|
||||||
|
let flag3 = item2.unit == null || item2.unit == '' || item2.unit == undefined;
|
||||||
|
if (flag1 && flag2 && flag3) {
|
||||||
|
item.goods.splice(index2, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
let data = {
|
||||||
|
associationNumber: this.poenNmber,
|
||||||
|
supplierSelection: JSON.stringify(this.classifyData),
|
||||||
|
}
|
||||||
|
if (data.supplierSelection == '[]') {
|
||||||
|
data.supplierSelection = '';
|
||||||
|
}
|
||||||
|
postAction(this.editUrl, data).then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.$message.success('整理成功');
|
||||||
|
this.arrange = false;
|
||||||
|
this.getTableData();
|
||||||
|
//将相关数据清空
|
||||||
|
this.classifyData = [];
|
||||||
|
this.classSupplier = [];
|
||||||
|
this.classFood = [];
|
||||||
|
this.selectedSuppliers = '';
|
||||||
|
this.selectedFoods = [];
|
||||||
|
this.poenNmber = '';
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//取消整理
|
||||||
|
arrangeCancel() {
|
||||||
|
this.arrange = false;
|
||||||
|
//将相关数据清空
|
||||||
|
this.classifyData = [];
|
||||||
|
this.classSupplier = [];
|
||||||
|
this.classFood = [];
|
||||||
|
this.selectedSuppliers = '';
|
||||||
|
this.selectedFoods = [];
|
||||||
|
this.poenNmber = '';
|
||||||
|
},
|
||||||
|
//打开整理弹窗,整理弹窗的数据初始化
|
||||||
|
arrangeOpen(item) {
|
||||||
|
//获取供应商数据
|
||||||
|
this.classifyData = [];
|
||||||
|
this.classSupplier = [];
|
||||||
|
this.supplierList.forEach(item => {
|
||||||
|
this.classSupplier.push({
|
||||||
|
id: item.id,
|
||||||
|
name: item.name,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.classSupplier = Object.assign([], this.classSupplier);
|
||||||
|
//获取物品数据
|
||||||
|
this.classFood = Object.assign([], item.procurementContent);
|
||||||
|
this.poenNmber = item.requirementNumber;
|
||||||
|
//判断supplierSelection是否为空或者null
|
||||||
|
if (item.supplierSelection == null || item.supplierSelection == '') {
|
||||||
|
this.arrange = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//将其转化为对象
|
||||||
|
let newData = JSON.parse(JSON.stringify(item.supplierSelection))
|
||||||
|
//将被选择的供应商从classSupplier中删除
|
||||||
|
newData.forEach(item => {
|
||||||
|
this.classSupplier.forEach((item2, index2) => {
|
||||||
|
if (item2.id == item.supplierID) {
|
||||||
|
this.classSupplier.splice(index2, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
//将其添加到classifyData中
|
||||||
|
this.classifyData = JSON.parse(JSON.stringify(newData))
|
||||||
|
this.arrange = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//以下为整理的相关操作
|
||||||
|
delSupplier(item) {
|
||||||
|
//搜索ID将这一行从classifyData中删除
|
||||||
|
this.classifyData.forEach((item2, index2) => {
|
||||||
|
if (item2.supplierID == item.supplierID) {
|
||||||
|
this.classifyData.splice(index2, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//将其添加到classSupplier中
|
||||||
|
this.classSupplier.push({
|
||||||
|
id: item.supplierID,
|
||||||
|
name: item.supplier,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
addSupplier() {
|
||||||
|
//如果选中的供应商为空,则不添加
|
||||||
|
if (this.selectedSuppliers == '') {
|
||||||
|
this.$message.warning('请选择供应商');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let selectedID = this.selectedSuppliers;
|
||||||
|
let selectedSupplier = {};
|
||||||
|
this.classSupplier.forEach((item, index) => {
|
||||||
|
if (item.id == selectedID) {
|
||||||
|
selectedSupplier = Object.assign({}, item);
|
||||||
|
this.classSupplier.splice(index, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.classifyData.push({
|
||||||
|
supplierID: selectedSupplier.id,
|
||||||
|
supplier: selectedSupplier.name,
|
||||||
|
goods: [{
|
||||||
|
name: '',
|
||||||
|
number: '',
|
||||||
|
unit: '',
|
||||||
|
}
|
||||||
|
],
|
||||||
|
});
|
||||||
|
//将选中制空
|
||||||
|
this.selectedSuppliers = '';
|
||||||
|
},
|
||||||
|
addRow(item, index) {
|
||||||
|
this.classifyData[index].goods.push({
|
||||||
|
name: '',
|
||||||
|
number: '',
|
||||||
|
unit: '',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
removeRow(index1, index2) {
|
||||||
|
this.classifyData[index1].goods.splice(index2, 1);
|
||||||
|
},
|
||||||
|
importFoods(index) {
|
||||||
|
let selectedFoods = this.selectedFoods;
|
||||||
|
let selectedGoods = [];
|
||||||
|
this.classFood.forEach(item => {
|
||||||
|
selectedFoods.forEach(item2 => {
|
||||||
|
if (item.name == item2) {
|
||||||
|
selectedGoods.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
//push而不是赋值,因为要保留原来的数据
|
||||||
|
selectedGoods.forEach(item => {
|
||||||
|
this.classifyData[index].goods.push({
|
||||||
|
name: item.name,
|
||||||
|
number: item.number,
|
||||||
|
unit: item.unit,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.selectedFoods = [];
|
||||||
|
},
|
||||||
|
GenerateQRcode(item) {
|
||||||
|
this.QRvis = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
<style></style>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,184 @@
|
||||||
|
<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.reqirementNumber }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<a-timeline mode="alternate">
|
||||||
|
<a-timeline-item>
|
||||||
|
物品整理完毕,开始采购
|
||||||
|
<a-button @click="see(item.procurementLog[0])">查看详情</a-button>
|
||||||
|
</a-timeline-item>
|
||||||
|
<a-timeline-item v-for="(item2, index2) in item.procurementLog" :key="index2.toString()" v-if="index2 > 0">
|
||||||
|
{{ item2 }}
|
||||||
|
</a-timeline-item>
|
||||||
|
|
||||||
|
<a-timeline-item v-if="item.isDone == 1">
|
||||||
|
采购结束
|
||||||
|
</a-timeline-item>
|
||||||
|
</a-timeline>
|
||||||
|
|
||||||
|
<div v-if="item.isDone == 0">
|
||||||
|
<a-button type="primary" style="float: right;margin-bottom: 10px;margin-left: 10px;"
|
||||||
|
@click="addLog(item)">添加日志</a-button>
|
||||||
|
<a-button type="primary" style="float: right;margin-bottom: 10px;" @click="endLog(item)">采购结束</a-button>
|
||||||
|
</div>
|
||||||
|
<div v-if="item.isDone == 1&&item.qualityIsPass == 0">
|
||||||
|
<a-button type="primary" style="float: right;margin-bottom: 10px;" @click="end(item)">完成质检</a-button>
|
||||||
|
</div>
|
||||||
|
<div v-if="item.isDone == 1&&item.qualityIsPass == 1">
|
||||||
|
<a-button type="primary" style="float: center;margin-bottom: 10px;" disabled>已完成质检</a-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</a-collapse-panel>
|
||||||
|
</a-collapse>
|
||||||
|
|
||||||
|
<a-modal v-model="seeModal" title="整理详情" width="800px" @ok="seeModal = false" @cancel="seeModal = false">
|
||||||
|
<a-card style="margin-top: 20px;margin-right: 20px;" v-for="(item2, index2) in supplierSelection"
|
||||||
|
:key="index2.toString()">
|
||||||
|
<template #title>
|
||||||
|
{{ item2.supplier }}
|
||||||
|
</template>
|
||||||
|
<div v-for="(item3, index3) in item2.goods" :key="index3.toString()">
|
||||||
|
<a-row :gutter="16" style="margin-top: 5px;">
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-input v-model="item3.name" placeholder="物品名称" disabled />
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="6">
|
||||||
|
<a-input v-model="item3.number" placeholder="数量" disabled />
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="6">
|
||||||
|
<a-input v-model="item3.unit" placeholder="单位" disabled />
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</div>
|
||||||
|
</a-card>
|
||||||
|
</a-modal>
|
||||||
|
|
||||||
|
<a-modal v-model="logModal" title="新增日志" width="800px" @ok="addLogText()" @cancel="logModal = false">
|
||||||
|
<a-textarea v-model="log" :autosize="{ minRows: 4, maxRows: 8 }" />
|
||||||
|
</a-modal>
|
||||||
|
</a-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getAction, postAction } from '@/api/manage'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dataList: [],
|
||||||
|
url: {
|
||||||
|
list: "/Try/procurementProgress/list",
|
||||||
|
edit: "/Try/procurementProgress/edit",
|
||||||
|
},
|
||||||
|
activeKey: [''],
|
||||||
|
supplierSelection: [],
|
||||||
|
seeModal: false,
|
||||||
|
logModal: false,
|
||||||
|
log: '',
|
||||||
|
addData: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getData()
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
list: function () {
|
||||||
|
return `${window._CONFIG['domianURL']}/${this.url.list}`;
|
||||||
|
},
|
||||||
|
edit: function () {
|
||||||
|
return `${window._CONFIG['domianURL']}/${this.url.edit}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getData() {
|
||||||
|
getAction(this.list, {}).then(res => {
|
||||||
|
let dataList = res.result.records
|
||||||
|
dataList.forEach(element => {
|
||||||
|
let Log = JSON.parse(element.procurementLog)
|
||||||
|
element.procurementLog = Log
|
||||||
|
})
|
||||||
|
this.dataList = Object.assign({}, dataList)
|
||||||
|
console.log(this.dataList)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
see(item) {
|
||||||
|
this.supplierSelection = item
|
||||||
|
this.seeModal = true
|
||||||
|
},
|
||||||
|
addLog(item) {
|
||||||
|
this.logModal = true
|
||||||
|
this.log = ''
|
||||||
|
this.addData = Object.assign({}, item)
|
||||||
|
},
|
||||||
|
addLogText() {
|
||||||
|
//遍历procurementLog.index,获取最后一位
|
||||||
|
let index = 0
|
||||||
|
for (const key in this.addData.procurementLog)
|
||||||
|
if (this.addData.procurementLog.hasOwnProperty(key))
|
||||||
|
index = key
|
||||||
|
index = parseInt(index) + 1
|
||||||
|
//将数据插入到addData中
|
||||||
|
const date = new Date()
|
||||||
|
const year = date.getFullYear()
|
||||||
|
const month = date.getMonth() + 1
|
||||||
|
const day = date.getDate()
|
||||||
|
const hour = date.getHours()
|
||||||
|
const minute = date.getMinutes()
|
||||||
|
const second = date.getSeconds()
|
||||||
|
let currentTime = `${year}-${month}-${day} ${hour}:${minute}:${second}`
|
||||||
|
|
||||||
|
this.log = currentTime + ' ' + this.log
|
||||||
|
this.addData.procurementLog[index] = this.log
|
||||||
|
//将data的JSON数据转换为字符串
|
||||||
|
this.addData.procurementLog = JSON.stringify(this.addData.procurementLog)
|
||||||
|
|
||||||
|
postAction(this.edit, this.addData).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.getData()
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.getData()
|
||||||
|
this.logModal = false
|
||||||
|
},
|
||||||
|
endLog(item) {
|
||||||
|
//设置isDone为1
|
||||||
|
this.addData = Object.assign({}, item)
|
||||||
|
this.addData.isDone = 1
|
||||||
|
//将data的JSON数据转换为字符串
|
||||||
|
this.addData.procurementLog = JSON.stringify(this.addData.procurementLog)
|
||||||
|
postAction(this.edit, this.addData).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.getData()
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
end(item) {
|
||||||
|
this.addData = Object.assign({}, item)
|
||||||
|
this.addData.qualityIsPass = 1
|
||||||
|
//将data的JSON数据转换为字符串
|
||||||
|
this.addData.procurementLog = JSON.stringify(this.addData.procurementLog)
|
||||||
|
postAction(this.edit, this.addData).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.getData()
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -1,6 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<a-card title="订单接收" :bordered="false">
|
<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()">
|
<a-collapse-panel v-for="(item, index) in dataList" :key="index.toString()">
|
||||||
<template slot="header">
|
<template slot="header">
|
||||||
<div style="font-size: 18px; font-weight: bold;">
|
<div style="font-size: 18px; font-weight: bold;">
|
||||||
|
@ -30,6 +33,14 @@
|
||||||
</a-collapse-panel>
|
</a-collapse-panel>
|
||||||
</a-collapse>
|
</a-collapse>
|
||||||
|
|
||||||
|
<a-empty v-else>
|
||||||
|
<template #description>
|
||||||
|
<span>
|
||||||
|
订单为空
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</a-empty>
|
||||||
|
|
||||||
<a-modal title="填写接收备注" :visible="receive" @ok="receiveOk" @cancel="receiveCancel">
|
<a-modal title="填写接收备注" :visible="receive" @ok="receiveOk" @cancel="receiveCancel">
|
||||||
<a-textarea v-model="auditResults" placeholder="请输入接收备注" />
|
<a-textarea v-model="auditResults" placeholder="请输入接收备注" />
|
||||||
</a-modal>
|
</a-modal>
|
||||||
|
@ -58,6 +69,7 @@ export default {
|
||||||
auditResults: '',
|
auditResults: '',
|
||||||
username: Vue.ls.get(USER_INFO).username,
|
username: Vue.ls.get(USER_INFO).username,
|
||||||
sysOrgCode: Vue.ls.get(USER_INFO).orgCode,
|
sysOrgCode: Vue.ls.get(USER_INFO).orgCode,
|
||||||
|
dataShow: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -98,15 +110,22 @@ export default {
|
||||||
this.receive = false;
|
this.receive = false;
|
||||||
},
|
},
|
||||||
getdata() {
|
getdata() {
|
||||||
|
this.dataShow = false;
|
||||||
getAction(this.list, {}).then(res => {
|
getAction(this.list, {}).then(res => {
|
||||||
//如果为200,则获取数据
|
//如果为200,则获取数据
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.dataList = res.result.records;
|
this.dataList = res.result.records;
|
||||||
this.activeKey = [0];
|
if (this.dataList.length == 0) {
|
||||||
//将其procurementContent转为json
|
this.dataShow = false;
|
||||||
this.dataList.forEach(item => {
|
} else {
|
||||||
item.procurementContent = JSON.parse(item.procurementContent);
|
this.activeKey = [''];
|
||||||
});
|
//将其procurementContent转为json
|
||||||
|
this.dataList.forEach(item => {
|
||||||
|
item.procurementContent = JSON.parse(item.procurementContent);
|
||||||
|
});
|
||||||
|
this.dataShow = true;
|
||||||
|
console.log(this.dataList);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.message);
|
this.$message.error(res.message);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue