addSample.vue 39 KB

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