xiaohaizhao 2 месяцев назад
Родитель
Сommit
392d8d91ff

+ 94 - 1
E-service/serviceImprovement/detail.js

@@ -2,7 +2,6 @@ const _Http = getApp().globalData.http;
 
 Page({
   data: {
-    tabsList: [],
     tabsActive: 0,
     tabColorS: {
       有效: {
@@ -14,6 +13,21 @@ Page({
         color: "#ED4949"
       },
     },
+    tabsList: [{
+      label: "真因分析"
+    }, {
+      label: "改善方案"
+    }, {
+      label: "方案执行"
+    }, {
+      label: "影响产品范围",
+      model: "#Product"
+    }, {
+      label: "改善单信息"
+    }, {
+      label: "关联改善单",
+      model: "#Improvement"
+    }],
   },
   onLoad(options) {
     this.setData({
@@ -38,9 +52,88 @@ Page({
         detail: res.data
       })
       this.setTabbar()
+      this.setPreview(res)
       this.partialRenewal();
     })
   },
+  setPreview(res) {
+    /* 基本信息 */
+    let list1 = [{
+      label: "改善单号",
+      value: res.data.billno
+    }, {
+      label: "改善类别",
+      value: res.data.type
+    }, {
+      label: "状态",
+      value: getApp().globalData.Language.getMapText(res.data.status),
+      style: `color:${this.data.sColors[res.data.status]}`
+    }, {
+      label: "工单号",
+      value: res.data.billno_workorder
+    }, {
+      label: "申请单号",
+      value: res.data.billno_serviceorder
+    }, {
+      label: "客诉大类",
+      value: res.data.class2
+    }, {
+      label: "分析负责人",
+      value: res.data.name_analysis
+    }, {
+      label: "责任部门",
+      value: res.data.depname_charge
+    }, {
+      label: "方案发布人",
+      value: res.data.sendby, // 使用 sendby 字段
+    }, {
+      label: "改善计划周期",
+      value: res.data.planned_cycle // 使用 planned_cycle 字段
+    }, {
+      label: "改善实际周期",
+      value: res.data.actual_cycle // 使用 actual_cycle 字段
+    }, {
+      label: "改善方案进度",
+      value: res.data.progress * 100 + '%'
+    }, {
+      label: "改善结果",
+      value: res.data.result,
+      style: `color:${this.data.sColors[res.data.result]}`
+    }, {
+      label: "备注",
+      value: res.data.remarks
+    }];
+    /* 系统信息 */
+    let list2 = [{
+      label: "创建时间",
+      value: res.data.createdate
+    }, {
+      label: "最近编辑人",
+      value: res.data.changeby
+    }, {
+      label: "最近编辑时间",
+      value: res.data.changedate
+    }, {
+      label: "提交分析时间",
+      value: res.data.submitdate // 使用 submitdate 字段
+    }, {
+      label: "发布方案时间",
+      value: res.data.senddate // 使用 senddate 字段
+    }, {
+      label: "完成时间",
+      value: res.data.finishdate // 使用 finishdate 字段
+    }, {
+      label: "中止原因",
+      value: res.data.abortreason // 使用 abortreason 字段
+    }, {
+      label: "中止时间",
+      value: res.data.abortdate // 使用 abortdate 字段
+    }];
+    this.setData({
+      list1,
+      list2,
+    });
+  },
   onCancel() {
     this.setData({
       abortreasonShow: false,

+ 5 - 1
E-service/serviceImprovement/detail.json

@@ -1,3 +1,7 @@
 {
-  "usingComponents": {}
+  "usingComponents": {
+    "Preview": "../components/preview/index",
+    "Improvement": "./improvement/index",
+    "Product": "./product/index"
+  }
 }

+ 3 - 3
E-service/serviceImprovement/detail.wxml

@@ -41,9 +41,9 @@
 </view>
 <view style="height: 20rpx;" />
 <Yl_FunTabs list='{{tabsList}}' showIcon='{{false}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
-	<Product slot='服务商品' id="Product" sa_orderid='{{detail.sa_orderid}}' disabled='{{detail.status!="新建"}}' />
-	<Preview slot='申请信息' list1='{{list1}}' list2='{{list2}}' />
-	<Preview slot='受理信息' title="确认信息" list1='{{list3}}' list2='{{list4}}' />
+	<Preview slot='改善单信息' list1='{{list1}}' list2='{{list2}}' />
+	<Improvement id="Improvement" slot='关联改善单' />
+	<Product id="Product" slot='影响产品范围' />
 	<view style="height: 180rpx;" />
 </Yl_FunTabs>
 

+ 100 - 0
E-service/serviceImprovement/improvement/index.js

@@ -0,0 +1,100 @@
+const _Http = getApp().globalData.http;
+
+Component({
+  properties: {
+  },
+  options: {
+    addGlobalClass: true
+  },
+  lifetimes: {
+    attached: function () {
+      getApp().globalData.Language.getLanguagePackage(this)
+    }
+  },
+  data: {
+    sa_service_improvementid: 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_service_improvementid: id || this.data.sa_service_improvementid
+      };
+      if (init) {
+        content.pageNumber = 1
+        content.pageTotal = 1
+      }
+      _Http.basic({
+        "id": 2026020215314702,
+        content
+      }).then(res => {
+        console.log("关联改善单", res)
+        if (res.code != '1') return wx.showToast({
+          title: res.data,
+          icon: "none"
+        });
+        let list = res.data.map(v => {
+          try {
+            v.cover = v.attinfos.length ? _Http.getSpecifiedImage(v.attinfos[0]) : ''
+          } catch (error) {
+
+          }
+          return v
+        })
+        this.setData({
+          "content.pageNumber": res.pageNumber + 1,
+          "content.pageTotal": res.pageTotal,
+          "content.total": res.total,
+          list: res.pageNumber == 1 ? list : this.data.list.concat(list),
+          sa_service_improvementid: content.sa_service_improvementid
+        })
+      })
+    },
+    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)
+    },
+  }
+})

+ 4 - 0
E-service/serviceImprovement/improvement/index.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 95 - 0
E-service/serviceImprovement/improvement/index.scss

@@ -0,0 +1,95 @@
+.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;
+}
+
+.item {
+	width: 690rpx;
+	background: #FFFFFF;
+	border-radius: 8rpx;
+	padding: 20rpx;
+	box-sizing: border-box;
+	margin: 20rpx auto 0;
+
+	.head1 {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		width: 100%;
+		padding-bottom: 18rpx;
+		border-bottom: 1px solid #DDDDDD;
+
+		.tabs {
+			display: flex;
+
+			.tab {
+				font-family: PingFang SC, PingFang SC;
+				font-size: 24rpx;
+				padding: 0 12rpx;
+				line-height: 40rpx;
+				border-radius: 20rpx;
+				margin-right: 20rpx;
+				background-color: #E1EAFE;
+				color: #3874F6
+			}
+		}
+
+		.status {
+			font-family: PingFang SC, PingFang SC;
+			font-size: 28rpx;
+			color: #3874F6;
+		}
+	}
+
+	.address {
+		line-height: 40rpx;
+		font-family: PingFang SC, PingFang SC;
+		font-size: 28rpx;
+		color: #333333;
+		margin-top: 8rpx;
+	}
+
+	.row {
+		line-height: 34rpx;
+		font-family: PingFang SC, PingFang SC;
+		font-size: 24rpx;
+		color: #999999;
+		margin-top: 8rpx;
+	}
+}

+ 31 - 0
E-service/serviceImprovement/improvement/index.wxml

@@ -0,0 +1,31 @@
+<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>
+  </view>
+</view>
+<navigator class="item" url="/E-service/serviceImprovement/detail?id={{item.sa_service_improvementid}}" wx:for="{{list}}" wx:key="sa_serviceorderid">
+  <view class="head1">
+    <view class="tabs">
+      <view class="tab" wx:if="{{item.type}}">
+        {{language[item.type]||item.type}}
+      </view>
+      <view class="tab" style="background-color: {{tabColorS[item.result].bgColor}};color:{{tabColorS[item.result].color}};">
+        {{language[item.result]||item.result}}
+      </view>
+    </view>
+    <view class="status" style="color:{{sColors[item.status]}};">{{language[item.status]||item.status}}</view>
+  </view>
+  <view class="address">{{language['改善单号']||'改善单号'}}:{{item.billno}}</view>
+  <view class="row">{{language['客诉大类']||'客诉大类'}}:{{language[item.class2]||item.class2 || '--'}}</view>
+  <view class="row">{{language['分析负责人']||'分析负责人'}}:{{item.name_analysis}}</view>
+  <view class="row">{{language['负责部门']||'负责部门'}}:{{language[item.depname_charge]||item.depname_charge||'--'}}</view>
+  <view class="row">{{language['改善计划周期']||'改善计划周期'}}:{{item.planned_days}}{{language['天']||'天'}}</view>
+  <view class="row">{{language['改善方案进度']||'改善方案进度'}}:{{item.progress}}%</view>
+</navigator>
+<Yl_Empty wx:if="{{list.length==0}}" />

+ 192 - 0
E-service/serviceImprovement/product/index.js

@@ -0,0 +1,192 @@
+const _Http = getApp().globalData.http;
+
+Component({
+  properties: {
+    disabled: {
+      type: Boolean,
+      value: false
+    }
+  },
+  options: {
+    addGlobalClass: true
+  },
+  lifetimes: {
+    attached: function () {
+      getApp().globalData.Language.getLanguagePackage(this)
+      this.setData({
+        siteid: wx.getStorageSync('userMsg').siteid
+      })
+    }
+  },
+  data: {
+    sa_service_improvementid: 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_service_improvementid: id || this.data.sa_service_improvementid
+      };
+      if (init) {
+        content.pageNumber = 1
+        content.pageTotal = 1
+      }
+      _Http.basic({
+        "id": 2026020214313702,
+        content
+      }).then(res => {
+        console.log("影响产品产品", res)
+        if (res.code != '1') return wx.showToast({
+          title: res.data,
+          icon: "none"
+        });
+        let list = res.data.map(v => {
+          try {
+            v.cover = v.attinfos.length ? _Http.getSpecifiedImage(v.attinfos[0]) : ''
+          } catch (error) {
+
+          }
+          return v
+        })
+        this.setData({
+          "content.pageNumber": res.pageNumber + 1,
+          "content.pageTotal": res.pageTotal,
+          "content.total": res.total,
+          list: res.pageNumber == 1 ? list : this.data.list.concat(list),
+          sa_service_improvementid: content.sa_service_improvementid
+        })
+      })
+    },
+    /* 去添加产品 */
+    addProduct() {
+      wx.navigateTo({
+        url: `/E-service/serviceBillList/product/select?params=${JSON.stringify({
+          "id":"2026020214323802",
+          "version":1,
+          "content":{
+            "pageSize":20,
+            "pageNumber":1,
+            "sa_service_improvementid":this.data.sa_service_improvementid,
+            "where":{"condition":""}
+          }})}`
+      });
+      getApp().globalData.handleSelect = this.handleSelect.bind(this)
+    },
+    /* 处理新增产品 */
+    handleSelect(detail) {
+      console.log(detail)
+      let that = this;
+      wx.showModal({
+        cancelText: getApp().globalData.Language.getMapText('取消'),
+        confirmText: getApp().globalData.Language.getMapText('确定'),
+        title: getApp().globalData.Language.getMapText('提示'),
+        content: getApp().globalData.Language.joint([{
+          v: '是否确认添加',
+          t: 1
+        }, {
+          v: detail.result.length,
+          t: 1,
+          r: ' ',
+          f: " "
+        }, {
+          v: '件商品',
+          t: 1,
+          r: '?',
+        }]),
+        complete: (res) => {
+          if (res.confirm) _Http.basic({
+            "id": "2026020214301002",
+            "version": 1,
+            "content": {
+              sa_service_improvementid: this.data.sa_service_improvementid,
+              "itemids": detail.list.map(v => v.itemid)
+            },
+          }).then(s => {
+            console.log('新增产品', s)
+            wx.showToast({
+              title: s.code == '1' ? getApp().globalData.Language.getMapText('添加成功') : s.msg,
+              icon: "none"
+            });
+            if (s.code == '1') setTimeout(() => {
+              that.getList('', true);
+              wx.navigateBack();
+            }, 300)
+          })
+        }
+      });
+    },
+    deleteItem(e) {
+      const {
+        item
+      } = e.currentTarget.dataset,
+        that = this;
+      wx.showModal({
+        content: getApp().globalData.Language.getMapText(`是否确定删除该产品`),
+        complete: ({
+          confirm
+        }) => {
+          if (confirm) _Http.basic({
+            "id": "2026020214312002",
+            "content": {
+              "sa_service_improvement_itemsid": item.sa_service_improvement_itemsid
+            },
+          }).then(res => {
+            wx.showToast({
+              title: res.code == 1 ? getApp().globalData.Language.getMapText(`删除成功`) : res.msg,
+              icon: "none"
+            })
+            if (res.code == 1) {
+              that.getList('', true)
+            }
+          })
+        }
+      })
+    },
+    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)
+    },
+  }
+})

+ 4 - 0
E-service/serviceImprovement/product/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 168 - 0
E-service/serviceImprovement/product/index.scss

@@ -0,0 +1,168 @@
+.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 {
+						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;
+			}
+		}
+	}
+}

+ 56 - 0
E-service/serviceImprovement/product/index.wxml

@@ -0,0 +1,56 @@
+<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="addProduct">
+      <van-icon name="plus" />
+    </navigator>
+  </view>
+</view>
+
+<view class="product-item" wx:for="{{list}}" wx:key="itemid">
+  <view class="product global-card">
+    <view class="mian">
+      <view class="img" data-file="{{item.attinfos}}" catchtap="viewImage">
+        <van-image width="100%" height="100%" wx:if="{{item.cover}}" src="{{item.cover}}" use-loading-slot lazy-load>
+          <van-loading slot="loading" type="spinner" size="20" vertical />
+        </van-image>
+        <text wx:else class="err">{{language['暂无图片']||'暂无图片'}}</text>
+      </view>
+      <view class="dec">
+        <view class="title">
+          <text class="line-1">{{item.itemname}}</text>
+        </view>
+        <view class="subfield">
+          {{language['编号']||'编号'}}:{{item.itemno||' --'}}
+        </view>
+        <view class="subfield">
+          {{language['型号']||'型号'}}:{{language[item.model]||item.model||' --'}}
+        </view>
+        <view class="subfield">
+          {{language['规格']||'规格'}}:{{language[item.spec]||item.spec||' --'}}
+        </view>
+        <block wx:if="{{siteid=='HY'}}">
+          <view class="subfield">
+            {{language['公称通径']||'公称通径'}}:{{item.caliber||' --'}}
+          </view>
+          <view class="subfield">
+            {{language['公称压力']||'公称压力'}}:{{item.nominalpressure}}
+          </view>
+        </block>
+        <view class="subfield">
+          {{language['供应方']||'供应方'}}:{{item.spec}}
+        </view>
+      </view>
+      <navigator wx:if="{{!disabled}}" url="#" class="iconfont-box" data-item="{{item}}" bind:tap="deleteItem">
+        <view class="iconfont icon-guanlian-shanchu" />
+      </navigator>
+    </view>
+  </view>
+</view>
+<Yl_Empty wx:if="{{list.length==0}}" />

+ 9 - 2
project.private.config.json

@@ -24,12 +24,19 @@
   "condition": {
     "miniprogram": {
       "list": [
+        {
+          "name": "改善单详情",
+          "pathName": "E-service/serviceImprovement/detail",
+          "query": "id=3",
+          "scene": null,
+          "launchMode": "default"
+        },
         {
           "name": "E-service/workOrder/detail",
           "pathName": "E-service/workOrder/detail",
           "query": "id=1386",
-          "scene": null,
-          "launchMode": "default"
+          "launchMode": "default",
+          "scene": null
         },
         {
           "name": "老工单详情",