|
|
@@ -2,18 +2,22 @@ const _Http = getApp().globalData.http;
|
|
|
|
|
|
Page({
|
|
|
data: {
|
|
|
+ delShow: false,
|
|
|
+ reason: {
|
|
|
+ voidreason: ""
|
|
|
+ },
|
|
|
sc_workorderid: '',
|
|
|
detail: {},
|
|
|
tabsList: [{
|
|
|
label: "工序信息",
|
|
|
idname: "sc_workorderid"
|
|
|
- },{
|
|
|
+ }, {
|
|
|
label: "工单物料",
|
|
|
idname: "sc_workorderid"
|
|
|
- },{
|
|
|
+ }, {
|
|
|
label: "团队信息",
|
|
|
idname: "sc_workorderid"
|
|
|
- },{
|
|
|
+ }, {
|
|
|
label: "工单信息",
|
|
|
idname: "sc_workorderid"
|
|
|
}, {
|
|
|
@@ -191,36 +195,187 @@ Page({
|
|
|
} catch (error) {}
|
|
|
},
|
|
|
|
|
|
+ onCancel() {
|
|
|
+ this.setData({
|
|
|
+ delShow: false,
|
|
|
+ reason: {
|
|
|
+ voidreason: ""
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ areaInput(e) {
|
|
|
+ this.data.reason[e.currentTarget.dataset.name] = e.detail.value;
|
|
|
+ },
|
|
|
+ // 作废
|
|
|
+ onSuspend() {
|
|
|
+ let that = this;
|
|
|
+ setTimeout(() => {
|
|
|
+ let voidreason = that.data.reason.voidreason;
|
|
|
+ if (voidreason == '') return wx.showToast({
|
|
|
+ title: getApp().globalData.Language.getMapText("请填写作废原因"),
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ _Http.basic({
|
|
|
+ "content": {
|
|
|
+ "sc_workorderid": that.data.detail.sc_workorderid,
|
|
|
+ voidreason
|
|
|
+ },
|
|
|
+ "id": 2026052113565202,
|
|
|
+ }).then(res => {
|
|
|
+ getApp().globalData.Language.showToast(res.code == '1' ? "作废成功" : res.msg)
|
|
|
+ if (res.code == 1) that.getDetail();
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
tabbarOnClick({
|
|
|
detail
|
|
|
}) {
|
|
|
- const item = this.data.detail;
|
|
|
+ let that = this;
|
|
|
switch (detail.label) {
|
|
|
- case '转工单':
|
|
|
- wx.navigateTo({
|
|
|
- url: '/bgj/handling/transferWorkOrder/transfer?sc_workorderid=' + this.data.sc_workorderid
|
|
|
- });
|
|
|
+ case '开始工单':
|
|
|
+ wx.showModal({
|
|
|
+ title: getApp().globalData.Language.getMapText('提示'),
|
|
|
+ content: getApp().globalData.Language.getMapText(`确认开始工单吗`) + '?',
|
|
|
+ confirmBtn: getApp().globalData.Language.getMapText('确定'),
|
|
|
+ cancelBtn: getApp().globalData.Language.getMapText('取消'),
|
|
|
+ complete: ({
|
|
|
+ confirm
|
|
|
+ }) => {
|
|
|
+ if (confirm) _Http.basic({
|
|
|
+ "content": {
|
|
|
+ "sc_workorderid": this.data.sc_workorderid
|
|
|
+ },
|
|
|
+ "id": "2026052113540302",
|
|
|
+ }).then(res => {
|
|
|
+ getApp().globalData.Language.showToast(res.code == '1' ? "开始成功" : res.msg)
|
|
|
+ that.getDetail()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ case '作废':
|
|
|
+ console.log(this.data.delShow,"delShow")
|
|
|
+ this.setData({
|
|
|
+ delShow: true
|
|
|
+ })
|
|
|
+ console.log(this.data.delShow,"delShow2")
|
|
|
+
|
|
|
+ break;
|
|
|
+ case '完结工单':
|
|
|
+ wx.showModal({
|
|
|
+ title: getApp().globalData.Language.getMapText('提示'),
|
|
|
+ content: getApp().globalData.Language.getMapText(`确认完结工单吗`) + '?',
|
|
|
+ confirmBtn: getApp().globalData.Language.getMapText('确定'),
|
|
|
+ cancelBtn: getApp().globalData.Language.getMapText('取消'),
|
|
|
+ complete: ({
|
|
|
+ confirm
|
|
|
+ }) => {
|
|
|
+ if (confirm) _Http.basic({
|
|
|
+ "content": {
|
|
|
+ "sc_workorderid": this.data.sc_workorderid
|
|
|
+ },
|
|
|
+ "id": "2026052113561302",
|
|
|
+ }).then(res => {
|
|
|
+ getApp().globalData.Language.showToast(res.code == '1' ? "完结成功" : res.msg)
|
|
|
+ that.getDetail()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
break;
|
|
|
- case '指派经销商':
|
|
|
- wx.navigateTo({
|
|
|
- url: '/bgj/handling/assignAgent/assign?sc_workorderid=' + this.data.sc_workorderid
|
|
|
- });
|
|
|
+ case '暂停':
|
|
|
+ wx.showModal({
|
|
|
+ title: getApp().globalData.Language.getMapText('提示'),
|
|
|
+ content: getApp().globalData.Language.getMapText(`是否暂停执行该工单`) + '?',
|
|
|
+ confirmBtn: getApp().globalData.Language.getMapText('确定'),
|
|
|
+ cancelBtn: getApp().globalData.Language.getMapText('取消'),
|
|
|
+ complete: ({
|
|
|
+ confirm
|
|
|
+ }) => {
|
|
|
+ if (confirm) _Http.basic({
|
|
|
+ "content": {
|
|
|
+ "sc_workorderid": this.data.sc_workorderid
|
|
|
+ },
|
|
|
+ "id": "2026052113545402",
|
|
|
+ }).then(res => {
|
|
|
+ getApp().globalData.Language.showToast(res.code == '1' ? "暂停成功" : res.msg)
|
|
|
+ that.getDetail()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ case '启用':
|
|
|
+ wx.showModal({
|
|
|
+ title: getApp().globalData.Language.getMapText('提示'),
|
|
|
+ content: getApp().globalData.Language.getMapText(`是否继续执行该工单`) + '?',
|
|
|
+ confirmBtn: getApp().globalData.Language.getMapText('确定'),
|
|
|
+ cancelBtn: getApp().globalData.Language.getMapText('取消'),
|
|
|
+ complete: ({
|
|
|
+ confirm
|
|
|
+ }) => {
|
|
|
+ if (confirm) _Http.basic({
|
|
|
+ "content": {
|
|
|
+ "sc_workorderid": this.data.sc_workorderid
|
|
|
+ },
|
|
|
+ "id": "2026052113553202",
|
|
|
+ }).then(res => {
|
|
|
+ getApp().globalData.Language.showToast(res.code == '1' ? "启用成功" : res.msg)
|
|
|
+ that.getDetail()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
setTabbar() {
|
|
|
- this.setData({
|
|
|
- tabbarList: [{
|
|
|
- icon: "icon-tijiao",
|
|
|
- label: "转工单"
|
|
|
+ const {
|
|
|
+ status = ''
|
|
|
+ } = this.data.detail;
|
|
|
+ console.log("status", status);
|
|
|
+
|
|
|
+ // 按钮列表 配置表
|
|
|
+ const statusMap = {
|
|
|
+ "已完成": [],
|
|
|
+ "质保卡审批": [],
|
|
|
+ "作废": [],
|
|
|
+ "待开始": [{
|
|
|
+ icon: "icon-kaishigongdan",
|
|
|
+ label: "开始工单"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ icon: "icon-zuofei",
|
|
|
+ label: "作废"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "进行中": [{
|
|
|
+ icon: "icon-wanjiegongdan",
|
|
|
+ label: "完结工单"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ icon: "icon-zanting",
|
|
|
+ label: "暂停"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ icon: "icon-zuofei",
|
|
|
+ label: "作废"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "暂停": [{
|
|
|
+ icon: "icon-qiyong",
|
|
|
+ label: "启用"
|
|
|
},
|
|
|
{
|
|
|
- icon: "icon-bianji2",
|
|
|
- label: "指派经销商"
|
|
|
+ icon: "icon-zuofei",
|
|
|
+ label: "作废"
|
|
|
}
|
|
|
]
|
|
|
- })
|
|
|
+ };
|
|
|
+
|
|
|
+ // 匹配对应按钮,未知状态默认空
|
|
|
+ const tabbarList = statusMap[status] || [];
|
|
|
+ this.setData({
|
|
|
+ tabbarList
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
onUnload() {
|