Просмотр исходного кода

feat: 新增抽样记录和字典选择组件功能

yusheng 5 месяцев назад
Родитель
Сommit
f105230511

+ 50 - 0
api/inspectionWork/index.js

@@ -122,6 +122,19 @@ export async function verificationQualityInspector(id) {
 
 }
 
+//收样
+export async function sampleCollection(data) {
+	const res = await putJ(
+		Vue.prototype.apiUrl + `/qms/quality_work_order/sampleCollection`,
+		data
+	);
+	if (res.code == 0) {
+		return res.data;
+	}
+	return Promise.reject(new Error(res.message));
+}
+
+
 
 //实验
 // 获取详情
@@ -148,4 +161,41 @@ export async function updateExperiment(data) {
 		return res.message;
 	}
 	return Promise.reject(new Error(res.message));
+}
+
+
+// 检查质检工单是否可以请样
+export async function checkByQualityWorkOrderId(qualityWorkOrderId) {
+	const res = await get(Vue.prototype.apiUrl + `/qms/samplingrecord/checkByQualityWorkOrderId/${qualityWorkOrderId}`);
+	if (res.code == 0) {
+		return res.data;
+	}
+	return Promise.reject(new Error(res.message));
+}
+
+// 根据质检工单id获取清单列表
+export async function queryQualityInventory(data) {
+	const res = await postJ(Vue.prototype.apiUrl + `/qms/quality_work_order/query_quality_inventory`, data);
+	if (res.code == 0) {
+		return res.data;
+	}
+	return Promise.reject(new Error(res.message));
+}
+
+// 根据质检工单id获取质检样品列表
+export async function queryQualitySamplContent(data) {
+	const res = await postJ(Vue.prototype.apiUrl + `/qms/quality_work_order/query_quality_sampl_content`, data);
+	if (res.code == 0) {
+		return res.data;
+	}
+	return Promise.reject(new Error(res.message));
+}
+
+// 根据质检工单id获取方案内容
+export async function queryQualityTempleContent(data) {
+	const res = await postJ(Vue.prototype.apiUrl + `/qms/quality_work_order/query_quality_temple_content`, data);
+	if (res.code == 0) {
+		return res.data;
+	}
+	return Promise.reject(new Error(res.message));
 }

+ 20 - 0
api/pda/picking.js

@@ -91,6 +91,26 @@ export async function getCode(code) {
   return Promise.reject(data.message);
 }
 
+// 批量生产编码
+export async function getCodeList(code, params) {
+  const data = await get(
+    Vue.prototype.apiUrl + `/main/codemanage/getCodeList/` + code,
+    params || {}
+  );
+  if (data.code == 0) {
+    return data.data;
+  }
+  return Promise.reject(data.message);
+}
+//获取系统参数
+export async function parameterGetByCode(data) {
+  const res = await postJ(Vue.prototype.apiUrl + `/sys/parameter/getByCode`, data, false);
+  if (res.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(res.message);
+}
+
 //查询出库单详情
 export async function queryOutWordDetail(params) {
   const data = await get(

+ 53 - 0
api/samplingRecords/index.js

@@ -0,0 +1,53 @@
+// 抽样记录
+import {
+	get,
+	put,
+	postJ,putJ,
+	deleteApi
+} from "@/utils/request";
+import Vue from "vue";
+
+// 分页
+export async function samplingRecordsPage(params) {
+	const res = await get(Vue.prototype.apiUrl + `/qms/samplingrecord/page`, params);
+	if (res.code == 0) {
+		return res.data;
+	}
+	return Promise.reject(new Error(res.message));
+}
+
+// 取样新建/修改
+export async function samplingrecordSave(data) {
+	const res = await postJ(Vue.prototype.apiUrl + `/qms/samplingrecord/save`, data);
+	if (res.code == 0) {
+		return res.data;
+	}
+	return Promise.reject(new Error(res.message));
+}
+
+// 取样新建/修改
+export async function samplingrecordUpdate(data) {
+	const res = await putJ(Vue.prototype.apiUrl + `/qms/samplingrecord/update`, data);
+	if (res.code == 0) {
+		return res.data;
+	}
+	return Promise.reject(new Error(res.message));
+}
+
+// 详情
+export async function getById(id) {
+	const res = await get(Vue.prototype.apiUrl + `/qms/samplingrecord/getById/${id}`);
+	if (res.code == 0) {
+		return res.data;
+	}
+	return Promise.reject(new Error(res.message));
+}
+
+// 作废
+export async function listCancel(data) {
+	const res = await putJ(Vue.prototype.apiUrl + `/qms/samplingrecord/cancel`, data);
+	if (res.code == 0) {
+		return res.data;
+	}
+	return Promise.reject(new Error(res.message));
+}

+ 135 - 0
components/Dict/DictSelection.vue

@@ -0,0 +1,135 @@
+<template>
+  <view class="dict-selection">
+    <view class="select-input" :class="{ disabled: disabled }" @click="handleClick">
+      <text class="value-text">{{ displayValue || placeholder }}</text>
+      <text class="arrow" v-if="!disabled">›</text>
+    </view>
+    <u-picker
+      :show="showPicker"
+      :columns="[dictList]"
+      keyName="label"
+      @confirm="onConfirm"
+      @cancel="showPicker = false"
+    ></u-picker>
+  </view>
+</template>
+
+<script>
+import dictEnum from '@/enum/dict';
+import { mapActions, mapGetters } from 'vuex';
+
+export default {
+  model: {
+    prop: 'value',
+    event: 'updateVal'
+  },
+  props: {
+    value: {
+      type: [String, Number],
+      default: ''
+    },
+    dictName: {
+      type: String,
+      required: true
+    },
+    labelName: {
+      type: String,
+      default: 'dictValue'
+    },
+    valueName: {
+      type: String,
+      default: 'dictCode'
+    },
+    listFormatte: Function,
+    placeholder: {
+      type: String,
+      default: '请选择'
+    },
+    disabled: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      showPicker: false
+    };
+  },
+  computed: {
+    ...mapGetters(['dict', 'getDict']),
+    dictList() {
+      const list =
+        (this.listFormatte &&
+          this.listFormatte(this.dict[dictEnum[this.dictName]] || [])) ||
+        this.dict[dictEnum[this.dictName]] ||
+        [];
+      return list.map(item => ({
+        label: item[this.labelName],
+        value: item[this.valueName],
+        ...item
+      }));
+    },
+    displayValue() {
+      if (!this.value && this.value !== 0) return '';
+      const item = this.dictList.find(d => d.value == this.value);
+
+      return item ? item.label : '';
+    }
+  },
+  created() {
+    if (this.dictName) {
+      this.requestDict(this.dictName);
+    }
+  },
+  methods: {
+    ...mapActions('dict', ['requestDict']),
+    handleClick() {
+      if (!this.disabled) {
+        this.showPicker = true;
+      }
+    },
+    onConfirm(e) {
+      const value = e.value[0].value;
+      this.$emit('updateVal', value);
+      this.$emit('itemChange', this.getDict(this.dictName, value));
+      this.showPicker = false;
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.dict-selection {
+  width: 100%;
+}
+
+.select-input {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 20rpx 0;
+  min-height: 70rpx;
+  border-bottom: 1rpx solid #e5e5e5;
+
+  &.disabled {
+    opacity: 0.6;
+  }
+
+  .value-text {
+    flex: 1;
+    font-size: 28rpx;
+    color: #333;
+
+    &.empty {
+      color: #999;
+    }
+  }
+
+  .arrow {
+    font-size: 40rpx;
+    color: #999;
+    line-height: 1;
+    margin-left: 20rpx;
+  }
+}
+</style>

+ 1 - 24
components/templateDiv/customTable.vue

@@ -126,30 +126,7 @@
 				console.log(this.equation);
 			},
 
-			editInputChange(domObj) {
-				let data = JSON.parse(JSON.stringify(domObj));
-				if (data.equation) {
-					this.equation[data.id] = data.equation;
-				}
-				if (data.units) {
-					this.units[data.id] = data.units;
-				}
-				// 移动端简化处理
-				this.columns.forEach((item, index) => {
-					let rowsIndex = item.findIndex(cells => cells.id == this.domId);
-					this.$set(this.columns[index], rowsIndex, data);
-					rowsIndex = item.findIndex(cells => cells.id == data.id);
-					if (rowsIndex >= 0) {
-						let width = data.width;
-						let newWidth = this.columns[index][rowsIndex].style.width;
-						this.columns[index][0].width = newWidth;
-						item.forEach((cell, _index) => {
-							this.$set(this.columns[index][_index].style, 'width', newWidth);
-							this.$set(this.columns[index][_index], 'width', newWidth);
-						});
-					}
-				});
-			},
+
 
 
 		}

+ 126 - 122
enum/dict.js

@@ -1,177 +1,181 @@
 export default {
-	单位: 'unit',
-	条码分类: 'BARCODE',
-	资产类型: 'ASSECTSTYPE',
-	物品类型: 'classify',
-	产地: 'purchase_origin',
-	物品机型: 'product_model_key',
-	物品颜色: 'product_color_key',
-	流程实例的结果: 'bpm_process_instance_result',
-	质检计划类型: 'inspection_plan_type',
-	质检标准类型: 'quality_testing_code',
-	取样类型: 'quality_method_code',
-
-}
+  单位: "unit",
+  条码分类: "BARCODE",
+  资产类型: "ASSECTSTYPE",
+  物品类型: "classify",
+  产地: "purchase_origin",
+  物品机型: "product_model_key",
+  物品颜色: "product_color_key",
+  流程实例的结果: "bpm_process_instance_result",
+  质检计划类型: "inspection_plan_type",
+  质检标准类型: "quality_testing_code",
+  取样类型: "quality_method_code",
+  计量单位: "measuring_uint",
+};
 
 //发货审核状态
-export const reviewStatusEnum = [{
-		value: 0,
-		label: '未提交'
-	},
-	{
-		value: 1,
-		label: '审核中'
-	},
-	{
-		value: 2,
-		label: '已审核'
-	},
-	{
-		value: 3,
-		label: '审核未通过'
-	},
-	{
-		value: 7,
-		label: '作废'
-	},
+export const reviewStatusEnum = [
+  {
+    value: 0,
+    label: "未提交",
+  },
+  {
+    value: 1,
+    label: "审核中",
+  },
+  {
+    value: 2,
+    label: "已审核",
+  },
+  {
+    value: 3,
+    label: "审核未通过",
+  },
+  {
+    value: 7,
+    label: "作废",
+  },
 ];
 
 //商品级别
-export const levelList = [{
-		value: '1',
-		text: '特级'
-	},
-	{
-		value: '2',
-		text: '一级'
-	},
-	{
-		value: '3',
-		text: '二级'
-	},
-	{
-		value: '4',
-		text: '三级'
-	}
+export const levelList = [
+  {
+    value: "1",
+    text: "特级",
+  },
+  {
+    value: "2",
+    text: "一级",
+  },
+  {
+    value: "3",
+    text: "二级",
+  },
+  {
+    value: "4",
+    text: "三级",
+  },
 ];
 
 //属性类型
 export const lbjtList = {
-	1: '自制件',
-	2: '采购件',
-	3: '外协件',
-	4: '受托件'
+  1: "自制件",
+  2: "采购件",
+  3: "外协件",
+  4: "受托件",
 };
 
 //需求类型
-export const requirementSourceType = [{
-		value: '1',
-		text: '生产性物资采购'
-	},
-	{
-		value: '2',
-		text: '非生产性物资采购'
-	},
-	{
-		value: '3',
-		text: '带料生产委外'
-	},
-	{
-		value: '4',
-		text: '不带料生产委外'
-	},
-	{
-		value: '5',
-		text: '研发委外'
-	},
-	{
-		value: '6',
-		text: '外协自供料采购'
-	},
-	{
-		value: '7',
-		text: '外协客供料采购'
-	},
-	{
-		value: '8',
-		text: '退货委外'
-	},
-	{
-		value: '9',
-		text: '委外返修'
-	},
-	{
-		value: '99',
-		text: '其他'
-	}
+export const requirementSourceType = [
+  {
+    value: "1",
+    text: "生产性物资采购",
+  },
+  {
+    value: "2",
+    text: "非生产性物资采购",
+  },
+  {
+    value: "3",
+    text: "带料生产委外",
+  },
+  {
+    value: "4",
+    text: "不带料生产委外",
+  },
+  {
+    value: "5",
+    text: "研发委外",
+  },
+  {
+    value: "6",
+    text: "外协自供料采购",
+  },
+  {
+    value: "7",
+    text: "外协客供料采购",
+  },
+  {
+    value: "8",
+    text: "退货委外",
+  },
+  {
+    value: "9",
+    text: "委外返修",
+  },
+  {
+    value: "99",
+    text: "其他",
+  },
 ];
 
 // 列表维度
-export const dimensionType = [{
-		value: 1,
-		text: '物品维度'
-	},
-	{
-		value: 2,
-		text: '批次维度'
-	},
-	{
-		value: 3,
-		text: '包装维度'
-	}
+export const dimensionType = [
+  {
+    value: 1,
+    text: "物品维度",
+  },
+  {
+    value: 2,
+    text: "批次维度",
+  },
+  {
+    value: 3,
+    text: "包装维度",
+  },
 ];
 
 export const transactionMethodsOp = [
   {
     value: 1,
-    label: '先票后款'
+    label: "先票后款",
   },
   {
     value: 2,
-    label: '先款后票'
-  }
+    label: "先款后票",
+  },
 ];
 
 export const shippingModeOp = [
   {
     value: 1,
-    label: '发货再对账'
+    label: "发货再对账",
   },
   {
     value: 2,
-    label: '对账再发货'
-  }
+    label: "对账再发货",
+  },
 ];
 
 export const shippingModePurchaseOp = [
   {
     value: 1,
-    label: '收货再对账'
+    label: "收货再对账",
   },
   {
     value: 2,
-    label: '对账再收货'
-  }
+    label: "对账再收货",
+  },
 ];
 
 // 计价方式
 export const pricingWayList = [
-  { id: 1, name: '按数量计价' },
-  { id: 2, name: '按重量计价' },
-  { id: 3, name: '按增重计价' }
+  { id: 1, name: "按数量计价" },
+  { id: 2, name: "按重量计价" },
+  { id: 3, name: "按增重计价" },
 ];
 
 export const quoteTypeOp = [
   {
     value: 1,
-    label: '常规价'
+    label: "常规价",
   },
   {
     value: 2,
-    label: '内部价'
+    label: "内部价",
   },
   {
     value: 3,
-    label: '议价'
-  }
-];
+    label: "议价",
+  },
+];

+ 8 - 0
pages.json

@@ -2438,6 +2438,14 @@
 				"navigationStyle": "custom",
 				"navigationBarTextStyle": "white"
 			}
+		},
+		{
+			"path": "pages/qms/inspectionWork/mySampleRecord",
+			"style": {
+				"navigationBarTitleText": "我的质检受托工单",
+				"navigationStyle": "custom",
+				"navigationBarTextStyle": "white"
+			}
 		}
 	],
 	"tabBar": {

+ 332 - 380
pages/index/index.vue

@@ -1,49 +1,33 @@
 <template>
-  <view>
-    <uni-nav-bar
-      fixed="true"
-      statusBar="true"
-      title="工作台"
-      right-icon="scan"
-      @clickRight="HandlScanCode"
-    ></uni-nav-bar>
-    <view>
-      <CellTip
-        title="协同办公"
-        v-if="internalManagementList.length > 0"
-      ></CellTip>
-      <view class="nav">
-        <view class="nav-content">
-          <view
-            class="nav-item"
-            v-for="(item, index) in internalManagementList"
-            @click="toNav(item.path)"
-          >
-            <span :class="'iconfont ' + item.icon"></span>
-            <i class="badge" v-if="item.badge">{{ item.badge }}</i>
-            <label>{{ item.name }}</label>
-          </view>
-        </view>
-      </view>
-    </view>
-    <view>
-      <CellTip title="生产管理" v-if="productionList.length > 0"></CellTip>
-      <view class="nav">
-        <view class="nav-content">
-          <view
-            class="nav-item"
-            v-for="item in productionList"
-            :key="item.link_url"
-            @click="toNav(item.path)"
-          >
-            <span :class="'iconfont ' + item.icon"></span>
-            <label>{{ item.title }}</label>
-            <label>{{ item.num }}</label>
-          </view>
-        </view>
-      </view>
-    </view>
-    <!-- <view>
+	<view>
+		<uni-nav-bar fixed="true" statusBar="true" title="工作台" right-icon="scan"
+			@clickRight="HandlScanCode"></uni-nav-bar>
+		<view>
+			<CellTip title="协同办公" v-if="internalManagementList.length > 0"></CellTip>
+			<view class="nav">
+				<view class="nav-content">
+					<view class="nav-item" v-for="(item, index) in internalManagementList" @click="toNav(item.path)">
+						<span :class="'iconfont ' + item.icon"></span>
+						<i class="badge" v-if="item.badge">{{ item.badge }}</i>
+						<label>{{ item.name }}</label>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view>
+			<CellTip title="生产管理" v-if="productionList.length > 0"></CellTip>
+			<view class="nav">
+				<view class="nav-content">
+					<view class="nav-item" v-for="item in productionList" :key="item.link_url"
+						@click="toNav(item.path)">
+						<span :class="'iconfont ' + item.icon"></span>
+						<label>{{ item.title }}</label>
+						<label>{{ item.num }}</label>
+					</view>
+				</view>
+			</view>
+		</view>
+		<!-- <view>
       <CellTip title="生产执行"></CellTip>
       <view class="nav">
         <view class="nav-content">
@@ -59,152 +43,116 @@
         </view>
       </view>
     </view> -->
-    <view>
-      <CellTip title="运维管理" v-if="operationsList.length > 0"></CellTip>
-      <view class="nav">
-        <view class="nav-content">
-          <view
-            class="nav-item"
-            v-for="(item, index) in operationsList"
-            @click="toNav(item.path)"
-          >
-            <span :class="'iconfont ' + item.icon"></span>
-            <i class="badge" v-if="item.badge">{{ item.badge }}</i>
-            <label>{{ item.name }}</label>
-          </view>
-        </view>
-      </view>
-    </view>
-    <view>
-      <CellTip title="售后服务管理" v-if="serviceList.length > 0"></CellTip>
-      <view class="nav">
-        <view class="nav-content">
-          <view
-            class="nav-item"
-            v-for="(item, index) in serviceList"
-            @click="toNav(item.path)"
-          >
-            <span :class="'iconfont ' + item.icon"></span>
-            <i class="badge" v-if="item.badge">{{ item.badge }}</i>
-            <label>{{ item.name }}</label>
-          </view>
-        </view>
-      </view>
-    </view>
-    <view>
-      <CellTip title="仓储管理" v-if="warehousingList.length > 0"></CellTip>
+		<view>
+			<CellTip title="运维管理" v-if="operationsList.length > 0"></CellTip>
+			<view class="nav">
+				<view class="nav-content">
+					<view class="nav-item" v-for="(item, index) in operationsList" @click="toNav(item.path)">
+						<span :class="'iconfont ' + item.icon"></span>
+						<i class="badge" v-if="item.badge">{{ item.badge }}</i>
+						<label>{{ item.name }}</label>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view>
+			<CellTip title="售后服务管理" v-if="serviceList.length > 0"></CellTip>
+			<view class="nav">
+				<view class="nav-content">
+					<view class="nav-item" v-for="(item, index) in serviceList" @click="toNav(item.path)">
+						<span :class="'iconfont ' + item.icon"></span>
+						<i class="badge" v-if="item.badge">{{ item.badge }}</i>
+						<label>{{ item.name }}</label>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view>
+			<CellTip title="仓储管理" v-if="warehousingList.length > 0"></CellTip>
 
-      <view class="nav">
-        <view class="nav-content">
-          <view
-            class="nav-item"
-            v-for="(item, index) in warehousingList"
-            @click="toNav(item.path)"
-          >
-            <span :class="'iconfont ' + item.icon"></span>
-            <label>{{ item.title }}</label>
-            <!-- <label>{{ item.num }}</label> -->
-          </view>
-        </view>
-      </view>
-    </view>
-    <view>
-      <CellTip title="运输管理" v-if="dispatchList.length > 0"></CellTip>
-      <view class="nav">
-        <view class="nav-content">
-          <view
-            class="nav-item"
-            v-for="(item, index) in dispatchList"
-            @click="toNav(item.url)"
-          >
-            <span :class="'iconfont ' + item.icon"></span>
-            <i class="badge" v-if="item.badge">{{ item.badge }}</i>
-            <label>{{ item.name }}</label>
-          </view>
-        </view>
-      </view>
-    </view>
-    <view>
-      <CellTip title="营销管理" v-if="saleManageList.length > 0"></CellTip>
-      <view class="nav">
-        <view class="nav-content">
-          <view
-            class="nav-item"
-            v-for="(item, index) in saleManageList"
-            @click="toNav(item.path)"
-          >
-            <span :class="'iconfont ' + item.icon"></span>
-            <i class="badge" v-if="item.badge">{{ item.badge }}</i>
-            <label>{{ item.name }}</label>
-          </view>
-        </view>
-      </view>
-    </view>
-    <view>
-      <CellTip title="采购管理" v-if="purchaseManageList.length > 0"></CellTip>
-      <view class="nav">
-        <view class="nav-content">
-          <view
-            class="nav-item"
-            v-for="(item, index) in purchaseManageList"
-            @click="toNav(item.path)"
-          >
-            <span :class="'iconfont ' + item.icon"></span>
-            <i class="badge" v-if="item.badge">{{ item.badge }}</i>
-            <label>{{ item.name }}</label>
-          </view>
-        </view>
-      </view>
-    </view>
-    <view>
-      <CellTip title="生产管控" v-if="pcsList.length > 0"></CellTip>
-      <view class="nav">
-        <view class="nav-content">
-          <view
-            class="nav-item"
-            v-for="(item, index) in pcsList"
-            @click="toNav(item.path)"
-          >
-            <span :class="'iconfont ' + item.icon"></span>
-            <i class="badge" v-if="item.badge">{{ item.badge }}</i>
-            <label>{{ item.name }}</label>
-          </view>
-        </view>
-      </view>
-    </view>
-    <view>
-      <CellTip title="质量管理" v-if="qmsList.length > 0"></CellTip>
-      <view class="nav">
-        <view class="nav-content">
-          <view
-            class="nav-item"
-            v-for="(item, index) in qmsList"
-            @click="toNav(item.path)"
-          >
-            <span :class="'iconfont ' + item.icon"></span>
-            <i class="badge" v-if="item.badge">{{ item.badge }}</i>
-            <label>{{ item.name }}</label>
-          </view>
-        </view>
-      </view>
-    </view>
-    <view>
-      <CellTip title="溯源管理" v-if="traceabilityList.length > 0"></CellTip>
-      <view class="nav">
-        <view class="nav-content">
-          <view
-            class="nav-item"
-            v-for="(item, index) in traceabilityList"
-            @click="toNav(item.path)"
-          >
-            <span :class="'iconfont ' + item.icon"></span>
-            <i class="badge" v-if="item.badge">{{ item.badge }}</i>
-            <label>{{ item.name }}</label>
-          </view>
-        </view>
-      </view>
-    </view>
-    <!--    <view>
+			<view class="nav">
+				<view class="nav-content">
+					<view class="nav-item" v-for="(item, index) in warehousingList" @click="toNav(item.path)">
+						<span :class="'iconfont ' + item.icon"></span>
+						<label>{{ item.title }}</label>
+						<!-- <label>{{ item.num }}</label> -->
+					</view>
+				</view>
+			</view>
+		</view>
+		<view>
+			<CellTip title="运输管理" v-if="dispatchList.length > 0"></CellTip>
+			<view class="nav">
+				<view class="nav-content">
+					<view class="nav-item" v-for="(item, index) in dispatchList" @click="toNav(item.path)">
+						<span :class="'iconfont ' + item.icon"></span>
+						<i class="badge" v-if="item.badge">{{ item.badge }}</i>
+						<label>{{ item.name }}</label>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view>
+			<CellTip title="营销管理" v-if="saleManageList.length > 0"></CellTip>
+			<view class="nav">
+				<view class="nav-content">
+					<view class="nav-item" v-for="(item, index) in saleManageList" @click="toNav(item.path)">
+						<span :class="'iconfont ' + item.icon"></span>
+						<i class="badge" v-if="item.badge">{{ item.badge }}</i>
+						<label>{{ item.name }}</label>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view>
+			<CellTip title="采购管理" v-if="purchaseManageList.length > 0"></CellTip>
+			<view class="nav">
+				<view class="nav-content">
+					<view class="nav-item" v-for="(item, index) in purchaseManageList" @click="toNav(item.path)">
+						<span :class="'iconfont ' + item.icon"></span>
+						<i class="badge" v-if="item.badge">{{ item.badge }}</i>
+						<label>{{ item.name }}</label>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view>
+			<CellTip title="生产管控" v-if="pcsList.length > 0"></CellTip>
+			<view class="nav">
+				<view class="nav-content">
+					<view class="nav-item" v-for="(item, index) in pcsList" @click="toNav(item.path)">
+						<span :class="'iconfont ' + item.icon"></span>
+						<i class="badge" v-if="item.badge">{{ item.badge }}</i>
+						<label>{{ item.name }}</label>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view>
+			<CellTip title="质量管理" v-if="qmsList.length > 0"></CellTip>
+			<view class="nav">
+				<view class="nav-content">
+					<view class="nav-item" v-for="(item, index) in qmsList" @click="toNav(item.path)">
+						<span :class="'iconfont ' + item.icon"></span>
+						<i class="badge" v-if="item.badge">{{ item.badge }}</i>
+						<label>{{ item.name }}</label>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view>
+			<CellTip title="溯源管理" v-if="traceabilityList.length > 0"></CellTip>
+			<view class="nav">
+				<view class="nav-content">
+					<view class="nav-item" v-for="(item, index) in traceabilityList" @click="toNav(item.path)">
+						<span :class="'iconfont ' + item.icon"></span>
+						<i class="badge" v-if="item.badge">{{ item.badge }}</i>
+						<label>{{ item.name }}</label>
+					</view>
+				</view>
+			</view>
+		</view>
+		<!--    <view>
       <CellTip title="生产类"></CellTip>
 
       <view class="nav">
@@ -221,202 +169,206 @@
         </view>
       </view>
     </view> -->
-  </view>
+	</view>
 </template>
 
 <script>
-import CellTip from "@/components/CellTip.vue";
-import { statistics } from "@/api/myTicket";
-export default {
-  components: {
-    CellTip,
-  },
-  data() {
-    return {
-      timer: null,
-      src1: "https://cdn.uviewui.com/uview/album/1.jpg",
-      workOrder: {}, // 工单统计数据
-      qmsList: [],
-      //生产类
-      productionList: [],
-      // executeList: [
-      //   {
-      //     class: "iconfont icon-gongdanguanli",
-      //     title: "成型",
-      //     link_url: "/pages/production/execute/extrusion/index",
-      //     // "num": 1
-      //   },
-      //   {
-      //     class: "iconfont icon-gongdanguanli",
-      //     title: "自然干燥",
-      //     link_url: "/pages/production/execute/drying/index",
-      //     // "num": 1
-      //   },
-      //   {
-      //     class: "iconfont icon-gongdanguanli",
-      //     title: "升温干燥",
-      //     link_url: "/pages/production/execute/heating/index",
-      //     // "num": 1
-      //   },
-      //   {
-      //     class: "iconfont icon-gongdanguanli",
-      //     title: "半加定长",
-      //     link_url: "/pages/production/execute/halfAdded/index",
-      //     // "num": 1
-      //   },
-      //   // {
-      //   //   class: "iconfont icon-gongdanguanli",
-      //   //   title: "领料",
-      //   //   link_url: "/pages/production/execute/picking/index",
-      //   //   // "num": 1
-      //   // },
-      // ],
-      //仓储管理
+	import CellTip from "@/components/CellTip.vue";
+	import {
+		statistics
+	} from "@/api/myTicket";
+	export default {
+		components: {
+			CellTip,
+		},
+		data() {
+			return {
+				timer: null,
+				src1: "https://cdn.uviewui.com/uview/album/1.jpg",
+				workOrder: {}, // 工单统计数据
+				qmsList: [],
+				//生产类
+				productionList: [],
+				// executeList: [
+				//   {
+				//     class: "iconfont icon-gongdanguanli",
+				//     title: "成型",
+				//     link_url: "/pages/production/execute/extrusion/index",
+				//     // "num": 1
+				//   },
+				//   {
+				//     class: "iconfont icon-gongdanguanli",
+				//     title: "自然干燥",
+				//     link_url: "/pages/production/execute/drying/index",
+				//     // "num": 1
+				//   },
+				//   {
+				//     class: "iconfont icon-gongdanguanli",
+				//     title: "升温干燥",
+				//     link_url: "/pages/production/execute/heating/index",
+				//     // "num": 1
+				//   },
+				//   {
+				//     class: "iconfont icon-gongdanguanli",
+				//     title: "半加定长",
+				//     link_url: "/pages/production/execute/halfAdded/index",
+				//     // "num": 1
+				//   },
+				//   // {
+				//   //   class: "iconfont icon-gongdanguanli",
+				//   //   title: "领料",
+				//   //   link_url: "/pages/production/execute/picking/index",
+				//   //   // "num": 1
+				//   // },
+				// ],
+				//仓储管理
 
-      warehousingList: [],
+				warehousingList: [],
 
-      //运维类
-      operationsList: [],
-      dispatchList: [],
-      internalManagementList: [],
-      treeList: [],
-      saleManageList: [],
-      // 售后服务
-      serviceList: [],
-      // 溯源管理
-      traceabilityList: [],
-      // 采购管理
-      purchaseManageList: [],
-	  pcsList:[]
-    };
-  },
-  created() {
-    this.getTree();
-  },
-  onShow() {
-    this.getStatistics();
-  },
-  onHide() {
-    clearTimeout(this.timer);
-  },
-  onUnload() {
-    clearTimeout(this.timer);
-  },
-  methods: {
-    getStatistics() {
-      // 获取工单统计数
-      statistics()
-        .then((res) => {
-          this.workOrder = res;
-          // console.log("this.operationsList---", this.operationsList);
-          // console.log("res", res);
-          this.operationsList.forEach((item) => {
-            if (item.name == "保养工单") item.badge = res.maintenanceNum;
-            if (item.name == "巡点检工单") item.badge = res.patrolInspection;
-            if (item.name == "维修工单") item.badge = res.repairsNum;
-          });
-        })
-        .finally(() => {
-          this.timer = setTimeout(() => {
-            this.getStatistics();
-          }, 12000);
-        });
-    },
-    getTree() {
-      let _list = uni.getStorageSync("treeList");
-      let list = JSON.parse(_list) || [];
-      console.log("-----------list--------------");
-      console.log(list);
-      if (list[0] && list[0].children.length > 0) {
-        // console.log(list[0].children, "list[0].children ----");
-        list[0].children.forEach((f) => {
-          if (f.path == "productionManage") {
-            this.productionList = f.children;
-          } else if (f.path == "operationsList") {
-            statistics().then((res) => {
-              this.workOrder = res;
-              // console.log("this.operationsList---", this.operationsList);
-              // console.log("res", res);
-              f.children.forEach((item) => {
-                if (item.name == "保养工单") item.badge = res.maintenanceNum;
-                if (item.name == "巡点检工单")
-                  item.badge = res.patrolInspection;
-                if (item.name == "维修工单") item.badge = res.repairsNum;
-              });
-              this.operationsList = f.children;
-            });
-          } else if (f.path == "warehouseManagement") {
-            this.warehousingList = f.children;
-          } else if (f.path == "saleManageList") {
-            this.saleManageList = f.children;
-            this.saleManageList.forEach((item) => {
-              item.name = item.name.replace("员工", "");
-              item.name = item.name.replace("管理员", "");
-            });
-          } else if (f.path == "internalManagement") {
-            // console.log(f, "f");
-            this.internalManagementList = f.children;
-          } else if (f.path == "serviceList") {
-            this.serviceList = f.children;
-          } else if (f.path == "traceability") {
-            this.traceabilityList = f.children;
-          } else if (f.path == "purchasingManage") {
-            this.purchaseManageList = f.children;
-          } else if (f.path == "qualityManage") {
-            this.qmsList = f.children;
-          } else if (f.path == "productionControlManagement") {
-            this.pcsList = f.children;
-          }
-        });
-      }
-    },
+				//运维类
+				operationsList: [],
+				dispatchList: [],
+				internalManagementList: [],
+				treeList: [],
+				saleManageList: [],
+				// 售后服务
+				serviceList: [],
+				// 溯源管理
+				traceabilityList: [],
+				// 采购管理
+				purchaseManageList: [],
+				pcsList: []
+			};
+		},
+		created() {
+			this.getTree();
+		},
+		onShow() {
+			this.getStatistics();
+		},
+		onHide() {
+			clearTimeout(this.timer);
+		},
+		onUnload() {
+			clearTimeout(this.timer);
+		},
+		methods: {
+			getStatistics() {
+				// 获取工单统计数
+				statistics()
+					.then((res) => {
+						this.workOrder = res;
+						// console.log("this.operationsList---", this.operationsList);
+						// console.log("res", res);
+						this.operationsList.forEach((item) => {
+							if (item.name == "保养工单") item.badge = res.maintenanceNum;
+							if (item.name == "巡点检工单") item.badge = res.patrolInspection;
+							if (item.name == "维修工单") item.badge = res.repairsNum;
+						});
+					})
+					.finally(() => {
+						this.timer = setTimeout(() => {
+							this.getStatistics();
+						}, 12000);
+					});
+			},
+			getTree() {
+				let _list = uni.getStorageSync("treeList");
+				let list = JSON.parse(_list) || [];
+				console.log("-----------list--------------");
+				console.log(list);
+				if (list[0] && list[0].children.length > 0) {
+					// console.log(list[0].children, "list[0].children ----");
+					list[0].children.forEach((f) => {
+						if (f.path == "productionManage") {
+							this.productionList = f.children;
+						} else if (f.path == "operationsList") {
+							statistics().then((res) => {
+								this.workOrder = res;
+								// console.log("this.operationsList---", this.operationsList);
+								// console.log("res", res);
+								f.children.forEach((item) => {
+									if (item.name == "保养工单") item.badge = res.maintenanceNum;
+									if (item.name == "巡点检工单")
+										item.badge = res.patrolInspection;
+									if (item.name == "维修工单") item.badge = res.repairsNum;
+								});
+								this.operationsList = f.children;
+							});
+						} else if (f.path == "warehouseManagement") {
+							this.warehousingList = f.children;
+						} else if (f.path == "saleManageList") {
+							this.saleManageList = f.children;
+							this.saleManageList.forEach((item) => {
+								item.name = item.name.replace("员工", "");
+								item.name = item.name.replace("管理员", "");
+							});
+						} else if (f.path == "internalManagement") {
+							// console.log(f, "f");
+							this.internalManagementList = f.children;
+						} else if (f.path == "serviceList") {
+							this.serviceList = f.children;
+						} else if (f.path == "traceability") {
+							this.traceabilityList = f.children;
+						} else if (f.path == "purchasingManage") {
+							this.purchaseManageList = f.children;
+						} else if (f.path == "qualityManage") {
+							this.qmsList = f.children;
+						} else if (f.path == "productionControlManagement") {
+							this.pcsList = f.children;
+						} else if (f.path == 'dispatchManage') {
+							this.dispatchList = f.children;
+						}
+					});
+				}
+			},
 
-    toNav(url) {
-      // console.log(url);
-      uni.navigateTo({
-        url: url,
-      });
-    },
-    HandlScanCode() {
-      let _this = this;
-      uni.scanCode({
-        success: function (res) {
-          console.log(res);
-          // 获取扫描结果中的URL
-          const scanResult = res.result;
-          // 检查URL是否包含traceability
-          if (scanResult && scanResult.includes("/traceability")) {
-            // 从扫描结果中提取id参数
-            let id = "";
-            if (scanResult.includes("id=")) {
-              // 分割URL获取id参数值
-              const idPart = scanResult.split("id=")[1];
-              // 如果id后面还有其他参数,只取到第一个&之前的部分
-              if (idPart.includes("&")) {
-                id = idPart.split("&")[0];
-              } else {
-                id = idPart;
-              }
-            }
-            // 跳转到溯源页面并传递id
-            uni.navigateTo({
-              url: `/pages/traceability/scanCode/index?id=${id}`,
-            });
-            return;
-          }
-          _this.scantoRouter(scanResult);
-        },
-      });
-    },
-    scantoRouter(result) {
-      uni.navigateTo({
-        url: `/pages/pda/workOrder/extrusionMolding/index?id=${result}`,
-      });
-    },
-  },
-};
+			toNav(url) {
+				// console.log(url);
+				uni.navigateTo({
+					url: url,
+				});
+			},
+			HandlScanCode() {
+				let _this = this;
+				uni.scanCode({
+					success: function(res) {
+						console.log(res);
+						// 获取扫描结果中的URL
+						const scanResult = res.result;
+						// 检查URL是否包含traceability
+						if (scanResult && scanResult.includes("/traceability")) {
+							// 从扫描结果中提取id参数
+							let id = "";
+							if (scanResult.includes("id=")) {
+								// 分割URL获取id参数值
+								const idPart = scanResult.split("id=")[1];
+								// 如果id后面还有其他参数,只取到第一个&之前的部分
+								if (idPart.includes("&")) {
+									id = idPart.split("&")[0];
+								} else {
+									id = idPart;
+								}
+							}
+							// 跳转到溯源页面并传递id
+							uni.navigateTo({
+								url: `/pages/traceability/scanCode/index?id=${id}`,
+							});
+							return;
+						}
+						_this.scantoRouter(scanResult);
+					},
+				});
+			},
+			scantoRouter(result) {
+				uni.navigateTo({
+					url: `/pages/pda/workOrder/extrusionMolding/index?id=${result}`,
+				});
+			},
+		},
+	};
 </script>
 
 <style lang="scss" scoped>
-@import "index.scss";
-</style>
+	@import "index.scss";
+</style>

+ 1591 - 0
pages/qms/inspectionWork/addSample.vue

@@ -0,0 +1,1591 @@
+<template>
+	<view>
+		<u-popup :show="visible" mode="center" :round="0" :closeOnClickOverlay="false" :zIndex="99999"
+			@close="closePopup">
+			<view class="popup-content">
+				<view class="popup-header">
+					<text class="popup-title">{{ title }}</text>
+					<view class="close-btn" @click="closePopup">×</view>
+				</view>
+
+				<scroll-view class="popup-body" scroll-y>
+					<view class="form-section">
+						<view class="section-title">基本信息</view>
+						<view class="form-row">
+							<view class="form-item">
+								<text class="label">工单编码</text>
+								<view class="value-wrap" @click="selectQualityWorkOrder"
+									v-if="!isSampleRecord || (isSampleRecord && type != 'add')">
+									<u-input v-model="form.qualityWorkOrderCode" disabled placeholder=" "
+										border="none"></u-input>
+								</view>
+								<view class="value-wrap" v-else>
+									<u-input v-model="form.qualityWorkOrderCode" disabled placeholder=" "
+										border="none"></u-input>
+								</view>
+							</view>
+						</view>
+						<view class="form-row">
+							<view class="form-item">
+								<text class="label">工单名称</text>
+								<view class="value-wrap">
+									<u-input v-model="form.qualityWorkOrderName" disabled placeholder=" "
+										border="none"></u-input>
+								</view>
+							</view>
+						</view>
+
+						<view class="form-row">
+							<view class="form-item">
+								<text class="label">编码</text>
+								<view class="value-wrap">
+									<u-input v-model="form.productCode" disabled placeholder=" "
+										border="none"></u-input>
+								</view>
+							</view>
+						</view>
+						<view class="form-row">
+							<view class="form-item">
+								<text class="label">名称</text>
+								<view class="value-wrap">
+									<u-input v-model="form.productName" disabled placeholder=" "
+										border="none"></u-input>
+								</view>
+							</view>
+						</view>
+						<view class="form-row">
+							<view class="form-item">
+								<text class="label">批次号</text>
+								<view class="value-wrap">
+									<u-input v-model="form.batchNo" disabled placeholder=" " border="none"></u-input>
+								</view>
+							</view>
+						</view>
+						<view class="form-row">
+							<view class="form-item">
+								<text class="label">规格</text>
+								<view class="value-wrap">
+									<u-input v-model="form.specification" disabled placeholder=" "
+										border="none"></u-input>
+								</view>
+							</view>
+						</view>
+						<view class="form-row">
+							<view class="form-item">
+								<text class="label">型号</text>
+								<view class="value-wrap">
+									<u-input v-model="form.modelType" disabled placeholder=" " border="none"></u-input>
+								</view>
+							</view>
+						</view>
+						<view class="form-row">
+							<view class="form-item">
+								<text class="label">牌号</text>
+								<view class="value-wrap">
+									<u-input v-model="form.brandNo" disabled placeholder=" " border="none"></u-input>
+								</view>
+							</view>
+						</view>
+						<view class="form-row">
+							<view class="form-item">
+								<text class="label">总数</text>
+								<view class="value-wrap">
+									<u-input v-model="form.total" disabled placeholder=" " border="none">
+										<template #suffix>{{
+                      tableList[0] && tableList[0].measureUnit
+                    }}</template>
+									</u-input>
+								</view>
+							</view>
+						</view>
+					</view>
+
+					<view class="form-section">
+						<view class="section-title">来源清单</view>
+						<view class="table-info">
+							<text>累计请样数量:{{ workSampleQuantity
+                }}{{
+                  (sampleList[0] && sampleList[0].measureUnit) ||
+                  form.measureUnit
+                }}</text>
+						</view>
+						<view class="table-wrapper">
+							<scroll-view scroll-x scroll-y class="table-scroll">
+								<view class="source-table">
+									<view class="table-header">
+										<view class="table-cell select-cell">
+											<checkbox :checked="isAllSelected" @click="toggleSelectAll" />
+										</view>
+										<view class="table-cell" v-for="col in displaySourceColumns.filter(
+                        (c) => c.prop !== 'select',
+                      )" :key="col.prop">{{ col.label }}</view>
+									</view>
+									<view class="table-body">
+										<view class="table-row" v-for="(item, index) in tableList" :key="index">
+											<view class="table-cell select-cell">
+												<checkbox :checked="isSelected(item)" @click="toggleSelect(item)" />
+											</view>
+											<view class="table-cell" v-for="col in displaySourceColumns.filter(
+                          (c) => c.prop !== 'select',
+                        )" :key="col.prop">
+												{{ item[col.prop] || "-" }}
+											</view>
+										</view>
+										<view class="table-empty" v-if="!tableList || tableList.length === 0">
+											<text>暂无数据</text>
+										</view>
+									</view>
+								</view>
+							</scroll-view>
+						</view>
+					</view>
+
+					<view class="form-section">
+						<view class="section-title">请样信息</view>
+						<view class="form-row">
+							<view class="form-item">
+								<text class="label">请样目的</text>
+								<view class="value-wrap">
+									<u-input v-model="form.pleasePurpose" placeholder="请输入" border="none" :disabled="type=='view'"></u-input>
+								</view>
+							</view>
+						</view>
+						<view class="form-row">
+							<view class="form-item">
+								<text class="label">质检方式</text>
+								<view class="value-wrap">
+									<DictSelection v-model="form.qualityMode" @change="handleQualityModeChange"
+										:disabled="form.isFirstSampling != '1'||type=='view'" dictName="取样类型"></DictSelection>
+								</view>
+							</view>
+						</view>
+						<view class="form-row">
+							<view class="form-item">
+								<text class="label">记录方法</text>
+								<view class="value-wrap" @click="selectRecordingMethod"
+									:class="{ disabled: form.isFirstSampling != '1'||type=='view' }">
+									<u-input :value="recordingMethodList.find(item=>item.value==form.recordingMethod)&&recordingMethodList.find(item=>item.value==form.recordingMethod).label" placeholder="请选择" border="none" disabled>
+										<template #suffix>
+											<text class="arrow">›</text>
+										</template>
+									</u-input>
+								</view>
+							</view>
+						</view>
+
+						<view class="form-section-inner" v-if="form.qualityMode == '2'">
+							<view class="form-row">
+								<view class="form-item">
+									<text class="label">请样类型</text>
+									<view class="value-wrap" @click="selectConditionType"
+										:class="{ disabled: form.isFirstSampling != '1'||type=='view' }">
+										<u-input :value="conditionTypeColumns.find(item=>item.value==form.conditionType)&&conditionTypeColumns.find(item=>item.value==form.conditionType).label"  placeholder="请选择" border="none"
+											disabled>
+											<template #suffix>
+												<text class="arrow">›</text>
+											</template>
+										</u-input>
+									</view>
+								</view>
+							</view>
+
+							<view class="form-row" v-if="form.conditionType == 2">
+								<view class="form-item">
+									<text class="label">数量</text>
+									<view class="value-wrap">
+										<u-input v-model="form.quantity" :disabled="type=='view'" placeholder="请输入" border="none"></u-input>
+									</view>
+								</view>
+							</view>
+							<view class="form-row" v-if="form.conditionType == 2">
+								<view class="form-item">
+									<text class="label">单位</text>
+									<view class="value-wrap" @click="selectUnit"
+										:class="{ disabled: form.isFirstSampling != '1'||type=='view' }">
+										<u-input v-model="form.unit" placeholder="请选择" border="none" disabled>
+											<template #suffix>
+												<text class="arrow">›</text>
+											</template>
+										</u-input>
+									</view>
+								</view>
+							</view>
+							<view class="form-row" v-if="form.conditionType == 2">
+								<view class="form-item">
+									<text class="label">条数</text>
+									<view class="value-wrap">
+										<u-input v-model="form.portion" :disabled="type=='view'" placeholder="请输入" border="none"></u-input>
+									</view>
+								</view>
+							</view>
+
+							<view class="form-row" v-if="form.conditionType == 1">
+								<view class="form-item">
+									<text class="label">数量</text>
+									<view class="value-wrap">
+										<u-input v-model="form.portion" :disabled="type=='view'" placeholder="请输入" border="none"></u-input>
+									</view>
+								</view>
+							</view>
+							<view class="form-row" v-if="form.conditionType == 1">
+								<view class="form-item">
+									<text class="label">单位</text>
+									<view class="value-wrap" @click="selectPackingUnit"
+										:class="{ disabled: form.isFirstSampling != '1'||type=='view' }">
+										<u-input v-model="form.unit" placeholder="请选择" border="none" disabled>
+											<template #suffix>
+												<text class="arrow">›</text>
+											</template>
+										</u-input>
+									</view>
+								</view>
+							</view>
+
+							<view class="confirm-btn-wrap" v-if="type != 'view'">
+								<u-button type="primary" @click="handleSampleSubmit">确认</u-button>
+							</view>
+						</view>
+					</view>
+
+					<view class="form-section">
+						<view class="section-title">样品信息</view>
+						<view class="table-wrapper">
+							<scroll-view scroll-x scroll-y class="table-scroll">
+								<view class="sample-table">
+									<view class="table-header">
+										<view class="table-cell" v-for="col in displaySampleColumns" :key="col.prop">
+											{{ col.label }}
+										</view>
+									</view>
+									<view class="table-body">
+										<view class="table-row" v-for="(item, index) in sampleList" :key="index">
+											<view class="table-cell" v-for="col in displaySampleColumns"
+												:key="col.prop">
+												{{ item[col.prop] || "-" }}
+											</view>
+										</view>
+										<view class="table-empty" v-if="!sampleList || sampleList.length === 0">
+											<text>暂无数据</text>
+										</view>
+									</view>
+								</view>
+							</scroll-view>
+						</view>
+					</view>
+				</scroll-view>
+
+				<view class="popup-footer">
+					<u-button type="default" @click="closePopup">关闭</u-button>
+					<u-button type="primary" @click="save()" v-if="type != 'view'" :loading="loading">保存</u-button>
+					<!-- <u-button type="success" @click="save('submit')" v-if="type != 'view' && isSamplingApproval == 1"
+						:loading="loading">提交</u-button> -->
+				</view>
+			</view>
+			<u-toast ref="uToast"></u-toast>
+		</u-popup>
+
+		<!-- 质检工单选择弹窗 -->
+		<inspectionWorkDialog ref="inspectionWorkDialog" @changeParent="changeParent"></inspectionWorkDialog>
+
+		<!-- 质检方式选择 -->
+		<u-picker :show="showQualityModePicker" :columns="qualityModeColumns" @confirm="confirmQualityMode"
+			@cancel="showQualityModePicker = false"></u-picker>
+
+		<!-- 记录方法选择 -->
+		<u-picker :show="showRecordingMethodPicker" :columns="[recordingMethodList]" @confirm="confirmRecordingMethod"
+			@cancel="showRecordingMethodPicker = false"></u-picker>
+
+		<!-- 请样类型选择 -->
+		<u-picker :show="showConditionTypePicker" :columns="[conditionTypeColumns]" @confirm="confirmConditionType"
+			@cancel="showConditionTypePicker = false"></u-picker>
+
+		<!-- 单位选择 -->
+		<u-picker :show="showUnitPicker" :columns="unitColumns" @confirm="confirmUnit"
+			@cancel="showUnitPicker = false"></u-picker>
+
+		<!-- 包装单位选择 -->
+		<u-picker :show="showPackingUnitPicker" :columns="packingUnitColumns" @confirm="confirmPackingUnit"
+			@cancel="showPackingUnitPicker = false"></u-picker>
+	</view>
+</template>
+
+<script>
+	import {
+		recordingMethodList
+	} from "@/utils/utils.js";
+	import DictSelection from "@/components/Dict/DictSelection.vue";
+	const defForm = {
+		code: "", //编码
+		name: "", //名称
+		conditionType: "",
+		quantity: "",
+		unit: "",
+		portion: "",
+		qualityMode: "",
+		qualityModeName: "",
+		recordingMethod: 1,
+		recordingMethodName: "",
+		pleaseQuantity: "",
+		pleasePurpose: "",
+		pleaseUnit: "",
+		sampleQuantity: "",
+		qualityWorkOrderId: "",
+		qualityWorkOrderCode: "",
+		qualityWorkOrderName: "",
+		isFirstSampling: "",
+    measureUnit:''
+	};
+	import {
+		queryQualityInventory,
+		queryQualityTempleContent,
+	} from "@/api/inspectionWork";
+	import {
+		samplingrecordSave,
+		getById,
+		samplingrecordUpdate,
+		samplingRecordsPage,
+	} from "@/api/samplingRecords";
+	import inspectionWorkDialog from "./components/inspectionWorkDialog.vue";
+	import { getCodeList, getCode, parameterGetByCode } from '@/api/pda/picking.js'
+	export default {
+		components: {
+			inspectionWorkDialog,
+			DictSelection
+		},
+
+		data() {
+			return {
+				recordingMethodList,
+				form: {
+					...defForm
+				},
+				activeComp: "main",
+				tabOptions: [{
+						key: "main",
+						name: "请样详情"
+					},
+					{
+						key: "bpm",
+						name: "流程详情"
+					},
+				],
+				workSampleQuantity: 0,
+				visible: false,
+				loading: false,
+				sampleNumberList: [{
+						label: "全检",
+						value: 1
+					},
+					{
+						label: "抽检",
+						value: 2
+					},
+				],
+				selection: [],
+				// 弹窗相关
+				showQualityModePicker: false,
+				showRecordingMethodPicker: false,
+				showConditionTypePicker: false,
+				showUnitPicker: false,
+				showPackingUnitPicker: false,
+				qualityModeColumns: [],
+				recordingMethodPickerColumns: [],
+				conditionTypeColumns: [{
+						label: "请整样",
+						value: 1
+					},
+					{
+						label: "请小样",
+						value: 2
+					},
+				],
+				unitColumns: [
+					[]
+				],
+				packingUnitColumns: [
+					[]
+				],
+				// 显示的表格列
+				displaySourceColumns: [{
+						label: "",
+						prop: "select",
+						type: "selection"
+					},
+					{
+						label: "名称",
+						prop: "categoryName"
+					},
+					{
+						label: "计量数量",
+						prop: "measureQuantity"
+					},
+					{
+						label: "计量单位",
+						prop: "measureUnit"
+					},
+					{
+						label: "包装数量",
+						prop: "packingQuantity"
+					},
+					{
+						label: "包装单位",
+						prop: "packingUnit"
+					},
+				],
+				displaySampleColumns: [{
+						label: "样品编码",
+						prop: "sampleCode"
+					},
+					{
+						label: "名称",
+						prop: "categoryName"
+					},
+					{
+						label: "计量数量",
+						prop: "measureQuantity"
+					},
+					{
+						label: "计量单位",
+						prop: "measureUnit"
+					},
+					{
+						label: "包装数量",
+						prop: "packingQuantity"
+					},
+					{
+						label: "包装单位",
+						prop: "packingUnit"
+					}
+				],
+				packingSpecificationOption: [],
+				sampleList: [],
+				schemeList: [],
+				tableList: [],
+				type: "add",
+				title: "",
+				isSamplingApproval: 0,
+				isSampleRecord: false,
+				isAllSelected: false,
+			};
+		},
+
+		computed: {
+			allSelected() {
+				return (
+					this.tableList.length > 0 &&
+					this.selection.length === this.tableList.length
+				);
+			},
+		},
+		created() {},
+		methods: {
+			// 切换全选
+			toggleSelectAll() {
+				if (this.isAllSelected) {
+					this.selection = [];
+				} else {
+					this.selection = [...this.tableList];
+				}
+				this.isAllSelected = !this.isAllSelected;
+			},
+			// 切换单选
+			toggleSelect(item) {
+				const index = this.selection.findIndex((row) => row.id === item.id);
+				if (index > -1) {
+					this.selection.splice(index, 1);
+				} else {
+					this.selection.push(item);
+				}
+				this.isAllSelected = this.selection.length === this.tableList.length;
+			},
+			// 判断是否选中
+			isSelected(item) {
+				return this.selection.findIndex((row) => row.id === item.id) > -1;
+			},
+			closePopup() {
+				this.cancel();
+			},
+			async open(type, row) {
+				// this.activeComp = 'main';
+				this.visible = true;
+				this.type = type;
+				// this.parameterGetByCode();
+				this.title =
+					type == "add" ? "请样" : type == "edit" ? "修改请样" : "详情";
+				if (type == "add") {
+					if (row) {
+						this.init(row);
+					}
+				} else {
+					this.getById(row.id);
+				}
+			},
+			// 选择质检工单
+			selectQualityWorkOrder() {
+				this.$refs.inspectionWorkDialog.open();
+			},
+			// 质检方式选择
+			selectQualityMode() {
+				if (this.form.isFirstSampling != "1") return;
+				this.qualityModeColumns = [this.sampleNumberList];
+				this.showQualityModePicker = true;
+			},
+			confirmQualityMode(e) {
+				this.form.qualityMode = e.value[0].value;
+				this.form.qualityModeName = e.value[0].label;
+				this.handleQualityModeChange(e.value[0].value);
+				this.showQualityModePicker = false;
+			},
+			// 记录方法选择
+			selectRecordingMethod() {
+				if (this.form.isFirstSampling != "1") return;
+				// this.recordingMethodPickerColumns = [this.recordingMethodList];
+				this.showRecordingMethodPicker = true;
+			},
+			confirmRecordingMethod(e) {
+				this.form.recordingMethod = e.value[0].value;
+				this.form.recordingMethodName = e.value[0].label;
+				this.showRecordingMethodPicker = false;
+			},
+			// 请样类型选择
+			selectConditionType() {
+				if (this.form.isFirstSampling != "1") return;
+
+				this.showConditionTypePicker = true;
+			},
+			confirmConditionType(e) {
+				this.form.conditionType = e.value[0].value;
+				this.form.conditionTypeName = e.value[0].label;
+				this.showConditionTypePicker = false;
+			},
+			// 单位选择
+			selectUnit() {
+				if (this.form.isFirstSampling != "1") return;
+				let unitList = this.packingSpecificationOption.map(
+					(item) => item.conversionUnit,
+				);
+				this.unitColumns = [unitList];
+				this.showUnitPicker = true;
+			},
+			confirmUnit(e) {
+				this.form.unit = e.value[0];
+				this.showUnitPicker = false;
+			},
+			// 包装单位选择
+			selectPackingUnit() {
+				if (this.form.isFirstSampling != "1") return;
+				let unitList = this.packingSpecificationOption.map(
+					(item) => item.conversionUnit,
+				);
+				this.packingUnitColumns = [unitList];
+				this.showPackingUnitPicker = true;
+			},
+			confirmPackingUnit(e) {
+				let selectedItem = this.packingSpecificationOption.find(
+					(item) => item.conversionUnit === e.value[0],
+				);
+				if (selectedItem) {
+					this.form.packingUnit = selectedItem.id;
+					this.form.packingUnitName = selectedItem.conversionUnit;
+					this.form.unit = selectedItem.conversionUnit;
+				}
+				this.showPackingUnitPicker = false;
+			},
+			parameterGetByCode() {
+				parameterGetByCode({
+					code: "sampling_approval",
+				}).then((res) => {
+					this.isSamplingApproval = res.value;
+				});
+			},
+			async init(row) {
+				let isPackingUnit = false;
+				let data = await samplingRecordsPage({
+					qualityWorkOrderId: row.id,
+				});
+				let list = data.list.filter(
+					(item) => item.status === 0 || item.status === 4,
+				);
+				let list1 = data.list.filter((item) => item.status != 3);
+				if (list?.length) {
+					this.getById(list[0].id);
+					this.type = "edit";
+					this.title = "修改请样";
+				} else {
+					row.sourceCode = row.qualityPlanCode || row.workOrderCode;
+					this.form = JSON.parse(JSON.stringify(row));
+					this.form.qualityWorkOrderId = row.id;
+					this.form.qualityWorkOrderCode = row.code;
+					this.form.qualityWorkOrderName = row.name;
+					this.workSampleQuantity = Number(row.sampleQuantity) || 0;
+
+					if (!list1?.length) {
+						this.form.isFirstSampling = 1;
+						isPackingUnit = true;
+						if (this.form.conditionType == 1) {
+							this.$set(this.form, "packingUnit", "111");
+						}
+					} else {
+						this.$set(this.form, "unit", list1[0].unit);
+						this.$set(this.form, "measureUnit", list1[0].measureUnit);
+					}
+					await this.datasource(list1[0]?.unit, isPackingUnit);
+					await this.queryQualityTempleContent(
+						!list1.length && row.qualityMode == 1,
+					);
+				}
+			},
+			getById(id) {
+				getById(id).then((res) => {
+					this.workSampleQuantity =
+						Number(res.qualityWorkOrderVO.sampleQuantity) || 0;
+					[
+						"id",
+						"code",
+						"name",
+						"createTime",
+						"createUserId",
+						"status",
+						"approvalStatus",
+						"approvalUserId",
+						"sampleQuantity",
+						"processInstanceId",
+					].forEach((it) => {
+						delete res.qualityWorkOrderVO[it];
+					});
+					this.form = {
+						...res,
+						...res.qualityWorkOrderVO
+					};
+					this.datasource(this.form.unit);
+					this.queryQualityTempleContent();
+					if (this.form.qualityMode == 2) {
+						if (res.qualityWorkOrderVO.conditionType == 1) {
+							this.$set(this.form, "portion", res.quantity);
+							this.$set(this.form, "quantity", 0);
+						} else {
+							this.$set(this.form, "portion", res.copies);
+						}
+					}
+
+					this.sampleList = res.qualitySampleList;
+				});
+			},
+			/* 查询质检模板内容 */
+			async queryQualityTempleContent(is) {
+				const res = await queryQualityTempleContent({
+					qualityWorkerId: this.form.qualityWorkOrderId,
+					page: 1,
+					size: 10000,
+				});
+				this.schemeList = res.list;
+				if (is) {
+					this.updatePackingList();
+				}
+			},
+			cancel() {
+				this.form = {
+					...defForm,
+				};
+        this.workSampleQuantity=0
+				this.schemeList = [];
+				this.packingSpecificationOption = [];
+				this.sampleList = [];
+				this.tableList = [];
+
+				this.visible = false;
+			},
+			changeParent(row) {
+				this.init(row);
+			},
+			async datasource(unit, isPackingUnit) {
+				const res = await queryQualityInventory({
+					qualityWorkerId: this.form.qualityWorkOrderId,
+					pageNum: 1,
+					size: -1,
+				});
+				console.log(res, "res");
+
+				let o = res.list[0];
+				let listArr = [];
+				if (o.measureUnit) {
+					listArr.push({
+						packageCellTotal: 1,
+						conversionUnit: o.measureUnit,
+						id: "111",
+					});
+				}
+				if (o.packingUnit) {
+					listArr.push({
+						packageCellTotal: o.measureQuantity - 0,
+						conversionUnit: o.packingUnit,
+						id: "222",
+					});
+				}
+				if (unit) {
+					this.$set(
+						this.form,
+						"packingUnit",
+						listArr.find((item) => unit == item.conversionUnit)?.id,
+					);
+				}
+				if (isPackingUnit) {
+					this.$set(this.form, "unit", res.list[0]?.measureUnit);
+				}
+				this.form.pleaseUnit = res.list[0]?.measureUnit;
+				res.list.map((el) => {
+					el.weightProportion = el.weight ?
+						(el.weight / el.measureQuantity).toFixed(4) :
+						0;
+					el.weightProportion = el.weightProportion - 0;
+				});
+				this.packingSpecificationOption = listArr;
+				this.tableList = res.list;
+				return res;
+			},
+
+			handleSampleSubmit() {
+				let params = {
+					conditionType: this.form.conditionType,
+					quantity: this.form.quantity,
+					sampleUnit: this.form.unit,
+					portion: this.form.portion,
+				};
+				let specifications = this.packingSpecificationOption.find(
+					(el) => el.id == this.form.packingUnit,
+				);
+				this.sampleFn(params, specifications);
+			},
+
+			async sampleFn(data, specifications) {
+				console.log(this.selection, 'this.selection')
+				this.sampleList = [];
+				if (!this.selection || this.selection.length == 0) {
+					this.$refs.uToast.show({
+						type: "error",
+						icon: false,
+						message: "请先选择来源清单!",
+					}, )
+
+					return;
+				}
+				const quantity = data.quantity || 1;
+				const unit = data.sampleUnit;
+				const sampleCount = Number(data.portion);
+				try {
+					// 2 取小样
+					if (this.form.conditionType == 2) {
+						if (!this.validateMeasureQuantity(quantity, unit, sampleCount))
+							return; //取样数量验证
+						if (unit === "KG" && !this.validateWeight(quantity, sampleCount))
+							return; // 若计量单位为重量,还需验证总重量是否足够
+						await this.getNewFullSampleList(
+							Math.ceil(sampleCount),
+							quantity,
+							unit,
+							specifications,
+						);
+					} else {
+						let isFlag = this.validateSampleQuantity(sampleCount, specifications);
+						if (!isFlag) return;
+						if (this.form.inspectionStandards == 1) {
+							await this.getNewFullSampleList(
+								Math.ceil(sampleCount),
+								quantity,
+								unit,
+								specifications,
+							);
+						} else {
+							await this.handleWeightFullSample(sampleCount, specifications);
+						}
+					}
+				} catch (error) {
+					console.error("请样处理失败:", error);
+					this.$refs.uToast.show({
+						type: "error",
+						icon: false,
+						message: "请样处理失败!",
+					}, )
+
+
+
+				}
+			},
+			validateWeight(quantity, sampleCount) {
+				let totalMaxPossible = 0;
+				this.selection.forEach((item) => {
+					totalMaxPossible += item.measureQuantity / quantity;
+				});
+
+				if (totalMaxPossible < sampleCount) {
+					console.error("请样处理失败:", error);
+					this.$refs.uToast.show({
+						type: "error",
+						icon: false,
+						message: `最大请样条数为${totalMaxPossible}`,
+					}, )
+
+					return false;
+				}
+
+				let totalWeight = this.selection.reduce(
+					(sum, item) => sum + item.weight,
+					0,
+				);
+				const weightUnit = this.selection[0].weightUnit;
+				if (weightUnit === "G") totalWeight /= 1000;
+
+				if (quantity * sampleCount > totalWeight) {
+
+					this.$refs.uToast.show({
+						type: "error",
+						icon: false,
+						message: `请样计量重量不能大于总计量重量`,
+					}, )
+
+					return false;
+				}
+
+				const invalidItem = this.selection.find((item) => {
+					const weight =
+						item.weightUnit === "G" ? item.weight / 1000 : item.weight;
+					return weight < quantity;
+				});
+
+				if (invalidItem) {
+					this.$refs.uToast.show({
+						type: "error",
+						icon: false,
+						message: `勾选条目重量小于请样重量`,
+					}, )
+
+					return false;
+
+				}
+
+				return true;
+			},
+
+			validateMeasureQuantity(quantity, unit, sampleCount) {
+				if (quantity <= 0) {
+
+					this.$refs.uToast.show({
+						type: "error",
+						icon: false,
+						message: `请样计量数量必须大于`,
+					}, )
+
+					return false;
+
+				}
+
+				const totalQuantity =
+					this.selection.reduce((sum, item) => sum + item.measureQuantity, 0) -
+					this.workSampleQuantity;
+
+				if (
+					this.selection[0].measureUnit === unit &&
+					quantity * sampleCount > totalQuantity
+				) {
+					this.$refs.uToast.show({
+						type: "error",
+						icon: false,
+						message: `请样计量数量不能大于总计量数量`,
+					}, )
+
+
+					return false;
+				}
+
+				const invalidItem = this.selection.find(
+					(item) => item.measureQuantity < quantity,
+				);
+				if (invalidItem) {
+					this.$refs.uToast.show({
+						type: "error",
+						icon: false,
+						message: `条目计量数量小于请样计量数量`,
+					}, )
+
+
+					return false;
+				}
+				return true;
+			},
+
+			async handleWeightFullSample(sampleCount, specifications) {
+				const dataList = [];
+				let currentNum = sampleCount - this.selection.length;
+				let currentNum1 = sampleCount;
+				for (const item of this.selection) {
+					const qualitySampleTemplateList = item.qualitySampleTemplateList?.length ?
+						JSON.parse(JSON.stringify(item.qualitySampleTemplateList)) :
+						JSON.parse(
+							JSON.stringify(
+								this.schemeList.map((item) => {
+									item["qualityResults"] = 1;
+									return item;
+								}),
+							),
+						);
+
+					if (sampleCount >= this.selection.length) {
+						dataList.push({
+							...item,
+							measureQuantity: 1, //作为计量数量
+							sampleCode: await getCode("sample_code"),
+							qualitySampleTemplateList,
+						});
+					} else {
+						if (dataList.length < sampleCount) {
+							dataList.push({
+								...item,
+								measureQuantity: currentNum1 > 1 ? 1 : currentNum1, //作为计量数量
+								sampleCode: await getCode("sample_code"),
+								qualitySampleTemplateList,
+							});
+							currentNum1 -= 1;
+						}
+					}
+				}
+				if (sampleCount > this.selection.length) {
+					dataList.forEach((item) => {
+						if (currentNum > 0) {
+							let data = this.selection.find((val) => val.id == item.id);
+							item["measureQuantity"] =
+								data.measureQuantity - 1 - currentNum > 0 ?
+								currentNum + 1 :
+								data.measureQuantity;
+							currentNum = currentNum - (data.measureQuantity - 1);
+						}
+					});
+				}
+				// 更改 从新计算 样品清单 取整样 数据
+				if (specifications && specifications.id) {
+					dataList.map((el) => {
+						el.measureQuantity =
+							el.measureQuantity * specifications.packageCellTotal;
+						el.weight = this.formatNumber(
+							el.measureQuantity,
+							el.weightProportion,
+						);
+					});
+				}
+				// 更改
+				this.sampleList = dataList;
+				this.getTotal();
+			},
+			// 小数点数据判断
+			formatNumber(a, b, maxDecimals = 4) {
+				if (a == 0 || b == 0 || !a || !b) {
+					return 0;
+				}
+				const product = a * b;
+				const rounded = Number(product.toFixed(maxDecimals));
+				const str = rounded.toString();
+				if (str.indexOf(".") !== -1) {
+					return str.replace(/\.?0+$/, "");
+				}
+				return str;
+			},
+			//从来源数组取样到目标数组
+			async getNewFullSampleList(
+				sampleCount,
+				sampleQuantity,
+				sampleUnit,
+				specifications,
+			) {
+				const sourceArray = this.selection;
+				const isUnitMismatch =
+					sourceArray.length > 0 && sourceArray[0].measureUnit !== sampleUnit;
+
+				const items = sourceArray.map((item) => ({
+					...item,
+					remainingQuantity: isUnitMismatch ? Infinity : item["measureQuantity"],
+					maxPossible: item["measureQuantity"] / sampleQuantity,
+				}));
+
+				const result = [];
+				let remainingCount = sampleCount;
+				let count = Math.ceil(remainingCount);
+				const codeList = await this.batchCodes(count);
+				let codeIdx = 0;
+
+				while (remainingCount > 0) {
+					items.sort(
+						(a, b) =>
+						b.remainingQuantity / b["measureQuantity"] -
+						a.remainingQuantity / a["measureQuantity"],
+					);
+
+					let distributed = false;
+
+					for (const item of items) {
+						if (
+							!isUnitMismatch ||
+							(item.remainingQuantity >= sampleQuantity && remainingCount > 0)
+						) {
+							let qualitySampleTemplateList = [];
+							if (
+								item.qualitySampleTemplateList == undefined ||
+								item.qualitySampleTemplateList == null ||
+								item.qualitySampleTemplateList.length == 0
+							) {
+								qualitySampleTemplateList = JSON.parse(
+									JSON.stringify(this.schemeList),
+								);
+							} else {
+								qualitySampleTemplateList = item.qualitySampleTemplateList;
+							}
+							let sampleCode = codeList[codeIdx];
+							if (
+								this.form.conditionType == 1 &&
+								this.form.inspectionStandards == 1
+							) {
+								result.push({
+									...item,
+									measureQuantity: 1,
+									sampleCode,
+									qualitySampleTemplateList,
+								});
+							} else if (this.form.conditionType == 2) {
+								let weight = (item.weight / item.maxPossible).toFixed(2);
+								result.push({
+									...item,
+									measureQuantity: sampleQuantity,
+									measureUnit: sampleUnit,
+									sampleCode,
+									weight,
+									qualitySampleTemplateList,
+								});
+							}
+							if (!isUnitMismatch) {
+								item.remainingQuantity -= sampleQuantity;
+							}
+							remainingCount = (remainingCount - 1).toFixed(2);
+							codeIdx++;
+							distributed = true;
+						}
+					}
+
+					if (!distributed) {
+						break;
+					}
+				}
+
+				if (this.form.conditionType == 1 && specifications && specifications.id) {
+					result.map((el) => {
+						el.measureQuantity =
+							el.measureQuantity * specifications.packageCellTotal;
+						el.weight = this.formatNumber(
+							el.measureQuantity,
+							el.weightProportion,
+						);
+					});
+				}
+				this.sampleList = result;
+				if (this.sampleList.length > sampleCount) {
+					this.sampleList = this.sampleList.splice(0, sampleCount);
+				}
+				this.getTotal();
+			},
+			// 当计量类型 是数量的时候 取整样 校验
+			validateSampleQuantity(sampleCount, specifications) {
+				let packingUnit = this.selection[0].packingUnit?.trim() || "";
+				let totalS = 0;
+				let measureQuantityCount = 0;
+				let labelKey =
+					packingUnit == specifications.conversionUnit.trim() ?
+					"packingQuantity" :
+					"measureQuantity";
+				let labelName = labelKey == "packingQuantity" ? "包装数量" : "计量数量";
+				totalS = this.selection.reduce((total, el) => total + el[labelKey], 0);
+				let formTotalS = this.tableList.reduce(
+					(total, el) => total + el.measureQuantity,
+					0,
+				);
+				if (sampleCount > totalS) {
+					this.$refs.uToast.show({
+						type: "error",
+						icon: false,
+						message: `所填的条目数量不能超过所选${labelName}总和${totalS}`,
+					}, )
+
+
+					return false;
+				}
+				if (labelKey == "packingQuantity") {
+					measureQuantityCount = sampleCount * this.selection[0].measureQuantity;
+				} else {
+					measureQuantityCount = sampleCount;
+				}
+				if (measureQuantityCount > formTotalS - this.workSampleQuantity) {
+					this.$refs.uToast.show({
+						type: "error",
+						icon: false,
+						message: `请样数量不能大于${formTotalS - this.workSampleQuantity} ${
+            this.selection[0].measureUnit
+          }`,
+					}, )
+
+
+					return false;
+
+				}
+				return true;
+			},
+
+			handleQualityModeChange(val) {
+				if (val == 1) {
+					this.updatePackingList();
+				} else {
+					this.sampleList = [];
+					this.getTotal();
+				}
+			},
+			// 全检
+			async updatePackingList() {
+				let list = this.tableList;
+				let sampleCount = this.form.total;
+				const dataList = [];
+				let count = list ? list.length : 0;
+				const codeList = await this.batchCodes(count);
+				for (const [index, item] of list.entries()) {
+					const qualitySampleTemplateList = item.qualitySampleTemplateList?.length ?
+						JSON.parse(JSON.stringify(item.qualitySampleTemplateList)) :
+						JSON.parse(
+							JSON.stringify(
+								this.schemeList.map((item) => {
+									item["qualityResults"] = 1;
+									return item;
+								}),
+							),
+						);
+					dataList.push({
+						...item,
+						measureQuantity: item.measureQuantity,
+						sampleCode: codeList[index],
+						qualitySampleTemplateList,
+					});
+				}
+				this.sampleList = dataList;
+				this.getTotal();
+			},
+			getTotal() {
+				this.form.sampleQuantity = this.sampleList
+					.reduce((total, el) => total + Number(el.measureQuantity), 0)
+					.toFixed(2);
+				this.form.sampleWeight = this.sampleList
+					.reduce((total, el) => total + Number(el.weight), 0)
+					.toFixed(2);
+			},
+			async batchCodes(count) {
+				if (count <= 0) return;
+				let params = {
+					count
+				};
+				const res = await getCodeList("sample_code", params);
+				return res;
+			},
+			/* 保存编辑 */
+			save(type) {
+				if (this.type == "add") {
+					[
+						"id",
+						"code",
+						"name",
+						"createTime",
+						"createUserId",
+						"status",
+						"approvalStatus",
+						"approvalUserId",
+					].forEach((key) => {
+						delete this.form[key];
+					});
+				}
+				let data = JSON.parse(JSON.stringify(this.form));
+
+				// 验证
+				if (!this.form.qualityWorkOrderCode) {
+					uni.showToast({
+						title: "请选择质检工单",
+						icon: "none"
+					});
+					return;
+				}
+				if (!this.form.qualityMode) {
+					uni.showToast({
+						title: "请选择质检方式",
+						icon: "none"
+					});
+					return;
+				}
+				if (!this.form.recordingMethod) {
+					uni.showToast({
+						title: "请选择记录方法",
+						icon: "none"
+					});
+					return;
+				}
+				if (this.form.qualityMode == "2" && !this.form.conditionType) {
+					uni.showToast({
+						title: "请选择请样类型",
+						icon: "none"
+					});
+					return;
+				}
+				if (!this.sampleList.length) {
+					uni.showToast({
+						title: "样品清单不能为空!",
+						icon: "none"
+					});
+					return;
+				}
+				//抽检
+				if (data.qualityMode == 2) {
+					//取整样
+					if (data.conditionType == 1) {
+						data.quantity = data.portion;
+					} else {
+						data.copies = data.portion;
+					}
+				}
+				data.measureUnit = this.sampleList[0].measureUnit;
+
+				let api = this.type == "add" ? samplingrecordSave : samplingrecordUpdate;
+				this.loading = true;
+
+				api({
+						...data,
+						sampleList: this.sampleList,
+					})
+					.then((res) => {
+						this.loading = false;
+
+						uni.showToast({
+							title: "操作成功",
+							icon: "success"
+						});
+
+						if (type == "submit") {
+							this.approvalSubmit(this.type == "add" ? res : data.id);
+						} else {
+							this.cancel();
+							this.$emit("reload");
+						}
+					})
+					.catch(() => {
+						this.loading = false;
+					});
+			},
+			async approvalSubmit(id) {
+				const res = await getById(id);
+				this.processSubmitDialogFlag = true;
+				this.$nextTick(() => {
+					let params = {
+						businessId: res.id,
+						businessKey: "sampling_approval_process",
+						formCreateUserId: res.createUserId,
+						variables: {
+							businessCode: res.code,
+							businessName: "请样",
+							businessType: res.qualityWorkOrderVO.conditionType == 1 ? "整样" : "小样",
+						},
+					};
+					this.$refs.processSubmitDialogRef.init(params);
+				});
+			},
+			search() {
+				this.cancel();
+				this.$emit("reload");
+			},
+		},
+	};
+</script>
+
+<style lang="scss" scoped>
+	.popup-content {
+		width: 100vw;
+		height: 100vh;
+		background: #fff;
+		border-radius: 0;
+		display: flex;
+		flex-direction: column;
+	}
+
+	.popup-header {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 30rpx;
+		border-bottom: 1rpx solid #e5e5e5;
+
+		.popup-title {
+			font-size: 36rpx;
+			font-weight: bold;
+			color: #333;
+		}
+
+		.close-btn {
+			width: 60rpx;
+			height: 60rpx;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			font-size: 60rpx;
+			color: #999;
+			line-height: 1;
+		}
+	}
+
+	.popup-body {
+		flex: 1;
+		overflow-y: auto;
+		padding: 0 30rpx 30rpx;
+	}
+
+	.form-section {
+		margin-top: 30rpx;
+
+		.section-title {
+			font-size: 32rpx;
+			font-weight: bold;
+			color: #333;
+			margin-bottom: 20rpx;
+			padding-left: 20rpx;
+			border-left: 6rpx solid #157a2c;
+		}
+
+		.form-row {
+			margin-bottom: 20rpx;
+
+			.form-item {
+				display: flex;
+				align-items: center;
+				padding: 20rpx 0;
+				border-bottom: 1rpx solid #f5f5f5;
+
+				.label {
+					width: 150rpx;
+					font-size: 28rpx;
+					color: #333;
+					flex-shrink: 0;
+
+					&::after {
+						content: ":";
+					}
+				}
+
+				.value-wrap {
+					flex: 1;
+					min-height: 60rpx;
+					display: flex;
+					align-items: center;
+					position: relative;
+
+					&.disabled {
+						opacity: 0.6;
+					}
+
+					.arrow {
+						color: #999;
+						font-size: 40rpx;
+						line-height: 1;
+					}
+				}
+			}
+		}
+
+		.form-section-inner {
+			// margin-top: 20rpx;
+			// padding: 0 20rpx;
+			// background: #f9f9f9;
+			// border-radius: 12rpx;
+		}
+	}
+
+	.table-info {
+		padding: 20rpx;
+		font-size: 28rpx;
+		color: #666;
+		background: #f9f9f9;
+		border-radius: 8rpx;
+		margin-bottom: 20rpx;
+	}
+
+	.table-wrapper {
+		border: 1rpx solid #e5e5e5;
+		border-radius: 8rpx;
+		overflow: hidden;
+		max-height: 400rpx;
+	}
+
+	.table-scroll {
+		width: 100%;
+		height: 400rpx;
+	}
+
+	.source-table {
+		min-width: 100%;
+		width: 950rpx;
+	}
+
+	.table-header {
+		display: flex;
+		background: #f5f5f5;
+		z-index: 10;
+		min-width: 100%;
+		box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.05);
+
+		.table-cell {
+			padding: 20rpx 10rpx;
+			font-size: 26rpx;
+			font-weight: bold;
+			color: #333;
+			text-align: center;
+			border-right: 1rpx solid #e5e5e5;
+			white-space: nowrap;
+			overflow: hidden;
+			text-overflow: ellipsis;
+			flex-shrink: 0;
+
+			&.select-cell {
+				width: 80rpx;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				padding: 20rpx;
+			}
+
+			&:nth-child(2) {
+				width: 300rpx;
+			}
+
+			&:nth-child(3),
+			&:nth-child(4),
+			&:nth-child(5),
+			&:nth-child(6) {
+				width: 140rpx;
+			}
+
+			&:last-child {
+				border-right: none;
+			}
+		}
+	}
+
+	.sample-table {
+		min-width: 100%;
+		width: 1040rpx;
+	}
+
+	.table-body {
+		.table-row {
+			display: flex;
+			border-bottom: 1rpx solid #e5e5e5;
+
+			&:last-child {
+				border-bottom: none;
+			}
+
+			.table-cell {
+				padding: 20rpx 10rpx;
+				font-size: 24rpx;
+				color: #666;
+				text-align: center;
+				border-right: 1rpx solid #e5e5e5;
+				white-space: nowrap;
+				overflow: hidden;
+				text-overflow: ellipsis;
+				flex-shrink: 0;
+
+				&.select-cell {
+					width: 80rpx;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					padding: 20rpx;
+				}
+
+				&:nth-child(2) {
+					width: 300rpx;
+				}
+
+				&:nth-child(3),
+				&:nth-child(4),
+				&:nth-child(5),
+				&:nth-child(6) {
+					width: 140rpx;
+				}
+
+				&:last-child {
+					border-right: none;
+				}
+			}
+		}
+
+		.table-empty {
+			padding: 60rpx 0;
+			text-align: center;
+			font-size: 28rpx;
+			color: #999;
+		}
+	}
+
+	// 样品信息表格特定样式
+	.sample-table {
+		.table-header {
+			.table-cell {
+				&:nth-child(1) {
+					width: 200rpx;
+				}
+
+				&:nth-child(2) {
+					width: 250rpx;
+				}
+
+				&:nth-child(3),
+				&:nth-child(4),
+				&:nth-child(5),
+				&:nth-child(6) {
+					width: 140rpx;
+				}
+			}
+		}
+
+		.table-body {
+			.table-cell {
+				&:nth-child(1) {
+					width: 200rpx;
+				}
+
+				&:nth-child(2) {
+					width: 250rpx;
+				}
+
+				&:nth-child(3),
+				&:nth-child(4),
+				&:nth-child(5),
+				&:nth-child(6) {
+					width: 140rpx;
+				}
+			}
+		}
+	}
+
+	.confirm-btn-wrap {
+		margin-top: 20rpx;
+		padding: 0 20rpx;
+	}
+
+	.popup-footer {
+		display: flex;
+		padding: 20rpx 30rpx;
+		border-top: 1rpx solid #e5e5e5;
+		gap: 20rpx;
+
+		/deep/ .u-button {
+			flex: 1;
+		}
+	}
+</style>

+ 171 - 0
pages/qms/inspectionWork/components/inspectionWorkDialog.vue

@@ -0,0 +1,171 @@
+<template>
+  <u-popup :show="show" mode="center" :round="10" @close="close">
+    <view class="popup-content">
+      <view class="popup-header">
+        <text class="popup-title">选择质检工单</text>
+        <view class="close-btn" @click="close">×</view>
+      </view>
+
+      <view class="popup-body">
+        <view class="search-wrap">
+          <u-input v-model="keyword" placeholder="请输入工单编码或名称" border="surround" @confirm="search"></u-input>
+        </view>
+        <scroll-view scroll-y class="list-scroll">
+          <view class="list-item" v-for="(item, index) in list" :key="index" @click="selectItem(item)">
+            <view class="item-main">
+              <text class="item-code">{{ item.code }}</text>
+              <text class="item-name">{{ item.name }}</text>
+            </view>
+            <text class="arrow">›</text>
+          </view>
+          <view class="empty-text" v-if="list.length === 0">
+            暂无数据
+          </view>
+        </scroll-view>
+      </view>
+
+      <view class="popup-footer">
+        <u-button type="default" @click="close">取消</u-button>
+      </view>
+    </view>
+  </u-popup>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      show: false,
+      keyword: '',
+      list: []
+    };
+  },
+  methods: {
+    open() {
+      this.show = true;
+      this.keyword = '';
+      this.search();
+    },
+    close() {
+      this.show = false;
+    },
+    search() {
+      // 这里调用后端接口获取质检工单列表
+      // 示例代码,需要替换为实际接口
+      // getQualityWorkOrderList({ keyword: this.keyword }).then(res => {
+      //   this.list = res.list;
+      // });
+      // 临时模拟数据
+      this.list = [];
+    },
+    selectItem(item) {
+      this.$emit('changeParent', item);
+      this.close();
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.popup-content {
+  width: 80vw;
+  max-height: 80vh;
+  background: #fff;
+  border-radius: 20rpx;
+  display: flex;
+  flex-direction: column;
+}
+
+.popup-header {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 30rpx;
+  border-bottom: 1rpx solid #e5e5e5;
+
+  .popup-title {
+    font-size: 36rpx;
+    font-weight: bold;
+    color: #333;
+  }
+
+  .close-btn {
+    width: 60rpx;
+    height: 60rpx;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    font-size: 60rpx;
+    color: #999;
+    line-height: 1;
+  }
+}
+
+.popup-body {
+  flex: 1;
+  display: flex;
+  flex-direction: column;
+  padding: 20rpx 30rpx;
+}
+
+.search-wrap {
+  margin-bottom: 20rpx;
+}
+
+.list-scroll {
+  flex: 1;
+  max-height: 60vh;
+}
+
+.list-item {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 25rpx 0;
+  border-bottom: 1rpx solid #f5f5f5;
+
+  &:last-child {
+    border-bottom: none;
+  }
+
+  .item-main {
+    flex: 1;
+    display: flex;
+    flex-direction: column;
+
+    .item-code {
+      font-size: 28rpx;
+      color: #333;
+      margin-bottom: 8rpx;
+    }
+
+    .item-name {
+      font-size: 26rpx;
+      color: #999;
+    }
+  }
+
+  .arrow {
+    color: #999;
+    font-size: 40rpx;
+    line-height: 1;
+    margin-left: 20rpx;
+  }
+}
+
+.empty-text {
+  text-align: center;
+  padding: 80rpx 0;
+  color: #999;
+  font-size: 28rpx;
+}
+
+.popup-footer {
+  padding: 20rpx 30rpx;
+  border-top: 1rpx solid #e5e5e5;
+
+  /deep/ .u-button {
+    width: 100%;
+  }
+}
+</style>

+ 112 - 8
pages/qms/inspectionWork/list.vue

@@ -26,16 +26,36 @@
 							<view class="herder_text"></view>
 							<view class="herder_view">
 								{{ getDictValue('质检计划类型', item.qualityType+'')}}/{{item.code}}/{{item.productCode}}/{{item.productName}}
+								<text>
+									({{item.isPendingSample == 1?'待收样':statusList.find(row=>row.value==item.status).label}})
+								</text>
 							</view>
 						</view>
 						<view class="text">检验项目:</view>
-						<view class="item_value">
-							<view @click="goTo(item.id,row.id,item.sampleMeasureUnit)"
+						<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.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="text btnlist"
+							v-if="![1, 2].includes(item.status)&&(pageName=='myList'||!pageName)">操作:
+							<view>
+								<u-button v-if="item.isPendingSample == 1" type="primary" text="收样"
+									@click="sampleCollection(item)"></u-button>
+								<u-button
+									v-if="![1, 2].includes(item.status) &&item.sampleQuantity < item.total &&item.isPendingSample != 1"
+									type="primary" text="清样" @click="addSampleOpen(item)"></u-button>
+							</view>
+						</view>
 					</view>
 				</view>
 				<view style="width:100%;height:40rpx"></view>
@@ -51,19 +71,25 @@
 
 
 		<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,
-		getTaskmonadList
+		sampleCollection,
+		getTaskmonadList,
+		verificationQualityInspector,checkByQualityWorkOrderId
 	} from '@/api/inspectionWork/index.js'
 	export default {
-		components: {},
+		components: {
+			addSample
+		},
 		mixins: [dictMixns],
 		props: {
 			pageName: {
@@ -73,7 +99,23 @@
 		data() {
 			return {
 
-
+				statusList: [{
+						value: 0,
+						label: '未报工'
+					},
+					{
+						value: 1,
+						label: '已报工'
+					},
+					{
+						value: 2,
+						label: '已关闭'
+					},
+					{
+						value: 3,
+						label: '待请样'
+					}
+				],
 				tableList: [],
 				page: 1,
 				size: 10,
@@ -137,7 +179,7 @@
 					pageNum: this.page,
 					size: this.size,
 					keyWord: this.keyWord,
-					recordingMethod: 1,
+					// recordingMethod: 1,
 
 				}
 				if (this.pageName) {
@@ -161,14 +203,67 @@
 					uni.hideLoading()
 				})
 			},
-			goTo(workId, projectId, sampleMeasureUnit) {
+			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
+					}
+				}
+
+
 
 				uni.navigateTo({
 					url: '/pages/qms/inspectionWork/inspectionProjectReport?workId=' + workId + '&projectId=' +
 						projectId + '&pageName=' + this.pageName + '&sampleMeasureUnit=' + sampleMeasureUnit
 				})
 			},
-
+			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
@@ -282,4 +377,13 @@
 			margin-top: 5rpx;
 		}
 	}
+
+	.btnlist {
+		display: flex;
+		align-items: center;
+	}
+
+	/deep/.u-button {
+		height: 60rpx
+	}
 </style>

+ 382 - 0
pages/qms/inspectionWork/mySampleRecord.vue

@@ -0,0 +1,382 @@
+<template>
+	<view class="mainBox">
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="我的请样记录" @clickLeft="back">
+		</uni-nav-bar>
+		<view class="top-wrapper">
+			<uni-section>
+				<uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="qualityWorkOrderCode"
+					placeholder="质检工单编码">
+				</uni-easyinput>
+			</uni-section>
+			<button class="search_btn" @click="doSearch">搜索</button>
+		</view>
+		<view class="wrapper">
+			<u-list @scrolltolower="scrolltolower" class="listContent">
+				<view v-for="(item, index) in tableList" :key="index" style="position: relative">
+					<myCard :item="item" :index="index + 1" :btnList="btnList" :columns="columns" @submit="submit(item)"
+						@view="open('view',item)" @edit="open('edit',item)" @cancel="cancel(item.id)">
+					</myCard>
+				</view>
+			</u-list>
+		</view>
+		<view style="margin-top: 20vh" v-if="tableList.length == 0">
+			<u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
+		</view>
+		<!-- 		<view class="add" @click="open('add')">
+			<u-icon name="plus" color="#fff"></u-icon>
+		</view> -->
+		<u-toast ref="uToast"></u-toast>
+		<addSample ref='addSampleRef' @reload="doSearch"></addSample>
+	</view>
+</template>
+
+<script>
+	import {
+		samplingRecordsPage,
+		listCancel
+	} from "@/api/samplingRecords";
+	import myCard from "@/pages/saleManage/components/myCard.vue";
+	import {
+		recordingMethodList
+	} from "@/utils/utils.js";
+	import addSample from './addSample.vue'
+	import {
+		processInstanceCreateAPI,
+		processInstancePage
+	} from '@/api/wt/index.js'
+	export default {
+		components: {
+			myCard,
+			addSample
+		},
+		data() {
+			return {
+				btnList: [{
+						name: "详情",
+						btnType: "primary",
+						apiName: 'view',
+					},
+					{
+						name: "编辑",
+						btnType: "primary",
+						apiName: 'edit',
+						judge: [{
+								key: "approvalStatus",
+								value: [0, 3],
+							},
+							{
+								key: "status",
+								value: [0, 1, 2, 4],
+							},
+						],
+					},
+					{
+						name: "提交",
+						btnType: "success",
+						apiName: 'submit',
+						judge: [{
+								key: "approvalStatus",
+								value: [0, 3],
+							},
+							{
+								key: "status",
+								value: [0, 1, 2, 4],
+							},
+						],
+					},
+					{
+						name: "作废",
+						btnType: "error",
+						apiName: 'cancel',
+						judge: [{
+								key: "approvalStatus",
+								value: [0, 3],
+							},
+							{
+								key: "status",
+								value: [0, 1, 2, 4],
+							},
+						],
+					},
+				],
+				columns: [
+					[{
+						label: "请样记录编码:",
+						prop: "code",
+						type: "title",
+						className: "perce100",
+					}, ],
+					[{
+							label: "质检工单编码:",
+							prop: "qualityWorkOrderCode",
+						},
+						{
+							label: "质检工单名称:",
+							prop: "qualityWorkOrderName",
+						},
+					],
+					[{
+							label: "质检方式:",
+							prop: "qualityMode",
+							formatter: (row) => {
+								return row.qualityMode == 1 ? "全检" : "抽检";
+							},
+						},
+						{
+							label: "请样类型:",
+							prop: "conditionType",
+							formatter: (row) => {
+								return row.conditionType == 1 ? "整样" : "小样";
+							},
+						},
+					],
+					[{
+							label: "编码:",
+							prop: "productCode",
+						},
+						{
+							label: "名称:",
+							prop: "productName",
+						},
+					],
+					[{
+							label: "批次号:",
+							prop: "batchNo",
+						},
+						{
+							label: "规格:",
+							prop: "specification",
+						},
+					],
+					[{
+							label: "请样数量:",
+							prop: "sampleQuantity",
+						},
+						{
+							label: "单位:",
+							prop: "measureUnit",
+						},
+					],
+					[{
+							label: "状态:",
+							prop: "status",
+							formatter: (row) => {
+								return row.status == 1 ?
+									"审核中" :
+									row.status == 2 ?
+									"已请样" :
+									row.status == 3 ?
+									"已作废" :
+									row.status == 4 ?
+									"不通过" :
+									"未提交";
+							},
+						},
+						{
+							label: "审核状态:",
+							prop: "approvalStatus",
+							formatter: (row) => {
+								const reviewStatus = {
+									0: "未提交",
+									1: "审核中",
+									2: "已审核",
+									3: "审核不通过",
+								};
+								return reviewStatus[row.approvalStatus];
+							},
+						},
+					],
+					[{
+							label: "创建人:",
+							prop: "createUserName",
+						},
+						{
+							label: "创建时间:",
+							prop: "createTime",
+						},
+					],
+					[{
+						label: "操作:",
+						prop: "action",
+						type: "action",
+						className: "perce100",
+					}, ],
+				],
+				tableList: [],
+				page: 1,
+				size: 10,
+				isEnd: false,
+				qualityWorkOrderCode: "",
+			};
+		},
+		computed: {},
+		onShow() {
+			this.isEnd = false;
+			this.page = 1;
+			this.getList();
+		},
+		methods: {
+			async listSubmit(item) {
+				try {
+					//后台不提供接口
+					let list = await processInstancePage({
+						pageNo: 1,
+						pageSize: 1,
+						reset: true,
+						key: 'sampling_approval_process'
+					})
+					let params = {
+						businessId: item.id,
+						businessKey: 'sampling_approval_process',
+						formCreateUserId: item.createUserId,
+						processDefinitionId: list?.list[0]?.processDefinition.id,
+						variables: {
+							businessCode: item.code,
+							businessName: '请样',
+							businessType: item.conditionType == 1 ? '整样' : '小样'
+						},
+					}
+
+					await processInstanceCreateAPI(params)
+					uni.showModal({
+						title: `提交成功`,
+						content: '',
+						confirmText: '确认',
+						showCancel: false, // 是否显示取消按钮,默认为 true
+						success: () => {
+							this.doSearch()
+						}
+					})
+				} catch {
+
+				}
+			},
+			open(type, row) {
+				console.log(1212)
+
+				this.$refs.addSampleRef.open(type, row);
+			},
+			doSearch() {
+				this.isEnd = false;
+				this.page = 1;
+				this.getList();
+			},
+			getList() {
+				let userInfo = uni.getStorageSync('userInfo')
+				if (this.isEnd) {
+					return;
+				}
+				uni.showLoading({
+					title: "加载中",
+				});
+
+				let data = {
+					pageNum: this.page,
+					size: this.size,
+					currentLoginUserId: userInfo.userId,
+					qualityWorkOrderCode: this.qualityWorkOrderCode,
+				};
+				samplingRecordsPage(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();
+					});
+			},
+			cancel(id) {
+				uni.showModal({
+					title: "提示",
+					content: "确定要作废此信息吗?",
+					success: (res) => {
+						if (res.confirm) {
+							listCancel({
+								id
+							}).then((res) => {
+								this.isEnd = false;
+								this.page = 1;
+								this.$refs.uToast.show({
+									type: "success",
+									message: "操作成功",
+								});
+								this.getList();
+							});
+						}
+					},
+				});
+			},
+			add() {
+				uni.navigateTo({
+					url: "/pages/qms/inspectionWork/list",
+				});
+			},
+			scrolltolower() {
+				if (this.isEnd) {
+					return;
+				}
+				this.getList();
+			},
+			back() {
+				uni.navigateBack();
+			},
+			submit(row) {
+				// 提交逻辑,需要根据实际业务实现
+				uni.showToast({
+					title: "提交功能待实现",
+					icon: "none",
+				});
+			},
+		},
+	};
+</script>
+
+<style lang="scss" scoped>
+	.add {
+		width: 96rpx;
+		height: 96rpx;
+		border-radius: 48rpx;
+		background: #3c9cff;
+		position: fixed;
+		bottom: 100rpx;
+		right: 24rpx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+
+	.top-wrapper {
+		background-color: #fff;
+		display: flex;
+		width: 750rpx;
+		height: 88rpx;
+		padding: 16rpx 32rpx;
+		align-items: center;
+		gap: 16rpx;
+
+		/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;
+		}
+	}
+</style>

+ 4 - 0
utils/utils.js

@@ -45,6 +45,10 @@ export function initDict(originalData) {
 }
 
 
+export const recordingMethodList = [
+  { label: '按质检项检', value: 1 },
+  { label: '按样品检', value: 2 }
+];
 
 export function stopScroll() {
 	var box = function(e) {