|
|
@@ -19,7 +19,7 @@
|
|
|
<el-button
|
|
|
link
|
|
|
type="primary"
|
|
|
- @click="changeTypes(scope.row, 5)"
|
|
|
+ @click="changeTypes(scope.row, 1)"
|
|
|
v-if="canShowButton(scope.row.status, OPERATION_PERMISSIONS.上架)"
|
|
|
>
|
|
|
上架
|
|
|
@@ -41,6 +41,14 @@
|
|
|
修改库存
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ @click="viewRejectReason(scope.row)"
|
|
|
+ v-if="canShowButton(scope.row.status, OPERATION_PERMISSIONS.查看拒绝原因)"
|
|
|
+ >
|
|
|
+ 查看拒绝原因
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
type="primary"
|
|
|
link
|
|
|
@click="toDetail(scope.row)"
|
|
|
@@ -78,6 +86,28 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+ <!-- 查看拒绝原因弹窗 -->
|
|
|
+ <el-dialog v-model="rejectReasonDialogVisible" title="查看拒绝原因" width="600px">
|
|
|
+ <div class="reject-reason-content">
|
|
|
+ <div class="reject-reason-item">
|
|
|
+ <div class="reject-reason-label">代金券名称:</div>
|
|
|
+ <div class="reject-reason-value">
|
|
|
+ {{ rejectReasonData.name || "--" }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="reject-reason-item">
|
|
|
+ <div class="reject-reason-label">拒绝原因:</div>
|
|
|
+ <div class="reject-reason-value reject-reason-text">
|
|
|
+ {{ rejectReasonData.approvalComments || "暂无拒绝原因" }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="closeRejectReasonDialog"> 确定 </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -103,6 +133,12 @@ const formInventory: any = ref({
|
|
|
});
|
|
|
const rowData = ref<any>();
|
|
|
const activeName = ref("");
|
|
|
+// 查看拒绝原因弹窗相关
|
|
|
+const rejectReasonDialogVisible = ref(false);
|
|
|
+const rejectReasonData = ref<any>({
|
|
|
+ name: "",
|
|
|
+ approvalComments: ""
|
|
|
+});
|
|
|
// 定义表单类型
|
|
|
interface RuleForm {
|
|
|
newInventory: string;
|
|
|
@@ -218,7 +254,9 @@ const OPERATION_PERMISSIONS = {
|
|
|
// 编辑:草稿、审核拒绝、已售罄、已下架、已结束
|
|
|
编辑: [STATUS.草稿, STATUS.审核拒绝, STATUS.已售罄, STATUS.已下架, STATUS.已结束],
|
|
|
// 删除:草稿、未开始、审核拒绝、已售罄、已结束
|
|
|
- 删除: [STATUS.草稿, STATUS.未开始, STATUS.审核拒绝, STATUS.已售罄, STATUS.已结束]
|
|
|
+ 删除: [STATUS.草稿, STATUS.未开始, STATUS.审核拒绝, STATUS.已售罄, STATUS.已结束],
|
|
|
+ // 查看拒绝原因:审核拒绝
|
|
|
+ 查看拒绝原因: [STATUS.审核拒绝]
|
|
|
} as const;
|
|
|
|
|
|
// 判断按钮是否显示的工具函数
|
|
|
@@ -327,7 +365,7 @@ const deleteRow = row => {
|
|
|
});
|
|
|
};
|
|
|
const handleClick = () => {};
|
|
|
-const changeTypes = async (row: any, status: string) => {
|
|
|
+const changeTypes = async (row, status) => {
|
|
|
rowData.value = row;
|
|
|
let res = await updateStatus({ id: row.id, status: status, approvalComments: "" });
|
|
|
if (res && res.code == 200) {
|
|
|
@@ -347,9 +385,9 @@ const handleSubmit = async () => {
|
|
|
if (!ruleFormRef.value) return;
|
|
|
await ruleFormRef.value.validate(async (valid, fields) => {
|
|
|
if (valid) {
|
|
|
- let res = await updateNum({ id: formInventory.value.id, num: formInventory.value.newInventory });
|
|
|
+ let res = await updateNum({ id: formInventory.value.id, singleQty: formInventory.value.newInventory });
|
|
|
if (res && res.code == 200) {
|
|
|
- ElMessage.success("库存修改成功");
|
|
|
+ ElMessage.success("修改成功");
|
|
|
dialogFormVisible.value = false;
|
|
|
proTable.value?.getTableList();
|
|
|
}
|
|
|
@@ -366,6 +404,22 @@ const closeDialog = () => {
|
|
|
newInventory: ""
|
|
|
};
|
|
|
};
|
|
|
+// 查看拒绝原因
|
|
|
+const viewRejectReason = (row: any) => {
|
|
|
+ rejectReasonData.value = {
|
|
|
+ name: row.name || "--",
|
|
|
+ approvalComments: row.approvalComments || "--"
|
|
|
+ };
|
|
|
+ rejectReasonDialogVisible.value = true;
|
|
|
+};
|
|
|
+// 关闭拒绝原因弹窗
|
|
|
+const closeRejectReasonDialog = () => {
|
|
|
+ rejectReasonDialogVisible.value = false;
|
|
|
+ rejectReasonData.value = {
|
|
|
+ name: "",
|
|
|
+ approvalComments: ""
|
|
|
+ };
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
@@ -386,4 +440,35 @@ const closeDialog = () => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.reject-reason-content {
|
|
|
+ padding: 20px 0;
|
|
|
+ .reject-reason-item {
|
|
|
+ display: flex;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ &:last-child {
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+ .reject-reason-label {
|
|
|
+ flex-shrink: 0;
|
|
|
+ min-width: 100px;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #606266;
|
|
|
+ }
|
|
|
+ .reject-reason-value {
|
|
|
+ flex: 1;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #303133;
|
|
|
+ word-break: break-word;
|
|
|
+ &.reject-reason-text {
|
|
|
+ min-height: 80px;
|
|
|
+ padding: 12px;
|
|
|
+ line-height: 1.6;
|
|
|
+ white-space: pre-wrap;
|
|
|
+ background-color: #f5f7fa;
|
|
|
+ border-radius: 4px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|