|
|
@@ -1,5 +1,6 @@
|
|
|
<template>
|
|
|
- <ele-data-table row-key="userId" :columns="columns" :data="dataList" border class="order-books">
|
|
|
+ <ele-data-table row-key="userId" :columns="columns" :data="dataList" border class="order-books"
|
|
|
+ :span-method="handleSpanMethod">
|
|
|
<template #baseInfo="{ row }">
|
|
|
<div class="base-info flex justify-between">
|
|
|
<div class="base-info-left flex flex-1">
|
|
|
@@ -37,7 +38,7 @@
|
|
|
</div>
|
|
|
<div class="common-text flex">
|
|
|
<el-text>预估金额:</el-text>
|
|
|
- <el-text>¥ {{ row.expectMoney }}</el-text>
|
|
|
+ <el-text>¥ {{ row.recyclePrice }}</el-text>
|
|
|
</div>
|
|
|
<div class="common-text flex">
|
|
|
<el-text>销售价格:</el-text>
|
|
|
@@ -58,14 +59,20 @@
|
|
|
</template>
|
|
|
<template #auditInfo="{ row }">
|
|
|
<div class="audit-info flex justify-center">
|
|
|
- <el-radio-group v-model="row.auditInfo" style="width: 120px"
|
|
|
- :disabled="!(detail.status == 8 || detail.status == 9)">
|
|
|
+ <el-radio-group v-model="row.sts" style="width: 120px"
|
|
|
+ :disabled="!(detail.status == 8 || detail.status == 9)"
|
|
|
+ @change="(value) => handleAuditInfo(value, row)">
|
|
|
<el-radio :value="1">品相良好</el-radio>
|
|
|
- <el-radio :value="2">品相一般</el-radio>
|
|
|
+ <el-radio :value="2" disabled>品相一般</el-radio>
|
|
|
<el-radio :value="3">品相极差</el-radio>
|
|
|
</el-radio-group>
|
|
|
- <el-input v-model="row.textarea" style="width: 170px" :rows="4" type="textarea" placeholder="请输入品相极差的原因"
|
|
|
- :disabled="!(detail.status == 8 || detail.status == 9)" />
|
|
|
+
|
|
|
+ <el-select v-model="row.com" style="width: 180px" placeholder="请选择品相极差的原因"
|
|
|
+ :disabled="!(detail.status == 8 || detail.status == 9) || row.sts !== 3" class="reason-select"
|
|
|
+ @change="(value) => handleSelectReason(value, row)">
|
|
|
+ <el-option v-for="item in auditReason" :key="item.dictValue" :label="item.dictValue"
|
|
|
+ :value="item.dictValue" />
|
|
|
+ </el-select>
|
|
|
</div>
|
|
|
</template>
|
|
|
</ele-data-table>
|
|
|
@@ -94,10 +101,96 @@ const props = defineProps({
|
|
|
}
|
|
|
});
|
|
|
const dataList = ref([]);
|
|
|
+
|
|
|
+// 处理detailVoList数据
|
|
|
+const processDetailList = (list) => {
|
|
|
+ const result = [];
|
|
|
+ let currentIndex = 0;
|
|
|
+ list.forEach(item => {
|
|
|
+ let auditInfo = item.auditCommentList
|
|
|
+ // 根据num拆分对象
|
|
|
+ for (let i = 0; i < item.num; i++) {
|
|
|
+ let audit = auditInfo ? auditInfo[i] : { sts: 0, com: '' }
|
|
|
+ result.push({
|
|
|
+ ...item,
|
|
|
+ ...audit,
|
|
|
+ _index: i,
|
|
|
+ _groupIndex: currentIndex, // 用于标识分组
|
|
|
+ _isFirstRow: i === 0 // 标识是否是组内第一行
|
|
|
+ });
|
|
|
+ }
|
|
|
+ currentIndex++;
|
|
|
+ });
|
|
|
+ return result;
|
|
|
+};
|
|
|
+
|
|
|
watch(() => props.detail.detailVoList, (newVal) => {
|
|
|
- dataList.value = newVal;
|
|
|
+ if (!newVal) return;
|
|
|
+ dataList.value = processDetailList(newVal);
|
|
|
+ console.log(dataList.value);
|
|
|
+ if (auditReason.value.length == 0) {
|
|
|
+ getAuditReason();
|
|
|
+ }
|
|
|
}, { deep: true });
|
|
|
|
|
|
+// 处理单元格合并
|
|
|
+const handleSpanMethod = ({ row, column, rowIndex }) => {
|
|
|
+ if (column.property === 'num') {
|
|
|
+ // 找到当前行所在组的所有行
|
|
|
+ const currentGroup = dataList.value.filter(item => item._groupIndex === row._groupIndex);
|
|
|
+ if (row._isFirstRow) {
|
|
|
+ // 如果是组内第一行,设置合并行数
|
|
|
+ return {
|
|
|
+ rowspan: currentGroup.length,
|
|
|
+ colspan: 1
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ // 组内其他行不显示
|
|
|
+ return {
|
|
|
+ rowspan: 0,
|
|
|
+ colspan: 0
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ rowspan: 1,
|
|
|
+ colspan: 1
|
|
|
+ };
|
|
|
+};
|
|
|
+//审核书籍
|
|
|
+function handleAudit(row) {
|
|
|
+ request.post('/order/orderInfo/adminCheckOrder', {
|
|
|
+ "orderId": props.detail.orderId,
|
|
|
+ "isbn": row.isbn,
|
|
|
+ "inx": row._index,
|
|
|
+ "sts": row.sts,
|
|
|
+ "com": row.com
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ ElMessage.success('操作成功');
|
|
|
+ } else {
|
|
|
+ ElMessage.error(res.data.msg)
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+//单选框选择变化
|
|
|
+function handleAuditInfo(value, row) {
|
|
|
+ if (value == 1) {
|
|
|
+ row.com = '';
|
|
|
+ handleAudit(row)
|
|
|
+ } else if (value == 3 && row.com) {
|
|
|
+ handleAudit(row)
|
|
|
+ }
|
|
|
+}
|
|
|
+//选择审核原因
|
|
|
+function handleSelectReason(value, row) {
|
|
|
+ if (row.sts == 3) {
|
|
|
+ row.com = value;
|
|
|
+ handleAudit(row)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const emit = defineEmits(['update:detail', 'refresh']);
|
|
|
|
|
|
const columns = ref([
|
|
|
@@ -121,7 +214,15 @@ const columns = ref([
|
|
|
width: 220,
|
|
|
align: 'center'
|
|
|
},
|
|
|
- { label: '数量', prop: 'num', minWidth: 90, align: 'center' },
|
|
|
+ {
|
|
|
+ label: '数量',
|
|
|
+ prop: 'num',
|
|
|
+ minWidth: 90,
|
|
|
+ align: 'center',
|
|
|
+ formatter: (row) => {
|
|
|
+ return `× ${row.num}`;
|
|
|
+ }
|
|
|
+ },
|
|
|
{
|
|
|
label: '审核信息',
|
|
|
prop: 'auditInfo',
|
|
|
@@ -131,14 +232,22 @@ const columns = ref([
|
|
|
},
|
|
|
{
|
|
|
label: '审核金额',
|
|
|
- prop: 'finalMoney',
|
|
|
+ prop: 'recyclePrice',
|
|
|
align: 'center',
|
|
|
minWidth: 100,
|
|
|
- render: (row) => {
|
|
|
- return row.finalMoney ? `¥ ${row.finalMoney}` : '待核算';
|
|
|
+ formatter: (row) => {
|
|
|
+ return row.sts == 1 ? `¥ ${row.recyclePrice}` : '0';
|
|
|
}
|
|
|
}
|
|
|
]);
|
|
|
+//获取审核原因的字典 book_audit_reason
|
|
|
+const auditReason = ref([]);
|
|
|
+const getAuditReason = async () => {
|
|
|
+ const res = await request.get('/system/dict/data/type/book_audit_reason');
|
|
|
+ auditReason.value = res.data.data;
|
|
|
+ console.log(res, 'xxxx')
|
|
|
+};
|
|
|
+
|
|
|
|
|
|
//查看当当、淘宝、豆瓣链接
|
|
|
const handleViewUrl = (row, type) => {
|
|
|
@@ -220,11 +329,24 @@ const handleRefresh = (type) => {
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss">
|
|
|
+<style lang="scss" scoped>
|
|
|
.mb-10 {
|
|
|
margin-bottom: 7px;
|
|
|
}
|
|
|
|
|
|
+.reason-select {
|
|
|
+ :deep(.el-select__wrapper) {
|
|
|
+ height: 120px !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ :deep(.el-select__placeholder) {
|
|
|
+ top: 0;
|
|
|
+ text-wrap: wrap;
|
|
|
+ white-space: normal;
|
|
|
+ text-overflow: initial;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
.order-books {
|
|
|
.action-btns {
|
|
|
display: flex;
|
|
|
@@ -236,5 +358,20 @@ const handleRefresh = (type) => {
|
|
|
color: #fff;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 处理合并单元格效果
|
|
|
+ .el-table {
|
|
|
+ td.el-table__cell {
|
|
|
+ &.first-row {
|
|
|
+ border-bottom: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .first-row~tr {
|
|
|
+ td.el-table__cell:nth-child(4) {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|