|
@@ -265,28 +265,26 @@
|
|
|
<el-table
|
|
|
ref="multipleTable"
|
|
|
v-loading="loading"
|
|
|
+ :span-method="objectSpanMethod"
|
|
|
:data="spuList"
|
|
|
@selection-change="handleSelectionChange"
|
|
|
row-key="id"
|
|
|
>
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="序号" type="index" />
|
|
|
+ <!-- <el-table-column label="序号" type="index" /> -->
|
|
|
<el-table-column
|
|
|
label="订单编号"
|
|
|
align="center"
|
|
|
- prop="userOrderSn"
|
|
|
- width="150"
|
|
|
+ prop="carPayNo"
|
|
|
+ width="230"
|
|
|
:show-overflow-tooltip="true"
|
|
|
/>
|
|
|
|
|
|
- <el-table-column label="商品名称" align="center" prop="skuName" width="100" />
|
|
|
- <!-- <el-table-column label="商品图片" align="center" prop="skuPic">
|
|
|
+ <el-table-column label="商品名称" align="center" prop="skuName" width="200">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-image :src="scope.row.skuPic" style="width: 60px; height: 60px"> </el-image>
|
|
|
+ {{ scope.row.goodsInfo ? JSON.parse(scope.row.goodsInfo)[0].skuName : "" }}
|
|
|
</template>
|
|
|
- </el-table-column> -->
|
|
|
- <!-- <el-table-column label="商品分类" align="center" prop="categoryName" width="150">
|
|
|
- </el-table-column> -->
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
label="实付金额(元)"
|
|
|
align="center"
|
|
@@ -317,13 +315,13 @@
|
|
|
<el-table-column label="单价/数量" align="center" prop="price">
|
|
|
<template slot-scope="scope">
|
|
|
<span>
|
|
|
- {{ scope.row.price }}元 <br />
|
|
|
- 共{{ scope.row.quantity }}{{ scope.row.unit }}</span
|
|
|
+ {{ scope.row.goodsInfo ? JSON.parse(scope.row.goodsInfo)[0].price : "" }}元
|
|
|
+ <br />
|
|
|
+ 共{{ scope.row.goodsInfo ? JSON.parse(scope.row.goodsInfo)[0].quantity : ""
|
|
|
+ }}{{ scope.row.goodsInfo ? JSON.parse(scope.row.goodsInfo)[0].unit:'' }}</span
|
|
|
>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column label="包装方式" align="center" prop="packageType">
|
|
|
- </el-table-column> -->
|
|
|
<el-table-column label="支付方式" align="center" prop="packageType">
|
|
|
<template slot-scope="scope">
|
|
|
{{
|
|
@@ -408,13 +406,6 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="center" width="150">
|
|
|
<template slot-scope="scope">
|
|
|
- <!-- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- @click="handleUpdate(scope.row)"
|
|
|
- v-hasPermi="['manage:order:detail']"
|
|
|
- >我要发货</el-button
|
|
|
- > -->
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
@@ -682,7 +673,7 @@ export default {
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
- configValue: [{ required: true, message: "参数键值不能为空", trigger: "blur" }],
|
|
|
+ sn: [{ required: true, message: "请选择打印机", trigger: "blur" }],
|
|
|
},
|
|
|
orderStatistics: {},
|
|
|
mergeObj: {}, // 用来记录需要合并行的下标
|
|
@@ -715,6 +706,22 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
|
+ if (columnIndex === 0 || columnIndex === 1) {
|
|
|
+ if (rowIndex === 0 || row.carPayNo != this.spuList[rowIndex - 1].carPayNo) {
|
|
|
+ let rowspan = 0;
|
|
|
+ this.spuList.forEach((element) => {
|
|
|
+ if (element.carPayNo === row.carPayNo) {
|
|
|
+ rowspan++;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return [rowspan, 1];
|
|
|
+ } else {
|
|
|
+ return [0, 0];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
getEquipmentList() {
|
|
|
equipmentList().then((res) => {
|
|
|
if (res.code == 200) {
|
|
@@ -723,11 +730,16 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
printSubmitForm() {
|
|
|
- this.printForm.id = this.selectList.toString();
|
|
|
+ if (!this.printForm.sn) {
|
|
|
+ this.$message.error("请选择打印机!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.printForm.carPayNos = this.selectList.toString();
|
|
|
printOrder(this.printForm)
|
|
|
.then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.equipmentOpen = false;
|
|
|
+ this.selectList = [];
|
|
|
this.$modal.msgSuccess("操作成功!");
|
|
|
} else {
|
|
|
this.equipmentOpen = false;
|
|
@@ -761,32 +773,45 @@ export default {
|
|
|
(response) => {
|
|
|
if (response.code == 200) {
|
|
|
let list = response.data.records;
|
|
|
- let totalList = [];
|
|
|
- for (let i = 0; i < list.length; i++) {
|
|
|
- if (list[i].goodsInfo) {
|
|
|
- var goods = JSON.parse(list[i].goodsInfo);
|
|
|
- for (let a = 0; a < goods.length; a++) {
|
|
|
- let bb = {};
|
|
|
- if (goods[a].specsValue.length > 0) {
|
|
|
- for (let s = 0; s < goods[a].specsValue.length; s++) {
|
|
|
- bb = {
|
|
|
- ...list[i],
|
|
|
- ...goods[a],
|
|
|
- ...goods[a].specsValue[s],
|
|
|
- };
|
|
|
- totalList.push(bb);
|
|
|
- }
|
|
|
- } else {
|
|
|
- bb = {
|
|
|
- ...list[i],
|
|
|
- ...goods[a],
|
|
|
- };
|
|
|
- totalList.push(bb);
|
|
|
- }
|
|
|
- }
|
|
|
+ let infoList = [];
|
|
|
+ for (let index = 0; index < list.length; index++) {
|
|
|
+ let e = list[index];
|
|
|
+ for (let i = 0; i < e.dxUserOrderVOList.length; i++) {
|
|
|
+ let a = e.dxUserOrderVOList[i];
|
|
|
+ let c = { ...e, ...a };
|
|
|
+ infoList.push(c);
|
|
|
}
|
|
|
}
|
|
|
- this.spuList = totalList;
|
|
|
+
|
|
|
+ // let totalList = [];
|
|
|
+ // for (let i = 0; i < infoList.length; i++) {
|
|
|
+ // if (infoList[i].goodsInfo) {
|
|
|
+ // var goods = JSON.parse(infoList[i].goodsInfo);
|
|
|
+ // for (let a = 0; a < goods.length; a++) {
|
|
|
+ // let bb = {};
|
|
|
+ // if (goods[a].specsValue.length > 0) {
|
|
|
+ // for (let s = 0; s < goods[a].specsValue.length; s++) {
|
|
|
+ // bb = {
|
|
|
+ // ...infoList[i],
|
|
|
+ // ...goods[a],
|
|
|
+ // ...goods[a].specsValue[s],
|
|
|
+ // };
|
|
|
+ // totalList.push(bb);
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // bb = {
|
|
|
+ // ...infoList[i],
|
|
|
+ // ...goods[a],
|
|
|
+ // };
|
|
|
+ // totalList.push(bb);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ this.spuList = infoList;
|
|
|
+ console.log("xxx", this.spuList);
|
|
|
+
|
|
|
this.total = response.data.total;
|
|
|
this.loading = false;
|
|
|
}
|
|
@@ -835,7 +860,9 @@ export default {
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.selectList = selection.map((item) => item.id);
|
|
|
+ console.log("selection", selection);
|
|
|
+
|
|
|
+ this.selectList = selection.map((item) => item.carPayNo);
|
|
|
// this.ids = Array.from(new Set(this.selectList));
|
|
|
},
|
|
|
|