xiaohaizhao 3 месяцев назад
Родитель
Сommit
3712c825c4

+ 68 - 1
E-service/serviceBillList/detail.js

@@ -22,7 +22,13 @@ Page({
     }, {
       label: "受理信息"
     }],
-    tabsActive: 0
+    tabsActive: 0,
+    reason: {
+      abortreason: "",
+      backreason: ""
+    },
+    abortreasonShow: false,
+    backreasonShow: false
   },
   onLoad(options) {
     console.log("options", options)
@@ -62,10 +68,71 @@ Page({
       this.partialRenewal();
     })
   },
+  onCancel() {
+    this.setData({
+      abortreasonShow: false,
+      backreasonShow: false
+    })
+  },
+  // 中止
+  onSuspend() {
+    let abortreason = this.data.reason.abortreason;
+    if (abortreason == '') return wx.showToast({
+      title: getApp().globalData.Language.getMapText("请说明中止原因"),
+      icon: "none"
+    })
+    _Http.basic({
+      "content": {
+        "sa_serviceorderid": this.data.detail.sa_serviceorderid,
+        abortreason
+      },
+      "id": 2026012414051502,
+    }).then(res => {
+      getApp().globalData.Language.showToast(res.code == '1' ? "中止成功" : res.msg)
+      if (res.code == 1) this.getDetail();
+    })
+  },
+  // 退回
+  onBack() {
+    let backreason = this.data.reason.backreason;
+    if (backreason == '') return wx.showToast({
+      title: getApp().globalData.Language.getMapText("请说明退回原因"),
+      icon: "none"
+    })
+    _Http.basic({
+      "content": {
+        "sa_serviceorderid": this.data.detail.sa_serviceorderid,
+        "issumbit": 0,
+        backreason
+      },
+      "id": "20230206101403",
+    }).then(res => {
+      getApp().globalData.Language.showToast(res.code == '1' ? "退回成功" : res.msg)
+      if (res.code == 1) this.getDetail();
+    })
+  },
+  areaInput(e) {
+    this.data.reason[e.currentTarget.dataset.name] = e.detail.value;
+  },
   tabbarOnClick(e) {
     let that = this,
       detail = this.data.detail;
     switch (e.detail.label) {
+      case '中止':
+        this.setData({
+          abortreasonShow: true
+        })
+        break;
+      case '退回':
+        this.setData({
+          backreasonShow: true
+        })
+        break;
+      case '转工单':
+        wx.navigateTo({
+          url: "/E-service/serviceBillList/transferWorkOrder/transfer?id=" + detail.sa_serviceorderid
+        })
+        break;
       case '编辑':
         wx.navigateTo({
           url: `/E-service/serviceBillList/insert?type=${this.data.type}&edit=true`

+ 12 - 0
E-service/serviceBillList/detail.scss

@@ -47,4 +47,16 @@
 		}
 	}
 
+}
+
+
+.textarea {
+	width: 90%;
+	height: 200rpx;
+	box-sizing: border-box;
+	padding: 20rpx 30rpx;
+	background-color: #FDF9FC;
+	margin: 20rpx auto;
+	border: 1rpx solid #EEECEF;
+	border-radius: 8rpx;
 }

+ 9 - 1
E-service/serviceBillList/detail.wxml

@@ -47,4 +47,12 @@
 	<view style="height: 180rpx;" />
 </Yl_FunTabs>
 
-<Yl_Tabbar wx:if="{{tabbarList.length}}" list='{{tabbarList}}' bind:callback="tabbarOnClick" />
+<Yl_Tabbar wx:if="{{tabbarList.length}}" list='{{tabbarList}}' bind:callback="tabbarOnClick" />
+
+<van-dialog confirmButtonText="{{language['确定']||'确定'}}" cancelButtonText="{{language['取消']||'取消'}}" use-slot title="{{language['中止']||'中止'}}" show="{{ abortreasonShow }}" show-cancel-button confirm-button-color='#3874F6' bind:confirm='onSuspend' bind:cancel='onCancel'>
+	<textarea placeholder="{{language['中止原因']||'中止原因'}}" value="{{reason.abortreason}}" data-name="abortreason" bindinput="areaInput" class="textarea" />
+</van-dialog>
+
+<van-dialog confirmButtonText="{{language['确定']||'确定'}}" cancelButtonText="{{language['取消']||'取消'}}" use-slot title="{{language['退回']||'退回'}}" show="{{ backreasonShow }}" show-cancel-button confirm-button-color='#3874F6' bind:confirm='onBack' bind:cancel='onCancel'>
+	<textarea placeholder="{{language['退回原因']||'退回原因'}}" value="{{reason.backreason}}" data-name="backreason" bindinput="areaInput" class="textarea" />
+</van-dialog>

+ 171 - 0
E-service/serviceBillList/transferWorkOrder/transfer.js

@@ -0,0 +1,171 @@
+const _Http = getApp().globalData.http;
+
+Page({
+  data: {
+    loading: false,
+    showAll: false,
+    disabled: true,
+    "sa_serviceorderid": "0",
+    form: []
+  },
+  async onLoad(options) {
+    console.log("options", options)
+    /*     _Http.basic({
+          id: "20230208140203",
+          content: {}
+        }).then(res => {
+          console.log(res)
+        }) */
+    let form = [];
+    // 服务类型
+    await _Http.basic({
+      "id": 20230206155803,
+      "content": {},
+    }).then(res => {
+      if (res.code == 1) {
+        form.push({
+          label: "工单模版",
+          error: false,
+          errMsg: "",
+          hint: "",
+          type: "radio",
+          value: res.data.length ? res.data[0].sa_workorder_templateid : "",
+          interrupt: true,
+          radioList: res.data.map(v => {
+            return {
+              id: v.sa_workorder_templateid,
+              ...v
+            }
+          }),
+          valueName: "sa_workorder_templateid", //绑定的字段名称
+          required: true, //必填
+          checking: `base`,
+        })
+        form.push({
+          label: "工单类型",
+          error: false,
+          errMsg: "",
+          hint: "",
+          type: "radio",
+          value: res.data.length ? res.data[0].type : "",
+          interrupt: true,
+          radioList: res.data.map(v => {
+            return {
+              ...v,
+              id: v.type,
+              name: v.type
+            }
+          }),
+          valueName: "type", //绑定的字段名称
+          required: true, //必填
+          checking: `base`,
+        })
+      }
+    })
+    await _Http.basic({
+      "id": "20230213143003",
+      "version": 1,
+      "content": {
+        "where": {
+          "condition": ""
+        }
+      }
+    }).then(res => {
+      if (res.code == 1) {
+        form.push({
+          label: "负责人",
+          error: false,
+          errMsg: "",
+          hint: "",
+          type: "radio",
+          value: "",
+          interrupt: true,
+          radioList: res.data.map(v => {
+            return {
+              ...v,
+              id: v.userid,
+            }
+          }),
+          valueName: "userid", //绑定的字段名称
+          required: true, //必填
+          checking: `base`,
+        })
+      }
+    })
+    this.setData({
+      form,
+      sa_serviceorderid: options.id
+    })
+    getApp().globalData.Language.getLanguagePackage(this, '转工单');
+  },
+  submit() {
+    this.setData({
+      loading: true
+    })
+    let content = this.selectComponent("#Form").submit();
+    content.projectlearders = [content.userid]
+    content.sa_serviceorderid = this.data.sa_serviceorderid;
+    delete content.userid;
+    _Http.basic({
+      "id": "20230207091003",
+      content
+    }).then(res => {
+      this.setData({
+        loading: false
+      })
+      console.log("转工单", res)
+      if (res.code == 1) {
+        getCurrentPages().find(v => v.__route__ == 'E-service/serviceBillList/detail').getDetail();
+        wx.navigateBack({
+          success() {
+            wx.showToast({
+              title: getApp().globalData.Language.getMapText('操作成功'),
+              icon: "none",
+              mask: true
+            })
+          }
+        });
+      } else {
+        wx.showToast({
+          title: res.msg,
+          icon: "none",
+          mask: true
+        })
+      }
+    })
+  },
+  interrupt({
+    detail
+  }) {
+    if (detail.data.valueName == "sa_workorder_templateid") {
+      detail.form[detail.form.findIndex(v => v.valueName == 'sa_workorder_templateid')] = detail.data;
+      detail.form[detail.form.findIndex(v => v.valueName == 'type')].value = detail.data.radioList.find(v => v.id == detail.data.value).type;
+      this.setData({
+        form: detail.form
+      })
+    } else if (detail.data.valueName == "type") {
+      detail.form[detail.form.findIndex(v => v.valueName == 'type')] = detail.data;
+      detail.form[detail.form.findIndex(v => v.valueName == 'sa_workorder_templateid')].value = detail.data.radioList.find(v => v.id == detail.data.value).sa_workorder_templateid;
+      this.setData({
+        form: detail.form
+      })
+    }
+    this.selectComponent("#Form").confirm()
+  },
+  // 是否显示全部
+  onChange({
+    detail
+  }) {
+    this.setData({
+      showAll: detail
+    })
+  },
+  /* 表单必填项是否完成 */
+  onConfirm({
+    detail
+  }) {
+    this.setData({
+      disabled: detail
+    })
+  }
+})

+ 3 - 0
E-service/serviceBillList/transferWorkOrder/transfer.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 24 - 0
E-service/serviceBillList/transferWorkOrder/transfer.scss

@@ -0,0 +1,24 @@
+.new-footer {
+	display: flex;
+	align-items: center;
+	justify-content: flex-end;
+	position: fixed;
+	width: 100vw;
+	height: 130rpx;
+	background: #FFFFFF;
+	box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+	bottom: 0;
+	z-index: 9999;
+
+	.new-submit {
+			width: 156rpx;
+			height: 90rpx;
+			background: #3874F6;
+			border-radius: 8rpx;
+			font-size: 28rpx;
+			font-family: PingFang SC-Bold, PingFang SC;
+			font-weight: bold;
+			color: #FFFFFF;
+			margin-right: 30rpx;
+	}
+}

+ 6 - 0
E-service/serviceBillList/transferWorkOrder/transfer.wxml

@@ -0,0 +1,6 @@
+<Yl_Headline title='基本信息' type='switch' switchLabel='仅显示必填信息' switch='{{showAll}}' bind:callBack='onChange' />
+<Yl_Field id='Form' form='{{form}}' showAll='{{!showAll}}' bind:onConfirm='onConfirm' bind:interrupt="interrupt" />
+<view style="height: 150rpx;" />
+<view class="new-footer">
+    <van-button custom-class='new-submit' disabled='{{disabled || loading}}' loading='{{loading}}' bindclick='submit'>{{language['确定']||'确定'}}</van-button>
+</view>

+ 3 - 1
app.json

@@ -94,7 +94,8 @@
         "workOrder/index",
         "workOrder/insert",
         "workOrder/detail",
-        "serviceBillList/product/select"
+        "serviceBillList/product/select",
+        "serviceBillList/transferWorkOrder/transfer"
       ]
     },
     {
@@ -150,6 +151,7 @@
     }
   },
   "usingComponents": {
+    "van-dialog": "@vant/weapp/dialog/index",
     "Yl_Empty": "/components/Yl_Empty/index",
     "Yl_Filtrate": "/components/Yl_Filtrate/index",
     "organization": "/components/organization/index",

+ 0 - 1
components/Yl_Tabbar/index.js

@@ -29,7 +29,6 @@ Component({
         'list': function (numberA, numberB) {
             numberA = numberA.map(v => {
                 v.classnames = (v.icon.split("-")[0] == 'color' ? 't-icon ' : 'iconfont ') + v.icon
-                console.log(v.classnames)
                 return v
             })
             if (numberA.length >= 6) {

+ 16 - 2
project.private.config.json

@@ -24,12 +24,26 @@
   "condition": {
     "miniprogram": {
       "list": [
+        {
+          "name": "已提交详情",
+          "pathName": "E-service/serviceBillList/detail",
+          "query": "id=1536&type=admin",
+          "scene": null,
+          "launchMode": "default"
+        },
+        {
+          "name": "服务申请单详情",
+          "pathName": "E-service/serviceBillList/detail",
+          "query": "id=1548&type=admin",
+          "launchMode": "default",
+          "scene": null
+        },
         {
           "name": "老申请单详情",
           "pathName": "/Eservice/workerLeader/serviceBillDetail/index",
           "query": "id=1524",
-          "scene": null,
-          "launchMode": "default"
+          "launchMode": "default",
+          "scene": null
         },
         {
           "name": "工单详情",