printOriginalRecords.vue 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134
  1. <template>
  2. <BasicModal
  3. v-bind="$attrs"
  4. @register="registerModal"
  5. destroyOnClose
  6. title="推钢室生产原始记录"
  7. :width="1400"
  8. :height="930"
  9. ok-text="打印"
  10. @ok="onPrint"
  11. >
  12. <section
  13. ref="print"
  14. style="padding: 10px; position: relative; border: 1px solid #c5c5c5; background: #fff; width: 100%; min-height: 100%"
  15. id="printBilletSampleCard"
  16. :key="printKey"
  17. >
  18. <div class="ticket next-ticket">
  19. <div style="text-align: center; position: relative">
  20. <div class="noprint" style="position: absolute; z-index: 100">
  21. <a-button v-if="(isConfirmOrgData || !isEditAbled) && showAddHeatNo" type="primary" style="margin-right: 10px" @click="addHeatNo"
  22. >添加炉号</a-button
  23. >
  24. <a-button
  25. v-if="isConfirmOrgData"
  26. type="primary"
  27. @click="
  28. () => {
  29. closeModal();
  30. openModal(true, {
  31. ccmNo: hostNumber,
  32. queryType: '2',
  33. shiftText: shiftInfoTxt.join('-'),
  34. curShiftInfo: shiftInfo,
  35. changeShiftId: fetchChangeShiftId,
  36. });
  37. }
  38. "
  39. >送样卡</a-button
  40. >
  41. </div>
  42. <p style="font-size: 24px; font-weight: 800; display: inline-block; margin-bottom: 16px; line-height: 30px">
  43. <span class="ccmno">{{ hostNumber }}</span> #机推钢室生产原始记录
  44. </p>
  45. </div>
  46. <div class="flex ccmno-info" style="line-height: 24px">
  47. <div class="flex-1"> 班组:<component :is="renderDictTag(shiftInfo.shiftGroup, 'lg_bz')" /> </div>
  48. <div class="flex-1"> 班次:<component :is="renderDictTag(shiftInfo.shift, 'lg_bb')" /> </div>
  49. <div class="flex-1 flex"
  50. ><span> 定尺:</span><a-input v-model:value="mainSize" @blur="handleSizeBlur" style="flex: 1" :bordered="false" size="small" />
  51. </div>
  52. <div class="flex-1" style="text-align: center; font-size: 13px">
  53. {{ dayjs(curTime).format('YYYY 年 MM 月 DD 日') }}
  54. </div>
  55. <div class="flex-1" style="text-align: right; font-size: 12px"> lg/R05 </div>
  56. </div>
  57. <a-table :columns="columns" size="small" :data-source="dataSource" bordered :pagination="false">
  58. <template #summary>
  59. <a-table-summary-row>
  60. <a-table-summary-cell :col-span="remakeColSpan" style="text-align: center">备注</a-table-summary-cell>
  61. <a-table-summary-cell :col-span="sizeColSpan" style="text-align: center"> 定尺 </a-table-summary-cell>
  62. <a-table-summary-cell :col-span="flowColSpan" style="text-align: center"> 支数(支) </a-table-summary-cell>
  63. <a-table-summary-cell :col-span="weightColSpan" style="text-align: center"> 产量(吨) </a-table-summary-cell>
  64. </a-table-summary-row>
  65. <a-table-summary-row class="summary-row-no-border">
  66. <a-table-summary-cell :row-span="2" :col-span="remakeColSpan">
  67. <div class="summary-cell-remark">
  68. <a-textarea v-model:value="mainRemark" @blur="handleRemarkBlur" style="min-height: 160px" :bordered="false" />
  69. </div>
  70. </a-table-summary-cell>
  71. <a-table-summary-cell :row-span="1" :col-span="1"> 热送 </a-table-summary-cell>
  72. <a-table-summary-cell :row-span="1" :col-span="sizeColSpan - 1">
  73. <div class="song-items flex" v-for="(item, index) in hotSendList" :key="index">
  74. <div class="title">{{ index }}</div>
  75. <div class="flex flex-col">
  76. <div class="song-item" v-for="ele in item">{{ ele.size }}</div>
  77. </div>
  78. </div>
  79. </a-table-summary-cell>
  80. <a-table-summary-cell :col-span="flowColSpan">
  81. <div class="song-items flex" v-for="(item, index) in hotSendList" :key="index">
  82. <div class="flex flex-col">
  83. <div class="song-item" v-for="ele in item">{{ ele.amount }}</div>
  84. </div>
  85. </div>
  86. </a-table-summary-cell>
  87. <a-table-summary-cell :col-span="weightColSpan">
  88. <div class="song-items flex" v-for="(item, index) in hotSendList" :key="index">
  89. <div class="flex flex-col">
  90. <div class="song-item" v-for="ele in item">{{ ele.weight ? ele.weight.toFixed(3) : '' }} t</div>
  91. </div>
  92. </div>
  93. </a-table-summary-cell>
  94. </a-table-summary-row>
  95. <a-table-summary-row>
  96. <!-- <a-table-summary-cell :col-span="remakeColSpan">
  97. <div class="summary-cell-remark"></div>
  98. </a-table-summary-cell> -->
  99. <a-table-summary-cell :row-span="1" :col-span="1"> 堆垛 </a-table-summary-cell>
  100. <a-table-summary-cell :row-span="1" :col-span="sizeColSpan - 1">
  101. <div class="song-items flex">
  102. <div class="flex flex-col">
  103. <div class="song-item" v-for="ele in stackingList">{{ ele.size }}</div>
  104. </div>
  105. </div>
  106. <div class="song-items flex" v-for="(item, index) in coldSendList" :key="index">
  107. <div class="title" style="margin-right: 10px; color: #108ee9">{{ index }}</div>
  108. <div class="flex flex-col">
  109. <div class="song-item" v-for="ele in item">{{ ele.size }}</div>
  110. </div>
  111. </div>
  112. </a-table-summary-cell>
  113. <a-table-summary-cell :col-span="flowColSpan">
  114. <div class="song-items flex">
  115. <div class="flex flex-col">
  116. <div class="song-item" v-for="ele in stackingList">{{ ele.amount }}</div>
  117. </div>
  118. </div>
  119. <div class="song-items flex" v-for="(item, index) in coldSendList" :key="index">
  120. <div class="flex flex-col">
  121. <div class="song-item" v-for="ele in item">{{ ele.amount }}</div>
  122. </div>
  123. </div>
  124. </a-table-summary-cell>
  125. <a-table-summary-cell :col-span="weightColSpan">
  126. <div class="song-items flex">
  127. <div class="flex flex-col">
  128. <div class="song-item" v-for="ele in stackingList">{{ ele.weight ? ele.weight.toFixed(3) : '' }} t</div>
  129. </div>
  130. </div>
  131. <div class="song-items flex" v-for="(item, index) in coldSendList" :key="index">
  132. <div class="flex flex-col">
  133. <div class="song-item" v-for="ele in item">{{ ele.weight ? ele.weight.toFixed(3) : '' }} t</div>
  134. </div>
  135. </div>
  136. </a-table-summary-cell>
  137. </a-table-summary-row>
  138. </template>
  139. </a-table>
  140. </div>
  141. <div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%" v-if="isConfirmOrgData && isEditAbled"> </div>
  142. </section>
  143. <template #appendFooter>
  144. <a-button @click="openJSModal = true" v-if="!isConfirmOrgData"> 重量计算 </a-button>
  145. <a-button type="primary" v-if="isConfirmOrgData && !isEditAbled" @click="handlerConfirmOrgData"> 确认无误 </a-button>
  146. </template>
  147. </BasicModal>
  148. <a-modal
  149. v-model:open="openJSModal"
  150. title="重量计算"
  151. centered
  152. width="600px"
  153. :zIndex="9999"
  154. @ok="
  155. () => {
  156. openJSModal = false;
  157. }
  158. "
  159. @cancel="
  160. () => {
  161. openJSModal = false;
  162. }
  163. "
  164. >
  165. <div class="flex justify-center items-center" style="margin: 20px; line-height: 40px">
  166. <a-input-group size="large">
  167. <a-row :gutter="8">
  168. <a-col :span="5">
  169. <a-input type="number" :min="1" v-model:value="weightNum" placeholder="支数" />
  170. </a-col>
  171. <a-col :span="1" style="line-height: 40px; text-align: center">*</a-col>
  172. <a-col :span="5">
  173. <a-input type="number" v-model:value="sizeNum" placeholder="定尺" />
  174. </a-col>
  175. <a-col :span="1" style="line-height: 40px; text-align: center">*</a-col>
  176. <a-col :span="5">
  177. <a-input type="number" v-model:value="xiShu" placeholder="请输入比例" />
  178. </a-col>
  179. <a-col :span="1" style="line-height: 40px; text-align: center">=</a-col>
  180. <a-col :span="6" style="line-height: 40px; text-align: center">{{ weightCalc }}</a-col>
  181. </a-row>
  182. </a-input-group>
  183. </div>
  184. </a-modal>
  185. <!-- 设置定尺数量的modal -->
  186. <a-modal v-model:open="openSetSizeNumModal" title="设置定尺数量" centered width="500px" :zIndex="1100" @ok="confirmSetSizeNum">
  187. <div style="padding: 60px 30px 30px; font-size: 16px" v-if="editSizeNumRecord && editSizeNumRecord.hotChargeLengthArr">
  188. <div style="margin-bottom: 30px" v-for="(item, index) in editSizeNumRecord.hotChargeLengthArr" :key="index">
  189. <a-input-number
  190. size="large"
  191. v-model:value="item.totalCount"
  192. :min="0"
  193. :step="4"
  194. @change="
  195. (value) => {
  196. if (!value) {
  197. item.totalCount = 0;
  198. }
  199. // if (value % 4 !== 0) {
  200. // item.totalCount = value - (value % 4);
  201. // }
  202. }
  203. "
  204. :controls="false"
  205. >
  206. <template #addonBefore>
  207. <div :style="{ color: item.hotChargeBtype === '0' ? '#f50' : '#108ee9' }">
  208. {{
  209. headText[item.hotChargeDestination] +
  210. ' ' +
  211. Number(item.hotChargeLength) / 1000 +
  212. 'm ' +
  213. ' ' +
  214. (item.hotChargeBtype === '0' ? '热' : '冷')
  215. }}
  216. </div>
  217. </template>
  218. </a-input-number>
  219. </div>
  220. <div style="font-size: 16px; color: #f50">注:请输入大于等于0的数.</div>
  221. </div>
  222. </a-modal>
  223. <!-- 新增炉号 -->
  224. <a-modal v-model:open="openNewHeatNo" title="新增炉次" centered width="500px" :zIndex="1000" @ok="confirmAddHeatNo">
  225. <div style="padding: 30px; font-size: 16px">
  226. <div class="flex" style="margin-bottom: 30px">
  227. <span style="color: #f50; padding: 0 20px 0 0"> 添加</span>
  228. <a-select class="flex-1" v-model:value="nextHeatNo" allowClear :options="getAddHeatNo" />
  229. <span style="color: #f50; padding: 0 0 0 20px"> 之前</span>
  230. </div>
  231. <a-input size="large" v-model:value="newHeatNo"></a-input>
  232. </div>
  233. </a-modal>
  234. <!-- 打印钢坯送样卡 -->
  235. <print-billet-sample-card @register="registerPrintModal" />
  236. </template>
  237. <script lang="ts" setup>
  238. import { ref, computed, h } from 'vue';
  239. import { BasicModal, useModalInner } from '/@/components/Modal';
  240. import dayjs from 'dayjs';
  241. import { printJS } from '/@/hooks/web/usePrintJS';
  242. import type { TableColumnsType } from 'ant-design-vue';
  243. import { queryBilletRecordByCcmNo, editBilletRecord, addBilletNo, editOriginalProductRecord, deleteBilletRecord } from '../operator.api';
  244. import { render } from '/@/utils/common/renderUtils';
  245. import { isArray, isNumber } from '/@/utils/is';
  246. import Icon from '/@/components/Icon';
  247. import { Input, Select } from 'ant-design-vue';
  248. import { throttle } from 'lodash-es';
  249. import { useMessage } from '/@/hooks/web/useMessage';
  250. import { initDictOptions } from '/@/utils/dict';
  251. import printBilletSampleCard from './printBilletSampleCard.vue';
  252. import { useModal } from '/@/components/Modal';
  253. import { getMachineConfig, MachineConfigType } from '../../hotDelivery/common.data';
  254. import { steelPlateFormula } from '../operator.data';
  255. import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
  256. // 注册打印送样卡modal
  257. const [registerPrintModal, { openModal }] = useModal();
  258. const { createMessage, createConfirm } = useMessage();
  259. const printKey = ref(dayjs().unix());
  260. const isEditAbled = ref(false); // 是否可编辑
  261. // 渲染字典标签
  262. const renderDictTag = (value: string, dictCode: string) => {
  263. return render.renderDict(value, dictCode);
  264. };
  265. // 主机号
  266. const hostNumber = ref('5');
  267. const defaultColumns: TableColumnsType = [
  268. {
  269. title: '序号',
  270. width: 40,
  271. dataIndex: 'SerialNumber',
  272. align: 'center',
  273. key: 'SerialNumber',
  274. customRender: ({ text, record }) => {
  275. if (!record.heatNo) return text;
  276. const { orgData } = record;
  277. return h(
  278. 'div',
  279. {
  280. style: { position: 'relative' },
  281. },
  282. [
  283. h('span', {}, text),
  284. h(
  285. 'div',
  286. {
  287. class: 'noprint delete-heat',
  288. onClick: () => {
  289. console.log('record', orgData);
  290. createConfirm({
  291. iconType: 'warning',
  292. title: '删除确认',
  293. content: `确定删除【${record.heatNo}】吗?删除后无法恢复!`,
  294. onOk: () => {
  295. return deleteBilletRecord({
  296. id: orgData.id,
  297. }).then(() => {
  298. getHeatList({
  299. ccmNo: hostNumber.value,
  300. queryType: fetchQueryType.value,
  301. changeShiftId: fetchChangeShiftId.value,
  302. });
  303. });
  304. },
  305. });
  306. },
  307. },
  308. h(Icon, { icon: 'ant-design:delete-filled', size: '20' }, '')
  309. ),
  310. ]
  311. );
  312. },
  313. },
  314. {
  315. title: '炉号',
  316. dataIndex: 'heatNo',
  317. width: 100,
  318. align: 'center',
  319. key: 'heatNo',
  320. customRender: ({ text, record }) => {
  321. if (!record.heatNo) return '';
  322. const { orgData } = record;
  323. return h(Input, {
  324. key: orgData.heatNo + record.keyDate,
  325. size: 'small',
  326. bordered: false,
  327. value: text,
  328. onBlur: throttle(
  329. (e) => {
  330. const v = e.target.value.trim();
  331. if (!v || orgData.heatNo === v) return;
  332. createConfirm({
  333. iconType: 'warning',
  334. title: '交班确认',
  335. content: `确定修改【${record.heatNo}】吗?`,
  336. onOk: () => {
  337. return editBilletRecord({
  338. ...orgData,
  339. heatNo: v,
  340. }).then(() => {
  341. getHeatList({
  342. ccmNo: hostNumber.value,
  343. queryType: fetchQueryType.value,
  344. changeShiftId: fetchChangeShiftId.value,
  345. });
  346. });
  347. },
  348. onCancel: () => {
  349. getHeatList({
  350. ccmNo: hostNumber.value,
  351. queryType: fetchQueryType.value,
  352. changeShiftId: fetchChangeShiftId.value,
  353. });
  354. },
  355. });
  356. },
  357. 500,
  358. {
  359. leading: true,
  360. trailing: false,
  361. }
  362. ),
  363. });
  364. },
  365. },
  366. {
  367. title: '钢种',
  368. width: 100,
  369. align: 'center',
  370. dataIndex: 'brandNum',
  371. key: 'brandNum',
  372. customRender: ({ text, record }) => {
  373. if (!record.heatNo) return '';
  374. const { orgData } = record;
  375. return h(
  376. JSearchSelect,
  377. {
  378. key: orgData.heatNo + record.keyDate,
  379. type: 'list',
  380. bordered: false,
  381. size: 'small',
  382. value: text,
  383. dict: 'billet_spec',
  384. onChange: (v) => {
  385. createConfirm({
  386. iconType: 'warning',
  387. title: '交班确认',
  388. content: `确定修改【${record.heatNo}】的牌号吗?`,
  389. onOk: () => {
  390. return editBilletRecord({
  391. ...orgData,
  392. grade: v,
  393. }).then(() => {
  394. getHeatList({
  395. ccmNo: hostNumber.value,
  396. queryType: fetchQueryType.value,
  397. changeShiftId: fetchChangeShiftId.value,
  398. });
  399. });
  400. },
  401. onCancel: () => {
  402. getHeatList({
  403. ccmNo: hostNumber.value,
  404. queryType: fetchQueryType.value,
  405. changeShiftId: fetchChangeShiftId.value,
  406. });
  407. },
  408. });
  409. },
  410. placeholder: '请选择',
  411. },
  412. ''
  413. );
  414. },
  415. },
  416. // {
  417. // title: '支数(根)',
  418. // align: 'center',
  419. // width: 570,
  420. // children: [
  421. // {
  422. // title: 'I',
  423. // dataIndex: 'oneFlow',
  424. // key: 'oneFlow',
  425. // align: 'center',
  426. // width: 40,
  427. // },
  428. // {
  429. // title: 'II',
  430. // dataIndex: 'twoFlow',
  431. // key: 'twoFlow',
  432. // align: 'center',
  433. // width: 40,
  434. // },
  435. // {
  436. // title: 'III',
  437. // dataIndex: 'threeFlow',
  438. // key: 'threeFlow',
  439. // align: 'center',
  440. // width: 40,
  441. // },
  442. // {
  443. // title: 'IV',
  444. // dataIndex: 'fourFlow',
  445. // key: 'fourFlow',
  446. // align: 'center',
  447. // width: 40,
  448. // },
  449. // {
  450. // title: 'V',
  451. // dataIndex: 'fiveFlow',
  452. // key: 'fiveFlow',
  453. // align: 'center',
  454. // width: 40,
  455. // },
  456. // {
  457. // title: 'VI',
  458. // dataIndex: 'sixFlow',
  459. // key: 'sixFlow',
  460. // align: 'center',
  461. // width: 40,
  462. // },
  463. // {
  464. // title: 'VII',
  465. // dataIndex: 'sevenFlow',
  466. // key: 'sevenFlow',
  467. // align: 'center',
  468. // width: 40,
  469. // },
  470. // {
  471. // title: 'VIII',
  472. // dataIndex: 'eightFlow',
  473. // key: 'eightFlow',
  474. // align: 'center',
  475. // width: 40,
  476. // },
  477. // {
  478. // title: '合计',
  479. // dataIndex: 'total',
  480. // key: 'total',
  481. // align: 'center',
  482. // width: 40,
  483. // customRender({ text, record }) {
  484. // if (!record.heatNo) {
  485. // return '';
  486. // }
  487. // const allCount = handleTotalSum(record.orgData);
  488. // return h(
  489. // Input,
  490. // { class: 'total-input', size: 'small', bordered: false, value: allCount, onBlur: (e) => handleTotalChange(e, record) },
  491. // ''
  492. // );
  493. // },
  494. // },
  495. // ],
  496. // },
  497. {
  498. title: () => {
  499. return h('div', { style: { position: 'relative' } }, [
  500. h('span', {}, hostNumber.value == '5' ? '棒一' : '高线'),
  501. h(
  502. 'div',
  503. {
  504. style: {
  505. cursor: 'pointer',
  506. position: 'absolute',
  507. right: '4px',
  508. top: '1px',
  509. },
  510. class: 'noprint',
  511. onClick: () => {
  512. const rollOnrColumn: any = columns.value.find((item: any) => item.dataIndex === 'rollOne');
  513. let newSize: string | number = '';
  514. rollOnrColumn.children.push({
  515. title: () => {
  516. return h(
  517. // Select,
  518. Input,
  519. {
  520. // options: sizeListOPtions.value,
  521. bordered: false,
  522. // dropdownStyle: {
  523. // minWidth: '80px',
  524. // },
  525. defaultValue: '',
  526. style: {
  527. padding: 0,
  528. textAlign: 'center',
  529. },
  530. // onChange: (value) => {
  531. // newSize = value;
  532. // },
  533. onBlur: throttle((e) => {
  534. if (e.target.value.trim() === '') {
  535. createMessage.error('请输入定尺');
  536. return;
  537. }
  538. const size = Number(e.target.value.trim());
  539. if (!isNumber(size)) {
  540. createMessage.error('请输入数字');
  541. return;
  542. }
  543. newSize = size <= 20 ? size * 1000 : size;
  544. }, 500),
  545. },
  546. ''
  547. );
  548. },
  549. dataIndex: 'newSize',
  550. key: 'newSize',
  551. align: 'center',
  552. // width: 100,
  553. customRender({ text, record }) {
  554. if (!record.heatNo) {
  555. return '';
  556. }
  557. return h(
  558. Input,
  559. { class: 'total-input', size: 'small', bordered: false, value: text, onBlur: (e) => handleSizeChange(e, record, newSize) },
  560. ''
  561. );
  562. },
  563. });
  564. },
  565. },
  566. h(Icon, { icon: 'ant-design:plus-square-outlined' }, '')
  567. ),
  568. ]);
  569. },
  570. // width: 100,
  571. align: 'center',
  572. dataIndex: 'rollOne',
  573. key: 'rollOne',
  574. children: [],
  575. },
  576. ];
  577. const totalColum: TableColumnsType = [
  578. {
  579. title: '合计',
  580. dataIndex: 'total',
  581. key: 'total',
  582. align: 'center',
  583. // width: 100,
  584. customRender({ text, record }) {
  585. if (!record.heatNo) {
  586. return '';
  587. }
  588. const allCount = handleTotalSum(record.orgData);
  589. return h(Input, { class: 'total-input', size: 'small', bordered: false, value: allCount, onBlur: (e) => handleTotalChange(e, record) }, '');
  590. },
  591. },
  592. ];
  593. const columns = ref<TableColumnsType>(defaultColumns);
  594. const dataSource = ref<any[]>([]);
  595. const shiftInfoTxt = ref(['', '']);
  596. const shiftInfo = ref({ shift: '', shiftGroup: '' });
  597. const curTime = ref(dayjs().format('YYYY-MM-DD'));
  598. // 确认上一个班次的原始数据
  599. const isConfirmOrgData = ref(false);
  600. //表单赋值
  601. const fetchQueryType = ref(1);
  602. const fetchChangeShiftId = ref('');
  603. // 定尺
  604. const sizeListOPtions = ref([]);
  605. // 堆垛
  606. const stackList = ref<any[]>([]);
  607. // 获取堆垛信息
  608. const getStackInfo = async (ccmNo) => {
  609. const machineConfig = await getMachineConfig(ccmNo)[MachineConfigType.STACKING];
  610. stackList.value = machineConfig;
  611. };
  612. const getTotalRows = (num = 22) => {
  613. let newSip: any[] = [];
  614. for (let index = 0; index < num; index++) {
  615. newSip.push({
  616. SerialNumber: index + 1,
  617. heatNo: '',
  618. brandNum: '',
  619. oneFlow: '',
  620. twoFlow: '',
  621. threeFlow: '',
  622. fourFlow: '',
  623. fiveFlow: '',
  624. sixFlow: '',
  625. sevenFlow: '',
  626. eightFlow: '',
  627. total: '',
  628. });
  629. }
  630. return newSip;
  631. };
  632. const showAddHeatNo = ref(true);
  633. const [registerModal, { changeOkLoading, changeLoading, closeModal }] = useModalInner(async (data) => {
  634. const { ccmNo, shiftText, queryType, curShiftInfo, changeShiftId, time, confirmOrgData, isShowAddHeatNo } = data;
  635. printKey.value = dayjs().unix();
  636. // isShowAddHeatNo 是否显示添加炉号按钮 质检页面使用
  637. showAddHeatNo.value = isShowAddHeatNo !== false;
  638. // 获取堆垛信息
  639. getStackInfo(ccmNo);
  640. hostNumber.value = ccmNo;
  641. fetchQueryType.value = queryType;
  642. fetchChangeShiftId.value = changeShiftId;
  643. shiftInfoTxt.value = shiftText.split('-');
  644. shiftInfo.value = curShiftInfo;
  645. isConfirmOrgData.value = confirmOrgData === true;
  646. if (time) {
  647. curTime.value = time;
  648. }
  649. dataSource.value = getTotalRows();
  650. getHeatList({
  651. ccmNo,
  652. queryType,
  653. changeShiftId,
  654. });
  655. // 获取定尺啊
  656. initDictOptions('lg_dcgg').then((dc) => {
  657. sizeListOPtions.value = (dc || []).map((item) => {
  658. return {
  659. label: Number(item.value) / 1000,
  660. value: item.value,
  661. };
  662. });
  663. });
  664. });
  665. // 字段映射
  666. const headText = {
  667. rollClubTwoCount: '二',
  668. rollClubThreeCount: '三',
  669. rollClubShippCount: '上',
  670. roll_club_two: '棒二',
  671. roll_club_three: '棒三',
  672. roll_out_shipp: '上若',
  673. };
  674. // 备注
  675. const remakeColSpan = ref(8);
  676. // 定尺
  677. const sizeColSpan = ref(2);
  678. // 支数
  679. const flowColSpan = ref(2);
  680. // 产量
  681. const weightColSpan = ref(4);
  682. // 热送统计
  683. const hotSendList = ref<any>({});
  684. // 冷装统计
  685. const coldSendList = ref<any>({});
  686. // 堆垛统计
  687. const stackingList = ref<any>([]);
  688. // 定尺和备注
  689. const mainOrgSize = ref('');
  690. const mainSize = ref('');
  691. const mainOrgRemark = ref('');
  692. const mainRemark = ref('');
  693. const getHeatList = async (params) => {
  694. try {
  695. changeLoading(true);
  696. const { billetOriginalProductRecordList, content, sizeInfo, confirmStatus } = await queryBilletRecordByCcmNo(params);
  697. let newArr: any[] = [];
  698. mainOrgSize.value = sizeInfo || '';
  699. mainSize.value = sizeInfo || '';
  700. mainRemark.value = content || '';
  701. mainOrgRemark.value = content || '';
  702. isEditAbled.value = confirmStatus === 2;
  703. if (billetOriginalProductRecordList && Array.isArray(billetOriginalProductRecordList)) {
  704. // 根据时间排序
  705. newArr = billetOriginalProductRecordList.sort((a, b) => {
  706. return dayjs(a.createTime).isBefore(dayjs(b.createTime)) ? -1 : 1;
  707. });
  708. // 棒一
  709. const rollOneColumns: TableColumnsType = [];
  710. const rollOneSize = {};
  711. // 棒二
  712. const rollTwoSize = {};
  713. // 棒三
  714. const rollThreeSize = {};
  715. // 上若
  716. const rollShippSize = {};
  717. // 冷装
  718. const rollTwoColdSize = {};
  719. const rollThreeColdSize = {};
  720. const rollShippColdSize = {};
  721. // 堆垛
  722. const stackingSize = {};
  723. // 堆垛字段
  724. let stackLengthColumn: any[] = stackList.value.map((stack) => {
  725. return {
  726. title: () => {
  727. return h('div', { style: { position: 'relative' } }, [
  728. h('span', {}, stack.aliasName),
  729. h(
  730. 'div',
  731. {
  732. style: {
  733. cursor: 'pointer',
  734. position: 'absolute',
  735. right: '4px',
  736. top: '1px',
  737. },
  738. class: 'noprint',
  739. onClick: () => {
  740. const rollOnrColumn: any = columns.value.find((item: any) => item.dataIndex === 'stackLength' + stack.id);
  741. let newSize: string | number = '';
  742. rollOnrColumn.children.push({
  743. title: () => {
  744. return h(
  745. // Select,
  746. Input,
  747. {
  748. // options: sizeListOPtions.value,
  749. bordered: false,
  750. // dropdownStyle: {
  751. // minWidth: '80px',
  752. // },
  753. style: {
  754. padding: '0px',
  755. textAlign: 'center',
  756. },
  757. defaultValue: ' ',
  758. // onChange: (value) => {
  759. // newSize = value;
  760. // },
  761. onBlur: throttle((e) => {
  762. if (e.target.value.trim() === '') {
  763. createMessage.error('请输入定尺');
  764. return;
  765. }
  766. const size = Number(e.target.value.trim());
  767. if (!isNumber(size)) {
  768. createMessage.error('请输入数字');
  769. return;
  770. }
  771. newSize = size <= 20 ? size * 1000 : size;
  772. }, 500),
  773. },
  774. ''
  775. );
  776. },
  777. dataIndex: 'newSize',
  778. key: 'newSize',
  779. align: 'center',
  780. // width: 100,
  781. customRender({ text, record }) {
  782. if (!record.heatNo) {
  783. return '';
  784. }
  785. return h(
  786. Input,
  787. {
  788. class: 'total-input',
  789. size: 'small',
  790. bordered: false,
  791. value: text,
  792. onBlur: (e) => handleStackChange(e, record, newSize, stack.id),
  793. },
  794. ''
  795. );
  796. },
  797. });
  798. },
  799. },
  800. h(Icon, { icon: 'ant-design:plus-square-outlined' }, '')
  801. ),
  802. ]);
  803. },
  804. dataIndex: 'stackLength' + stack.id,
  805. key: 'stackLength' + stack.id,
  806. width: 120,
  807. children: [],
  808. };
  809. });
  810. const hotChargeColumns: any = {
  811. // 棒二字段
  812. roll_club_two: {
  813. title: '棒二',
  814. dataIndex: 'roll_club_two',
  815. key: 'roll_club_two',
  816. // width: 100,
  817. children: [],
  818. },
  819. // 棒三字段
  820. roll_club_three: {
  821. title: '棒三',
  822. dataIndex: 'roll_club_three',
  823. key: 'roll_club_three',
  824. // width: 100,
  825. children: [],
  826. },
  827. // 上若字段
  828. roll_out_shipp: {
  829. title: '上若',
  830. dataIndex: 'roll_out_shipp',
  831. key: 'roll_out_shipp',
  832. // width: 100,
  833. children: [],
  834. },
  835. };
  836. // 热装字段
  837. let columnsHotCharge: any = {
  838. roll_club_two: [],
  839. roll_club_three: [],
  840. roll_out_shipp: [],
  841. };
  842. const allSizeArr: any[] = [];
  843. const totalRows = getTotalRows();
  844. dataSource.value = totalRows.map((item, index) => {
  845. if (!newArr[index]) return item;
  846. const { hotChargeLength, rollClubOneDetails, stackLength } = newArr[index];
  847. // 棒一
  848. let rollOneNum = '';
  849. let rollOneSizesObj = {};
  850. // if (hotSend) {
  851. // const obj = JSON.parse(hotSend);
  852. // rollOneNum = obj.hotSendTotalCount || '';
  853. // }
  854. if (rollClubOneDetails) {
  855. const obj = JSON.parse(rollClubOneDetails);
  856. rollOneNum = obj.directRollingTotalCount || '';
  857. const lengthGroupCount = obj.lengthGroupCount;
  858. if (lengthGroupCount) {
  859. // 热送棒一的定尺
  860. Object.keys(lengthGroupCount).forEach((key) => {
  861. const column = key;
  862. allSizeArr.push(Number(column) / 1000);
  863. const columnKey = column + 'rollOneColumn';
  864. const findIndex = rollOneColumns.findIndex((item: any) => item.dataIndex === columnKey);
  865. if (findIndex === -1) {
  866. rollOneColumns.push({
  867. title: () => {
  868. return h('div', { class: 'rollOneColumnWrapper' }, [
  869. h(
  870. // Select,
  871. Input,
  872. {
  873. // options: sizeListOPtions.value,
  874. bordered: false,
  875. // dropdownStyle: {
  876. // minWidth: '80px',
  877. // },
  878. style: {
  879. padding: '0px',
  880. textAlign: 'center',
  881. },
  882. defaultValue: Number(column) > 20 ? Number(column) / 1000 : column,
  883. // onChange: (value) => {
  884. // switchSizehandler(value, column);
  885. // },
  886. onBlur: throttle((e) => {
  887. const value = Number(e.target.value) < 20 ? Number(e.target.value) * 1000 : Number(e.target.value);
  888. switchSizehandler(value, Number(column));
  889. }, 500),
  890. },
  891. ''
  892. ),
  893. h(
  894. 'div',
  895. { class: 'noprint', onClick: () => deleteRollOneColumn(column) },
  896. h(Icon, { icon: 'ant-design:delete-outlined' }, '')
  897. ),
  898. ]);
  899. },
  900. dataIndex: columnKey,
  901. key: columnKey,
  902. sortKey: column,
  903. align: 'center',
  904. width: 100,
  905. customRender({ text, record }) {
  906. if (!record.heatNo) {
  907. return '';
  908. }
  909. return h(
  910. Input,
  911. { class: 'total-input', size: 'small', bordered: false, value: text, onBlur: (e) => handleSizeChange(e, record, column) },
  912. ''
  913. );
  914. },
  915. });
  916. }
  917. rollOneSizesObj[columnKey] = lengthGroupCount[key];
  918. // 如果没有棒一的定尺
  919. if (!rollOneSize[key]) {
  920. rollOneSize[key] = {
  921. size: Number(column) / 1000 + 'm',
  922. amount: lengthGroupCount[key],
  923. weight: steelPlateFormula(column, lengthGroupCount[key]),
  924. };
  925. } else {
  926. rollOneSize[key].amount += lengthGroupCount[key];
  927. rollOneSize[key].weight += steelPlateFormula(column, lengthGroupCount[key]);
  928. }
  929. });
  930. }
  931. }
  932. // 热装
  933. let sizeArr = {};
  934. if (hotChargeLength) {
  935. // "[{\"hotChargeLength\":\"11820\",\"hotChargeDestination\":\"roll_club_three\",\"totalWeight\":\"74.9624\",\"hotChargeBtype\":\"0\",\"totalCount\":28}]"
  936. const hotChargeArr = JSON.parse(hotChargeLength);
  937. hotChargeArr.forEach((k) => {
  938. const sizeFormat = Number(k.hotChargeLength) / 1000;
  939. allSizeArr.push(sizeFormat);
  940. const dataKey = sizeFormat + k.hotChargeDestination + k.hotChargeBtype;
  941. sizeArr[dataKey] = k.totalCount;
  942. // 热送统计
  943. // 棒二
  944. if (k.hotChargeDestination === 'roll_club_two' && k.totalCount > 0) {
  945. // 添加定尺
  946. columnsHotCharge.roll_club_two.push(sizeFormat);
  947. if (k.hotChargeBtype === '0') {
  948. if (!rollTwoSize[k.hotChargeLength]) {
  949. rollTwoSize[k.hotChargeLength] = {
  950. size: Number(k.hotChargeLength) / 1000 + 'm',
  951. amount: k.totalCount,
  952. weight: steelPlateFormula(k.hotChargeLength, k.totalCount),
  953. };
  954. } else {
  955. rollTwoSize[k.hotChargeLength].amount += k.totalCount;
  956. rollTwoSize[k.hotChargeLength].weight += steelPlateFormula(k.hotChargeLength, k.totalCount);
  957. }
  958. } else {
  959. if (!rollTwoColdSize[k.hotChargeLength]) {
  960. rollTwoColdSize[k.hotChargeLength] = {
  961. type: k.hotChargeBtype,
  962. size: Number(k.hotChargeLength) / 1000 + 'm',
  963. amount: k.totalCount,
  964. weight: steelPlateFormula(k.hotChargeLength, k.totalCount),
  965. };
  966. } else {
  967. rollTwoColdSize[k.hotChargeLength].amount += k.totalCount;
  968. rollTwoColdSize[k.hotChargeLength].weight += steelPlateFormula(k.hotChargeLength, k.totalCount);
  969. }
  970. }
  971. }
  972. // 棒三
  973. if (k.hotChargeDestination === 'roll_club_three' && k.totalCount > 0) {
  974. // 添加定尺
  975. columnsHotCharge.roll_club_three.push(sizeFormat);
  976. if (k.hotChargeBtype === '0') {
  977. if (!rollThreeSize[k.hotChargeLength]) {
  978. rollThreeSize[k.hotChargeLength] = {
  979. size: Number(k.hotChargeLength) / 1000 + 'm',
  980. amount: k.totalCount,
  981. weight: steelPlateFormula(k.hotChargeLength, k.totalCount),
  982. };
  983. } else {
  984. rollThreeSize[k.hotChargeLength].amount += k.totalCount;
  985. rollThreeSize[k.hotChargeLength].weight += steelPlateFormula(k.hotChargeLength, k.totalCount);
  986. }
  987. } else {
  988. if (!rollThreeColdSize[k.hotChargeLength]) {
  989. rollThreeColdSize[k.hotChargeLength] = {
  990. type: k.hotChargeBtype,
  991. size: Number(k.hotChargeLength) / 1000 + 'm',
  992. amount: k.totalCount,
  993. weight: steelPlateFormula(k.hotChargeLength, k.totalCount),
  994. };
  995. } else {
  996. rollThreeColdSize[k.hotChargeLength].amount += k.totalCount;
  997. rollThreeColdSize[k.hotChargeLength].weight += steelPlateFormula(k.hotChargeLength, k.totalCount);
  998. }
  999. }
  1000. }
  1001. // 上若
  1002. if (k.hotChargeDestination === 'roll_out_shipp' && k.totalCount > 0) {
  1003. // 添加定尺
  1004. columnsHotCharge.roll_out_shipp.push(sizeFormat);
  1005. if (k.hotChargeBtype === '0') {
  1006. if (!rollShippSize[k.hotChargeLength]) {
  1007. rollShippSize[k.hotChargeLength] = {
  1008. size: Number(k.hotChargeLength) / 1000 + 'm',
  1009. amount: k.totalCount,
  1010. weight: steelPlateFormula(k.hotChargeLength, k.totalCount),
  1011. };
  1012. } else {
  1013. rollShippSize[k.hotChargeLength].amount += k.totalCount;
  1014. rollShippSize[k.hotChargeLength].weight += steelPlateFormula(k.hotChargeLength, k.totalCount);
  1015. }
  1016. } else {
  1017. if (!rollShippColdSize[k.hotChargeLength]) {
  1018. rollShippColdSize[k.hotChargeLength] = {
  1019. type: k.hotChargeBtype,
  1020. size: Number(k.hotChargeLength) / 1000 + 'm',
  1021. amount: k.totalCount,
  1022. weight: steelPlateFormula(k.hotChargeLength, k.totalCount),
  1023. };
  1024. } else {
  1025. rollShippColdSize[k.hotChargeLength].amount += k.totalCount;
  1026. rollShippColdSize[k.hotChargeLength].weight += steelPlateFormula(k.hotChargeLength, k.totalCount);
  1027. }
  1028. }
  1029. }
  1030. });
  1031. }
  1032. // 堆垛
  1033. let stackSizeData = {};
  1034. if (stackLength) {
  1035. const stackLeghtObj = JSON.parse(stackLength);
  1036. stackLeghtObj.forEach((v) => {
  1037. // 初始化堆垛的定尺key
  1038. const sSize = String(v.stackingLength);
  1039. allSizeArr.push(Number(sSize) / 1000);
  1040. const stackKey = sSize + 'stackLength' + v.stackingBhtcId;
  1041. // 查找某一个堆垛 dataIndex='stackLength' + stackingBhtcId
  1042. const index = stackLengthColumn.findIndex((ele) => ele.dataIndex == 'stackLength' + v.stackingBhtcId);
  1043. const curStackChild = stackLengthColumn[index === -1 ? 0 : index].children;
  1044. const hasChild = curStackChild.findIndex((ele) => ele.dataIndex === stackKey);
  1045. if (hasChild < 0) {
  1046. curStackChild.push({
  1047. title: () => {
  1048. return h('div', { class: 'rollOneColumnWrapper' }, [
  1049. h(
  1050. // Select,
  1051. Input,
  1052. {
  1053. // options: sizeListOPtions.value,
  1054. bordered: false,
  1055. // dropdownStyle: {
  1056. // minWidth: '80px',
  1057. // },
  1058. style: {
  1059. padding: '0px',
  1060. textAlign: 'center',
  1061. },
  1062. defaultValue: Number(sSize) > 20 ? Number(sSize) / 1000 : sSize,
  1063. // onChange: (value) => {
  1064. // switchSizehandler(value, column);
  1065. // },
  1066. onBlur: throttle((e) => {
  1067. const value = Number(e.target.value) < 20 ? Number(e.target.value) * 1000 : Number(e.target.value);
  1068. switchStackhandler(value, Number(sSize));
  1069. }, 500),
  1070. },
  1071. ''
  1072. ),
  1073. h(
  1074. 'div',
  1075. { class: 'noprint', onClick: () => deleteStackColumn(sSize, v.stackingBhtcId) },
  1076. h(Icon, { icon: 'ant-design:delete-outlined' }, '')
  1077. ),
  1078. ]);
  1079. },
  1080. dataIndex: stackKey,
  1081. key: stackKey,
  1082. width: 100,
  1083. sortKey: sSize,
  1084. customRender({ text, record }) {
  1085. if (!record.heatNo) {
  1086. return '';
  1087. }
  1088. return h(
  1089. Input,
  1090. {
  1091. class: 'total-input',
  1092. size: 'small',
  1093. bordered: false,
  1094. value: text,
  1095. onBlur: (e) => handleStackChange(e, record, sSize, v.stackingBhtcId),
  1096. },
  1097. ''
  1098. );
  1099. },
  1100. });
  1101. }
  1102. stackSizeData[stackKey] = v.stackingCount;
  1103. // 给堆垛添加致谢
  1104. if (!stackingSize[sSize]) {
  1105. stackingSize[sSize] = {
  1106. size: Number(sSize) / 1000 + 'm',
  1107. amount: v.stackingCount,
  1108. weight: steelPlateFormula(sSize, v.stackingCount),
  1109. };
  1110. } else {
  1111. stackingSize[sSize].amount += v.stackingCount;
  1112. stackingSize[sSize].weight += steelPlateFormula(sSize, v.stackingCount);
  1113. }
  1114. });
  1115. }
  1116. const curTime = new Date().getTime();
  1117. return {
  1118. ...item,
  1119. id: newArr[index].id || curTime,
  1120. heatNo: newArr[index].heatNo,
  1121. keyDate: curTime,
  1122. brandNum: newArr[index].grade,
  1123. oneFlow: newArr[index].oneStrandSum || '',
  1124. twoFlow: newArr[index].twoStrandSum || '',
  1125. threeFlow: newArr[index].threeStrandSum || '',
  1126. fourFlow: newArr[index].fourStrandSum || '',
  1127. fiveFlow: newArr[index].fiveStrandSum || '',
  1128. sixFlow: newArr[index].sixStrandSum || '',
  1129. sevenFlow: newArr[index].sevenStrandSum || '',
  1130. eightFlow: newArr[index].eightStrandSum || '',
  1131. total: newArr[index].amount || '',
  1132. rollOneOld: rollOneNum,
  1133. ...sizeArr,
  1134. ...rollOneSizesObj,
  1135. ...stackSizeData,
  1136. orgData: newArr[index],
  1137. };
  1138. });
  1139. let otherColumnsNums = 0;
  1140. const otherColumns = Object.keys(columnsHotCharge)
  1141. .filter((item) => columnsHotCharge[item].length)
  1142. .map((item) => {
  1143. const hotChargeSizeArr = [...new Set(columnsHotCharge[item])];
  1144. const niubiGls: any[] = [];
  1145. hotChargeSizeArr.forEach((ele) => {
  1146. niubiGls.push(
  1147. {
  1148. hotChargeLength: Number(ele) * 1000,
  1149. hotChargeDestination: item,
  1150. totalWeight: 0,
  1151. hotChargeBtype: '0',
  1152. totalCount: 0,
  1153. },
  1154. {
  1155. hotChargeLength: Number(ele) * 1000,
  1156. hotChargeDestination: item,
  1157. totalWeight: 0,
  1158. hotChargeBtype: '1',
  1159. totalCount: 0,
  1160. }
  1161. );
  1162. });
  1163. const childSizesColumn = hotChargeSizeArr
  1164. .sort((a, b) => Number(a) * 1000 - Number(b) * 1000)
  1165. .map((childItem) => {
  1166. return {
  1167. title: childItem,
  1168. dataIndex: `${item}.${childItem}`,
  1169. key: `${item}.${childItem}`,
  1170. width: 100,
  1171. align: 'center',
  1172. customRender: ({ record }) => {
  1173. const hotKey = childItem + item + '0';
  1174. const coldKey = childItem + item + '1';
  1175. let sizeArr: any = [];
  1176. if (record[hotKey] || record[coldKey]) {
  1177. sizeArr = [h('div', { class: 'line' }, ''), h('div', { class: 'size-st-item' }, record[hotKey] || '~')];
  1178. sizeArr.push(h('div', { class: ' size-st-num' }, record[coldKey] || '~'));
  1179. }
  1180. return h(
  1181. 'div',
  1182. {
  1183. class: 'size-st-wrapper',
  1184. onClick: () => {
  1185. // if (!record[hotKey] && !record[coldKey]) return;
  1186. const { orgData } = record;
  1187. if (!orgData) return;
  1188. const { hotChargeLength } = orgData;
  1189. const hotChargeInfoArr = hotChargeLength ? JSON.parse(hotChargeLength) : [];
  1190. const itemsHotArr = niubiGls.map((v) => {
  1191. const hasVal = hotChargeInfoArr.find(
  1192. (j) => j.hotChargeLength == v.hotChargeLength && j.hotChargeBtype == v.hotChargeBtype
  1193. );
  1194. return {
  1195. ...v,
  1196. totalCount: hasVal ? hasVal.totalCount : 0,
  1197. };
  1198. });
  1199. editSizeNumRecord.value = {
  1200. ...orgData,
  1201. hotChargeLengthArr: itemsHotArr,
  1202. };
  1203. openSetSizeNumModal.value = true;
  1204. },
  1205. },
  1206. sizeArr
  1207. );
  1208. },
  1209. };
  1210. });
  1211. otherColumnsNums = otherColumnsNums + (childSizesColumn.length ? childSizesColumn.length : 1);
  1212. return {
  1213. ...hotChargeColumns[item],
  1214. children: childSizesColumn,
  1215. };
  1216. });
  1217. const sortedStackLengthColumn = stackLengthColumn.map((ss) => {
  1218. return {
  1219. ...ss,
  1220. children: ss.children.sort((a, b) => {
  1221. return Number(a.sortKey) - Number(b.sortKey);
  1222. }),
  1223. };
  1224. });
  1225. columns.value = [...defaultColumns, ...otherColumns, ...sortedStackLengthColumn, ...totalColum];
  1226. const rollOneIndex = defaultColumns.findIndex((ele: any) => ele.dataIndex === 'rollOne');
  1227. (columns.value[rollOneIndex] as any).children = rollOneColumns.length
  1228. ? rollOneColumns.sort((a: any, b: any) => Number(a.sortKey) - Number(b.sortKey))
  1229. : [];
  1230. // 堆垛的列数量
  1231. const stackColNums = stackLengthColumn.reduce((pre: any, cur: any) => {
  1232. return pre + (cur.children && cur.children.length ? cur.children.length : 1);
  1233. }, 0);
  1234. // 计算列,合并
  1235. const allSpan = 4 + (rollOneColumns.length ? rollOneColumns.length : 1) + otherColumnsNums + stackColNums;
  1236. remakeColSpan.value = Math.ceil(allSpan / 3);
  1237. const nnColSpan = Math.ceil((allSpan - remakeColSpan.value) / 2);
  1238. const newNNColSpan = nnColSpan % 2 === 0 ? nnColSpan : nnColSpan + 1;
  1239. sizeColSpan.value = newNNColSpan / 2 > 4 ? 4 : newNNColSpan / 2;
  1240. flowColSpan.value = newNNColSpan - sizeColSpan.value;
  1241. weightColSpan.value = allSpan - remakeColSpan.value - newNNColSpan;
  1242. // console.log('列宽计算结果allSpan', allSpan);
  1243. // console.log('列宽计算结果stackColNums', stackColNums);
  1244. // console.log('列宽计算结果remakeColSpan.value', remakeColSpan.value);
  1245. // console.log('列宽计算结果nnColSpan', nnColSpan);
  1246. // console.log('列宽计算结果newNNColSpan', newNNColSpan);
  1247. // console.log('列宽计算结果sizeColSpan.value', sizeColSpan.value);
  1248. // console.log('列宽计算结果flowColSpan.value', flowColSpan.value);
  1249. // console.log('列宽计算结果weightColSpan.value', weightColSpan.value);
  1250. let allWeight = 0;
  1251. // 热送统计
  1252. if (Object.values(rollOneSize).length) {
  1253. hotSendList.value['一'] = Object.values(rollOneSize);
  1254. hotSendList.value['一'].forEach((ele) => (allWeight += ele.weight));
  1255. }
  1256. if (Object.values(rollTwoSize).length) {
  1257. hotSendList.value['二'] = Object.values(rollTwoSize);
  1258. hotSendList.value['二'].forEach((ele) => (allWeight += ele.weight));
  1259. }
  1260. if (Object.values(rollThreeSize).length) {
  1261. hotSendList.value['三'] = Object.values(rollThreeSize);
  1262. hotSendList.value['三'].forEach((ele) => (allWeight += ele.weight));
  1263. }
  1264. if (Object.values(rollShippSize).length) {
  1265. hotSendList.value['上'] = Object.values(rollShippSize);
  1266. hotSendList.value['上'].forEach((ele) => (allWeight += ele.weight));
  1267. }
  1268. if (Object.values(stackingSize)) {
  1269. stackingList.value = Object.values(stackingSize);
  1270. stackingList.value.forEach((ele) => (allWeight += ele.weight));
  1271. }
  1272. // 冷装统计
  1273. if (Object.values(rollTwoColdSize).length) {
  1274. coldSendList.value['二'] = Object.values(rollTwoColdSize);
  1275. coldSendList.value['二'].forEach((ele) => (allWeight += ele.weight));
  1276. }
  1277. if (Object.values(rollThreeColdSize).length) {
  1278. coldSendList.value['三'] = Object.values(rollThreeColdSize);
  1279. coldSendList.value['三'].forEach((ele) => (allWeight += ele.weight));
  1280. }
  1281. if (Object.values(rollShippColdSize).length) {
  1282. coldSendList.value['上'] = Object.values(rollShippColdSize);
  1283. coldSendList.value['上'].forEach((ele) => (allWeight += ele.weight));
  1284. }
  1285. mainRemark.value = `合计:${allWeight.toFixed(3)} t`;
  1286. // 查看所有的定尺
  1287. mainSize.value = sizeInfo || [...new Set(allSizeArr)].join(',');
  1288. }
  1289. changeLoading(false);
  1290. } catch (error) {
  1291. changeLoading(false);
  1292. console.log(error);
  1293. }
  1294. };
  1295. const openJSModal = ref(false);
  1296. const xiShu = ref(0.2265);
  1297. const sizeNum = ref();
  1298. const weightNum = ref();
  1299. // 重量计算按钮
  1300. const weightCalc = computed(() => {
  1301. const w = Number(weightNum.value);
  1302. const x = Number(xiShu.value);
  1303. const s = Number(sizeNum.value);
  1304. if (isNumber(w) && isNumber(x) && isNumber(s)) {
  1305. const r = w * x * s;
  1306. return !isNaN(r) ? r.toFixed(6) : '';
  1307. }
  1308. return '';
  1309. });
  1310. // 修改合计
  1311. const handleTotalChange = throttle((e: any, record) => {
  1312. const val = Number(e.target.value);
  1313. if (!isNumber(val) || val < 0) {
  1314. createMessage.error('请输入大于0数字');
  1315. return;
  1316. }
  1317. const { orgData } = record;
  1318. const allCount = handleTotalSum(orgData);
  1319. if (Number(orgData.amount) != val && allCount != val) {
  1320. handleEdit({
  1321. ...orgData,
  1322. amount: val,
  1323. });
  1324. }
  1325. }, 800);
  1326. // 编辑
  1327. const handleEdit = async (record) => {
  1328. try {
  1329. changeLoading(true);
  1330. await editBilletRecord(record);
  1331. await getHeatList({
  1332. ccmNo: hostNumber.value,
  1333. queryType: fetchQueryType.value,
  1334. changeShiftId: fetchChangeShiftId.value,
  1335. });
  1336. changeLoading(false);
  1337. } catch (error) {
  1338. changeLoading(false);
  1339. console.log(error);
  1340. }
  1341. };
  1342. // 修改棒一定尺数量
  1343. const handleSizeChange = throttle((e: any, record, size) => {
  1344. if (!size) {
  1345. createMessage.error('请选择定尺');
  1346. return;
  1347. }
  1348. const val = Number(e.target.value);
  1349. if (!isNumber(val) || val < 0) {
  1350. createMessage.error('请输入大于或等于0的数字');
  1351. return;
  1352. }
  1353. const { orgData } = record;
  1354. const { rollClubOneDetails } = orgData;
  1355. let obj = {
  1356. lengthGroupCount: {},
  1357. directRollingTotalWeight: 0,
  1358. directRollingTotalCount: 0,
  1359. };
  1360. if (rollClubOneDetails) {
  1361. obj = JSON.parse(rollClubOneDetails);
  1362. }
  1363. const lengthGroupCount = obj.lengthGroupCount;
  1364. if (
  1365. lengthGroupCount &&
  1366. ((Object.hasOwn(lengthGroupCount, size) && (val === 0 || lengthGroupCount[size] !== val)) ||
  1367. (!Object.hasOwn(lengthGroupCount, size) && val > 0))
  1368. ) {
  1369. if (val <= 0) {
  1370. delete obj.lengthGroupCount[size];
  1371. } else {
  1372. obj.lengthGroupCount[size] = val;
  1373. }
  1374. const params = {
  1375. ...orgData,
  1376. rollClubOneDetails: JSON.stringify(obj),
  1377. };
  1378. const amount = handleTotalSum(params);
  1379. handleEdit({
  1380. ...params,
  1381. amount,
  1382. });
  1383. }
  1384. }, 800);
  1385. // 计算总数
  1386. const handleTotalSum = (record) => {
  1387. const { rollClubOneDetails, stackLength, hotChargeLength } = record;
  1388. let allCount = 0;
  1389. if (rollClubOneDetails) {
  1390. const sendObj = JSON.parse(rollClubOneDetails);
  1391. if (sendObj.lengthGroupCount) {
  1392. Object.keys(sendObj.lengthGroupCount).forEach((key) => {
  1393. allCount += sendObj.lengthGroupCount[key];
  1394. });
  1395. }
  1396. }
  1397. if (stackLength) {
  1398. const stackObj = JSON.parse(stackLength);
  1399. if (isArray(stackObj)) {
  1400. stackObj.forEach((item) => {
  1401. allCount += item.stackingCount;
  1402. });
  1403. }
  1404. }
  1405. if (hotChargeLength) {
  1406. const chargeObj = JSON.parse(hotChargeLength);
  1407. if (isArray(chargeObj)) {
  1408. chargeObj.forEach((item) => {
  1409. allCount += item.totalCount;
  1410. });
  1411. }
  1412. }
  1413. return allCount;
  1414. };
  1415. // 修改堆垛定尺数量
  1416. const handleStackChange = throttle((e: any, record, size, stackingId) => {
  1417. if (e.target.value.trim() === '') return;
  1418. if (!size) {
  1419. createMessage.error('请选择定尺');
  1420. return;
  1421. }
  1422. const val = Number(e.target.value);
  1423. if (!isNumber(val)) {
  1424. createMessage.error('请输入大于等于0的数字');
  1425. return;
  1426. }
  1427. const { orgData } = record;
  1428. const { stackLength } = orgData;
  1429. let obj: any[] = [];
  1430. if (stackLength) {
  1431. obj = JSON.parse(stackLength);
  1432. }
  1433. const lengthGroupCount = obj.findIndex((v) => v.stackingLength == size && v.stackingBhtcId == stackingId);
  1434. // 计算补的数量是不是4的倍数
  1435. let stackInfo: any = null;
  1436. // const buCount = lengthGroupCount > -1 ? val - obj[lengthGroupCount].stackingCount : val;
  1437. if (val && val > 0) {
  1438. // if (val % 4 !== 0) {
  1439. // createMessage.error('补数量必须是4的倍数');
  1440. // return;
  1441. // }
  1442. stackInfo = val + '-' + size + '-' + stackingId;
  1443. } else {
  1444. stackInfo = '0-' + size + '-' + stackingId;
  1445. }
  1446. if (lengthGroupCount === -1) {
  1447. obj.push({
  1448. stackingCount: val,
  1449. stackingLength: size,
  1450. stackingWeight: steelPlateFormula(size, val),
  1451. stackingBhtcId: stackingId,
  1452. });
  1453. } else {
  1454. if (obj[lengthGroupCount].stackingCount === val) return;
  1455. obj[lengthGroupCount].stackingCount = val;
  1456. obj[lengthGroupCount].stackingWeight = steelPlateFormula(size, val);
  1457. }
  1458. const params = {
  1459. ...orgData,
  1460. stackLength: JSON.stringify(obj.filter((v) => v.stackingCount > 0)),
  1461. stackInfo,
  1462. };
  1463. const amount = handleTotalSum(params);
  1464. handleEdit({
  1465. ...params,
  1466. amount,
  1467. });
  1468. }, 800);
  1469. // 编辑切换定尺
  1470. const switchSizehandler = async (val, oldSize) => {
  1471. try {
  1472. changeLoading(true);
  1473. const fetchArr: any[] = [];
  1474. dataSource.value.forEach((item) => {
  1475. if (item.heatNo && item.orgData) {
  1476. const { rollClubOneDetails } = item.orgData;
  1477. if (rollClubOneDetails) {
  1478. const obj = JSON.parse(rollClubOneDetails);
  1479. if (obj && obj.lengthGroupCount) {
  1480. const lengthGroupCount = obj.lengthGroupCount;
  1481. if (lengthGroupCount[oldSize]) {
  1482. obj.lengthGroupCount[val] = lengthGroupCount[oldSize] + (lengthGroupCount[val] ? lengthGroupCount[val] : 0);
  1483. delete obj.lengthGroupCount[oldSize];
  1484. // 请求push了
  1485. fetchArr.push(
  1486. editBilletRecord({
  1487. ...item.orgData,
  1488. rollClubOneDetails: JSON.stringify(obj),
  1489. })
  1490. );
  1491. }
  1492. }
  1493. }
  1494. }
  1495. });
  1496. if (fetchArr.length > 0) {
  1497. await Promise.all(fetchArr);
  1498. await getHeatList({
  1499. ccmNo: hostNumber.value,
  1500. queryType: fetchQueryType.value,
  1501. changeShiftId: fetchChangeShiftId.value,
  1502. });
  1503. changeLoading(false);
  1504. }
  1505. } catch (error) {
  1506. changeLoading(false);
  1507. console.log(error);
  1508. }
  1509. };
  1510. // 堆垛编辑定尺
  1511. const switchStackhandler = async (val, oldSize) => {
  1512. console.log(val, oldSize);
  1513. try {
  1514. changeLoading(true);
  1515. const fetchArr: any[] = [];
  1516. dataSource.value.forEach((item) => {
  1517. if (item.heatNo && item.orgData) {
  1518. const { stackLength } = item.orgData;
  1519. if (stackLength) {
  1520. let obj = stackLength ? JSON.parse(stackLength) : [];
  1521. const oldSizeIndex = obj.findIndex((k) => k.stackingLength === oldSize);
  1522. if (oldSizeIndex > -1) {
  1523. const newSizeIndex = obj.findIndex((k) => k.stackingLength === Number(val));
  1524. if (newSizeIndex > -1) {
  1525. obj[newSizeIndex].stackingCount += obj[oldSizeIndex].stackingCount;
  1526. obj = obj.filter((j) => j.stackingLength !== oldSize);
  1527. } else {
  1528. obj[oldSizeIndex].stackingLength = Number(val);
  1529. }
  1530. // 请求push了
  1531. fetchArr.push(
  1532. editBilletRecord({
  1533. ...item.orgData,
  1534. stackLength: JSON.stringify(obj),
  1535. })
  1536. );
  1537. }
  1538. }
  1539. }
  1540. });
  1541. if (fetchArr.length > 0) {
  1542. await Promise.all(fetchArr);
  1543. await getHeatList({
  1544. ccmNo: hostNumber.value,
  1545. queryType: fetchQueryType.value,
  1546. changeShiftId: fetchChangeShiftId.value,
  1547. });
  1548. changeLoading(false);
  1549. }
  1550. } catch (error) {
  1551. changeLoading(false);
  1552. console.log(error);
  1553. }
  1554. };
  1555. // 删除定尺
  1556. const deleteRollOneColumn = async (size) => {
  1557. try {
  1558. changeLoading(true);
  1559. const fetchArr: any[] = [];
  1560. dataSource.value.forEach((item) => {
  1561. if (item.heatNo && item.orgData) {
  1562. const { rollClubOneDetails } = item.orgData;
  1563. if (rollClubOneDetails) {
  1564. const obj = JSON.parse(rollClubOneDetails);
  1565. if (obj && obj.lengthGroupCount) {
  1566. const lengthGroupCount = obj.lengthGroupCount;
  1567. if (lengthGroupCount[size]) {
  1568. delete obj.lengthGroupCount[size];
  1569. // 请求push了
  1570. const params = {
  1571. ...item.orgData,
  1572. rollClubOneDetails: JSON.stringify(obj),
  1573. };
  1574. const amount = handleTotalSum(params);
  1575. fetchArr.push(
  1576. editBilletRecord({
  1577. ...params,
  1578. amount,
  1579. })
  1580. );
  1581. }
  1582. }
  1583. }
  1584. }
  1585. });
  1586. if (fetchArr.length > 0) {
  1587. await Promise.all(fetchArr);
  1588. await getHeatList({
  1589. ccmNo: hostNumber.value,
  1590. queryType: fetchQueryType.value,
  1591. changeShiftId: fetchChangeShiftId.value,
  1592. });
  1593. changeLoading(false);
  1594. }
  1595. } catch (error) {
  1596. changeLoading(false);
  1597. console.log(error);
  1598. }
  1599. };
  1600. // 删除堆垛定尺
  1601. const deleteStackColumn = async (size, stackingId) => {
  1602. try {
  1603. changeLoading(true);
  1604. const fetchArr: any[] = [];
  1605. dataSource.value.forEach((item) => {
  1606. if (item.heatNo && item.orgData) {
  1607. const { stackLength } = item.orgData;
  1608. if (stackLength) {
  1609. const obj = JSON.parse(stackLength);
  1610. const hasStackItem = obj.findIndex((n) => n.stackingLength == size && n.stackingBhtcId == stackingId);
  1611. if (hasStackItem > -1) {
  1612. const lengthGroupCount = obj.filter((m) => m.stackingLength != size || m.stackingBhtcId != stackingId);
  1613. // 请求push了
  1614. const params = {
  1615. ...item.orgData,
  1616. stackLength: JSON.stringify(lengthGroupCount),
  1617. stackInfo: '0-' + size + '-' + stackingId,
  1618. };
  1619. const amount = handleTotalSum(params);
  1620. fetchArr.push(
  1621. editBilletRecord({
  1622. ...params,
  1623. amount,
  1624. })
  1625. );
  1626. }
  1627. }
  1628. }
  1629. });
  1630. if (fetchArr.length > 0) {
  1631. await Promise.all(fetchArr);
  1632. await getHeatList({
  1633. ccmNo: hostNumber.value,
  1634. queryType: fetchQueryType.value,
  1635. changeShiftId: fetchChangeShiftId.value,
  1636. });
  1637. }
  1638. changeLoading(false);
  1639. } catch (error) {
  1640. changeLoading(false);
  1641. console.log(error);
  1642. }
  1643. };
  1644. // 编辑目的地定尺数量
  1645. const openSetSizeNumModal = ref(false);
  1646. const editSizeNumRecord = ref<any>({});
  1647. const confirmSetSizeNum = async () => {
  1648. try {
  1649. changeLoading(true);
  1650. const { hotChargeLengthArr } = editSizeNumRecord.value;
  1651. if (!hotChargeLengthArr.length) {
  1652. return;
  1653. }
  1654. const arr = hotChargeLengthArr
  1655. .filter((ele) => ele.totalCount)
  1656. .map((k) => {
  1657. return {
  1658. ...k,
  1659. totalWeight: steelPlateFormula(k.hotChargeLength, k.totalCount).toFixed(4),
  1660. };
  1661. });
  1662. editSizeNumRecord.value.hotChargeLength = arr.length ? JSON.stringify(arr) : null;
  1663. await editBilletRecord({
  1664. ...editSizeNumRecord.value,
  1665. });
  1666. openSetSizeNumModal.value = false;
  1667. await getHeatList({
  1668. ccmNo: hostNumber.value,
  1669. queryType: fetchQueryType.value,
  1670. changeShiftId: fetchChangeShiftId.value,
  1671. });
  1672. changeLoading(false);
  1673. } catch (e) {
  1674. changeLoading(false);
  1675. console.log(e);
  1676. }
  1677. };
  1678. // 确定修改定尺
  1679. const handleSizeBlur = throttle((e) => {
  1680. if (mainOrgSize.value.trim() === e.target.value.trim()) return;
  1681. handleEditShiftInfo({
  1682. id: fetchChangeShiftId.value,
  1683. sizeInfo: e.target.value,
  1684. });
  1685. }, 500);
  1686. // 修改备注
  1687. const handleRemarkBlur = throttle((e) => {
  1688. if (mainOrgRemark.value.trim() === e.target.value.trim()) return;
  1689. handleEditShiftInfo({
  1690. id: fetchChangeShiftId.value,
  1691. content: e.target.value,
  1692. });
  1693. }, 500);
  1694. // 确认上一个班次的原始数据
  1695. const handlerConfirmOrgData = async () => {
  1696. try {
  1697. changeLoading(true);
  1698. await handleEditShiftInfo({
  1699. id: fetchChangeShiftId.value,
  1700. confirmStatus: 2,
  1701. });
  1702. closeModal();
  1703. changeLoading(false);
  1704. } catch (e) {
  1705. console.log(e);
  1706. changeLoading(false);
  1707. }
  1708. };
  1709. // 编辑定尺和备注
  1710. const handleEditShiftInfo = async (params) => {
  1711. try {
  1712. changeLoading(true);
  1713. await editOriginalProductRecord(params);
  1714. await getHeatList({
  1715. ccmNo: hostNumber.value,
  1716. queryType: fetchQueryType.value,
  1717. changeShiftId: fetchChangeShiftId.value,
  1718. });
  1719. changeLoading(false);
  1720. } catch (e) {
  1721. console.log(e);
  1722. changeLoading(false);
  1723. }
  1724. };
  1725. // 添加炉次
  1726. const newHeatNo = ref('');
  1727. const nextHeatNo = ref(undefined);
  1728. const openNewHeatNo = ref(false);
  1729. const addHeatNo = () => {
  1730. newHeatNo.value = '';
  1731. openNewHeatNo.value = true;
  1732. };
  1733. const getAddHeatNo = computed(() => {
  1734. return dataSource.value
  1735. .filter((o) => o.heatNo)
  1736. .map((t) => {
  1737. return {
  1738. label: t.SerialNumber + ' - ' + t.heatNo,
  1739. value: t.heatNo,
  1740. };
  1741. });
  1742. });
  1743. const confirmAddHeatNo = async () => {
  1744. try {
  1745. if (!newHeatNo.value) {
  1746. createMessage.error('请输入炉次号');
  1747. return;
  1748. }
  1749. changeLoading(true);
  1750. await addBilletNo({
  1751. ccmNo: hostNumber.value,
  1752. heatNo: newHeatNo.value,
  1753. changeShiftId: fetchChangeShiftId.value,
  1754. nextHeatNo: nextHeatNo.value,
  1755. });
  1756. openNewHeatNo.value = false;
  1757. await getHeatList({
  1758. ccmNo: hostNumber.value,
  1759. queryType: fetchQueryType.value,
  1760. changeShiftId: fetchChangeShiftId.value,
  1761. });
  1762. changeLoading(false);
  1763. } catch (e) {
  1764. console.log(e);
  1765. changeLoading(false);
  1766. }
  1767. };
  1768. function onPrint() {
  1769. changeOkLoading(true);
  1770. printJS({
  1771. printable: '#printBilletSampleCard',
  1772. type: 'html',
  1773. });
  1774. setTimeout(() => {
  1775. changeOkLoading(false);
  1776. }, 1000);
  1777. }
  1778. </script>
  1779. <style scoped lang="less">
  1780. .ticket {
  1781. max-width: 1400px;
  1782. height: 100%;
  1783. display: flex;
  1784. flex-direction: column;
  1785. .ccmno-info {
  1786. font-family: 'Kingsoft_Cloud_Font';
  1787. }
  1788. .ccmno {
  1789. display: inline-block;
  1790. width: 60px;
  1791. border-bottom: 1px solid black;
  1792. text-align: center;
  1793. }
  1794. .size-items-title {
  1795. font-size: 12px;
  1796. line-height: 32px;
  1797. border-bottom: 1px solid #bfbfbf;
  1798. padding-left: 10px;
  1799. min-width: 100px;
  1800. }
  1801. .size-num-title {
  1802. font-size: 12px;
  1803. line-height: 32px;
  1804. padding-left: 10px;
  1805. }
  1806. .size-items-content {
  1807. height: 32px;
  1808. text-align: center;
  1809. line-height: 32px;
  1810. }
  1811. .size-items-remark {
  1812. width: 100%;
  1813. min-height: 90px;
  1814. flex-wrap: wrap;
  1815. font-family: 'Kingsoft_Cloud_Font';
  1816. align-content: flex-start;
  1817. .size-remark-item {
  1818. width: 50%;
  1819. height: 30px;
  1820. color: #000;
  1821. }
  1822. .size-remark-size {
  1823. display: inline-block;
  1824. width: 80px;
  1825. }
  1826. .size-remark-num {
  1827. display: inline-block;
  1828. width: 80px;
  1829. padding: 0 40px 0 0;
  1830. font-size: 12px;
  1831. }
  1832. }
  1833. .two-num-wrapper {
  1834. position: absolute;
  1835. left: 0;
  1836. top: 0;
  1837. width: 100%;
  1838. height: 100%;
  1839. z-index: 10;
  1840. display: flex;
  1841. flex-direction: column;
  1842. justify-content: center;
  1843. align-items: flex-end;
  1844. padding-right: 6px;
  1845. }
  1846. .s-txt {
  1847. font-family: 'Kingsoft_Cloud_Font';
  1848. }
  1849. .ant-table-wrapper {
  1850. flex: 1;
  1851. :deep(.ant-spin-nested-loading) {
  1852. min-height: 100%;
  1853. .ant-table {
  1854. border-top: 1px solid rgba(0, 0, 0, 0.6);
  1855. > .ant-table-container {
  1856. border-inline-start: 1px solid rgba(0, 0, 0, 0.6);
  1857. }
  1858. .ant-table-content > table > thead > tr > th,
  1859. .ant-table-tbody > tr > td,
  1860. .ant-table-summary > tr > td {
  1861. padding: 2px;
  1862. border-inline-end: 1px solid rgba(0, 0, 0, 0.6);
  1863. border-bottom: 1px solid rgba(0, 0, 0, 0.6) !important;
  1864. text-align: center;
  1865. position: relative;
  1866. }
  1867. .delete-heat {
  1868. position: absolute;
  1869. top: 0;
  1870. left: -10px;
  1871. color: #f50;
  1872. cursor: pointer;
  1873. }
  1874. .size-st-wrapper {
  1875. position: absolute;
  1876. top: 1px;
  1877. left: 1px;
  1878. right: 1px;
  1879. bottom: 1px;
  1880. font-weight: 600;
  1881. cursor: pointer;
  1882. overflow: hidden;
  1883. .line {
  1884. // content: '';
  1885. // position: absolute;
  1886. // top: 0;
  1887. // left: 0;
  1888. // width: 100%; /* 等于长方形宽度 */
  1889. // height: 100%; /* 等于长方形高度 */
  1890. // /* 创建斜线:线性渐变从左上到右下 */
  1891. // background: linear-gradient(
  1892. // to bottom right,
  1893. // transparent 0%,
  1894. // transparent calc(50% - 0.5px),
  1895. // /* 斜线上方透明 */ rgba(0, 0, 0, 0.6) calc(50% - 0.5px),
  1896. // /* 斜线颜色 */ rgba(0, 0, 0, 0.6) calc(50% + 0.5px),
  1897. // /* 斜线厚度 */ transparent calc(50% + 0.5px) /* 斜线下方透明 */
  1898. // );
  1899. position: absolute;
  1900. left: -5px;
  1901. top: 50%;
  1902. width: 110%;
  1903. border-bottom: 1px solid rgba(0, 0, 0, 0.6);
  1904. transform: rotate(165deg);
  1905. }
  1906. .size-st-item {
  1907. position: absolute;
  1908. top: -4px;
  1909. left: 2px;
  1910. color: #f50;
  1911. }
  1912. }
  1913. .size-st-num {
  1914. color: #108ee9;
  1915. cursor: pointer;
  1916. position: absolute;
  1917. right: 1px;
  1918. bottom: -4px;
  1919. }
  1920. // 自定义啊
  1921. .total-input {
  1922. width: 100%;
  1923. padding: 0;
  1924. text-align: center;
  1925. cursor: pointer;
  1926. }
  1927. .ant-select {
  1928. width: 100%;
  1929. .ant-select-selector {
  1930. padding: 0;
  1931. .ant-select-selection-item,
  1932. .ant-select-selection-placeholder {
  1933. padding-inline-end: 0;
  1934. }
  1935. }
  1936. .ant-select-arrow {
  1937. display: none;
  1938. }
  1939. }
  1940. .rollOneColumnWrapper {
  1941. position: relative;
  1942. width: 100%;
  1943. height: 100%;
  1944. .noprint {
  1945. position: absolute;
  1946. left: 0;
  1947. top: 0;
  1948. display: none;
  1949. color: #f50;
  1950. cursor: pointer;
  1951. }
  1952. &:hover {
  1953. .noprint {
  1954. display: block;
  1955. }
  1956. }
  1957. }
  1958. }
  1959. }
  1960. .summary-row-no-border {
  1961. td:first-child {
  1962. border-bottom: none !important;
  1963. }
  1964. .song-items {
  1965. width: 100%;
  1966. height: 100%;
  1967. align-items: flex-start;
  1968. justify-content: flex-start;
  1969. .title {
  1970. margin-right: 10px;
  1971. color: #f50;
  1972. }
  1973. }
  1974. }
  1975. .summary-cell-remark {
  1976. min-height: 70px;
  1977. }
  1978. }
  1979. }
  1980. </style>
  1981. <style lang="less">
  1982. @media print {
  1983. header,
  1984. footer,
  1985. .noprint {
  1986. display: none;
  1987. }
  1988. @page {
  1989. margin-top: 10px; /* 第一页的页眉距离顶部为0 */
  1990. margin-bottom: 0; /* 第一页的页脚距离底部为0 */
  1991. }
  1992. }
  1993. </style>