|
|
@@ -20,6 +20,7 @@
|
|
|
class="inline-16"
|
|
|
title_btn="编辑"
|
|
|
title_drawer="编辑工单模板"
|
|
|
+ btn_size="mini"
|
|
|
:data="mainData"
|
|
|
@onSuccess="queryMainData"
|
|
|
></Edit>
|
|
|
@@ -29,37 +30,44 @@
|
|
|
size="mini"
|
|
|
:loading="btnLoading"
|
|
|
@click="onToggleUsed(1, '启用')"
|
|
|
- >{{ $t('启 用') }}</el-button>
|
|
|
+ >{{ $t("启 用") }}</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
v-if="mainData.isused == 1"
|
|
|
type="warning"
|
|
|
size="mini"
|
|
|
:loading="btnLoading"
|
|
|
@click="onToggleUsed(0, '禁用')"
|
|
|
- >{{ $t('禁 用') }}</el-button>
|
|
|
- <el-button type="danger" @click="onDelete" size="mini">{{ $t(`删 除`) }}</el-button>
|
|
|
+ >{{ $t("禁 用") }}</el-button
|
|
|
+ >
|
|
|
+ <el-button type="danger" @click="onDelete" size="mini">{{
|
|
|
+ $t(`删 除`)
|
|
|
+ }}</el-button>
|
|
|
</template>
|
|
|
<div slot="slot0">
|
|
|
<taskDetail> </taskDetail>
|
|
|
</div>
|
|
|
<div slot="slot1">
|
|
|
- <base-info v-if="detailInfo" :detailInfo="detailInfo"></base-info>
|
|
|
+ <base-info
|
|
|
+ v-if="detailInfo"
|
|
|
+ :detailInfo="detailInfo"
|
|
|
+ ></base-info>
|
|
|
</div>
|
|
|
</basicDetails>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import Edit from '@/Form/terminalWorkBillModule/add';
|
|
|
-import BaseInfo from '@/HDrpManagement/projectChange/modules/modules/baseInfo/baseInfo';
|
|
|
-import taskDetail from './taskDetail/index';
|
|
|
+import Edit from "@/Form/terminalWorkBillModule/add";
|
|
|
+import BaseInfo from "@/HDrpManagement/projectChange/modules/modules/baseInfo/baseInfo";
|
|
|
+import taskDetail from "./taskDetail/index";
|
|
|
export default {
|
|
|
- name: 'detail',
|
|
|
+ name: "detail",
|
|
|
data() {
|
|
|
return {
|
|
|
mainData: {},
|
|
|
mainAreaData: [],
|
|
|
- detailInfo: '',
|
|
|
+ detailInfo: "",
|
|
|
processDetailList: [],
|
|
|
btnLoading: false,
|
|
|
};
|
|
|
@@ -72,42 +80,51 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
onToggleUsed(value, actionText) {
|
|
|
- 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: '2026051513140102',
|
|
|
- content: {
|
|
|
- sc_workorder_templateid: this.$route.query.id,
|
|
|
- isused: value,
|
|
|
- },
|
|
|
- });
|
|
|
- this.tool.showMessage(res, () => {
|
|
|
- setTimeout(() => {
|
|
|
- instance.confirmButtonLoading = false;
|
|
|
- done();
|
|
|
- this.queryMainData();
|
|
|
- }, 500);
|
|
|
- });
|
|
|
- } else {
|
|
|
- done();
|
|
|
- }
|
|
|
- },
|
|
|
- }).catch(() => {});
|
|
|
+ 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: "2026051513140102",
|
|
|
+ content: {
|
|
|
+ sc_workorder_templateid:
|
|
|
+ this.$route.query.id,
|
|
|
+ isused: value,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ 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',
|
|
|
- })
|
|
|
+ this.$confirm(
|
|
|
+ this.$t("是否确认删除此工单模板") + "?",
|
|
|
+ this.$t("提示"),
|
|
|
+ {
|
|
|
+ confirmButtonText: this.$t("确定"),
|
|
|
+ cancelButtonText: this.$t("取消"),
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ )
|
|
|
.then(async () => {
|
|
|
const res = await this.$api.requested({
|
|
|
- id: '2026051513141202',
|
|
|
+ id: "2026051513141202",
|
|
|
content: {
|
|
|
sc_workorder_templateids: [this.$route.query.id],
|
|
|
},
|
|
|
@@ -116,16 +133,16 @@ export default {
|
|
|
this.$message.error(res.data[0].errmsg);
|
|
|
} else {
|
|
|
this.$message({
|
|
|
- message: this.$t('删除成功'),
|
|
|
- type: 'success',
|
|
|
+ message: this.$t("删除成功"),
|
|
|
+ type: "success",
|
|
|
});
|
|
|
- this.$store.dispatch('changeDetailDrawer', false);
|
|
|
+ this.$store.dispatch("changeDetailDrawer", false);
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.$message({
|
|
|
- type: 'info',
|
|
|
- message: this.$t('已取消删除'),
|
|
|
+ type: "info",
|
|
|
+ message: this.$t("已取消删除"),
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
@@ -138,30 +155,30 @@ export default {
|
|
|
});
|
|
|
this.mainData = res.data;
|
|
|
this.changeDataStructure();
|
|
|
- console.log('this.mainData', this.mainData);
|
|
|
+ console.log("this.mainData", this.mainData);
|
|
|
},
|
|
|
changeDataStructure() {
|
|
|
let that = this;
|
|
|
this.mainAreaData = [
|
|
|
{
|
|
|
- label: '模板名称',
|
|
|
+ label: "模板名称",
|
|
|
value: this.mainData.name,
|
|
|
},
|
|
|
{
|
|
|
- label: '工单类型',
|
|
|
+ label: "工单类型",
|
|
|
value: this.mainData.type,
|
|
|
},
|
|
|
{
|
|
|
- label: '是否启用',
|
|
|
- value: this.mainData.isused ? '是' : '否',
|
|
|
+ label: "是否启用",
|
|
|
+ value: this.mainData.isused ? "是" : "否",
|
|
|
style: function () {
|
|
|
let style = {};
|
|
|
switch (that.mainData.isused) {
|
|
|
case 1:
|
|
|
- style = { color: '#ff0000' };
|
|
|
+ style = { color: "#ff0000" };
|
|
|
break;
|
|
|
case 0:
|
|
|
- style = { color: '#666666' };
|
|
|
+ style = { color: "#666666" };
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
@@ -170,16 +187,16 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- label: '是否后续工单',
|
|
|
- value: this.mainData.isworkorder ? '是' : '否',
|
|
|
+ label: "是否后续工单",
|
|
|
+ value: this.mainData.isworkorder ? "是" : "否",
|
|
|
style: function () {
|
|
|
let style = {};
|
|
|
switch (that.mainData.isworkorder) {
|
|
|
case 1:
|
|
|
- style = { color: '#ff0000' };
|
|
|
+ style = { color: "#ff0000" };
|
|
|
break;
|
|
|
case 0:
|
|
|
- style = { color: '#666666' };
|
|
|
+ style = { color: "#666666" };
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
@@ -188,16 +205,34 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- label: '是否积分计算',
|
|
|
- value: this.mainData.ispoints ? '是' : '否',
|
|
|
+ label: "是否积分计算",
|
|
|
+ value: this.mainData.ispoints ? "是" : "否",
|
|
|
style: function () {
|
|
|
let style = {};
|
|
|
switch (that.mainData.ispoints) {
|
|
|
case 1:
|
|
|
- style = { color: '#ff0000' };
|
|
|
+ style = { color: "#ff0000" };
|
|
|
+ break;
|
|
|
+ case 0:
|
|
|
+ style = { color: "#666666" };
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return style;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "是否工单完结时生成质保卡",
|
|
|
+ value: this.mainData.iswarrantycard ? "是" : "否",
|
|
|
+ style: function () {
|
|
|
+ let style = {};
|
|
|
+ switch (that.mainData.iswarrantycard) {
|
|
|
+ case 1:
|
|
|
+ style = { color: "#ff0000" };
|
|
|
break;
|
|
|
case 0:
|
|
|
- style = { color: '#666666' };
|
|
|
+ style = { color: "#666666" };
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
@@ -209,24 +244,24 @@ export default {
|
|
|
this.detailInfo = {
|
|
|
baseInfo: [
|
|
|
{
|
|
|
- label: '模板名称',
|
|
|
+ label: "模板名称",
|
|
|
value: this.mainData.name,
|
|
|
},
|
|
|
{
|
|
|
- label: '工单类型',
|
|
|
+ label: "工单类型",
|
|
|
value: this.mainData.type,
|
|
|
},
|
|
|
{
|
|
|
- label: '是否启用',
|
|
|
- value: this.mainData.isused ? '是' : '否',
|
|
|
+ label: "是否启用",
|
|
|
+ value: this.mainData.isused ? "是" : "否",
|
|
|
style: function () {
|
|
|
let style = {};
|
|
|
switch (that.mainData.isused) {
|
|
|
case 1:
|
|
|
- style = { color: '#ff0000' };
|
|
|
+ style = { color: "#ff0000" };
|
|
|
break;
|
|
|
case 0:
|
|
|
- style = { color: '#666666' };
|
|
|
+ style = { color: "#666666" };
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
@@ -235,16 +270,16 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- label: '是否后续工单',
|
|
|
- value: this.mainData.isworkorder ? '是' : '否',
|
|
|
+ label: "是否后续工单",
|
|
|
+ value: this.mainData.isworkorder ? "是" : "否",
|
|
|
style: function () {
|
|
|
let style = {};
|
|
|
switch (that.mainData.isworkorder) {
|
|
|
case 1:
|
|
|
- style = { color: '#ff0000' };
|
|
|
+ style = { color: "#ff0000" };
|
|
|
break;
|
|
|
case 0:
|
|
|
- style = { color: '#666666' };
|
|
|
+ style = { color: "#666666" };
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
@@ -253,16 +288,16 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- label: '是否积分计算',
|
|
|
- value: this.mainData.ispoints ? '是' : '否',
|
|
|
+ label: "是否积分计算",
|
|
|
+ value: this.mainData.ispoints ? "是" : "否",
|
|
|
style: function () {
|
|
|
let style = {};
|
|
|
switch (that.mainData.ispoints) {
|
|
|
case 1:
|
|
|
- style = { color: '#ff0000' };
|
|
|
+ style = { color: "#ff0000" };
|
|
|
break;
|
|
|
case 0:
|
|
|
- style = { color: '#666666' };
|
|
|
+ style = { color: "#666666" };
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
@@ -272,10 +307,10 @@ 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.createby },
|
|
|
+ { label: "创建时间", value: this.mainData.createdate },
|
|
|
+ { label: "最近编辑人", value: this.mainData.changeby },
|
|
|
+ { label: "最近编辑时间", value: this.mainData.changedate },
|
|
|
],
|
|
|
};
|
|
|
},
|
|
|
@@ -284,7 +319,7 @@ export default {
|
|
|
this.flag = false;
|
|
|
tabIndex = this.$route.query.tabIndex;
|
|
|
this.$router.replace({
|
|
|
- path: '/serveWorkTaskDetail',
|
|
|
+ path: "/serveWorkTaskDetail",
|
|
|
query: { id: id, rowindex: rowindex, tabIndex: tabIndex },
|
|
|
});
|
|
|
this.queryMainData(id);
|