addSample.vue 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606
  1. <template>
  2. <view>
  3. <u-popup :show="visible" :round="0" :closeOnClickOverlay="false" :zIndex="99999" @close="closePopup">
  4. <view class="popup-content">
  5. <view class="popup-header">
  6. <text class="popup-title">{{ title }}</text>
  7. <view class="close-btn" @click="closePopup">×</view>
  8. </view>
  9. <scroll-view class="popup-body" scroll-y>
  10. <view class="form-section">
  11. <view class="section-title">基本信息</view>
  12. <view class="form-row">
  13. <view class="form-item">
  14. <text class="label">工单编码</text>
  15. <view class="value-wrap" @click="selectQualityWorkOrder"
  16. v-if="!isSampleRecord || (isSampleRecord && type != 'add')">
  17. <u-input v-model="form.qualityWorkOrderCode" disabled placeholder=" "
  18. border="none"></u-input>
  19. </view>
  20. <view class="value-wrap" v-else>
  21. <u-input v-model="form.qualityWorkOrderCode" disabled placeholder=" "
  22. border="none"></u-input>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="form-row">
  27. <view class="form-item">
  28. <text class="label">工单名称</text>
  29. <view class="value-wrap">
  30. <u-input v-model="form.qualityWorkOrderName" disabled placeholder=" "
  31. border="none"></u-input>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="form-row">
  36. <view class="form-item">
  37. <text class="label">编码</text>
  38. <view class="value-wrap">
  39. <u-input v-model="form.productCode" disabled placeholder=" "
  40. border="none"></u-input>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="form-row">
  45. <view class="form-item">
  46. <text class="label">名称</text>
  47. <view class="value-wrap">
  48. <u-input v-model="form.productName" disabled placeholder=" "
  49. border="none"></u-input>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="form-row">
  54. <view class="form-item">
  55. <text class="label">批次号</text>
  56. <view class="value-wrap">
  57. <u-input v-model="form.batchNo" disabled placeholder=" " border="none"></u-input>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="form-row">
  62. <view class="form-item">
  63. <text class="label">规格</text>
  64. <view class="value-wrap">
  65. <u-input v-model="form.specification" disabled placeholder=" "
  66. border="none"></u-input>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="form-row">
  71. <view class="form-item">
  72. <text class="label">型号</text>
  73. <view class="value-wrap">
  74. <u-input v-model="form.modelType" disabled placeholder=" " border="none"></u-input>
  75. </view>
  76. </view>
  77. </view>
  78. <view class="form-row">
  79. <view class="form-item">
  80. <text class="label">牌号</text>
  81. <view class="value-wrap">
  82. <u-input v-model="form.brandNo" disabled placeholder=" " border="none"></u-input>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="form-row">
  87. <view class="form-item">
  88. <text class="label">总数</text>
  89. <view class="value-wrap">
  90. <u-input v-model="form.total" disabled placeholder=" " border="none">
  91. <template #suffix>{{
  92. tableList[0] && tableList[0].measureUnit
  93. }}</template>
  94. </u-input>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <view class="form-section">
  100. <view class="section-title">来源清单</view>
  101. <view class="table-info">
  102. <text>累计请样数量:{{ workSampleQuantity
  103. }}{{
  104. (sampleList[0] && sampleList[0].measureUnit) ||
  105. form.measureUnit
  106. }}</text>
  107. </view>
  108. <view class="table-wrapper">
  109. <scroll-view scroll-x scroll-y class="table-scroll">
  110. <view class="source-table">
  111. <view class="table-header">
  112. <view class="table-cell select-cell">
  113. <checkbox :checked="isAllSelected" @click="toggleSelectAll" />
  114. </view>
  115. <view class="table-cell" v-for="col in displaySourceColumns.filter(
  116. (c) => c.prop !== 'select',
  117. )" :key="col.prop">{{ col.label }}</view>
  118. </view>
  119. <view class="table-body">
  120. <view class="table-row" v-for="(item, index) in tableList" :key="index">
  121. <view class="table-cell select-cell">
  122. <checkbox :checked="isSelected(item)" @click="toggleSelect(item)" />
  123. </view>
  124. <view class="table-cell" v-for="col in displaySourceColumns.filter(
  125. (c) => c.prop !== 'select',
  126. )" :key="col.prop">
  127. {{ item[col.prop] || "-" }}
  128. </view>
  129. </view>
  130. <view class="table-empty" v-if="!tableList || tableList.length === 0">
  131. <text>暂无数据</text>
  132. </view>
  133. </view>
  134. </view>
  135. </scroll-view>
  136. </view>
  137. </view>
  138. <view class="form-section">
  139. <view class="section-title">请样信息</view>
  140. <view class="form-row">
  141. <view class="form-item">
  142. <text class="label">请样目的</text>
  143. <view class="value-wrap">
  144. <u-input v-model="form.pleasePurpose" placeholder="请输入" border="none"
  145. :disabled="type=='view'"></u-input>
  146. </view>
  147. </view>
  148. </view>
  149. <view class="form-row">
  150. <view class="form-item">
  151. <text class="label">质检方式</text>
  152. <view class="value-wrap">
  153. <DictSelection v-model="form.qualityMode" @itemChange="handleQualityModeChange"
  154. :disabled="form.isFirstSampling != '1'||type=='view'" dictName="取样类型">
  155. </DictSelection>
  156. </view>
  157. </view>
  158. </view>
  159. <view class="form-row">
  160. <view class="form-item">
  161. <text class="label">记录方法</text>
  162. <view class="value-wrap">
  163. <view class="select-input"
  164. :class="{ disabled: form.isFirstSampling != '1'||type=='view' }"
  165. @click="selectRecordingMethod">
  166. <text
  167. class="value-text">{{ recordingMethodList.find(item=>item.value==form.recordingMethod)&&recordingMethodList.find(item=>item.value==form.recordingMethod).label||'请选择' }}</text>
  168. <text class="arrow">›</text>
  169. </view>
  170. </view>
  171. </view>
  172. </view>
  173. <view class="form-section-inner" v-if="form.qualityMode == '2'">
  174. <view class="form-row">
  175. <view class="form-item">
  176. <text class="label">请样类型</text>
  177. <view class="value-wrap" @click="selectConditionType">
  178. <view class="select-input"
  179. :class="{ disabled: form.isFirstSampling != '1'||type=='view' }"
  180. @click="selectConditionType">
  181. <text
  182. class="value-text">{{ conditionTypeColumns.find(item=>item.value==form.conditionType)&&conditionTypeColumns.find(item=>item.value==form.conditionType).label||'请选择' }}</text>
  183. <text class="arrow">›</text>
  184. </view>
  185. </view>
  186. </view>
  187. </view>
  188. <view class="form-row" v-if="form.conditionType == 2">
  189. <view class="form-item">
  190. <text class="label">数量</text>
  191. <view class="value-wrap">
  192. <u-input v-model="form.quantity" :disabled="type=='view'" placeholder="请输入"
  193. border="none"></u-input>
  194. </view>
  195. </view>
  196. </view>
  197. <view class="form-row" v-if="form.conditionType == 2">
  198. <view class="form-item">
  199. <text class="label">单位</text>
  200. <view class="value-wrap">
  201. <DictSelection v-model="form.unit" @itemChange="handleQualityModeChange"
  202. :disabled="form.isFirstSampling != '1'||type=='view'" dictName="计量单位">
  203. </DictSelection>
  204. </view>
  205. </view>
  206. </view>
  207. <view class="form-row" v-if="form.conditionType == 2">
  208. <view class="form-item">
  209. <text class="label">条数</text>
  210. <view class="value-wrap">
  211. <u-input v-model="form.portion" :disabled="type=='view'" placeholder="请输入"
  212. border="none"></u-input>
  213. </view>
  214. </view>
  215. </view>
  216. <view class="form-row" v-if="form.conditionType == 1">
  217. <view class="form-item">
  218. <text class="label">数量</text>
  219. <view class="value-wrap">
  220. <u-input v-model="form.portion" :disabled="type=='view'" placeholder="请输入"
  221. border="none"></u-input>
  222. </view>
  223. </view>
  224. </view>
  225. <view class="form-row" v-if="form.conditionType == 1">
  226. <view class="form-item">
  227. <text class="label">单位</text>
  228. <view class="value-wrap"
  229. >
  230. <view class="select-input"
  231. :class="{ disabled: form.isFirstSampling != '1'||type=='view' }"
  232. @click="selectPackingUnit">
  233. <text
  234. class="value-text">{{ packingSpecificationOption.find(item=>item.id==form.packingUnit)&&packingSpecificationOption.find(item=>item.id==form.packingUnit).conversionUnit||'请选择' }}</text>
  235. <text class="arrow">›</text>
  236. </view>
  237. </view>
  238. </view>
  239. </view>
  240. <view class="confirm-btn-wrap" v-if="type != 'view'">
  241. <u-button type="primary" @click="handleSampleSubmit">确认</u-button>
  242. </view>
  243. </view>
  244. </view>
  245. <view class="form-section">
  246. <view class="section-title">样品信息</view>
  247. <view class="table-wrapper">
  248. <scroll-view scroll-x scroll-y class="table-scroll">
  249. <view class="sample-table">
  250. <view class="table-header">
  251. <view class="table-cell" v-for="col in displaySampleColumns" :key="col.prop">
  252. {{ col.label }}
  253. </view>
  254. </view>
  255. <view class="table-body">
  256. <view class="table-row" v-for="(item, index) in sampleList" :key="index">
  257. <view class="table-cell" v-for="col in displaySampleColumns"
  258. :key="col.prop">
  259. {{ item[col.prop] || "-" }}
  260. </view>
  261. </view>
  262. <view class="table-empty" v-if="!sampleList || sampleList.length === 0">
  263. <text>暂无数据</text>
  264. </view>
  265. </view>
  266. </view>
  267. </scroll-view>
  268. </view>
  269. </view>
  270. </scroll-view>
  271. <view class="popup-footer">
  272. <u-button type="default" @click="closePopup">关闭</u-button>
  273. <u-button type="primary" @click="save()" v-if="type != 'view'" :loading="loading">保存</u-button>
  274. </view>
  275. </view>
  276. <u-toast ref="uToast"></u-toast>
  277. <!-- 记录方法选择 -->
  278. <u-picker :show="showRecordingMethodPicker" keyName="label" :columns="[recordingMethodList]" @confirm="confirmRecordingMethod" @cancel="showRecordingMethodPicker = false"></u-picker>
  279. <!-- 请样类型选择 -->
  280. <u-picker :show="showConditionTypePicker" :columns="[conditionTypeColumns]" keyName="label" @confirm="confirmConditionType"
  281. @cancel="showConditionTypePicker = false"></u-picker>
  282. <!-- 包装单位选择 -->
  283. <u-picker :show="showPackingUnitPicker" keyName="label" :columns="[packingSpecificationOption.map(item=>{
  284. return {
  285. label:item.conversionUnit,
  286. value:item.id
  287. }
  288. })]" @confirm="confirmPackingUnit"
  289. @cancel="showPackingUnitPicker = false"></u-picker>
  290. </u-popup>
  291. </view>
  292. </template>
  293. <script>
  294. import {
  295. recordingMethodList
  296. } from "@/utils/utils.js";
  297. import DictSelection from "@/components/Dict/DictSelection.vue";
  298. const defForm = {
  299. code: "", //编码
  300. name: "", //名称
  301. conditionType: "",
  302. quantity: "",
  303. unit: "",
  304. portion: "",
  305. qualityMode: "",
  306. qualityModeName: "",
  307. recordingMethod: 1,
  308. recordingMethodName: "",
  309. pleaseQuantity: "",
  310. pleasePurpose: "",
  311. pleaseUnit: "",
  312. sampleQuantity: "",
  313. qualityWorkOrderId: "",
  314. qualityWorkOrderCode: "",
  315. qualityWorkOrderName: "",
  316. isFirstSampling: "",
  317. measureUnit: ''
  318. };
  319. import {
  320. queryQualityInventory,
  321. queryQualityTempleContent,
  322. } from "@/api/inspectionWork";
  323. import {
  324. samplingrecordSave,
  325. getById,
  326. samplingrecordUpdate,
  327. samplingRecordsPage,
  328. } from "@/api/samplingRecords";
  329. import {
  330. getCodeList,
  331. getCode,
  332. parameterGetByCode
  333. } from '@/api/pda/picking.js'
  334. export default {
  335. components: {
  336. DictSelection
  337. },
  338. data() {
  339. return {
  340. recordingMethodList,
  341. form: {
  342. ...defForm
  343. },
  344. activeComp: "main",
  345. tabOptions: [{
  346. key: "main",
  347. name: "请样详情"
  348. },
  349. {
  350. key: "bpm",
  351. name: "流程详情"
  352. },
  353. ],
  354. workSampleQuantity: 0,
  355. visible: false,
  356. loading: false,
  357. sampleNumberList: [{
  358. label: "全检",
  359. value: 1
  360. },
  361. {
  362. label: "抽检",
  363. value: 2
  364. },
  365. ],
  366. selection: [],
  367. // 弹窗相关
  368. showRecordingMethodPicker: false,
  369. showConditionTypePicker: false,
  370. showUnitPicker: false,
  371. showPackingUnitPicker: false,
  372. recordingMethodPickerColumns: [],
  373. conditionTypeColumns: [{
  374. label: "请整样",
  375. value: 1
  376. },
  377. {
  378. label: "请小样",
  379. value: 2
  380. },
  381. ],
  382. packingUnitColumns: [
  383. []
  384. ],
  385. // 显示的表格列
  386. displaySourceColumns: [{
  387. label: "",
  388. prop: "select",
  389. type: "selection"
  390. },
  391. {
  392. label: "名称",
  393. prop: "categoryName"
  394. },
  395. {
  396. label: "计量数量",
  397. prop: "measureQuantity"
  398. },
  399. {
  400. label: "计量单位",
  401. prop: "measureUnit"
  402. },
  403. {
  404. label: "包装数量",
  405. prop: "packingQuantity"
  406. },
  407. {
  408. label: "包装单位",
  409. prop: "packingUnit"
  410. },
  411. ],
  412. displaySampleColumns: [{
  413. label: "样品编码",
  414. prop: "sampleCode"
  415. },
  416. {
  417. label: "名称",
  418. prop: "categoryName"
  419. },
  420. {
  421. label: "计量数量",
  422. prop: "measureQuantity"
  423. },
  424. {
  425. label: "计量单位",
  426. prop: "measureUnit"
  427. },
  428. {
  429. label: "包装数量",
  430. prop: "packingQuantity"
  431. },
  432. {
  433. label: "包装单位",
  434. prop: "packingUnit"
  435. }
  436. ],
  437. packingSpecificationOption: [],
  438. sampleList: [],
  439. schemeList: [],
  440. tableList: [],
  441. type: "add",
  442. title: "",
  443. isSamplingApproval: 0,
  444. isSampleRecord: false,
  445. isAllSelected: false,
  446. };
  447. },
  448. computed: {
  449. allSelected() {
  450. return (
  451. this.tableList.length > 0 &&
  452. this.selection.length === this.tableList.length
  453. );
  454. },
  455. },
  456. created() {},
  457. methods: {
  458. // 切换全选
  459. toggleSelectAll() {
  460. if (this.isAllSelected) {
  461. this.selection = [];
  462. } else {
  463. this.selection = [...this.tableList];
  464. }
  465. this.isAllSelected = !this.isAllSelected;
  466. },
  467. // 切换单选
  468. toggleSelect(item) {
  469. const index = this.selection.findIndex((row) => row.id === item.id);
  470. if (index > -1) {
  471. this.selection.splice(index, 1);
  472. } else {
  473. this.selection.push(item);
  474. }
  475. this.isAllSelected = this.selection.length === this.tableList.length;
  476. },
  477. // 判断是否选中
  478. isSelected(item) {
  479. return this.selection.findIndex((row) => row.id === item.id) > -1;
  480. },
  481. closePopup() {
  482. this.cancel();
  483. },
  484. async open(type, row) {
  485. // this.activeComp = 'main';
  486. this.visible = true;
  487. this.type = type;
  488. // this.parameterGetByCode();
  489. this.title =
  490. type == "add" ? "请样" : type == "edit" ? "修改请样" : "详情";
  491. if (type == "add") {
  492. if (row) {
  493. this.init(row);
  494. }
  495. } else {
  496. this.getById(row.id);
  497. }
  498. },
  499. // 记录方法选择
  500. selectRecordingMethod() {
  501. console.log(this.form.isFirstSampling, 'this.form.isFirstSampling')
  502. if (this.form.isFirstSampling != "1") return;
  503. // this.recordingMethodPickerColumns = [this.recordingMethodList];
  504. this.showRecordingMethodPicker = true;
  505. },
  506. confirmRecordingMethod(e) {
  507. this.form.recordingMethod = e.value[0].value;
  508. this.form.recordingMethodName = e.value[0].label;
  509. this.showRecordingMethodPicker = false;
  510. },
  511. // 请样类型选择
  512. selectConditionType() {
  513. if (this.form.isFirstSampling != "1") return;
  514. this.showConditionTypePicker = true;
  515. },
  516. confirmConditionType(e) {
  517. this.form.conditionType = e.value[0].value;
  518. this.form.conditionTypeName = e.value[0].label;
  519. this.showConditionTypePicker = false;
  520. },
  521. // 包装单位选择
  522. selectPackingUnit() {
  523. if (this.form.isFirstSampling != "1") return;
  524. // let unitList = this.packingSpecificationOption.map(
  525. // (item) => item.conversionUnit,
  526. // );
  527. // this.packingUnitColumns = [unitList];
  528. this.showPackingUnitPicker = true;
  529. },
  530. confirmPackingUnit(e) {
  531. this.$set(this.form, 'packingUnit', e.value[0].value);
  532. this.$set(this.form, 'unit', e.value[0].label);
  533. this.showPackingUnitPicker = false;
  534. },
  535. parameterGetByCode() {
  536. parameterGetByCode({
  537. code: "sampling_approval",
  538. }).then((res) => {
  539. this.isSamplingApproval = res.value;
  540. });
  541. },
  542. async init(row) {
  543. let isPackingUnit = false;
  544. let data = await samplingRecordsPage({
  545. qualityWorkOrderId: row.id,
  546. });
  547. let list = data.list.filter(
  548. (item) => item.status === 0 || item.status === 4,
  549. );
  550. let list1 = data.list.filter((item) => item.status != 3);
  551. if (list?.length) {
  552. this.getById(list[0].id);
  553. this.type = "edit";
  554. this.title = "修改请样";
  555. } else {
  556. row.sourceCode = row.qualityPlanCode || row.workOrderCode;
  557. this.form = JSON.parse(JSON.stringify(row));
  558. this.form.qualityWorkOrderId = row.id;
  559. this.form.qualityWorkOrderCode = row.code;
  560. this.form.qualityWorkOrderName = row.name;
  561. this.workSampleQuantity = Number(row.sampleQuantity) || 0;
  562. this.form.recordingMethod = this.form.recordingMethod || '1'
  563. if (!list1?.length) {
  564. this.form.isFirstSampling = 1;
  565. isPackingUnit = true;
  566. if (this.form.conditionType == 1) {
  567. this.$set(this.form, "packingUnit", "111");
  568. }
  569. } else {
  570. this.$set(this.form, "unit", list1[0].unit);
  571. this.$set(this.form, "measureUnit", list1[0].measureUnit);
  572. }
  573. await this.datasource(list1[0]?.unit, isPackingUnit);
  574. await this.queryQualityTempleContent(
  575. !list1.length && row.qualityMode == 1,
  576. );
  577. }
  578. },
  579. getById(id) {
  580. getById(id).then((res) => {
  581. this.workSampleQuantity =
  582. Number(res.qualityWorkOrderVO.sampleQuantity) || 0;
  583. [
  584. "id",
  585. "code",
  586. "name",
  587. "createTime",
  588. "createUserId",
  589. "status",
  590. "approvalStatus",
  591. "approvalUserId",
  592. "sampleQuantity",
  593. "processInstanceId",
  594. ].forEach((it) => {
  595. delete res.qualityWorkOrderVO[it];
  596. });
  597. this.form = {
  598. ...res,
  599. ...res.qualityWorkOrderVO
  600. };
  601. this.datasource(this.form.unit);
  602. this.queryQualityTempleContent();
  603. if (this.form.qualityMode == 2) {
  604. if (res.qualityWorkOrderVO.conditionType == 1) {
  605. this.$set(this.form, "portion", res.quantity);
  606. this.$set(this.form, "quantity", 0);
  607. } else {
  608. this.$set(this.form, "portion", res.copies);
  609. }
  610. }
  611. this.sampleList = res.qualitySampleList;
  612. });
  613. },
  614. /* 查询质检模板内容 */
  615. async queryQualityTempleContent(is) {
  616. const res = await queryQualityTempleContent({
  617. qualityWorkerId: this.form.qualityWorkOrderId,
  618. page: 1,
  619. size: 10000,
  620. });
  621. this.schemeList = res.list;
  622. if (is) {
  623. this.updatePackingList();
  624. }
  625. },
  626. cancel() {
  627. this.form = {
  628. ...defForm,
  629. };
  630. this.workSampleQuantity = 0
  631. this.schemeList = [];
  632. this.packingSpecificationOption = [];
  633. this.sampleList = [];
  634. this.tableList = [];
  635. this.visible = false;
  636. },
  637. async datasource(unit, isPackingUnit) {
  638. const res = await queryQualityInventory({
  639. qualityWorkerId: this.form.qualityWorkOrderId,
  640. pageNum: 1,
  641. size: -1,
  642. });
  643. console.log(res, "res");
  644. let o = res.list[0];
  645. let listArr = [];
  646. if (o.measureUnit) {
  647. listArr.push({
  648. packageCellTotal: 1,
  649. conversionUnit: o.measureUnit,
  650. id: "111",
  651. });
  652. }
  653. if (o.packingUnit) {
  654. listArr.push({
  655. packageCellTotal: o.measureQuantity - 0,
  656. conversionUnit: o.packingUnit,
  657. id: "222",
  658. });
  659. }
  660. if (unit) {
  661. this.$set(
  662. this.form,
  663. "packingUnit",
  664. listArr.find((item) => unit == item.conversionUnit)?.id,
  665. );
  666. }
  667. if (isPackingUnit) {
  668. this.$set(this.form, "unit", res.list[0]?.measureUnit);
  669. }
  670. this.form.pleaseUnit = res.list[0]?.measureUnit;
  671. res.list.map((el) => {
  672. el.weightProportion = el.weight ?
  673. (el.weight / el.measureQuantity).toFixed(4) :
  674. 0;
  675. el.weightProportion = el.weightProportion - 0;
  676. });
  677. this.packingSpecificationOption = listArr;
  678. this.tableList = res.list;
  679. return res;
  680. },
  681. handleSampleSubmit() {
  682. let params = {
  683. conditionType: this.form.conditionType,
  684. quantity: this.form.quantity,
  685. sampleUnit: this.form.unit,
  686. portion: this.form.portion,
  687. };
  688. let specifications = this.packingSpecificationOption.find(
  689. (el) => el.id == this.form.packingUnit,
  690. );
  691. this.sampleFn(params, specifications);
  692. },
  693. async sampleFn(data, specifications) {
  694. console.log(this.selection, 'this.selection')
  695. this.sampleList = [];
  696. if (!this.selection || this.selection.length == 0) {
  697. this.$refs.uToast.show({
  698. type: "error",
  699. icon: false,
  700. message: "请先选择来源清单!",
  701. }, )
  702. return;
  703. }
  704. const quantity = data.quantity || 1;
  705. const unit = data.sampleUnit;
  706. const sampleCount = Number(data.portion);
  707. try {
  708. // 2 取小样
  709. if (this.form.conditionType == 2) {
  710. if (!this.validateMeasureQuantity(quantity, unit, sampleCount))
  711. return; //取样数量验证
  712. if (unit === "KG" && !this.validateWeight(quantity, sampleCount))
  713. return; // 若计量单位为重量,还需验证总重量是否足够
  714. await this.getNewFullSampleList(
  715. Math.ceil(sampleCount),
  716. quantity,
  717. unit,
  718. specifications,
  719. );
  720. } else {
  721. let isFlag = this.validateSampleQuantity(sampleCount, specifications);
  722. if (!isFlag) return;
  723. if (this.form.inspectionStandards == 1) {
  724. await this.getNewFullSampleList(
  725. Math.ceil(sampleCount),
  726. quantity,
  727. unit,
  728. specifications,
  729. );
  730. } else {
  731. await this.handleWeightFullSample(sampleCount, specifications);
  732. }
  733. }
  734. } catch (error) {
  735. console.error("请样处理失败:", error);
  736. this.$refs.uToast.show({
  737. type: "error",
  738. icon: false,
  739. message: "请样处理失败!",
  740. }, )
  741. }
  742. },
  743. validateWeight(quantity, sampleCount) {
  744. let totalMaxPossible = 0;
  745. this.selection.forEach((item) => {
  746. totalMaxPossible += item.measureQuantity / quantity;
  747. });
  748. if (totalMaxPossible < sampleCount) {
  749. console.error("请样处理失败:", error);
  750. this.$refs.uToast.show({
  751. type: "error",
  752. icon: false,
  753. message: `最大请样条数为${totalMaxPossible}`,
  754. }, )
  755. return false;
  756. }
  757. let totalWeight = this.selection.reduce(
  758. (sum, item) => sum + item.weight,
  759. 0,
  760. );
  761. const weightUnit = this.selection[0].weightUnit;
  762. if (weightUnit === "G") totalWeight /= 1000;
  763. if (quantity * sampleCount > totalWeight) {
  764. this.$refs.uToast.show({
  765. type: "error",
  766. icon: false,
  767. message: `请样计量重量不能大于总计量重量`,
  768. }, )
  769. return false;
  770. }
  771. const invalidItem = this.selection.find((item) => {
  772. const weight =
  773. item.weightUnit === "G" ? item.weight / 1000 : item.weight;
  774. return weight < quantity;
  775. });
  776. if (invalidItem) {
  777. this.$refs.uToast.show({
  778. type: "error",
  779. icon: false,
  780. message: `勾选条目重量小于请样重量`,
  781. }, )
  782. return false;
  783. }
  784. return true;
  785. },
  786. validateMeasureQuantity(quantity, unit, sampleCount) {
  787. if (quantity <= 0) {
  788. this.$refs.uToast.show({
  789. type: "error",
  790. icon: false,
  791. message: `请样计量数量必须大于`,
  792. }, )
  793. return false;
  794. }
  795. const totalQuantity =
  796. this.selection.reduce((sum, item) => sum + item.measureQuantity, 0) -
  797. this.workSampleQuantity;
  798. if (
  799. this.selection[0].measureUnit === unit &&
  800. quantity * sampleCount > totalQuantity
  801. ) {
  802. this.$refs.uToast.show({
  803. type: "error",
  804. icon: false,
  805. message: `请样计量数量不能大于总计量数量`,
  806. }, )
  807. return false;
  808. }
  809. const invalidItem = this.selection.find(
  810. (item) => item.measureQuantity < quantity,
  811. );
  812. if (invalidItem) {
  813. this.$refs.uToast.show({
  814. type: "error",
  815. icon: false,
  816. message: `条目计量数量小于请样计量数量`,
  817. }, )
  818. return false;
  819. }
  820. return true;
  821. },
  822. async handleWeightFullSample(sampleCount, specifications) {
  823. const dataList = [];
  824. let currentNum = sampleCount - this.selection.length;
  825. let currentNum1 = sampleCount;
  826. for (const item of this.selection) {
  827. const qualitySampleTemplateList = item.qualitySampleTemplateList?.length ?
  828. JSON.parse(JSON.stringify(item.qualitySampleTemplateList)) :
  829. JSON.parse(
  830. JSON.stringify(
  831. this.schemeList.map((item) => {
  832. item["qualityResults"] = 1;
  833. return item;
  834. }),
  835. ),
  836. );
  837. if (sampleCount >= this.selection.length) {
  838. dataList.push({
  839. ...item,
  840. measureQuantity: 1, //作为计量数量
  841. sampleCode: await getCode("sample_code"),
  842. qualitySampleTemplateList,
  843. });
  844. } else {
  845. if (dataList.length < sampleCount) {
  846. dataList.push({
  847. ...item,
  848. measureQuantity: currentNum1 > 1 ? 1 : currentNum1, //作为计量数量
  849. sampleCode: await getCode("sample_code"),
  850. qualitySampleTemplateList,
  851. });
  852. currentNum1 -= 1;
  853. }
  854. }
  855. }
  856. if (sampleCount > this.selection.length) {
  857. dataList.forEach((item) => {
  858. if (currentNum > 0) {
  859. let data = this.selection.find((val) => val.id == item.id);
  860. item["measureQuantity"] =
  861. data.measureQuantity - 1 - currentNum > 0 ?
  862. currentNum + 1 :
  863. data.measureQuantity;
  864. currentNum = currentNum - (data.measureQuantity - 1);
  865. }
  866. });
  867. }
  868. // 更改 从新计算 样品清单 取整样 数据
  869. if (specifications && specifications.id) {
  870. dataList.map((el) => {
  871. el.measureQuantity =
  872. el.measureQuantity * specifications.packageCellTotal;
  873. el.weight = this.formatNumber(
  874. el.measureQuantity,
  875. el.weightProportion,
  876. );
  877. });
  878. }
  879. // 更改
  880. this.sampleList = dataList;
  881. this.getTotal();
  882. },
  883. // 小数点数据判断
  884. formatNumber(a, b, maxDecimals = 4) {
  885. if (a == 0 || b == 0 || !a || !b) {
  886. return 0;
  887. }
  888. const product = a * b;
  889. const rounded = Number(product.toFixed(maxDecimals));
  890. const str = rounded.toString();
  891. if (str.indexOf(".") !== -1) {
  892. return str.replace(/\.?0+$/, "");
  893. }
  894. return str;
  895. },
  896. //从来源数组取样到目标数组
  897. async getNewFullSampleList(
  898. sampleCount,
  899. sampleQuantity,
  900. sampleUnit,
  901. specifications,
  902. ) {
  903. const sourceArray = this.selection;
  904. const isUnitMismatch =
  905. sourceArray.length > 0 && sourceArray[0].measureUnit !== sampleUnit;
  906. const items = sourceArray.map((item) => ({
  907. ...item,
  908. remainingQuantity: isUnitMismatch ? Infinity : item["measureQuantity"],
  909. maxPossible: item["measureQuantity"] / sampleQuantity,
  910. }));
  911. const result = [];
  912. let remainingCount = sampleCount;
  913. let count = Math.ceil(remainingCount);
  914. const codeList = await this.batchCodes(count);
  915. let codeIdx = 0;
  916. while (remainingCount > 0) {
  917. items.sort(
  918. (a, b) =>
  919. b.remainingQuantity / b["measureQuantity"] -
  920. a.remainingQuantity / a["measureQuantity"],
  921. );
  922. let distributed = false;
  923. for (const item of items) {
  924. if (
  925. !isUnitMismatch ||
  926. (item.remainingQuantity >= sampleQuantity && remainingCount > 0)
  927. ) {
  928. let qualitySampleTemplateList = [];
  929. if (
  930. item.qualitySampleTemplateList == undefined ||
  931. item.qualitySampleTemplateList == null ||
  932. item.qualitySampleTemplateList.length == 0
  933. ) {
  934. qualitySampleTemplateList = JSON.parse(
  935. JSON.stringify(this.schemeList),
  936. );
  937. } else {
  938. qualitySampleTemplateList = item.qualitySampleTemplateList;
  939. }
  940. let sampleCode = codeList[codeIdx];
  941. if (
  942. this.form.conditionType == 1 &&
  943. this.form.inspectionStandards == 1
  944. ) {
  945. result.push({
  946. ...item,
  947. measureQuantity: 1,
  948. sampleCode,
  949. qualitySampleTemplateList,
  950. });
  951. } else if (this.form.conditionType == 2) {
  952. let weight = (item.weight / item.maxPossible).toFixed(2);
  953. result.push({
  954. ...item,
  955. measureQuantity: sampleQuantity,
  956. measureUnit: sampleUnit,
  957. sampleCode,
  958. weight,
  959. qualitySampleTemplateList,
  960. });
  961. }
  962. if (!isUnitMismatch) {
  963. item.remainingQuantity -= sampleQuantity;
  964. }
  965. remainingCount = (remainingCount - 1).toFixed(2);
  966. codeIdx++;
  967. distributed = true;
  968. }
  969. }
  970. if (!distributed) {
  971. break;
  972. }
  973. }
  974. if (this.form.conditionType == 1 && specifications && specifications.id) {
  975. result.map((el) => {
  976. el.measureQuantity =
  977. el.measureQuantity * specifications.packageCellTotal;
  978. el.weight = this.formatNumber(
  979. el.measureQuantity,
  980. el.weightProportion,
  981. );
  982. });
  983. }
  984. this.sampleList = result;
  985. if (this.sampleList.length > sampleCount) {
  986. this.sampleList = this.sampleList.splice(0, sampleCount);
  987. }
  988. this.getTotal();
  989. },
  990. // 当计量类型 是数量的时候 取整样 校验
  991. validateSampleQuantity(sampleCount, specifications) {
  992. let packingUnit = this.selection[0].packingUnit?.trim() || "";
  993. let totalS = 0;
  994. let measureQuantityCount = 0;
  995. let labelKey =
  996. packingUnit == specifications.conversionUnit.trim() ?
  997. "packingQuantity" :
  998. "measureQuantity";
  999. let labelName = labelKey == "packingQuantity" ? "包装数量" : "计量数量";
  1000. totalS = this.selection.reduce((total, el) => total + el[labelKey], 0);
  1001. let formTotalS = this.tableList.reduce(
  1002. (total, el) => total + el.measureQuantity,
  1003. 0,
  1004. );
  1005. if (sampleCount > totalS) {
  1006. this.$refs.uToast.show({
  1007. type: "error",
  1008. icon: false,
  1009. message: `所填的条目数量不能超过所选${labelName}总和${totalS}`,
  1010. }, )
  1011. return false;
  1012. }
  1013. if (labelKey == "packingQuantity") {
  1014. measureQuantityCount = sampleCount * this.selection[0].measureQuantity;
  1015. } else {
  1016. measureQuantityCount = sampleCount;
  1017. }
  1018. if (measureQuantityCount > formTotalS - this.workSampleQuantity) {
  1019. this.$refs.uToast.show({
  1020. type: "error",
  1021. icon: false,
  1022. message: `请样数量不能大于${formTotalS - this.workSampleQuantity} ${
  1023. this.selection[0].measureUnit
  1024. }`,
  1025. }, )
  1026. return false;
  1027. }
  1028. return true;
  1029. },
  1030. handleQualityModeChange({
  1031. dictCode,
  1032. dictValue
  1033. }) {
  1034. if (dictCode == 1) {
  1035. this.updatePackingList();
  1036. } else {
  1037. this.sampleList = [];
  1038. this.getTotal();
  1039. }
  1040. },
  1041. // 全检
  1042. async updatePackingList() {
  1043. let list = this.tableList;
  1044. const dataList = [];
  1045. let count = list ? list.length : 0;
  1046. const codeList = await this.batchCodes(count);
  1047. for (const [index, item] of list.entries()) {
  1048. const qualitySampleTemplateList = item.qualitySampleTemplateList?.length ?
  1049. JSON.parse(JSON.stringify(item.qualitySampleTemplateList)) :
  1050. JSON.parse(
  1051. JSON.stringify(
  1052. this.schemeList.map((item) => {
  1053. item["qualityResults"] = 1;
  1054. return item;
  1055. }),
  1056. ),
  1057. );
  1058. dataList.push({
  1059. ...item,
  1060. measureQuantity: item.measureQuantity,
  1061. sampleCode: codeList[index],
  1062. qualitySampleTemplateList,
  1063. });
  1064. }
  1065. this.sampleList = dataList;
  1066. this.getTotal();
  1067. },
  1068. getTotal() {
  1069. this.form.sampleQuantity = this.sampleList
  1070. .reduce((total, el) => total + Number(el.measureQuantity), 0)
  1071. .toFixed(2);
  1072. this.form.sampleWeight = this.sampleList
  1073. .reduce((total, el) => total + Number(el.weight), 0)
  1074. .toFixed(2);
  1075. },
  1076. async batchCodes(count) {
  1077. if (count <= 0) return;
  1078. let params = {
  1079. count
  1080. };
  1081. const res = await getCodeList("sample_code", params);
  1082. return res;
  1083. },
  1084. /* 保存编辑 */
  1085. save(type) {
  1086. if (this.type == "add") {
  1087. [
  1088. "id",
  1089. "code",
  1090. "name",
  1091. "createTime",
  1092. "createUserId",
  1093. "status",
  1094. "approvalStatus",
  1095. "approvalUserId",
  1096. ].forEach((key) => {
  1097. delete this.form[key];
  1098. });
  1099. }
  1100. let data = JSON.parse(JSON.stringify(this.form));
  1101. // 验证
  1102. if (!this.form.qualityWorkOrderCode) {
  1103. uni.showToast({
  1104. title: "请选择质检工单",
  1105. icon: "none"
  1106. });
  1107. return;
  1108. }
  1109. if (!this.form.qualityMode) {
  1110. uni.showToast({
  1111. title: "请选择质检方式",
  1112. icon: "none"
  1113. });
  1114. return;
  1115. }
  1116. if (!this.form.recordingMethod) {
  1117. uni.showToast({
  1118. title: "请选择记录方法",
  1119. icon: "none"
  1120. });
  1121. return;
  1122. }
  1123. if (this.form.qualityMode == "2" && !this.form.conditionType) {
  1124. uni.showToast({
  1125. title: "请选择请样类型",
  1126. icon: "none"
  1127. });
  1128. return;
  1129. }
  1130. if (!this.sampleList.length) {
  1131. uni.showToast({
  1132. title: "样品清单不能为空!",
  1133. icon: "none"
  1134. });
  1135. return;
  1136. }
  1137. //抽检
  1138. if (data.qualityMode == 2) {
  1139. //取整样
  1140. if (data.conditionType == 1) {
  1141. data.quantity = data.portion;
  1142. } else {
  1143. data.copies = data.portion;
  1144. }
  1145. }
  1146. data.measureUnit = this.sampleList[0].measureUnit;
  1147. let api = this.type == "add" ? samplingrecordSave : samplingrecordUpdate;
  1148. this.loading = true;
  1149. api({
  1150. ...data,
  1151. sampleList: this.sampleList,
  1152. })
  1153. .then((res) => {
  1154. this.loading = false;
  1155. uni.showToast({
  1156. title: "操作成功",
  1157. icon: "success"
  1158. });
  1159. if (type == "submit") {
  1160. this.approvalSubmit(this.type == "add" ? res : data.id);
  1161. } else {
  1162. this.cancel();
  1163. this.$emit("reload");
  1164. }
  1165. })
  1166. .catch(() => {
  1167. this.loading = false;
  1168. });
  1169. },
  1170. async approvalSubmit(id) {
  1171. const res = await getById(id);
  1172. this.processSubmitDialogFlag = true;
  1173. this.$nextTick(() => {
  1174. let params = {
  1175. businessId: res.id,
  1176. businessKey: "sampling_approval_process",
  1177. formCreateUserId: res.createUserId,
  1178. variables: {
  1179. businessCode: res.code,
  1180. businessName: "请样",
  1181. businessType: res.qualityWorkOrderVO.conditionType == 1 ? "整样" : "小样",
  1182. },
  1183. };
  1184. this.$refs.processSubmitDialogRef.init(params);
  1185. });
  1186. },
  1187. search() {
  1188. this.cancel();
  1189. this.$emit("reload");
  1190. },
  1191. },
  1192. };
  1193. </script>
  1194. <style lang="scss" scoped>
  1195. .popup-content {
  1196. width: 100vw;
  1197. height: 90vh;
  1198. background: #fff;
  1199. border-radius: 0;
  1200. display: flex;
  1201. flex-direction: column;
  1202. }
  1203. .popup-header {
  1204. display: flex;
  1205. justify-content: space-between;
  1206. align-items: center;
  1207. padding: 30rpx;
  1208. border-bottom: 1rpx solid #e5e5e5;
  1209. .popup-title {
  1210. font-size: 36rpx;
  1211. font-weight: bold;
  1212. color: #333;
  1213. }
  1214. .close-btn {
  1215. width: 60rpx;
  1216. height: 60rpx;
  1217. display: flex;
  1218. align-items: center;
  1219. justify-content: center;
  1220. font-size: 60rpx;
  1221. color: #999;
  1222. line-height: 1;
  1223. }
  1224. }
  1225. .popup-body {
  1226. flex: 1;
  1227. overflow-y: auto;
  1228. padding: 0 30rpx 30rpx;
  1229. }
  1230. .form-section {
  1231. margin-top: 30rpx;
  1232. .section-title {
  1233. font-size: 32rpx;
  1234. font-weight: bold;
  1235. color: #333;
  1236. margin-bottom: 20rpx;
  1237. padding-left: 20rpx;
  1238. border-left: 6rpx solid #157a2c;
  1239. }
  1240. .form-row {
  1241. margin-bottom: 20rpx;
  1242. .form-item {
  1243. display: flex;
  1244. align-items: center;
  1245. padding: 20rpx 0;
  1246. border-bottom: 1rpx solid #f5f5f5;
  1247. .label {
  1248. width: 150rpx;
  1249. font-size: 28rpx;
  1250. color: #333;
  1251. flex-shrink: 0;
  1252. &::after {
  1253. content: ":";
  1254. }
  1255. }
  1256. .value-wrap {
  1257. flex: 1;
  1258. min-height: 60rpx;
  1259. display: flex;
  1260. align-items: center;
  1261. position: relative;
  1262. &.disabled {
  1263. opacity: 0.6;
  1264. }
  1265. .arrow {
  1266. color: #999;
  1267. font-size: 40rpx;
  1268. line-height: 1;
  1269. }
  1270. }
  1271. }
  1272. }
  1273. }
  1274. .table-info {
  1275. padding: 20rpx;
  1276. font-size: 28rpx;
  1277. color: #666;
  1278. background: #f9f9f9;
  1279. border-radius: 8rpx;
  1280. margin-bottom: 20rpx;
  1281. }
  1282. .table-wrapper {
  1283. border: 1rpx solid #e5e5e5;
  1284. border-radius: 8rpx;
  1285. overflow: hidden;
  1286. max-height: 400rpx;
  1287. }
  1288. .table-scroll {
  1289. width: 100%;
  1290. height: 400rpx;
  1291. }
  1292. .source-table {
  1293. min-width: 100%;
  1294. width: 950rpx;
  1295. }
  1296. .table-header {
  1297. display: flex;
  1298. background: #f5f5f5;
  1299. z-index: 10;
  1300. min-width: 100%;
  1301. box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.05);
  1302. .table-cell {
  1303. padding: 20rpx 10rpx;
  1304. font-size: 26rpx;
  1305. font-weight: bold;
  1306. color: #333;
  1307. text-align: center;
  1308. border-right: 1rpx solid #e5e5e5;
  1309. white-space: nowrap;
  1310. overflow: hidden;
  1311. text-overflow: ellipsis;
  1312. flex-shrink: 0;
  1313. &.select-cell {
  1314. width: 80rpx;
  1315. display: flex;
  1316. align-items: center;
  1317. justify-content: center;
  1318. padding: 20rpx;
  1319. }
  1320. &:nth-child(2) {
  1321. width: 300rpx;
  1322. }
  1323. &:nth-child(3),
  1324. &:nth-child(4),
  1325. &:nth-child(5),
  1326. &:nth-child(6) {
  1327. width: 140rpx;
  1328. }
  1329. &:last-child {
  1330. border-right: none;
  1331. }
  1332. }
  1333. }
  1334. .sample-table {
  1335. min-width: 100%;
  1336. width: 1040rpx;
  1337. }
  1338. .table-body {
  1339. .table-row {
  1340. display: flex;
  1341. border-bottom: 1rpx solid #e5e5e5;
  1342. &:last-child {
  1343. border-bottom: none;
  1344. }
  1345. .table-cell {
  1346. padding: 20rpx 10rpx;
  1347. font-size: 24rpx;
  1348. color: #666;
  1349. text-align: center;
  1350. border-right: 1rpx solid #e5e5e5;
  1351. white-space: nowrap;
  1352. overflow: hidden;
  1353. text-overflow: ellipsis;
  1354. flex-shrink: 0;
  1355. &.select-cell {
  1356. width: 80rpx;
  1357. display: flex;
  1358. align-items: center;
  1359. justify-content: center;
  1360. padding: 20rpx;
  1361. }
  1362. &:nth-child(2) {
  1363. width: 300rpx;
  1364. }
  1365. &:nth-child(3),
  1366. &:nth-child(4),
  1367. &:nth-child(5),
  1368. &:nth-child(6) {
  1369. width: 140rpx;
  1370. }
  1371. &:last-child {
  1372. border-right: none;
  1373. }
  1374. }
  1375. }
  1376. .table-empty {
  1377. padding: 60rpx 0;
  1378. text-align: center;
  1379. font-size: 28rpx;
  1380. color: #999;
  1381. }
  1382. }
  1383. // 样品信息表格特定样式
  1384. .sample-table {
  1385. .table-header {
  1386. .table-cell {
  1387. &:nth-child(1) {
  1388. width: 200rpx;
  1389. }
  1390. &:nth-child(2) {
  1391. width: 250rpx;
  1392. }
  1393. &:nth-child(3),
  1394. &:nth-child(4),
  1395. &:nth-child(5),
  1396. &:nth-child(6) {
  1397. width: 140rpx;
  1398. }
  1399. }
  1400. }
  1401. .table-body {
  1402. .table-cell {
  1403. &:nth-child(1) {
  1404. width: 200rpx;
  1405. }
  1406. &:nth-child(2) {
  1407. width: 250rpx;
  1408. }
  1409. &:nth-child(3),
  1410. &:nth-child(4),
  1411. &:nth-child(5),
  1412. &:nth-child(6) {
  1413. width: 140rpx;
  1414. }
  1415. }
  1416. }
  1417. }
  1418. .confirm-btn-wrap {
  1419. margin-top: 20rpx;
  1420. padding: 0 20rpx;
  1421. }
  1422. .popup-footer {
  1423. display: flex;
  1424. padding: 20rpx 30rpx;
  1425. border-top: 1rpx solid #e5e5e5;
  1426. gap: 20rpx;
  1427. /deep/ .u-button {
  1428. flex: 1;
  1429. }
  1430. }
  1431. .select-input {
  1432. display: flex;
  1433. align-items: center;
  1434. justify-content: space-between;
  1435. padding: 20rpx 0;
  1436. min-height: 70rpx;
  1437. border-bottom: 1rpx solid #e5e5e5;
  1438. width: 100%;
  1439. &.disabled {
  1440. opacity: 0.6;
  1441. }
  1442. .value-text {
  1443. flex: 1;
  1444. font-size: 28rpx;
  1445. color: #333;
  1446. &.empty {
  1447. color: #999;
  1448. }
  1449. }
  1450. .arrow {
  1451. font-size: 40rpx;
  1452. color: #999;
  1453. line-height: 1;
  1454. margin-left: 20rpx;
  1455. }
  1456. }
  1457. </style>