|
|
@@ -17,6 +17,7 @@
|
|
|
<div slot="tags"></div>
|
|
|
<template slot="customOperation">
|
|
|
<Edit
|
|
|
+ v-if="mainData.isenable == 0"
|
|
|
class="inline-16"
|
|
|
title_btn="编辑"
|
|
|
title_drawer="编辑服务物料"
|
|
|
@@ -24,6 +25,29 @@
|
|
|
:data="mainData"
|
|
|
@onSuccess="queryMainData"
|
|
|
></Edit>
|
|
|
+ <el-button
|
|
|
+ v-if="mainData.isenable == 0"
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ :loading="btnLoading"
|
|
|
+ @click="onToggleUsed(1, '启用', '2026051512000001')"
|
|
|
+ >{{ $t("启 用") }}</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="mainData.isenable == 1"
|
|
|
+ type="warning"
|
|
|
+ size="mini"
|
|
|
+ :loading="btnLoading"
|
|
|
+ @click="onToggleUsed(0, '停用', '2026051512000002')"
|
|
|
+ >{{ $t("停 用") }}</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="mainData.isenable == 0"
|
|
|
+ type="danger"
|
|
|
+ @click="onDelete"
|
|
|
+ size="mini"
|
|
|
+ >{{ $t(`移 除`) }}</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
<div slot="slot0">
|
|
|
<base-info
|
|
|
@@ -32,31 +56,7 @@
|
|
|
></base-info>
|
|
|
</div>
|
|
|
<div slot="slot1">
|
|
|
- <saleClass ref="saleClass" :data="mainData">
|
|
|
- <template v-slot:addClass="scope">
|
|
|
- <addClass
|
|
|
- v-if="
|
|
|
- tool.checkAuth($route.name, 'salerClass') &&
|
|
|
- mainData.status === '新建'
|
|
|
- "
|
|
|
- :data="scope.data"
|
|
|
- @onSuccess="
|
|
|
- $refs.saleClass.listData();
|
|
|
- queryMainData($route.query.id);
|
|
|
- "
|
|
|
- />
|
|
|
- </template>
|
|
|
- <template v-slot:delProduct="scope">
|
|
|
- <delete-btn
|
|
|
- v-if="tool.checkAuth($route.name, 'salerClass')"
|
|
|
- :nameId="20230214111502"
|
|
|
- nameKey="sa_itemsaleclassids"
|
|
|
- message="确定删除当前分类吗?"
|
|
|
- :id="scope.data.sa_itemsaleclassid"
|
|
|
- @deleteSuccess="$refs.saleClass.listData()"
|
|
|
- ></delete-btn>
|
|
|
- </template>
|
|
|
- </saleClass>
|
|
|
+ <saleClass ref="saleClass" :data="mainData"> </saleClass>
|
|
|
</div>
|
|
|
</basicDetails>
|
|
|
</div>
|
|
|
@@ -65,8 +65,7 @@
|
|
|
<script>
|
|
|
import Edit from "@/Form/ourServiceMaterial/add";
|
|
|
import BaseInfo from "@/bgj/headquartersServiceMaterial/modules/baseInfo";
|
|
|
-import saleClass from "@/bgj/headquartersServiceMaterial/modules/saleClass.vue";
|
|
|
-import addClass from "@/bgj/headquartersServiceMaterial/modules/addClass";
|
|
|
+import saleClass from "./saleClass";
|
|
|
export default {
|
|
|
name: "detail",
|
|
|
data() {
|
|
|
@@ -74,9 +73,10 @@ export default {
|
|
|
mainData: {},
|
|
|
mainAreaData: {},
|
|
|
detailInfo: "",
|
|
|
+ btnLoading: false,
|
|
|
};
|
|
|
},
|
|
|
- components: { Edit, BaseInfo, saleClass, addClass },
|
|
|
+ components: { Edit, BaseInfo, saleClass },
|
|
|
methods: {
|
|
|
async queryMainData() {
|
|
|
const res = await this.$api.requested({
|
|
|
@@ -113,14 +113,6 @@ export default {
|
|
|
label: "计量单位",
|
|
|
value: this.mainData.unit,
|
|
|
},
|
|
|
- {
|
|
|
- label: "起订量",
|
|
|
- value: this.mainData.start_num,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "增量",
|
|
|
- value: this.mainData.increment,
|
|
|
- },
|
|
|
{
|
|
|
label: "erp品号",
|
|
|
value: this.mainData.erpitemno,
|
|
|
@@ -129,10 +121,6 @@ export default {
|
|
|
label: "erp品名",
|
|
|
value: this.mainData.erpitemname,
|
|
|
},
|
|
|
- {
|
|
|
- label: "品牌",
|
|
|
- value: this.mainData.brand,
|
|
|
- },
|
|
|
{
|
|
|
label: "领域",
|
|
|
value: Array.isArray(this.mainData.domains)
|
|
|
@@ -144,32 +132,23 @@ export default {
|
|
|
value: this.mainData.marketprice,
|
|
|
},
|
|
|
{
|
|
|
- label: "上/下架",
|
|
|
- value: this.mainData.shelf == 1 ? "上架" : "下架",
|
|
|
- style: () => {
|
|
|
- let color =
|
|
|
- this.mainData.shelf == 1
|
|
|
- ? this.tool.getStatusColor("上架", true)
|
|
|
- : this.tool.getStatusColor("下架", true);
|
|
|
- return { color: color };
|
|
|
- },
|
|
|
+ label: "品牌",
|
|
|
+ value: Array.isArray(this.mainData.brand)
|
|
|
+ ? this.mainData.brand
|
|
|
+ .map((item) => item.brandname)
|
|
|
+ .join(",")
|
|
|
+ : "--",
|
|
|
},
|
|
|
{
|
|
|
- label: "状态",
|
|
|
- value: this.mainData.status == 1 ? "新建" : "审核",
|
|
|
+ label: "使用状态",
|
|
|
+ value: this.mainData.isenable == 1 ? "启用" : "停用",
|
|
|
style: () => {
|
|
|
let color =
|
|
|
- this.mainData.status == 1
|
|
|
- ? this.tool.getStatusColor("新建", true)
|
|
|
- : this.tool.getStatusColor("审核", true);
|
|
|
+ this.mainData.isenable == 1
|
|
|
+ ? this.tool.getStatusColor("启用", true)
|
|
|
+ : this.tool.getStatusColor("停用", true);
|
|
|
return { color: color };
|
|
|
},
|
|
|
- // style: function () {
|
|
|
- // let style = that.tool.getStatusColor(
|
|
|
- // that.mainData.status
|
|
|
- // );
|
|
|
- // return style;
|
|
|
- // },
|
|
|
},
|
|
|
];
|
|
|
this.detailInfo = {
|
|
|
@@ -183,13 +162,13 @@ export default {
|
|
|
value: this.mainData.code,
|
|
|
},
|
|
|
{
|
|
|
- label: "状态",
|
|
|
- value: this.mainData.status == 1 ? "新建" : "审核",
|
|
|
+ label: "使用状态",
|
|
|
+ value: this.mainData.isenable == 1 ? "启用" : "停用",
|
|
|
style: () => {
|
|
|
let color =
|
|
|
- this.mainData.status == 1
|
|
|
- ? this.tool.getStatusColor("新建", true)
|
|
|
- : this.tool.getStatusColor("审核", true);
|
|
|
+ this.mainData.isenable == 1
|
|
|
+ ? this.tool.getStatusColor("启用", true)
|
|
|
+ : this.tool.getStatusColor("停用", true);
|
|
|
return { color: color };
|
|
|
},
|
|
|
},
|
|
|
@@ -215,11 +194,19 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: "品牌",
|
|
|
- value: this.mainData.brand,
|
|
|
+ value: Array.isArray(this.mainData.brand)
|
|
|
+ ? this.mainData.brand
|
|
|
+ .map((item) => item.brandname)
|
|
|
+ .join(",")
|
|
|
+ : "--",
|
|
|
},
|
|
|
{
|
|
|
label: "分类",
|
|
|
- value: this.mainData.itemclassids,
|
|
|
+ value: Array.isArray(this.mainData.itemClassList)
|
|
|
+ ? this.mainData.itemClassList
|
|
|
+ .map((item) => item.itemclassfullname)
|
|
|
+ .join(",")
|
|
|
+ : "--",
|
|
|
},
|
|
|
{
|
|
|
label: "领域",
|
|
|
@@ -233,17 +220,83 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
systemInfo: [
|
|
|
- { label: "创建人", value: this.mainData.createby },
|
|
|
- { label: "创建时间", value: this.mainData.createdate },
|
|
|
- { label: "最近编辑人", value: this.mainData.changeby },
|
|
|
- { label: "最近编辑时间", value: this.mainData.changedate },
|
|
|
- { label: "上架人", value: this.mainData.onsaleby },
|
|
|
- { label: "上架时间", value: this.mainData.shefl_time },
|
|
|
- { label: "审核人", value: this.mainData.checkby },
|
|
|
- { label: "审核时间", value: this.mainData.checkdate },
|
|
|
+ {
|
|
|
+ label: "添加至本站时间",
|
|
|
+ value: this.mainData.createdate,
|
|
|
+ },
|
|
|
+ { label: "启用时间", value: this.mainData.enable_time },
|
|
|
+ {
|
|
|
+ label: "停用时间",
|
|
|
+ value: this.mainData.disable_time,
|
|
|
+ },
|
|
|
],
|
|
|
};
|
|
|
},
|
|
|
+ onToggleUsed(value, actionText, id) {
|
|
|
+ this.$confirm(
|
|
|
+ this.$t(`确认${actionText}当前服务物料吗`) + "?",
|
|
|
+ this.$t("提示"),
|
|
|
+ {
|
|
|
+ confirmButtonText: this.$t("确定"),
|
|
|
+ cancelButtonText: this.$t("取消"),
|
|
|
+ type: "warning",
|
|
|
+ beforeClose: async (action, instance, done) => {
|
|
|
+ if (action === "confirm") {
|
|
|
+ instance.confirmButtonLoading = true;
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id: id,
|
|
|
+ content: {
|
|
|
+ sc_item_localids: this.$route.query.id,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.tool.showMessage(res, () => {
|
|
|
+ setTimeout(() => {
|
|
|
+ instance.confirmButtonLoading = false;
|
|
|
+ done();
|
|
|
+ this.queryMainData();
|
|
|
+ }, 500);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ done();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+ ).catch(() => {});
|
|
|
+ },
|
|
|
+ onDelete() {
|
|
|
+ this.$confirm(
|
|
|
+ this.$t("是否确认移除本服务物料") + "?",
|
|
|
+ this.$t("提示"),
|
|
|
+ {
|
|
|
+ confirmButtonText: this.$t("确定"),
|
|
|
+ cancelButtonText: this.$t("取消"),
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(async () => {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id: "2026051510000004",
|
|
|
+ content: {
|
|
|
+ sc_item_localid: this.$route.query.id,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.$message.error(res.data[0].errmsg);
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("移除成功"),
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.$store.dispatch("changeDetailDrawer", false);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: this.$t("已取消移除"),
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
// 监听切换数据,上一页,下一页
|
|
|
pageChange(id, rowindex, tabIndex) {
|
|
|
this.flag = false;
|