|
|
@@ -15,21 +15,27 @@ Page({
|
|
|
},
|
|
|
tabsList: [{
|
|
|
label: "真因分析",
|
|
|
- model: "#Analysis"
|
|
|
+ model: "#Analysis",
|
|
|
+ color: "#EA820A"
|
|
|
}, {
|
|
|
label: "改善方案",
|
|
|
- model: "#Scheme"
|
|
|
+ model: "#Scheme",
|
|
|
+ color: "#EA820A"
|
|
|
}, {
|
|
|
label: "方案执行",
|
|
|
- model: "#Execute"
|
|
|
+ model: "#Execute",
|
|
|
+ color: "#EA820A"
|
|
|
}, {
|
|
|
label: "影响产品范围",
|
|
|
- model: "#Product"
|
|
|
+ model: "#Product",
|
|
|
+ color: "#EA820A"
|
|
|
}, {
|
|
|
- label: "改善单信息"
|
|
|
+ label: "改善单信息",
|
|
|
+ color: "#EA820A"
|
|
|
}, {
|
|
|
label: "关联改善单",
|
|
|
- model: "#Improvement"
|
|
|
+ model: "#Improvement",
|
|
|
+ color: "#EA820A"
|
|
|
}],
|
|
|
user_analysis: false,
|
|
|
user_charge: false,
|
|
|
@@ -41,7 +47,7 @@ Page({
|
|
|
this.getDetail()
|
|
|
getApp().globalData.Language.getLanguagePackage(this, '改善单详情');
|
|
|
let auth = wx.getStorageSync('auth').wServiceImprovement;
|
|
|
- console.log("auth",auth)
|
|
|
+ console.log("auth", auth)
|
|
|
this.setData({
|
|
|
isProduct: auth.options.includes("product")
|
|
|
})
|
|
|
@@ -52,7 +58,7 @@ Page({
|
|
|
"content": {
|
|
|
"sa_service_improvementid": this.data.sa_service_improvementid
|
|
|
},
|
|
|
- }).then(res => {
|
|
|
+ }).then(async res => {
|
|
|
console.log("改善单详情", res)
|
|
|
if (res.code != '1') return wx.showToast({
|
|
|
title: res.msg,
|
|
|
@@ -64,6 +70,119 @@ Page({
|
|
|
this.setTabbar()
|
|
|
this.setPreview(res)
|
|
|
this.partialRenewal();
|
|
|
+ const appAuth = wx.getStorageSync('auth').wServiceImprovement;
|
|
|
+ if (appAuth.options.some(v => v == 'applicationForm')) await this.getServiceDetail(res.data.sa_serviceorderid)
|
|
|
+ if (appAuth.options.some(v => v == 'workOrders')) await this.getWorkDetail(res.data.sa_workorderid)
|
|
|
+ this.setData({
|
|
|
+ tabsList: this.data.tabsList.concat([{
|
|
|
+ label: "附件",
|
|
|
+ color: "#ED4949",
|
|
|
+ model: "#Files"
|
|
|
+ }, {
|
|
|
+ label: "操作记录",
|
|
|
+ color: "#ED4949",
|
|
|
+ model: "#Record"
|
|
|
+ }])
|
|
|
+ })
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getServiceDetail(id) {
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20230206091603,
|
|
|
+ "content": {
|
|
|
+ "sa_serviceorderid": id
|
|
|
+ },
|
|
|
+ }).then(res => {
|
|
|
+ console.log("申请单详情", res)
|
|
|
+ resolve()
|
|
|
+ if (res.code != '1') return wx.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ let tabsList = [{
|
|
|
+ label: "申请信息",
|
|
|
+ idname: "sa_serviceorderid",
|
|
|
+ color: "#3874F6"
|
|
|
+ }, {
|
|
|
+ label: "受理信息",
|
|
|
+ idname: "sa_serviceorderid",
|
|
|
+ color: "#3874F6"
|
|
|
+ }];
|
|
|
+ if (['售中', "售后"].includes(res.data.servicetype)) {
|
|
|
+ tabsList.unshift({
|
|
|
+ label: "服务商品",
|
|
|
+ model: "#ServiceProduct",
|
|
|
+ idname: "sa_serviceorderid",
|
|
|
+ color: "#3874F6"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ tabsList: this.data.tabsList.concat(tabsList),
|
|
|
+ serviceDetail: res.data
|
|
|
+ })
|
|
|
+ this.selectComponent("#ServicePview1").setPreview(res);
|
|
|
+ this.selectComponent("#ServicePview2").setPreview(res);
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ getWorkDetail(id) {
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20230208140103,
|
|
|
+ "content": {
|
|
|
+ "sa_workorderid": id
|
|
|
+ },
|
|
|
+ }).then(res => {
|
|
|
+ console.log("工单详情", res)
|
|
|
+ resolve()
|
|
|
+ if (res.code != '1') return wx.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ let tabsList = [{
|
|
|
+ label: "工单服务商品",
|
|
|
+ model: "#WorkOrderProduct",
|
|
|
+ idname: "sa_workorderid",
|
|
|
+ color: "#2AA520"
|
|
|
+ }, {
|
|
|
+ label: "工序详情",
|
|
|
+ model: "#WorkOrderNodes",
|
|
|
+ idname: "sa_workorderid",
|
|
|
+ color: "#2AA520"
|
|
|
+ }, {
|
|
|
+ label: "工单物料",
|
|
|
+ model: "#WorkOrderMaterial",
|
|
|
+ idname: "sa_workorderid",
|
|
|
+ color: "#2AA520"
|
|
|
+ }, {
|
|
|
+ label: "服务确认单",
|
|
|
+ model: "#WorkOrderNotarizeBill",
|
|
|
+ idname: "sa_workorderid",
|
|
|
+ color: "#2AA520"
|
|
|
+ }, {
|
|
|
+ label: "服务团队",
|
|
|
+ idname: "sa_workorderid",
|
|
|
+ color: "#2AA520"
|
|
|
+ }, {
|
|
|
+ label: "工单信息",
|
|
|
+ idname: "sa_workorderid",
|
|
|
+ color: "#2AA520"
|
|
|
+ }];
|
|
|
+ if (res.data.actiontype == '非工序模板') {
|
|
|
+ tabsList = tabsList.filter(v => ['工单服务商品', '服务确认单', '服务团队', '工单信息'].includes(v.label))
|
|
|
+
|
|
|
+ } else {
|
|
|
+ tabsList = tabsList.filter(v => ['工序详情', '工单物料', '服务确认单', '服务团队', '工单信息'].includes(v.label))
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ tabsList: this.data.tabsList.concat(tabsList),
|
|
|
+ workDetail: res.data
|
|
|
+ })
|
|
|
+ this.selectComponent("#WorkOrderPview").setPreview(res);
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
setPreview(res) {
|
|
|
@@ -366,7 +485,8 @@ Page({
|
|
|
//局部数据更新 tabs
|
|
|
partialRenewal(init = false) {
|
|
|
try {
|
|
|
- let model = this.data.tabsList[this.data.tabsActive].model;
|
|
|
+ let ac = this.data.tabsList[this.data.tabsActive];
|
|
|
+ let model = ac.model;
|
|
|
if (model) {
|
|
|
let Component = this.selectComponent(model),
|
|
|
{
|
|
|
@@ -374,7 +494,7 @@ Page({
|
|
|
pageNumber,
|
|
|
pageTotal
|
|
|
} = Component.data.content,
|
|
|
- id = this.data.detail.sa_service_improvementid;
|
|
|
+ id = this.data.detail[ac.idname || 'sa_service_improvementid'];
|
|
|
if (total == null || init) {
|
|
|
Component.getList(id, init);
|
|
|
} else if (pageNumber <= pageTotal) {
|