yusheng пре 2 месеци
родитељ
комит
f4e4abfc0a
2 измењених фајлова са 1382 додато и 1183 уклоњено
  1. 547 449
      pages/qms/inspectionWork/list.vue
  2. 835 734
      pages/qms/inspectionWork/sampleList.vue

+ 547 - 449
pages/qms/inspectionWork/list.vue

@@ -1,457 +1,555 @@
 <template>
-	<view class="mainBox">
-		<uni-nav-bar v-if="way != 'todo' && way != 'done'" fixed="true" statusBar="true" left-icon="back"
-			:title="pageName=='myList'?'我的质检工单':pageName=='myInspectionProjectTask'?'我的质检任务单':pageName=='myInspectionProjectEntrusted'?'我的质检受托单':'质检工单'"
-			@clickLeft="back">
-		</uni-nav-bar>
-
-		<view class="top-wrapper">
-
-			<uni-section>
-				<uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="keyWord" placeholder="名称、批次号、工单编码">
-				</uni-easyinput>
-			</uni-section>
-			<button class="search_btn" @click="doSearch">搜索</button>
-		</view>
-		<div style="height:100rpx;width: 475rpx;"></div>
-		<view class="wrapper">
-
-
-			<u-list @scrolltolower="scrolltolower" class="listContent">
-
-
-				<view v-for="(item, index) in tableList" :key="index+item.id" style="position: relative;">
-					<view class="item">
-						<view class="herder_item">
-							<view class="herder_text"></view>
-							<view class="herder_view">
-								{{ getDictValue('质检计划类型', item.qualityType+'')}}/{{item.code}}/{{item.productCode}}/{{item.productName}}
-								<text v-if="!pageName||pageName=='myList'">
-									({{item.isPendingSample == 1?'待收样':statusList.find(row=>row.value==item.status).label}})
-								</text>
-								<text v-else>
-									({{statusList1.find(row=>row.value==item.status).label}})
-								</text>
-								<text>
-									({{item.recordingMethod==1?'按质检项检':"按样品检"}})
-								</text>
-								<text v-if="item.productLineName">
-									{{item.productLineName}}
-								</text>
-								
-							</view>
-						</view>
-						<view class="text">检验项目:</view>
-						<view class="item_value" v-if="item.recordingMethod==1">
-							<view @click="goTo(item.id,row.id,item.sampleMeasureUnit,item,row)"
-								v-for="(row,_index) in item.templateList" :key="item.inspectionName+index+'_'+_index"
-								:style="{background:row.status==1?'#19be6b':row.status==2?'#ff9900':row.status==3?'#ff9900':'#909399'}">
-								{{row.inspectionName}}
-							</view>
-						</view>
-						<view class="item_value" v-else>
-							<view @click="goTo(item.id,row.id,item.sampleMeasureUnit,item,row)"
-								v-for="(row,_index) in item.qualitySampleList" :key="item.sampleCode+index+'_'+_index"
-								:style="{background:row.status==1?'#19be6b':row.status==2?'#ff9900':row.status==3?'#ff9900':'#909399'}">
-								{{row.sampleCode}}
-							</view>
-						</view>
-						<view class="text btnlist" v-if="![1, 2].includes(item.status)">
-
-							操作:
-							<view style="display: flex;">
-								<u-button v-if="item.isPendingSample == 1&&(pageName=='myList'||!pageName)" type="primary" text="收样"
-									@click="sampleCollection(item)"></u-button>
-								<u-button style="margin-left: 5px;" v-if="item.sampleQuantity < item.total &&item.isPendingSample != 1&&(pageName=='myList'||!pageName)"
-									type="primary" text="请样" @click="addSampleOpen(item)"></u-button>
-								<u-button style="margin-left: 5px;" v-if="item.recordingMethod != 1" type="primary" text="批量质检"
-									@click="goTo(item.id,'',item.sampleMeasureUnit,item,{})">
-
-								</u-button>
-							</view>
-
-						</view>
-					</view>
-				</view>
-				<view style="width:100%;height:40rpx"></view>
-				<view style='margin-top: 20vh;' v-if="tableList.length==0">
-					<u-empty iconSize='150' textSize='32' text='暂无数据'>
-					</u-empty>
-				</view>
-			</u-list>
-
-		</view>
-
-
-
-
-		<u-toast ref="uToast"></u-toast>
-		<addSample ref='addSampleRef' @reload="doSearch"></addSample>
-
-	</view>
+  <view class="mainBox">
+    <uni-nav-bar
+      v-if="way != 'todo' && way != 'done'"
+      fixed="true"
+      statusBar="true"
+      left-icon="back"
+      :title="
+        pageName == 'myList'
+          ? '我的质检工单'
+          : pageName == 'myInspectionProjectTask'
+            ? '我的质检任务单'
+            : pageName == 'myInspectionProjectEntrusted'
+              ? '我的质检受托单'
+              : '质检工单'
+      "
+      @clickLeft="back"
+    >
+    </uni-nav-bar>
+
+    <view class="top-wrapper">
+      <uni-section>
+        <uni-easyinput
+          prefixIcon="search"
+          style="width: 460rpx"
+          v-model="keyWord"
+          placeholder="名称、批次号、工单编码"
+        >
+        </uni-easyinput>
+      </uni-section>
+      <button class="search_btn" @click="doSearch">搜索</button>
+    </view>
+    <div style="height: 100rpx; width: 475rpx"></div>
+    <view class="wrapper">
+      <u-list @scrolltolower="scrolltolower" class="listContent">
+        <view
+          v-for="(item, index) in tableList"
+          :key="index + item.id"
+          style="position: relative"
+        >
+          <view class="item">
+            <view class="herder_item">
+              <view class="herder_text"></view>
+              <view class="herder_view">
+                {{ getDictValue("质检计划类型", item.qualityType + "") }}/{{
+                  item.code
+                }}/{{ item.productCode }}/{{ item.productName }}
+                <text v-if="!pageName || pageName == 'myList'">
+                  ({{
+                    item.isPendingSample == 1
+                      ? "待收样"
+                      : statusList.find((row) => row.value == item.status)
+                          .label
+                  }})
+                </text>
+                <text v-else>
+                  ({{
+                    statusList1.find((row) => row.value == item.status).label
+                  }})
+                </text>
+                <text>
+                  ({{ item.recordingMethod == 1 ? "按质检项检" : "按样品检" }})
+                </text>
+                <text v-if="item.productLineName">
+                  {{ item.productLineName }}
+                </text>
+              </view>
+            </view>
+            <view class="text">检验项目:</view>
+            <view class="item_value" v-if="item.recordingMethod == 1">
+              <view
+                @click="
+                  goTo(item.id, row.id, item.sampleMeasureUnit, item, row)
+                "
+                v-for="(row, _index) in item.templateList"
+                :key="item.inspectionName + index + '_' + _index"
+                :style="{
+                  background:
+                    row.status == 1
+                      ? '#19be6b'
+                      : row.status == 2
+                        ? '#ff9900'
+                        : row.status == 3
+                          ? '#ff9900'
+                          : '#909399',
+                }"
+              >
+                {{ row.inspectionName }}
+              </view>
+            </view>
+            <view class="item_value" v-else>
+              <view
+                @click="
+                  goTo(item.id, row.id, item.sampleMeasureUnit, item, row)
+                "
+                v-for="(row, _index) in item.qualitySampleList"
+                :key="item.sampleCode + index + '_' + _index"
+                :style="{
+                  background:
+                    row.status == 1
+                      ? '#19be6b'
+                      : row.status == 2
+                        ? '#ff9900'
+                        : row.status == 3
+                          ? '#ff9900'
+                          : '#909399',
+                }"
+              >
+                {{ row.sampleCode }}
+              </view>
+            </view>
+            <view
+              class="text btnlist"
+              v-if="
+                ![1, 2].includes(item.status) &&
+                (pageName == 'myList' || !pageName)
+              "
+            >
+              操作:
+              <view style="display: flex">
+                <u-button
+                  v-if="item.isPendingSample == 1"
+                  type="primary"
+                  text="收样"
+                  @click="sampleCollection(item)"
+                ></u-button>
+                <u-button
+                  style="margin-left: 5px"
+                  v-if="
+                    item.sampleQuantity < item.total &&
+                    item.isPendingSample != 1 &&
+                    (pageName == 'myList' || !pageName)
+                  "
+                  type="primary"
+                  text="请样"
+                  @click="addSampleOpen(item)"
+                ></u-button>
+                <u-button
+                  style="margin-left: 5px"
+                  v-if="item.recordingMethod != 1"
+                  type="primary"
+                  text="批量质检"
+                  @click="goTo(item.id, '', item.sampleMeasureUnit, item, {})"
+                >
+                </u-button>
+              </view>
+            </view>
+           
+            <!-- <view
+              class="text btnlist"
+              v-if="
+                ![2].includes(item.status) && pageName && pageName != 'myList'
+              "
+            >
+              操作:
+              <view style="display: flex">
+                <u-button
+                  style="margin-left: 5px"
+                  v-if="item.recordingMethod != 1"
+                  type="primary"
+                  text="批量质检"
+                  @click="goTo(item.id, '', item.sampleMeasureUnit, item, {})"
+                >
+                </u-button>
+              </view>
+            </view> -->
+          </view>
+        </view>
+        <view style="width: 100%; height: 40rpx"></view>
+        <view style="margin-top: 20vh" v-if="tableList.length == 0">
+          <u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
+        </view>
+      </u-list>
+    </view>
+
+    <u-toast ref="uToast"></u-toast>
+    <addSample ref="addSampleRef" @reload="doSearch"></addSample>
+  </view>
 </template>
 
 <script>
-	import dictMixns from '@/mixins/dictMixins'
-	import addSample from './addSample.vue'
-	import {
-		getList,
-		getRequestentrustList,
-		sampleCollection,
-		getTaskmonadList,
-		verificationQualityInspector,
-		checkByQualityWorkOrderId
-	} from '@/api/inspectionWork/index.js'
-	export default {
-		components: {
-			addSample
-		},
-		mixins: [dictMixns],
-		props: {
-			pageName: {
-				default: ""
-			},
-			way: {
-				default: 'route'
-			},
-			produceFilter: {
-				type: Object,
-				default: () => ({})
-			}
-		},
-		data() {
-			return {
-
-				statusList: [{
-						value: 0,
-						label: '未报工'
-					},
-					{
-						value: 1,
-						label: '已报工'
-					},
-					{
-						value: 2,
-						label: '已关闭'
-					},
-					{
-						value: 3,
-						label: '待请样'
-					}
-				],
-				statusList1: [{
-						value: 1,
-						label: '未报工'
-					},
-					{
-						value: 2,
-						label: '已报工'
-					}
-				],
-				tableList: [],
-				page: 1,
-				size: 10,
-				isEnd: false,
-				keyWord: '',
-				userInfo: {}
-
-			}
-		},
-		computed: {
-
-		},
-		created() {
-			this.requestDict('质检计划类型')
-
-		},
-		onLoad() {
-
-		},
-
-		methods: {
-			buildQueryData(baseData = {}) {
-				const data = {
-					...baseData
-				}
-				if (this.produceFilter && this.produceFilter.produceSourceTaskId) {
-					data.produceSourceTaskId = this.produceFilter.produceSourceTaskId
-				}
-				if (this.produceFilter && this.produceFilter.workOrderCode) {
-					data.workOrderCodeList = [this.produceFilter.workOrderCode]
-				}
-				return data
-			},
-			successInit() {
-				uni.showLoading({
-					title: '加载中'
-				})
-
-				let data = this.buildQueryData({
-					pageNum: 1,
-					size: this.tableList.length,
-					keyWord: this.keyWord,
-					// recordingMethod: 1,
-				})
-				if (this.pageName) {
-					data.currentLoginUserId = this.userInfo.userId
-				}
-				if (this.pageName == 'myInspectionProjectEntrusted') {
-					data.approvalStatus = 2
-				}
-				if (this.way == 'todo') {
-					data.status = 0
-				}
-				if (this.way == 'done') {
-					data.status = 1
-				}
-				let api = this.pageName == 'myInspectionProjectTask' ? getTaskmonadList : this.pageName ==
-					'myInspectionProjectEntrusted' ? getRequestentrustList : getList
-				api(data).then(res => {
-					this.tableList = res.list
-				}).then(() => {
-					uni.hideLoading()
-				})
-
-			},
-			doSearch() {
-				this.isEnd = false
-				this.page = 1
-				this.getList()
-			},
-			//获取列表信息
-			getList() {
-				this.userInfo = uni.getStorageSync('userInfo')
-				if (this.isEnd || !this.userInfo.userId) {
-					return
-				}
-				uni.showLoading({
-					title: '加载中'
-				})
-
-				let data = this.buildQueryData({
-					pageNum: this.page,
-					size: this.size,
-					keyWord: this.keyWord,
-					// recordingMethod: 1,
-
-				})
-				if (this.pageName) {
-					data.currentLoginUserId = this.userInfo.userId
-				}
-				if (this.pageName == 'myInspectionProjectEntrusted') {
-					data.approvalStatus = 2
-				}
-				if (this.way == 'todo') {
-					data.status = 0
-				}
-				if (this.way == 'done') {
-					data.status = 1
-				}
-				let api = this.pageName == 'myInspectionProjectTask' ? getTaskmonadList : this.pageName ==
-					'myInspectionProjectEntrusted' ? getRequestentrustList : getList
-
-				api(data).then(res => {
-					if (this.page === 1) {
-						this.tableList = res.list
-					} else {
-						this.tableList.push(...res.list)
-					}
-					this.page += 1
-					this.isEnd = this.tableList.length >= res.count
-				}).then(() => {
-					uni.hideLoading()
-				})
-			},
-			async sampleCollection(row) {
-				if (!this.pageName) {
-					const code = await verificationQualityInspector(row.id);
-					if (code == '-1') {
-						return;
-					}
-				}
-				sampleCollection({
-					id: row.id
-				}).then((res) => {
-					this.$refs.uToast.show({
-						type: "success",
-						icon: false,
-						message: "收样成功",
-					}, )
-					this.doSearch();
-				});
-			},
-			goTo(workId, projectId, sampleMeasureUnit, item, row) {
-				if (this.pageName == 'myList' || !this.pageName) {
-					if (item.isPendingSample == 1 && row.status != 1) {
-						this.$refs.uToast.show({
-							type: "error",
-							icon: false,
-							message: "请先完成收样!",
-						}, )
-						return
-					}
-					if (item.status == 3) {
-						this.$refs.uToast.show({
-							type: "error",
-							icon: false,
-							message: "请先完成请样!",
-						}, )
-						return
-					}
-				}
-				if (item.recordingMethod == 1) {
-					uni.navigateTo({
-						url: '/pages/qms/inspectionWork/inspectionProjectReport?workId=' + workId + '&projectId=' +
-							projectId + '&pageName=' + this.pageName + '&sampleMeasureUnit=' + sampleMeasureUnit
-					})
-				} else {
-					uni.navigateTo({
-						url: '/pages/qms/inspectionWork/sampleList?workId=' + workId + '&projectId=' +
-							projectId + '&pageName=' + this.pageName
-					})
-				}
-
-
-
-
-			},
-			async addSampleOpen(row) {
-				const code = await verificationQualityInspector(row.id);
-				if (code == '-1') {
-					return;
-				}
-				const is = await checkByQualityWorkOrderId(row.id);
-				if (is) {
-					this.$refs.uToast.show({
-						type: "error",
-						icon: false,
-						message: "此工单存在未处理完的请样记录,请检查!",
-					}, )
-					return;
-				}
-				this.$refs.addSampleRef.open('add', row);
-			},
-			scrolltolower() {
-				if (this.isEnd) {
-					return
-				}
-				this.getList();
-			},
-		}
-	}
+import dictMixns from "@/mixins/dictMixins";
+import addSample from "./addSample.vue";
+import {
+  getList,
+  getRequestentrustList,
+  sampleCollection,
+  getTaskmonadList,
+  verificationQualityInspector,
+  checkByQualityWorkOrderId,
+} from "@/api/inspectionWork/index.js";
+export default {
+  components: {
+    addSample,
+  },
+  mixins: [dictMixns],
+  props: {
+    pageName: {
+      default: "",
+    },
+    way: {
+      default: "route",
+    },
+    produceFilter: {
+      type: Object,
+      default: () => ({}),
+    },
+  },
+  data() {
+    return {
+      statusList: [
+        {
+          value: 0,
+          label: "未报工",
+        },
+        {
+          value: 1,
+          label: "已报工",
+        },
+        {
+          value: 2,
+          label: "已关闭",
+        },
+        {
+          value: 3,
+          label: "待请样",
+        },
+      ],
+      statusList1: [
+        {
+          value: 1,
+          label: "未报工",
+        },
+        {
+          value: 2,
+          label: "已报工",
+        },
+      ],
+      tableList: [],
+      page: 1,
+      size: 10,
+      isEnd: false,
+      keyWord: "",
+      userInfo: {},
+    };
+  },
+  computed: {},
+  created() {
+    this.requestDict("质检计划类型");
+  },
+  onLoad() {},
+
+  methods: {
+    buildQueryData(baseData = {}) {
+      const data = {
+        ...baseData,
+      };
+      if (this.produceFilter && this.produceFilter.produceSourceTaskId) {
+        data.produceSourceTaskId = this.produceFilter.produceSourceTaskId;
+      }
+      if (this.produceFilter && this.produceFilter.workOrderCode) {
+        data.workOrderCodeList = [this.produceFilter.workOrderCode];
+      }
+      return data;
+    },
+    successInit() {
+      uni.showLoading({
+        title: "加载中",
+      });
+
+      let data = this.buildQueryData({
+        pageNum: 1,
+        size: this.tableList.length,
+        keyWord: this.keyWord,
+        // recordingMethod: 1,
+      });
+      if (this.pageName) {
+        data.currentLoginUserId = this.userInfo.userId;
+      }
+      if (this.pageName == "myInspectionProjectEntrusted") {
+        data.approvalStatus = 2;
+      }
+      if (this.way == "todo") {
+        data.status = 0;
+      }
+      if (this.way == "done") {
+        data.status = 1;
+      }
+      let api =
+        this.pageName == "myInspectionProjectTask"
+          ? getTaskmonadList
+          : this.pageName == "myInspectionProjectEntrusted"
+            ? getRequestentrustList
+            : getList;
+      api(data)
+        .then((res) => {
+          this.tableList = res.list;
+        })
+        .then(() => {
+          uni.hideLoading();
+        });
+    },
+    doSearch() {
+      this.isEnd = false;
+      this.page = 1;
+      this.getList();
+    },
+    //获取列表信息
+    getList() {
+      this.userInfo = uni.getStorageSync("userInfo");
+      if (this.isEnd || !this.userInfo.userId) {
+        return;
+      }
+      uni.showLoading({
+        title: "加载中",
+      });
+
+      let data = this.buildQueryData({
+        pageNum: this.page,
+        size: this.size,
+        keyWord: this.keyWord,
+        // recordingMethod: 1,
+      });
+      if (this.pageName) {
+        data.currentLoginUserId = this.userInfo.userId;
+      }
+      if (this.pageName == "myInspectionProjectEntrusted") {
+        data.approvalStatus = 2;
+      }
+      if (this.way == "todo") {
+        data.status = 0;
+      }
+      if (this.way == "done") {
+        data.status = 1;
+      }
+      let api =
+        this.pageName == "myInspectionProjectTask"
+          ? getTaskmonadList
+          : this.pageName == "myInspectionProjectEntrusted"
+            ? getRequestentrustList
+            : getList;
+
+      api(data)
+        .then((res) => {
+          if (this.page === 1) {
+            this.tableList = res.list;
+          } else {
+            this.tableList.push(...res.list);
+          }
+          this.page += 1;
+          this.isEnd = this.tableList.length >= res.count;
+        })
+        .then(() => {
+          uni.hideLoading();
+        });
+    },
+    async sampleCollection(row) {
+      if (!this.pageName) {
+        const code = await verificationQualityInspector(row.id);
+        if (code == "-1") {
+          return;
+        }
+      }
+      sampleCollection({
+        id: row.id,
+      }).then((res) => {
+        this.$refs.uToast.show({
+          type: "success",
+          icon: false,
+          message: "收样成功",
+        });
+        this.doSearch();
+      });
+    },
+    goTo(workId, projectId, sampleMeasureUnit, item, row) {
+      if (this.pageName == "myList" || !this.pageName) {
+        if (item.isPendingSample == 1 && row.status != 1) {
+          this.$refs.uToast.show({
+            type: "error",
+            icon: false,
+            message: "请先完成收样!",
+          });
+          return;
+        }
+        if (item.status == 3) {
+          this.$refs.uToast.show({
+            type: "error",
+            icon: false,
+            message: "请先完成请样!",
+          });
+          return;
+        }
+      }
+      if (item.recordingMethod == 1) {
+        uni.navigateTo({
+          url:
+            "/pages/qms/inspectionWork/inspectionProjectReport?workId=" +
+            workId +
+            "&projectId=" +
+            projectId +
+            "&pageName=" +
+            this.pageName +
+            "&sampleMeasureUnit=" +
+            sampleMeasureUnit,
+        });
+      } else {
+        uni.navigateTo({
+          url:
+            "/pages/qms/inspectionWork/sampleList?workId=" +
+            workId +
+            "&projectId=" +
+            projectId +
+            "&pageName=" +
+            this.pageName,
+        });
+      }
+    },
+    async addSampleOpen(row) {
+      const code = await verificationQualityInspector(row.id);
+      if (code == "-1") {
+        return;
+      }
+      const is = await checkByQualityWorkOrderId(row.id);
+      if (is) {
+        this.$refs.uToast.show({
+          type: "error",
+          icon: false,
+          message: "此工单存在未处理完的请样记录,请检查!",
+        });
+        return;
+      }
+      this.$refs.addSampleRef.open("add", row);
+    },
+    scrolltolower() {
+      if (this.isEnd) {
+        return;
+      }
+      this.getList();
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-	.mainBox {
-		background-color: #f3f8fb
-	}
-
-	// .wrapper{
-
-	// }
-	.top-wrapper {
-		background-color: #fff;
-		display: flex;
-		width: 750rpx;
-		height: 88rpx;
-		padding: 16rpx 32rpx;
-		align-items: center;
-		// gap: 16rpx;
-		position: absolute;
-		z-index: 999;
-		// top: 44px;
-		// // #ifdef APP-PLUS
-		// top: 140rpx;
-
-		// // #endif
-		/deep/.uni-section {
-			margin-top: 0px;
-		}
-
-		/deep/.uni-section-header {
-			padding: 0px;
-
-		}
-
-		.search_btn {
-			width: 120rpx;
-			height: 70rpx;
-			line-height: 70rpx;
-			padding: 0 24rpx;
-			background: $theme-color;
-			font-size: 32rpx;
-			color: #fff;
-			margin: 0;
-			margin-left: 26rpx;
-		}
-
-		.menu_icon {
-			width: 44rpx;
-			height: 44rpx;
-			margin-left: 14rpx;
-		}
-	}
-
-	.item {
-		width: 720rpx;
-		// height:400rpx;
-		margin: 20rpx auto 0;
-		padding: 26rpx;
-		border-radius: 30rpx;
-
-		.text {
-			margin-top: 20rpx;
-		}
-
-		background: #fff;
-	}
-
-	.item_value {
-		width: 100%;
-		display: flex;
-		flex-wrap: wrap;
-		margin-left: -10rpx;
-
-		>view {
-			font-size: 24rpx;
-			color: #fff;
-			padding: 12rpx;
-			border-radius: 10rpx;
-			background: #979797;
-			margin-left: 10rpx;
-			margin-top: 20rpx;
-		}
-	}
-
-	.herder_item {
-		display: flex;
-		// align-items: center;
-		font-size: 28rpx;
-		font-weight: bold;
-
-		.herder_view {
-			width: calc(100% - 20rpx);
-			word-break: break-all;
-
-		}
-
-		.herder_text {
-			min-width: 10rpx;
-			height: 32rpx;
-			border-radius: 10rpx;
-			background: #00c0a1;
-			margin-right: 12rpx;
-			margin-top: 5rpx;
-		}
-	}
-
-	.btnlist {
-		display: flex;
-		align-items: center;
-	}
-
-	/deep/.u-button {
-		height: 60rpx;
-		width: auto;
-	}
+.mainBox {
+  background-color: #f3f8fb;
+}
+
+// .wrapper{
+
+// }
+.top-wrapper {
+  background-color: #fff;
+  display: flex;
+  width: 750rpx;
+  height: 88rpx;
+  padding: 16rpx 32rpx;
+  align-items: center;
+  // gap: 16rpx;
+  position: absolute;
+  z-index: 999;
+  // top: 44px;
+  // // #ifdef APP-PLUS
+  // top: 140rpx;
+
+  // // #endif
+  /deep/.uni-section {
+    margin-top: 0px;
+  }
+
+  /deep/.uni-section-header {
+    padding: 0px;
+  }
+
+  .search_btn {
+    width: 120rpx;
+    height: 70rpx;
+    line-height: 70rpx;
+    padding: 0 24rpx;
+    background: $theme-color;
+    font-size: 32rpx;
+    color: #fff;
+    margin: 0;
+    margin-left: 26rpx;
+  }
+
+  .menu_icon {
+    width: 44rpx;
+    height: 44rpx;
+    margin-left: 14rpx;
+  }
+}
+
+.item {
+  width: 720rpx;
+  // height:400rpx;
+  margin: 20rpx auto 0;
+  padding: 26rpx;
+  border-radius: 30rpx;
+
+  .text {
+    margin-top: 20rpx;
+  }
+
+  background: #fff;
+}
+
+.item_value {
+  width: 100%;
+  display: flex;
+  flex-wrap: wrap;
+  margin-left: -10rpx;
+
+  > view {
+    font-size: 24rpx;
+    color: #fff;
+    padding: 12rpx;
+    border-radius: 10rpx;
+    background: #979797;
+    margin-left: 10rpx;
+    margin-top: 20rpx;
+  }
+}
+
+.herder_item {
+  display: flex;
+  // align-items: center;
+  font-size: 28rpx;
+  font-weight: bold;
+
+  .herder_view {
+    width: calc(100% - 20rpx);
+    word-break: break-all;
+  }
+
+  .herder_text {
+    min-width: 10rpx;
+    height: 32rpx;
+    border-radius: 10rpx;
+    background: #00c0a1;
+    margin-right: 12rpx;
+    margin-top: 5rpx;
+  }
+}
+
+.btnlist {
+  display: flex;
+  align-items: center;
+}
+
+/deep/.u-button {
+  height: 60rpx;
+  width: auto;
+}
 </style>

+ 835 - 734
pages/qms/inspectionWork/sampleList.vue

@@ -1,62 +1,89 @@
 <!-- 样品列表页面 -->
 <template>
-	<view class="mainBox">
-		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" @clickLeft="handleClose">
-		</uni-nav-bar>
-
-		<!-- <view class="nav-placeholder"></view> -->
-
-		<view class="wrapper">
-			<scroll-view class="scroll-wrapper" scroll-y>
-				<view class="sample-list">
-					<view class="sample-item" v-for="(sample, sampleIndex) in projectId
+  <view class="mainBox">
+    <uni-nav-bar
+      fixed="true"
+      statusBar="true"
+      left-icon="back"
+      :title="title"
+      @clickLeft="handleClose"
+    >
+    </uni-nav-bar>
+
+    <!-- <view class="nav-placeholder"></view> -->
+
+    <view class="wrapper">
+      <scroll-view class="scroll-wrapper" scroll-y>
+        <view class="sample-list">
+          <view
+            class="sample-item"
+            v-for="(sample, sampleIndex) in projectId
               ? tableData.filter((item) => item.id == projectId)
-              : tableData" :key="sampleIndex">
-						<view class="sample-header" @click="toggleExpand(sampleIndex)">
-							<view class="sample-info">
-								<view class="info-row">
-									<text class="label">编码:</text>
-									<text class="value">{{ sample.categoryCode }}</text>
-								</view>
-								<view class="info-row">
-									<text class="label">名称:</text>
-									<text class="value">{{ sample.categoryName }}</text>
-								</view>
-								<view class="info-row" v-if="sample.batchNo">
-									<text class="label">批次号:</text>
-									<text class="value">{{ sample.batchNo }}</text>
-								</view>
-								<view class="info-row" v-if="sample.packageNo">
-									<text class="label">包装编码:</text>
-									<text class="value">{{ sample.packageNo }}</text>
-								</view>
-							</view>
-							<view class="expand-arrow" :class="{ expanded: expandedItems[sampleIndex] }">›</view>
-						</view>
-
-						<view class="quality-table-wrapper" v-if="expandedItems[sampleIndex]">
-							<scroll-view class="quality-table-scroll" scroll-x>
-								<view class="quality-table">
-									<view class="table-header">
-										<view class="table-cell">质检项名称</view>
-										<view class="table-cell">质检内容</view>
-										<view class="table-cell">质检结果</view>
-										<view class="table-cell">质检方案编码</view>
-										<view class="table-cell">质检方案名称</view>
-										<view class="table-cell">质检类型</view>
-										<view class="table-cell">工艺参数</view>
-									</view>
-									<view class="table-body">
-										<view class="table-row" v-for="(
+              : tableData"
+            :key="sampleIndex"
+          >
+            <view class="sample-header" @click="toggleExpand(sampleIndex)">
+              <view class="sample-info">
+                <view class="info-row">
+                  <text class="label">编码:</text>
+                  <text class="value">{{ sample.categoryCode }}</text>
+                </view>
+                <view class="info-row">
+                  <text class="label">名称:</text>
+                  <text class="value">{{ sample.categoryName }}</text>
+                </view>
+                <view class="info-row" v-if="sample.batchNo">
+                  <text class="label">批次号:</text>
+                  <text class="value">{{ sample.batchNo }}</text>
+                </view>
+                <view class="info-row" v-if="sample.packageNo">
+                  <text class="label">包装编码:</text>
+                  <text class="value">{{ sample.packageNo }}</text>
+                </view>
+              </view>
+              <view
+                class="expand-arrow"
+                :class="{ expanded: expandedItems[sampleIndex] }"
+                >›</view
+              >
+            </view>
+
+            <view
+              class="quality-table-wrapper"
+              v-if="expandedItems[sampleIndex]"
+            >
+              <scroll-view class="quality-table-scroll" scroll-x>
+                <view class="quality-table">
+                  <view class="table-header">
+                    <view class="table-cell">质检项名称</view>
+                    <view class="table-cell">质检内容</view>
+                    <view class="table-cell">质检结果</view>
+                    <view class="table-cell">质检方案编码</view>
+                    <view class="table-cell">质检方案名称</view>
+                    <view class="table-cell">质检类型</view>
+                    <view class="table-cell">工艺参数</view>
+                  </view>
+                  <view class="table-body">
+                    <view
+                      class="table-row"
+                      v-for="(
                         quality, qualityIndex
-                      ) in sample.qualitySampleTemplateList" :key="qualityIndex">
-											<view class="table-cell">
-												<text class="cell-text"
-													:class="{ warn: quality.qualityResults === 2 }">{{ quality.inspectionName }}</text>
-											</view>
-											<view class="table-cell">
-												<u-input v-model="quality.qualityResultContent" placeholder="请输入"
-													border="none" @change="
+                      ) in sample.qualitySampleTemplateList"
+                      :key="qualityIndex"
+                    >
+                      <view class="table-cell">
+                        <text
+                          class="cell-text"
+                          :class="{ warn: quality.qualityResults === 2 }"
+                          >{{ quality.inspectionName }}</text
+                        >
+                      </view>
+                      <view class="table-cell">
+                        <u-input
+                          v-model="quality.qualityResultContent"
+                          placeholder="请输入"
+                          border="none"
+                          @change="
                             clientEnvironmentId == 10
                               ? newHandleInput(
                                   sample.qualitySampleTemplateList,
@@ -67,81 +94,111 @@
                                   quality.qualityResultContent,
                                   tableData,
                                 )
-                          " :class="{ warn: quality.qualityResults === 2 }" :disabled="
+                          "
+                          :class="{ warn: quality.qualityResults === 2 }"
+                          :disabled="
                             type === 'detail' ||
                             ((!pageName || pageName == 'myList') &&
                               sample.correlationId)
-                          ">
-													<template #suffix v-if="quality.unitName">
-														<text class="unit">{{ quality.unitName }}</text>
-													</template>
-												</u-input>
-											</view>
-											<view class="table-cell" v-if="
+                          "
+                        >
+                          <template #suffix v-if="quality.unitName">
+                            <text class="unit">{{ quality.unitName }}</text>
+                          </template>
+                        </u-input>
+                      </view>
+                      <view
+                        class="table-cell"
+                        v-if="
                           ['炉水电导率', '给水电导率'].includes(
                             quality.inspectionName,
                           )
-                        "></view>
-											<view class="table-cell" v-else>
-												<u-input disabled placeholder=" " v-if="
+                        "
+                      ></view>
+                      <view class="table-cell" v-else>
+                        <u-input
+                          disabled
+                          placeholder=" "
+                          v-if="
                             type === 'detail' ||
                             ((!pageName || pageName == 'myList') &&
                               sample.correlationId)
-                          " border="surround" :value="
+                          "
+                          border="surround"
+                          :value="
                             quality.qualityResults &&
                             qualityResultsList.find(
                               (item) => item.value == quality.qualityResults,
                             ).text
-                          ">
-												</u-input>
-												<uni-data-picker v-else v-model="quality.qualityResults"
-													placeholder="请选择" :localdata="qualityResultsList"
-													@change="qualityResultsListChange(tableData)" :clear-icon="false">
-												</uni-data-picker>
-											</view>
-											<view class="table-cell">
-												<text class="cell-text"
-													:class="{ warn: quality.qualityResults === 2 }">{{ quality.qualitySchemeTemplateCode }}</text>
-											</view>
-											<view class="table-cell">
-												<text class="cell-text"
-													:class="{ warn: quality.qualityResults === 2 }">{{ quality.qualitySchemeTemplateName }}</text>
-											</view>
-											<view class="table-cell">
-												<text class="cell-text"
-													:class="{ warn: quality.qualityResults === 2 }">{{ quality.categoryLevelClassName }}</text>
-											</view>
-											<view class="table-cell parameter-cell">
-												<text class="cell-text" :class="{ warn: quality.qualityResults === 2 }">
-													<text v-if="quality.textType == 3">
-														{{ quality.symbol }}
-														{{ quality.minValue }}-{{ quality.maxValue }}
-													</text>
-													<text v-else-if="quality.textType == 8">
-														标准值:{{ quality.defaultValue
+                          "
+                        >
+                        </u-input>
+                        <uni-data-picker
+                          v-else
+                          v-model="quality.qualityResults"
+                          placeholder="请选择"
+                          :localdata="qualityResultsList"
+                          @change="qualityResultsListChange(tableData)"
+                          :clear-icon="false"
+                        >
+                        </uni-data-picker>
+                      </view>
+                      <view class="table-cell">
+                        <text
+                          class="cell-text"
+                          :class="{ warn: quality.qualityResults === 2 }"
+                          >{{ quality.qualitySchemeTemplateCode }}</text
+                        >
+                      </view>
+                      <view class="table-cell">
+                        <text
+                          class="cell-text"
+                          :class="{ warn: quality.qualityResults === 2 }"
+                          >{{ quality.qualitySchemeTemplateName }}</text
+                        >
+                      </view>
+                      <view class="table-cell">
+                        <text
+                          class="cell-text"
+                          :class="{ warn: quality.qualityResults === 2 }"
+                          >{{ quality.categoryLevelClassName }}</text
+                        >
+                      </view>
+                      <view class="table-cell parameter-cell">
+                        <text
+                          class="cell-text"
+                          :class="{ warn: quality.qualityResults === 2 }"
+                        >
+                          <text v-if="quality.textType == 3">
+                            {{ quality.symbol }}
+                            {{ quality.minValue }}-{{ quality.maxValue }}
+                          </text>
+                          <text v-else-if="quality.textType == 8">
+                            标准值:{{ quality.defaultValue
                             }}{{ quality.unitName || "" }} 下限:{{
                               quality.minValue || 0
                             }}{{ quality.unitName || "" }} 上限:{{
                               quality.minValue || 0
                             }}{{ quality.unitName || "" }}
-													</text>
-													<text v-else>
-														{{ quality.symbol }} {{ quality.defaultValue }}
-													</text>
-													<text v-if="quality.textType != 8">
-														{{ quality.unitName }}</text>
-												</text>
-											</view>
-										</view>
-									</view>
-								</view>
-							</scroll-view>
-						</view>
-
-						<view class="quality-summary" v-if="sample.qualityResults">
-							<view style="min-width: 10px; margin-left: 16rpx">
-								<text>
-									{{
+                          </text>
+                          <text v-else>
+                            {{ quality.symbol }} {{ quality.defaultValue }}
+                          </text>
+                          <text v-if="quality.textType != 8">
+                            {{ quality.unitName }}</text
+                          >
+                        </text>
+                      </view>
+                    </view>
+                  </view>
+                </view>
+              </scroll-view>
+            </view>
+
+            <view class="quality-summary" v-if="sample.qualityResults">
+              <view style="min-width: 10px; margin-left: 16rpx">
+                <text>
+                  {{
                     sample.status == 1
                       ? "已检"
                       : sample.status == 2
@@ -150,631 +207,675 @@
                           ? "已请托"
                           : "待检"
                   }}
-								</text>
-							</view>
-							<view>
-								<text class="summary-label">样品质检结果:</text>
-								<text class="summary-value" :class="getQualityResultClass(sample.qualityResults)">
-									{{ formatQualityResult(sample.qualityResults) }}
-								</text>
-							</view>
-						</view>
-					</view>
-
-					<view class="empty-state" v-if="!tableData || tableData.length === 0">
-						<text>暂无数据</text>
-					</view>
-				</view>
-			</scroll-view>
-
-			<view style="height: 84rpx"></view>
-			<view class="footerButton">
-				<u-button @click="handleClose" type="default" text="返回"></u-button>
-				<u-button v-if="type != 'view' && !isCorrelationId && workData.status != 1&&clientEnvironmentId!=10" type="primary" @click="save"
-					text="保存"></u-button>
-				<u-button v-if="type != 'view' && !isCorrelationId && workData.status != 1&&clientEnvironmentId==10" type="primary" @click="exeReportWork"
-					text="报工"></u-button>
-			</view>
-		</view>
-		<u-toast ref="uToast"></u-toast>
-	</view>
+                </text>
+              </view>
+              <view>
+                <text class="summary-label">样品质检结果:</text>
+                <text
+                  class="summary-value"
+                  :class="getQualityResultClass(sample.qualityResults)"
+                >
+                  {{ formatQualityResult(sample.qualityResults) }}
+                </text>
+              </view>
+            </view>
+          </view>
+
+          <view class="empty-state" v-if="!tableData || tableData.length === 0">
+            <text>暂无数据</text>
+          </view>
+        </view>
+      </scroll-view>
+
+      <view style="height: 84rpx"></view>
+      <view class="footerButton">
+        <u-button @click="handleClose" type="default" text="返回"></u-button>
+        <u-button
+          v-if="
+            type != 'view' &&
+            !isCorrelationId &&
+            workData.status != 1 &&
+            clientEnvironmentId != 10
+          "
+          type="primary"
+          @click="save"
+          text="保存"
+        ></u-button>
+        <u-button
+          v-if="type != 'view' && !isCorrelationId && workData.status != 1"
+          type="primary"
+          @click="exeReportWork"
+          text="报工"
+        ></u-button>
+      </view>
+    </view>
+    <u-toast ref="uToast"></u-toast>
+  </view>
 </template>
 
 <script>
-	import {
-		getById,
-		update,
-		queryQualityInventory,
-		exeReportWork
-	} from "@/api/inspectionWork/index.js";
-	import {
-		handleInput,
-		qualityResultsListChange
-	} from "./unit.js";
-	import dayjs from "dayjs";
-	export default {
-		components: {},
-		data() {
-			return {
-				title: "样品列表",
-				rowIndex: 0,
-				type: "",
-				pageName: "",
-				tableData: [],
-				handleInput,
-				qualityResultsListChange,
-				isCorrelationId: false,
-				expandedItems: {},
-				workData: {},
-				inventoryList: [],
-				projectId: "",
-				qualityResultsList: [{
-						text: "合格",
-						value: 1,
-					},
-					{
-						text: "不合格",
-						value: 2,
-					},
-					{
-						text: "让步接收",
-						value: 3,
-					},
-				],
-			};
-		},
-		onLoad(data) {
-			if (data.workId) {
-				this.projectId = data.projectId;
-				this.type = data.type || "";
-				this.pageName = data.pageName || "";
-				this.clientEnvironmentId = uni.getStorageSync("userInfo").clientEnvironmentId
-				getById(data.workId).then((res) => {
-					this.workData = res;
-					if (data.projectId) {
-						const qualitySampleList = res.qualitySampleList.filter(
-							(item) => item.id == data.projectId,
-						);
-
-						if (
-							qualitySampleList[0].correlationId &&
-							![
-								"myInspectionProjectEntrusted",
-								"myInspectionProjectTask",
-							].includes(this.pageName)
-						) {
-							this.isCorrelationId = true;
-						} else {
-							qualitySampleList[0].status = 1;
-						}
-					} else {
-						this.isCorrelationId = true;
-						res.qualitySampleList.forEach((item) => {
-							if (
-								!item.correlationId || [
-									"myInspectionProjectEntrusted",
-									"myInspectionProjectTask",
-								].includes(this.pageName)
-							) {
-								this.isCorrelationId = false;
-								item.status = 1;
-							}
-						});
-					}
-
-					this.tableData = res.qualitySampleList.map((item) => {
-						if (
-							!item.qualitySampleTemplateList.length &&
-							res.templateList.length
-						) {
-							item.qualitySampleTemplateList = JSON.parse(
-								JSON.stringify(res.templateList),
-							);
-						}
-
-						return item;
-					});
-				});
-
-				this.expandedItems = {};
-				this.getQueryQualityInventory(data.workId);
-			}
-		},
-		methods: {
-			async getQueryQualityInventory(workId) {
-				const res = await queryQualityInventory({
-					qualityWorkerId: workId,
-					size: -1,
-				});
-
-				if (res.list.length > 0) {
-					this.inventoryList = res.list;
-				}
-			},
-			handleClose() {
-				uni.navigateBack();
-			},
-
-			handleConfirm() {
-				this.tableData.forEach((item) => {
-					if (!this.pageName && item.correlationId) {
-						return;
-					}
-					item.status = 1;
-				});
-
-				const pages = getCurrentPages();
-				const prevPage = pages[pages.length - 2];
-				if (prevPage) {
-					prevPage.$vm.handleConfirm &&
-						prevPage.$vm.handleConfirm(this.tableData, this.rowIndex);
-				}
-
-				uni.navigateBack();
-			},
-
-			toggleExpand(index) {
-				this.$set(this.expandedItems, index, !this.expandedItems[index]);
-			},
-			setNum() {
-				let sampleQualifiedNumber = 0; //  样品合格数
-				let sampleNoQualifiedNumber = 0; //  样品不合格数
-				let sampleQualificationRate = 0; //样品合格率
-				let sampleNoQualificationRate = 0; //样品不合格率
-
-				let qualifiedNumber = 0; // 合格数
-				let noQualifiedNumber = 0; //  不合格数
-				let qualificationRate = 0; //  合格率
-				let noQualificationRate = 0; //不合格率
-
-				this.tableData.forEach((item) => {
-					if (item.qualityResults == 2) {
-						sampleNoQualifiedNumber += item.measureQuantity;
-					}
-				});
-				sampleQualifiedNumber =
-					this.workData.sampleQuantity - sampleNoQualifiedNumber;
-
-				sampleQualificationRate =
-					((sampleQualifiedNumber / this.workData.sampleQuantity) * 100).toFixed(
-						2,
-					) || "";
-				sampleNoQualificationRate =
-					(
-						(sampleNoQualifiedNumber / this.workData.sampleQuantity) *
-						100
-					).toFixed(2) || "";
-				if (this.workData.qualityMode == 2 && this.workData.qualityResults == 2) {
-					qualifiedNumber = sampleQualifiedNumber;
-					noQualifiedNumber = this.workData.total - sampleQualifiedNumber;
-				} else {
-					qualifiedNumber = this.workData.total - sampleNoQualifiedNumber;
-					noQualifiedNumber = sampleNoQualifiedNumber;
-				}
-
-				qualificationRate =
-					((qualifiedNumber / this.workData.total) * 100).toFixed(2) || "";
-				noQualificationRate =
-					((noQualifiedNumber / this.workData.total) * 100).toFixed(2) || "";
-				this.workData.sampleQualifiedNumber = sampleQualifiedNumber;
-				this.workData.sampleNoQualifiedNumber = sampleNoQualifiedNumber;
-				this.workData.sampleQualificationRate = sampleQualificationRate;
-				this.workData.sampleNoQualificationRate = sampleNoQualificationRate;
-				this.workData.qualifiedNumber = qualifiedNumber;
-				this.workData.noQualifiedNumber = noQualifiedNumber;
-				this.workData.qualificationRate = qualificationRate;
-				this.workData.noQualificationRate = noQualificationRate;
-				// qualityMode
-			},
-			/* 保存编辑 */
-			save() {
-				this.workData.isUpdate = 1;
-				this.setNum();
-				let params = {
-					...this.workData,
-					sampleList: this.tableData,
-					planTemplateList: this.workData.templateList,
-					templateList: this.workData.templateList,
-					qualityInventoryList: this.inventoryList
-				};
-
-				update(params)
-					.then((msg) => {
-						uni.$emit("successInit");
-						this.back();
-					})
-					.catch((e) => {});
-			},
-			exeReportWork() {
-				this.workData.isUpdate = 1;
-				this.tableData.qualityTimeEnd = dayjs().format('YYYY-MM-DD HH:mm:ss');
-				this.workData.executeUserId = uni.getStorageSync("userInfo").userId
-				this.workData.executeUserName = uni.getStorageSync("userInfo").name
-				this.workData.qualityResults=this.tableData[0].qualityResults
-				this.setNum();
-				let params = {
-					...this.workData,
-					sampleList: this.tableData,
-					planTemplateList: this.workData.templateList,
-					templateList: this.workData.templateList,
-					qualityInventoryList: this.inventoryList,
-				};
-
-				exeReportWork(params)
-					.then((msg) => {
-						uni.$emit("successInit");
-						this.back();
-					})
-					.catch((e) => {});
-			},
-			formatQualityResult(value) {
-				const map = {
-					1: "合格",
-					2: "不合格",
-					3: "让步接收",
-				};
-				return map[value] || "";
-			},
-			//宇信特殊处理
-			newHandleInput(arr, index) {
-				let num = arr.find(
-					(item) => item.inspectionName == "炉水电导率",
-				)?.qualityResultContent;
-				let num1 = arr.find(
-					(item) => item.inspectionName == "给水电导率",
-				)?.qualityResultContent;
-				console.log(num, num1);
-
-				arr.forEach((item, i) => {
-					if (num && num1 && item.inspectionName == "干度值") {
-						let val = parseFloat((((num - num1 / 1000) / num) * 100).toFixed(5));
-						this.$set(
-							this.tableData[index].qualitySampleTemplateList[i],
-							"qualityResultContent",
-							val,
-						);
-
-						this.handleInput(item, val, this.tableData);
-					}
-				});
-			},
-			getQualityResultClass(value) {
-				return {
-					1: "result-pass",
-					2: "result-fail",
-					3: "result-concession",
-				} [value];
-			},
-		},
-	};
+import {
+  getById,
+  update,
+  queryQualityInventory,
+  exeReportWork,
+  getTaskmonadById,
+} from "@/api/inspectionWork/index.js";
+import { handleInput, qualityResultsListChange } from "./unit.js";
+import dayjs from "dayjs";
+export default {
+  components: {},
+  data() {
+    return {
+      title: "样品列表",
+      rowIndex: 0,
+      type: "",
+      pageName: "",
+      tableData: [],
+      handleInput,
+      qualityResultsListChange,
+      isCorrelationId: false,
+      expandedItems: {},
+      workData: {},
+      inventoryList: [],
+      projectId: "",
+      qualityResultsList: [
+        {
+          text: "合格",
+          value: 1,
+        },
+        {
+          text: "不合格",
+          value: 2,
+        },
+        {
+          text: "让步接收",
+          value: 3,
+        },
+      ],
+    };
+  },
+  onLoad(data) {
+    if (data.workId) {
+      this.projectId = data.projectId;
+      this.type = data.type || "";
+      this.pageName = data.pageName || "";
+      this.clientEnvironmentId =
+        uni.getStorageSync("userInfo").clientEnvironmentId;
+      let api = [
+        "myInspectionProjectEntrusted",
+        "myInspectionProjectTask",
+      ].includes(this.pageName)
+        ? getTaskmonadById
+        : getById;
+      api(data.workId).then((res) => {
+        this.workData = res;
+        if (data.projectId) {
+          const qualitySampleList = res.qualitySampleList.filter(
+            (item) => item.id == data.projectId,
+          );
+
+          if (
+            qualitySampleList[0].correlationId &&
+            ![
+              "myInspectionProjectEntrusted",
+              "myInspectionProjectTask",
+            ].includes(this.pageName)
+          ) {
+            this.isCorrelationId = true;
+          } else {
+            qualitySampleList[0].status = 1;
+          }
+        } else {
+          this.isCorrelationId = true;
+          res.qualitySampleList.forEach((item) => {
+            if (
+              !item.correlationId ||
+              [
+                "myInspectionProjectEntrusted",
+                "myInspectionProjectTask",
+              ].includes(this.pageName)
+            ) {
+              this.isCorrelationId = false;
+              item.status = 1;
+            }
+          });
+        }
+
+        this.tableData = res.qualitySampleList.map((item) => {
+          if (
+            !item.qualitySampleTemplateList.length &&
+            res.templateList.length
+          ) {
+            item.qualitySampleTemplateList = JSON.parse(
+              JSON.stringify(res.templateList),
+            );
+          }
+
+          return item;
+        });
+      });
+
+      this.expandedItems = {};
+      this.getQueryQualityInventory(data.workId);
+    }
+  },
+  methods: {
+    async getQueryQualityInventory(workId) {
+      const res = await queryQualityInventory({
+        qualityWorkerId: workId,
+        size: -1,
+      });
+
+      if (res.list.length > 0) {
+        this.inventoryList = res.list;
+      }
+    },
+    handleClose() {
+      uni.navigateBack();
+    },
+
+    handleConfirm() {
+      this.tableData.forEach((item) => {
+        if (!this.pageName && item.correlationId) {
+          return;
+        }
+        item.status = 1;
+      });
+
+      const pages = getCurrentPages();
+      const prevPage = pages[pages.length - 2];
+      if (prevPage) {
+        prevPage.$vm.handleConfirm &&
+          prevPage.$vm.handleConfirm(this.tableData, this.rowIndex);
+      }
+
+      uni.navigateBack();
+    },
+
+    toggleExpand(index) {
+      this.$set(this.expandedItems, index, !this.expandedItems[index]);
+    },
+    setNum() {
+      let sampleQualifiedNumber = 0; //  样品合格数
+      let sampleNoQualifiedNumber = 0; //  样品不合格数
+      let sampleQualificationRate = 0; //样品合格率
+      let sampleNoQualificationRate = 0; //样品不合格率
+
+      let qualifiedNumber = 0; // 合格数
+      let noQualifiedNumber = 0; //  不合格数
+      let qualificationRate = 0; //  合格率
+      let noQualificationRate = 0; //不合格率
+
+      this.tableData.forEach((item) => {
+        if (item.qualityResults == 2) {
+          sampleNoQualifiedNumber += item.measureQuantity;
+        }
+      });
+      sampleQualifiedNumber =
+        this.workData.sampleQuantity - sampleNoQualifiedNumber;
+
+      sampleQualificationRate =
+        ((sampleQualifiedNumber / this.workData.sampleQuantity) * 100).toFixed(
+          2,
+        ) || "";
+      sampleNoQualificationRate =
+        (
+          (sampleNoQualifiedNumber / this.workData.sampleQuantity) *
+          100
+        ).toFixed(2) || "";
+      if (this.workData.qualityMode == 2 && this.workData.qualityResults == 2) {
+        qualifiedNumber = sampleQualifiedNumber;
+        noQualifiedNumber = this.workData.total - sampleQualifiedNumber;
+      } else {
+        qualifiedNumber = this.workData.total - sampleNoQualifiedNumber;
+        noQualifiedNumber = sampleNoQualifiedNumber;
+      }
+
+      qualificationRate =
+        ((qualifiedNumber / this.workData.total) * 100).toFixed(2) || "";
+      noQualificationRate =
+        ((noQualifiedNumber / this.workData.total) * 100).toFixed(2) || "";
+      this.workData.sampleQualifiedNumber = sampleQualifiedNumber;
+      this.workData.sampleNoQualifiedNumber = sampleNoQualifiedNumber;
+      this.workData.sampleQualificationRate = sampleQualificationRate;
+      this.workData.sampleNoQualificationRate = sampleNoQualificationRate;
+      this.workData.qualifiedNumber = qualifiedNumber;
+      this.workData.noQualifiedNumber = noQualifiedNumber;
+      this.workData.qualificationRate = qualificationRate;
+      this.workData.noQualificationRate = noQualificationRate;
+      // qualityMode
+    },
+    /* 保存编辑 */
+    save() {
+      this.workData.isUpdate = 1;
+      this.setNum();
+      let params = {
+        ...this.workData,
+        sampleList: this.tableData,
+        planTemplateList: this.workData.templateList,
+        templateList: this.workData.templateList,
+        qualityInventoryList: this.inventoryList,
+      };
+
+      update(params)
+        .then((msg) => {
+          uni.$emit("successInit");
+          this.back();
+        })
+        .catch((e) => {});
+    },
+    exeReportWork() {
+      if (this.clientEnvironmentId == 10) {
+        this.doExeReportWork();
+      } else if (
+        ["myInspectionProjectEntrusted", "myInspectionProjectTask"].includes(
+          this.pageName,
+        )
+      ) {
+        this.doExeReportWork();
+      } else {
+        uni.showActionSheet({
+          itemList: ["合格", "不合格"],
+          success: (res) => {
+            this.workData.qualityResults = res.tapIndex === 0 ? 1 : 2;
+            this.doExeReportWork();
+          },
+        });
+      }
+    },
+    doExeReportWork() {
+      this.workData.isUpdate = 1;
+      this.tableData.qualityTimeEnd = dayjs().format("YYYY-MM-DD HH:mm:ss");
+      this.workData.executeUserId = uni.getStorageSync("userInfo").userId;
+      this.workData.executeUserName = uni.getStorageSync("userInfo").name;
+      if (this.clientEnvironmentId == 10) {
+        this.workData.qualityResults = this.tableData[0].qualityResults;
+      }
+      this.setNum();
+      let params = {
+        ...this.workData,
+        sampleList: this.tableData,
+        planTemplateList: this.workData.templateList,
+        templateList: this.workData.templateList,
+        qualityInventoryList: this.inventoryList,
+      };
+
+      exeReportWork(params)
+        .then((msg) => {
+          uni.$emit("successInit");
+          this.back();
+        })
+        .catch((e) => {});
+    },
+    formatQualityResult(value) {
+      const map = {
+        1: "合格",
+        2: "不合格",
+        3: "让步接收",
+      };
+      return map[value] || "";
+    },
+    //宇信特殊处理
+    newHandleInput(arr, index) {
+      let num = arr.find(
+        (item) => item.inspectionName == "炉水电导率",
+      )?.qualityResultContent;
+      let num1 = arr.find(
+        (item) => item.inspectionName == "给水电导率",
+      )?.qualityResultContent;
+      console.log(num, num1);
+
+      arr.forEach((item, i) => {
+        if (num && num1 && item.inspectionName == "干度值") {
+          let val = parseFloat((((num - num1 / 1000) / num) * 100).toFixed(5));
+          this.$set(
+            this.tableData[index].qualitySampleTemplateList[i],
+            "qualityResultContent",
+            val,
+          );
+
+          this.handleInput(item, val, this.tableData);
+        }
+      });
+    },
+    getQualityResultClass(value) {
+      return {
+        1: "result-pass",
+        2: "result-fail",
+        3: "result-concession",
+      }[value];
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-	.mainBox {
-		height: 100vh;
-		display: flex;
-		flex-direction: column;
-		background-color: #f3f8fb;
-	}
-
-	.nav-placeholder {
-		height: calc(var(--status-bar-height, 0px) + 44px);
-	}
-
-	.wrapper {
-		flex: 1;
-		display: flex;
-		flex-direction: column;
-		overflow: hidden;
-	}
-
-	.scroll-wrapper {
-		flex: 1;
-		height: 0;
-		padding: 20rpx;
-
-		.sample-list {
-			padding-bottom: 20rpx;
-
-			.sample-item {
-				background: #fff;
-				border-radius: 30rpx;
-				margin-bottom: 20rpx;
-				overflow: hidden;
-				//   box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.08);
-				//   border: 1rpx solid #f0f0f0;
-
-				.quality-summary {
-					padding: 24rpx;
-					background: #fff;
-					border-top: 1rpx solid #f5f3f3;
-					display: flex;
-					align-items: center;
-					justify-content: space-between;
-					font-size: 28rpx;
-					font-weight: bold;
-
-					.summary-label {
-						color: #333;
-						margin-right: 20rpx;
-					}
-
-					.summary-value {
-						padding: 8rpx 20rpx;
-						border-radius: 8rpx;
-
-						&.result-pass {
-							color: #52c41a;
-							background: #f6ffed;
-						}
-
-						&.result-fail {
-							color: #ff4d4f;
-							background: #fff2f0;
-						}
-
-						&.result-concession {
-							color: #faad14;
-							background: #fffbe6;
-						}
-					}
-				}
-
-				.empty-state {
-					padding: 100rpx 0;
-					text-align: center;
-					font-size: 28rpx;
-					color: #999;
-				}
-
-				.sample-header {
-					display: flex;
-					justify-content: space-between;
-					align-items: center;
-					padding: 40rpx 40rpx 20rpx 40rpx;
-					background: #ffffff;
-					box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);
-
-					.sample-info {
-						flex: 1;
-					}
-
-					.info-row {
-						display: flex;
-						margin-bottom: 8rpx;
-
-						&:last-child {
-							margin-bottom: 0;
-						}
-
-						.label {
-							font-size: 28rpx;
-							color: #333;
-
-							font-weight: 800;
-
-							margin-right: 10rpx;
-							min-width: 120rpx;
-						}
-
-						.value {
-							font-size: 26rpx;
-							color: #333;
-							flex: 1;
-							font-weight: 800;
-						}
-					}
-
-					.expand-arrow {
-						font-size: 40rpx;
-						color: #999;
-						margin-left: 20rpx;
-						transform: rotate(0deg);
-						transition: transform 0.3s;
-						background: #fff;
-						width: 48rpx;
-						height: 48rpx;
-						border-radius: 50%;
-						display: flex;
-						align-items: center;
-						justify-content: center;
-						box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
-
-						&.expanded {
-							transform: rotate(90deg);
-						}
-					}
-				}
-
-				.quality-table-wrapper {
-					// margin: 20rpx;
-					margin-top: 0;
-					// border-radius: 12rpx;
-					overflow: hidden;
-					// box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
-				}
-
-				// 自定义滚动条样式
-				::v-deep .quality-table-scroll ::-webkit-scrollbar {
-					width: 6rpx;
-					height: 6rpx;
-				}
-
-				::v-deep .quality-table-scroll ::-webkit-scrollbar-track {
-					background: #f1f1f1;
-					border-radius: 3rpx;
-				}
-
-				::v-deep .quality-table-scroll ::-webkit-scrollbar-thumb {
-					background: #c1c1c1;
-					border-radius: 3rpx;
-				}
-
-				::v-deep .quality-table-scroll ::-webkit-scrollbar-thumb:hover {
-					background: #a8a8a8;
-				}
-
-				::v-deep .table-cell:last-child::-webkit-scrollbar {
-					width: 4rpx;
-				}
-
-				::v-deep .table-cell:last-child::-webkit-scrollbar-track {
-					background: #f9f9f9;
-					border-radius: 2rpx;
-				}
-
-				::v-deep .table-cell:last-child::-webkit-scrollbar-thumb {
-					background: #d9d9d9;
-					border-radius: 2rpx;
-				}
-
-				.quality-table-scroll {
-					width: 100%;
-				}
-
-				.quality-table {
-					min-width: 100%;
-					width: 1540rpx;
-					background: #fff;
-				}
-
-				.table-header {
-					display: flex;
-					background: #f5f5f5;
-					border-bottom: 2rpx solid #e5e5e5;
-
-					.table-cell {
-						padding: 24rpx 12rpx;
-						font-size: 26rpx;
-						font-weight: bold;
-						color: #333;
-						text-align: center;
-						border-right: 1rpx solid #e5e5e5;
-						white-space: nowrap;
-						flex-shrink: 0;
-						display: flex;
-						align-items: center;
-						justify-content: center;
-						background: #f5f5f5;
-						width: 200rpx;
-
-						&:last-child {
-							border-right: none;
-							background: #f5f5f5;
-						}
-
-						&:nth-child(2) {
-							width: 260rpx;
-						}
-
-						&:nth-child(3) {
-							width: 220rpx;
-						}
-
-						&:nth-child(7) {
-							width: 260rpx;
-						}
-					}
-				}
-
-				.table-body {
-					.table-row {
-						display: flex;
-						border-bottom: 1rpx solid #e5e5e5;
-						transition: background 0.2s;
-
-						&:nth-child(even) {
-							// background: #fafafa;
-						}
-
-						&:last-child {
-							border-bottom: none;
-						}
-
-						.table-cell {
-							padding: 20rpx 12rpx;
-							font-size: 24rpx;
-							// color: #666;
-							text-align: center;
-							border-right: 1rpx solid #e5e5e5;
-							white-space: nowrap;
-							flex-shrink: 0;
-							display: flex;
-							align-items: center;
-							justify-content: center;
-							width: 200rpx;
-
-							&:last-child {
-								border-right: none;
-								//   background: #f5f5f5;
-							}
-
-							&:nth-child(2) {
-								width: 260rpx;
-							}
-
-							&:nth-child(3) {
-								width: 220rpx;
-							}
-
-							&:nth-child(7) {
-								width: 260rpx !important;
-							}
-
-							.cell-text {
-								overflow: hidden;
-								text-overflow: ellipsis;
-								white-space: nowrap;
-								max-width: 100%;
-
-								&.warn {
-									color: #ff4d4f;
-								}
-							}
-
-							.unit {
-								font-size: 22rpx;
-								color: #999;
-								margin-left: 6rpx;
-							}
-
-							&.parameter-cell {
-								max-height: 120rpx;
-								overflow-y: auto;
-								align-items: flex-start;
-								padding: 16rpx 12rpx;
-								width: 200rpx;
-							}
-						}
-					}
-				}
-			}
-		}
-	}
-
-	.footerButton {
-		width: 100%;
-		height: 84rpx;
-		display: flex;
-		position: fixed;
-		bottom: 0;
-		z-index: 10;
-		background-color: #fff;
-
-		/deep/.u-button {
-			height: 100%;
-		}
-
-		>view {
-			flex: 1;
-		}
-	}
-
-	.warn {
-		color: #ff4d4f !important;
-	}
-
-	/deep/.text-color {
-		font-size: 28rpx;
-	}
-</style>
+.mainBox {
+  height: 100vh;
+  display: flex;
+  flex-direction: column;
+  background-color: #f3f8fb;
+}
+
+.nav-placeholder {
+  height: calc(var(--status-bar-height, 0px) + 44px);
+}
+
+.wrapper {
+  flex: 1;
+  display: flex;
+  flex-direction: column;
+  overflow: hidden;
+}
+
+.scroll-wrapper {
+  flex: 1;
+  height: 0;
+  padding: 20rpx;
+
+  .sample-list {
+    padding-bottom: 20rpx;
+
+    .sample-item {
+      background: #fff;
+      border-radius: 30rpx;
+      margin-bottom: 20rpx;
+      overflow: hidden;
+      //   box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.08);
+      //   border: 1rpx solid #f0f0f0;
+
+      .quality-summary {
+        padding: 24rpx;
+        background: #fff;
+        border-top: 1rpx solid #f5f3f3;
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        font-size: 28rpx;
+        font-weight: bold;
+
+        .summary-label {
+          color: #333;
+          margin-right: 20rpx;
+        }
+
+        .summary-value {
+          padding: 8rpx 20rpx;
+          border-radius: 8rpx;
+
+          &.result-pass {
+            color: #52c41a;
+            background: #f6ffed;
+          }
+
+          &.result-fail {
+            color: #ff4d4f;
+            background: #fff2f0;
+          }
+
+          &.result-concession {
+            color: #faad14;
+            background: #fffbe6;
+          }
+        }
+      }
+
+      .empty-state {
+        padding: 100rpx 0;
+        text-align: center;
+        font-size: 28rpx;
+        color: #999;
+      }
+
+      .sample-header {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        padding: 40rpx 40rpx 20rpx 40rpx;
+        background: #ffffff;
+        box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);
+
+        .sample-info {
+          flex: 1;
+        }
+
+        .info-row {
+          display: flex;
+          margin-bottom: 8rpx;
+
+          &:last-child {
+            margin-bottom: 0;
+          }
+
+          .label {
+            font-size: 28rpx;
+            color: #333;
+
+            font-weight: 800;
+
+            margin-right: 10rpx;
+            min-width: 120rpx;
+          }
+
+          .value {
+            font-size: 26rpx;
+            color: #333;
+            flex: 1;
+            font-weight: 800;
+          }
+        }
+
+        .expand-arrow {
+          font-size: 40rpx;
+          color: #999;
+          margin-left: 20rpx;
+          transform: rotate(0deg);
+          transition: transform 0.3s;
+          background: #fff;
+          width: 48rpx;
+          height: 48rpx;
+          border-radius: 50%;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+          box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
+
+          &.expanded {
+            transform: rotate(90deg);
+          }
+        }
+      }
+
+      .quality-table-wrapper {
+        // margin: 20rpx;
+        margin-top: 0;
+        // border-radius: 12rpx;
+        overflow: hidden;
+        // box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
+      }
+
+      // 自定义滚动条样式
+      ::v-deep .quality-table-scroll ::-webkit-scrollbar {
+        width: 6rpx;
+        height: 6rpx;
+      }
+
+      ::v-deep .quality-table-scroll ::-webkit-scrollbar-track {
+        background: #f1f1f1;
+        border-radius: 3rpx;
+      }
+
+      ::v-deep .quality-table-scroll ::-webkit-scrollbar-thumb {
+        background: #c1c1c1;
+        border-radius: 3rpx;
+      }
+
+      ::v-deep .quality-table-scroll ::-webkit-scrollbar-thumb:hover {
+        background: #a8a8a8;
+      }
+
+      ::v-deep .table-cell:last-child::-webkit-scrollbar {
+        width: 4rpx;
+      }
+
+      ::v-deep .table-cell:last-child::-webkit-scrollbar-track {
+        background: #f9f9f9;
+        border-radius: 2rpx;
+      }
+
+      ::v-deep .table-cell:last-child::-webkit-scrollbar-thumb {
+        background: #d9d9d9;
+        border-radius: 2rpx;
+      }
+
+      .quality-table-scroll {
+        width: 100%;
+      }
+
+      .quality-table {
+        min-width: 100%;
+        width: 1540rpx;
+        background: #fff;
+      }
+
+      .table-header {
+        display: flex;
+        background: #f5f5f5;
+        border-bottom: 2rpx solid #e5e5e5;
+
+        .table-cell {
+          padding: 24rpx 12rpx;
+          font-size: 26rpx;
+          font-weight: bold;
+          color: #333;
+          text-align: center;
+          border-right: 1rpx solid #e5e5e5;
+          white-space: nowrap;
+          flex-shrink: 0;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+          background: #f5f5f5;
+          width: 200rpx;
+
+          &:last-child {
+            border-right: none;
+            background: #f5f5f5;
+          }
+
+          &:nth-child(2) {
+            width: 260rpx;
+          }
+
+          &:nth-child(3) {
+            width: 220rpx;
+          }
+
+          &:nth-child(7) {
+            width: 260rpx;
+          }
+        }
+      }
+
+      .table-body {
+        .table-row {
+          display: flex;
+          border-bottom: 1rpx solid #e5e5e5;
+          transition: background 0.2s;
+
+          &:nth-child(even) {
+            // background: #fafafa;
+          }
+
+          &:last-child {
+            border-bottom: none;
+          }
+
+          .table-cell {
+            padding: 20rpx 12rpx;
+            font-size: 24rpx;
+            // color: #666;
+            text-align: center;
+            border-right: 1rpx solid #e5e5e5;
+            white-space: nowrap;
+            flex-shrink: 0;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            width: 200rpx;
+
+            &:last-child {
+              border-right: none;
+              //   background: #f5f5f5;
+            }
+
+            &:nth-child(2) {
+              width: 260rpx;
+            }
+
+            &:nth-child(3) {
+              width: 220rpx;
+            }
+
+            &:nth-child(7) {
+              width: 260rpx !important;
+            }
+
+            .cell-text {
+              overflow: hidden;
+              text-overflow: ellipsis;
+              white-space: nowrap;
+              max-width: 100%;
+
+              &.warn {
+                color: #ff4d4f;
+              }
+            }
+
+            .unit {
+              font-size: 22rpx;
+              color: #999;
+              margin-left: 6rpx;
+            }
+
+            &.parameter-cell {
+              max-height: 120rpx;
+              overflow-y: auto;
+              align-items: flex-start;
+              padding: 16rpx 12rpx;
+              width: 200rpx;
+            }
+          }
+        }
+      }
+    }
+  }
+}
+
+.footerButton {
+  width: 100%;
+  height: 84rpx;
+  display: flex;
+  position: fixed;
+  bottom: 0;
+  z-index: 10;
+  background-color: #fff;
+
+  /deep/.u-button {
+    height: 100%;
+  }
+
+  > view {
+    flex: 1;
+  }
+}
+
+.warn {
+  color: #ff4d4f !important;
+}
+
+/deep/.text-color {
+  font-size: 28rpx;
+}
+</style>