xiaohaizhao il y a 3 mois
Parent
commit
598085e3b5

+ 2 - 1
E-service/workOrder/detail.js

@@ -34,7 +34,8 @@ Page({
       label: "工单物料",
       model: "#Material"
     }, {
-      label: "服务确认单"
+      label: "服务确认单",
+      model: "#NotarizeBill"
     }, {
       label: "服务团队"
     }],

+ 2 - 1
E-service/workOrder/detail.json

@@ -3,6 +3,7 @@
     "Preview": "../components/preview/index",
     "Product": "./product/index",
     "Material": "./material/index",
-    "Nodes": "./nodes/index"
+    "Nodes": "./nodes/index",
+    "NotarizeBill": "./notarizeBill/index"
   }
 }

+ 5 - 2
E-service/workOrder/detail.wxml

@@ -51,7 +51,7 @@
 		<navigator wx:if="{{isworkleader || isLeader}}" class="confirm but" url="/E-service/workOrder/confirm?id={{sa_workorderid}}">
 			{{language['查看工单确认信息']||'查看工单确认信息'}}
 		</navigator>
-		<navigator class="start but" url="/E-service/workOrder/confirm?id={{sa_workorderid}}">
+		<navigator class="start but">
 			{{language['发起服务确认单']||'发起服务确认单'}}
 		</navigator>
 	</view>
@@ -59,9 +59,12 @@
 <view style="height: 20rpx;" />
 <Yl_FunTabs list='{{tabsList}}' showIcon='{{false}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
 	<Preview slot='工单信息' list1='{{list1}}' list2='{{list2}}' />
-	<Nodes id='Nodes' slot='工序详情' nodes='{{detail.nodes}}' status="{{detail.status}}" />
+	<view slot='工序详情' style="padding: 20rpx; background-color: #fff;">
+		<Nodes id='Nodes' wx:if="{{detail}}" nodes='{{detail.nodes}}' sa_workorderid='{{detail.sa_workorderid}}' status="{{detail.status}}" />
+	</view>
 	<Product slot='服务商品' id='Product' disabled="{{detail.status != '进行中'}}" />
 	<Material slot='工单物料' id='Material' />
+	<NotarizeBill slot='服务确认单' billData='{{detail}}' id='NotarizeBill' />
 	<view style="height: 180rpx;" />
 </Yl_FunTabs>
 

+ 7 - 2
E-service/workOrder/nodes/index.js

@@ -11,12 +11,15 @@ Component({
     },
     status: {
       type: String
+    },
+    sa_workorderid: {
+      type: [String, Number]
     }
   },
   lifetimes: {
     attached: function () {
       getApp().globalData.Language.getLanguagePackage(this)
-      console.log(this.data.prefix, this.data.nodes)
+      console.log(this.data.sa_workorderid, this.data.nodes)
     }
   },
   data: {
@@ -32,12 +35,14 @@ Component({
       } catch (error) {
         item.child = [];
       }
+      console.log(item)
       if (item.child.length) return;
       item.title = (this.data.prefix ? this.data.prefix + '-' : '') + item.rowindex + '. ' + item.workpresetjson.workname;
       item.status1 = this.data.status;
       _Http.data = item;
+      let isleader = true;
       wx.navigateTo({
-        url: '/E-service/workOrder/nodes/work',
+        url: (isleader ? '/Eservice/nodeDetail/index?id=' : '/Eservice/nodeDetail/index?class=stopClick&id=') + item.sa_workorder_nodeid + '&wid=' + item.sa_workorderid + (this.data.status != '进行中' ? '&class=stopClick' : '')
       })
     },
   }

+ 2 - 1
E-service/workOrder/nodes/index.json

@@ -1,6 +1,7 @@
 {
   "component": true,
   "usingComponents": {
-    "Nodes": "/E-service/workOrder/nodes/index"
+    "Nodes": "/E-service/workOrder/nodes/index",
+    "Yl_Files": "/components/Yl_Files/index"
   }
 }

+ 1 - 1
E-service/workOrder/nodes/index.scss

@@ -8,7 +8,7 @@
 
 	.label,
 	.number {
-			font-size: 32rpx;
+			font-size: 28rpx;
 	}
 
 	.number {

+ 2 - 2
E-service/workOrder/nodes/index.wxml

@@ -1,4 +1,4 @@
-<view class="{{prefix ? 'node child' : 'node'}}" hover-class="navigator-hover" wx:for="{{nodes}}" key="sa_workorder_nodeid" data-item="{{item}}" catch:tap="toWork">
+<navigator url="#" class="{{prefix ? 'node child' : 'node'}}" wx:for="{{nodes}}" key="sa_workorder_nodeid" data-item="{{item}}" catch:tap="toWork">
 	<view class="number">
 		{{ (prefix ? prefix + '-' : '') + item.rowindex }}.
 	</view>
@@ -16,4 +16,4 @@
 			</view>
 		</block>
 	</view>
-</view>
+</navigator>

+ 151 - 0
E-service/workOrder/notarizeBill/index.js

@@ -0,0 +1,151 @@
+const _Http = getApp().globalData.http;
+
+Component({
+  properties: {
+    disabled: {
+      type: Boolean,
+      value: false
+    },
+    billData: {
+      type: Object
+    }
+  },
+  options: {
+    addGlobalClass: true
+  },
+  lifetimes: {
+    attached: function () {
+      getApp().globalData.Language.getLanguagePackage(this)
+    }
+  },
+  data: {
+    sa_workorderid: 0,
+    content: {
+      nocache: true,
+      pageNumber: 1,
+      pageSize: 10,
+      pageTotal: 1,
+      total: null,
+      where: {
+        condition: ""
+      }
+    },
+    list: [],
+    showSearch: false,
+    focus: false,
+    condition: ""
+  },
+  methods: {
+    getList(id, init = false) {
+      console.log("getList", id)
+      let content = {
+        ...this.data.content,
+        sa_workorderid: id || this.data.sa_workorderid
+      };
+      if (init) {
+        content.pageNumber = 1
+        content.pageTotal = 1
+      }
+      _Http.basic({
+        "id": 20230211105903,
+        content
+      }).then(res => {
+        console.log("服务确认单", res)
+        if (res.code != '1') return wx.showToast({
+          title: res.data,
+          icon: "none"
+        });
+        this.setData({
+          "content.pageNumber": res.pageNumber + 1,
+          "content.pageTotal": res.pageTotal,
+          "content.total": res.total,
+          list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+          sa_workorderid: content.sa_workorderid
+        })
+      })
+    },
+    async addConfirmBill() {
+      const res = await _Http.basic({
+        "id": "20230211105703",
+        "version": 1,
+        "content": {
+          "sa_workorder_confirmationid": 0,
+          "sa_workorderid": this.data.sa_workorderid,
+          "attitudescore": 0,
+          "responsescore": 0,
+        }
+      })
+
+      if (this.data.billData.actiontype === "非工序模板") {
+        wx.navigateTo({
+          url: '/Eservice/materielConfirmBill/index?id=' + res.data.sa_workorder_confirmationid,
+        })
+      } else if (this.data.billData.type === '安装培训') {
+        wx.navigateTo({
+          url: '/Eservice/trainConfirmBill/index?id=' + res.data.sa_workorder_confirmationid,
+        })
+      } else if (this.data.billData.type === '安装调试') {
+        wx.navigateTo({
+          url: '/Eservice/installConfirmBill/index?id=' + res.data.sa_workorder_confirmationid,
+        })
+      } else {
+        wx.navigateTo({
+          url: '/Eservice/serviceConfirmBill/index?id=' + res.data.sa_workorder_confirmationid,
+        })
+      }
+      _Http.updateList = this.getList.bind(this)
+    },
+    toConfirmBill(data) {
+      let class1 = this.data.billData.status != '进行中' ? '&class=stopClick' : ''
+      if (this.data.billData.actiontype === "非工序模板") {
+        wx.navigateTo({
+          url: '/Eservice/materielConfirmBill/index?id=' + data.currentTarget.dataset.item.sa_workorder_confirmationid + '&class=' + class1,
+        })
+      } else if (this.data.billData.type === '安装培训') {
+        wx.navigateTo({
+          url: '/Eservice/trainConfirmBill/index?id=' + data.currentTarget.dataset.item.sa_workorder_confirmationid + '&class=' + class1,
+        })
+      } else if (this.data.billData.type === '安装调试') {
+        wx.navigateTo({
+          url: '/Eservice/installConfirmBill/index?id=' + data.currentTarget.dataset.item.sa_workorder_confirmationid + '&class=' + class1,
+        })
+      } else {
+        wx.navigateTo({
+          url: '/Eservice/serviceConfirmBill/index?id=' + data.currentTarget.dataset.item.sa_workorder_confirmationid + '&class=' + class1,
+        })
+      }
+      _Http.updateList = this.getList.bind(this)
+    },
+    toSearch() {
+      if (this.data.showSearch && this.data.content.where.condition) {
+        this.data.content.where.condition = '';
+        this.getList("", true);
+      } else if (this.data.condition) {
+        this.data.content.where.condition = this.data.condition;
+        this.setData({
+          condition: this.data.condition
+        })
+        this.getList("", true);
+      }
+      this.setData({
+        showSearch: !this.data.showSearch
+      })
+      setTimeout(() => {
+        this.setData({
+          focus: this.data.showSearch
+        })
+      }, 300)
+    },
+    onChange({
+      detail
+    }) {
+      this.data.condition = detail;
+    },
+    onSearch({
+      detail
+    }) {
+      this.data.content.where.condition = detail;
+      this.getList("", true)
+    },
+  }
+})

+ 6 - 0
E-service/workOrder/notarizeBill/index.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "t-cell": "tdesign-miniprogram/cell/cell"
+  }
+}

+ 167 - 0
E-service/workOrder/notarizeBill/index.scss

@@ -0,0 +1,167 @@
+.head {
+	display: flex;
+	align-items: center;
+	width: 100vw;
+	height: 120rpx;
+	padding: 0 20rpx 0 30rpx;
+	box-sizing: border-box;
+
+	.count {
+		font-size: 28rpx;
+		font-family: PingFang SC-Regular, PingFang SC;
+		color: #333333;
+	}
+
+	.expand {
+		flex: 1;
+		display: flex;
+		align-items: center;
+		justify-content: flex-end;
+
+		.but {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			flex-shrink: 0;
+			width: 80rpx;
+			height: 80rpx;
+			background: #FFFFFF;
+			border-radius: 8rpx;
+			border: 2rpx solid #CCCCCC;
+			margin-left: 20rpx;
+			color: #666666;
+		}
+	}
+}
+
+.custom-class {
+	--search-background-color: #fff !important;
+	padding-right: 10rpx !important;
+}
+
+.product-item {
+	box-sizing: border-box;
+
+	.product {
+
+		.mian {
+			position: relative;
+			display: flex;
+			width: 100%;
+			box-sizing: border-box;
+
+			.img {
+				position: relative;
+				flex-shrink: 0;
+				width: 112rpx;
+				height: 112rpx;
+				border-radius: 16rpx;
+				margin-right: 28rpx;
+
+				.err {
+					display: flex;
+					width: 100%;
+					height: 100%;
+					align-items: center;
+					justify-content: center;
+					font-size: 22rpx;
+					border: 1px solid #ddd;
+					box-sizing: border-box;
+					color: #666;
+					border-radius: 16rpx;
+				}
+
+			}
+
+			.dec {
+				flex: 1;
+				width: 0;
+				min-height: 128rpx;
+				height: 100%;
+				font-size: 24rpx;
+				font-family: PingFang SC-Regular, PingFang SC;
+				color: #999999;
+
+				.title {
+					display: flex;
+					width: 95%;
+					height: 40rpx;
+					font-size: 28rpx;
+					font-weight: 600;
+					color: #333333;
+
+					.line-1 {
+						max-width: 460rpx;
+					}
+
+					.tag {
+						display: inline-block;
+						color: #fff;
+						background-color: #F80700;
+						padding: 0 20rpx;
+						margin-left: 20rpx;
+						border-radius: 20rpx;
+						font-weight: normal;
+						font-size: 22rpx;
+						line-height: 40rpx;
+					}
+				}
+
+				.subfield {
+					display: flex;
+					margin-top: 8rpx;
+					height: 34rpx;
+					line-height: 34rpx;
+
+					text {
+						display: inline-block;
+						width: 48%;
+					}
+				}
+
+				.price {
+					font-size: 25rpx;
+					color: #FF3B30;
+				}
+
+				.old-price {
+					font-size: 24rpx;
+					font-family: PingFang SC-Regular, PingFang SC;
+					color: #999999;
+					margin-left: 8rpx;
+					text-decoration-line: line-through;
+				}
+
+				.bottom {
+					display: flex;
+					align-items: center;
+					height: 58rpx;
+					font-family: PingFang SC, PingFang SC;
+					font-size: 24rpx;
+					color: #333333;
+					margin-top: 24rpx;
+					margin-left: -130rpx;
+					padding-bottom: 2rpx;
+
+					textarea,
+					input {
+						flex: 1;
+						height: 58rpx;
+						line-height: 58rpx;
+						background: #FFFFFF;
+						border-radius: 8rpx;
+						border: 1rpx solid #CCCCCC;
+						padding-left: 20rpx;
+					}
+				}
+			}
+
+			.iconfont-box {
+				position: absolute;
+				right: 0rpx;
+				color: #B5B5B5;
+				border-radius: 8rpx;
+			}
+		}
+	}
+}

+ 21 - 0
E-service/workOrder/notarizeBill/index.wxml

@@ -0,0 +1,21 @@
+<view class="head">
+	<view class="count">
+		总共{{content.total}}个
+	</view>
+	<view class="expand">
+		<van-search wx:if="{{showSearch}}" custom-class='custom-class' focus='{{focus}}' value="{{ condition }}" shape="round" bind:change='onChange' bind:search='onSearch' bind:clear='onSearch' placeholder="搜索关键词" background='#F4F5F7' />
+		<navigator url="#" class="but" bindtap="toSearch">
+			<van-icon name="search" />
+		</navigator>
+		<navigator wx:if="{{!disabled}}" url="#" class="but" bindtap="addConfirmBill">
+			<van-icon name="plus" />
+		</navigator>
+	</view>
+</view>
+
+<t-cell wx:for="{{list}}" wx:key="sa_workorder_confirmationid" title="{{item.confirmationno}}" data-item="{{item}}" hover arrow bind:click="toConfirmBill">
+	<view slot="note" style="color:{{sColors[item.status]}};">
+		{{language[item.status]||item.status}}
+	</view>
+</t-cell>
+<Yl_Empty wx:if="{{list.length==0}}" />

+ 2 - 0
Eservice/installConfirmBill/index.js

@@ -1,4 +1,5 @@
 const api = require("../api/api")
+const _Http = getApp().globalData.http;
 let circulation = null;
 Page({
     data: {
@@ -218,6 +219,7 @@ Page({
     },
     onUnload() {
         clearInterval(circulation)
+        _Http.updateList && _Http.updateList("", true)
     },
     async updateDetail() {
         if (this.data.mainData.status != '新建') return;

+ 3 - 0
Eservice/materielConfirmBill/index.js

@@ -1,5 +1,7 @@
 const api = require("../api/api")
 let circulation = null;
+const _Http = getApp().globalData.http;
+
 
 Page({
   data: {
@@ -244,6 +246,7 @@ Page({
   },
   onUnload() {
     clearInterval(circulation)
+    _Http.updateList && _Http.updateList("", true)
   },
   async updateDetail() {
     if (this.data.mainData.status != '新建') return;

+ 4 - 0
Eservice/nodeDetail/index.js

@@ -300,4 +300,8 @@ Page({
     })
 
   },
+
+  onUnload() {
+    getCurrentPages().find(v => v.__route__ == 'E-service/workOrder/detail').getDetail()
+  }
 })

+ 2 - 0
Eservice/serviceConfirmBill/index.js

@@ -1,5 +1,6 @@
 const api = require("../api/api");
 let circulation = null;
+const _Http = getApp().globalData.http;
 
 Page({
   data: {
@@ -241,6 +242,7 @@ Page({
   },
   onUnload() {
     clearInterval(circulation)
+    _Http.updateList && _Http.updateList("", true)
   },
   async updateDetail() {
     if (this.data.mainData.status != '新建') return;

+ 3 - 1
Eservice/trainConfirmBill/index.js

@@ -1,4 +1,5 @@
-const api = require("../api/api")
+const api = require("../api/api");
+const _Http = getApp().globalData.http;
 let circulation = null;
 
 Page({
@@ -257,6 +258,7 @@ Page({
     },
     onUnload() {
         clearInterval(circulation)
+        _Http.updateList && _Http.updateList("", true)
     },
     async updateDetail() {
         if (this.data.mainData.status != '新建') return;

+ 0 - 1
Eservice/workerLeader/editworkOrderDetail/index.js

@@ -123,7 +123,6 @@ Page({
                 url: '/Eservice/serviceConfirmBill/index?id=' + res.data.sa_workorder_confirmationid,
             })
         }
-
     },
     toConfirmBill(data) {
         if (this.data.billData.actiontype === "非工序模板") {

+ 1 - 1
components/Yl_Attachment/index.json

@@ -1,6 +1,6 @@
 {
   "usingComponents": {
     "Yl_Upload": "/components/Yl_Upload/index",
-    "Yl_Files": "/components/Yl_Files/index"
+    "": "/components/Yl_Files/index"
   }
 }

+ 5 - 5
components/Yl_Files/index.wxml

@@ -1,19 +1,19 @@
 <view class="media" style="padding:{{padding}};">
     <!-- 图片 -->
     <navigator url="#" class="item" wx:for="{{files.images}}" wx:key="attachmentid">
-        <image src="{{item.url}}" data-index="{{index}}" data-type='image' mode="aspectFill" bindtap="viewMedias" />
-        <image wx:if="{{delete}}" class="delete" src="/static/image/delete.png" data-item="{{item}}" bindtap="handleDeleteFile" />
+        <image src="{{item.url}}" data-index="{{index}}" data-type='image' mode="aspectFill" catchtap="viewMedias" />
+        <image wx:if="{{delete}}" class="delete" src="/static/image/delete.png" data-item="{{item}}" catchtap="handleDeleteFile" />
     </navigator>
     <!-- 视频 -->
     <navigator url="#" class="item" wx:for="{{files.videos}}" wx:key="attachmentid">
         <image src="{{item.subfiles[0].url}}" mode="aspectFill" />
-        <view class="shade" data-index="{{index}}" data-type='video' bindtap="viewMedias">
+        <view class="shade" data-index="{{index}}" data-type='video' catchtap="viewMedias">
             <van-icon size='48rpx' name="play" />
         </view>
-        <image wx:if="{{delete}}" class="delete" src="/static/image/delete.png" data-item="{{item}}" bindtap="handleDeleteFile" />
+        <image wx:if="{{delete}}" class="delete" src="/static/image/delete.png" data-item="{{item}}" catchtap="handleDeleteFile" />
     </navigator>
     <!-- 文件 -->
-    <navigator url="#" class="item file" wx:for="{{files.files}}" wx:key="attachmentid" data-item='{{item}}' bindtap="viewFlies">
+    <navigator url="#" class="item file" wx:for="{{files.files}}" wx:key="attachmentid" data-item='{{item}}' catchtap="viewFlies">
         <image class="image" src="{{item.cover}}" mode="heightFix" />
         <view class="name">
             {{item.document}}