chafengbaogong.vue 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160
  1. <template>
  2. <div>
  3. <layout>
  4. <layout-content>
  5. <div class="gva-table-box">
  6. <h1 style="margin: 0%;margin-bottom: 10px;">车缝完工报工</h1>
  7. <el-row :gutter="10" style="align-items: center; margin-bottom: 20px;">
  8. <!-- 子订单编号输入框 -->
  9. <el-col :span="4" style="padding: 0px;margin: 0px;">
  10. <el-input v-model="add_searchInfo" placeholder="请扫描子订单编号"@keyup.enter="add_onSubmit" id="searchInput" style="width: 100%; height: 50px;"/>
  11. </el-col>
  12. <!-- 查询按钮 -->
  13. <el-col :span="1.5" style="padding: 0px;margin: 0px;">
  14. <el-button type="primary" icon="search" @click="add_onSubmit"style="height: 50px;width: 80px;">查询</el-button>
  15. </el-col>
  16. <el-col :span="1.5" style="padding: 0px;margin: 0px;">
  17. <el-text style="font-size: 30px;">机台号</el-text>
  18. </el-col>
  19. <!-- 机台号输入框 -->
  20. <el-col :span="2"><el-input v-model="add_formData['机台号']" readonly style="width: 100%; height: 40px;"/></el-col>
  21. <el-col :span="1.5" style="padding: 0px;margin: 0px;">
  22. <el-text style="font-size: 30px;">工序</el-text>
  23. </el-col>
  24. <!-- 工序输入框 -->
  25. <el-col :span="2"><el-input v-model="add_formData['工序']" readonly style="width: 100%; height: 40px;" /></el-col>
  26. <el-col :span="1.5" style="padding: 0px;margin: 0px;">
  27. <el-text style="font-size: 30px;">组别</el-text>
  28. </el-col>
  29. <!-- 组别输入框 -->
  30. <el-col :span="2"><el-input v-model="add_formData['组别']" readonly style="width: 100%; height: 40px;" /></el-col>
  31. <el-col :span="1.5" style="padding: 0px;margin: 0px;">
  32. <el-text style="font-size: 30px;">人员</el-text>
  33. </el-col>
  34. <!-- 人员输入框 -->
  35. <el-col :span="2"><el-input v-model="add_formData['人员']" readonly style="width: 100%; height: 40px;"/></el-col>
  36. </el-row>
  37. <!-- 是否尾包 -->
  38. <el-row :gutter="10" style="align-items: center; margin-bottom: 20px;">
  39. <!-- 是否尾包文本 -->
  40. <el-col :span="2.5">
  41. <el-text style="font-size: 30px;">是否尾包</el-text>
  42. </el-col>
  43. <!-- 是否尾包按钮 -->
  44. <el-col :span="5">
  45. <el-button
  46. :type="activeButton === 'yes' ? 'info' : 'primary'"
  47. @click="setActiveButton('yes')"
  48. :style="activeButton === 'yes' ? activeButtonStyle : defaultButtonStyle"
  49. style="height: 45px; width: 60px; margin-right: 10px; font-size: 24px;"
  50. >
  51. </el-button>
  52. <el-button
  53. :type="activeButton === 'no' ? 'info' : 'primary'"
  54. @click="setActiveButton('no')"
  55. :style="activeButton === 'no' ? activeButtonStyle : defaultButtonStyle"
  56. style="height: 45px; width: 60px; margin-right: 10px; font-size: 24px;"
  57. >
  58. </el-button>
  59. </el-col>
  60. </el-row>
  61. <el-row :gutter="0">
  62. <el-col :span="2.5"><el-text style="font-size: 30px;margin-left: 50px;">尺 码</el-text></el-col>
  63. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="cmformdata.cm1" id="cm1" readonly style="width: 65px;height: 40px;" /></el-col>
  64. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="cmformdata.cm2" id="cm2" readonly style="width: 65px;height: 40px;" /></el-col>
  65. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="cmformdata.cm3" id="cm3" readonly style="width: 65px;height: 40px;" /></el-col>
  66. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="cmformdata.cm4" id="cm4" readonly style="width: 65px;height: 40px;" /></el-col>
  67. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="cmformdata.cm5" id="cm5" readonly style="width: 65px;height: 40px;" /></el-col>
  68. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="cmformdata.cm6" id="cm6" readonly style="width: 65px;height: 40px;" /></el-col>
  69. <el-col :span="1" style= "padding-right: 5px;margin-right: 11px;"><el-input v-model="cmformdata.cm7" id="cm7" readonly style="width: 65px;height: 40px;" /></el-col>
  70. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="cmformdata.cm8" id="cm8" readonly style="width: 65px;height: 40px;" /></el-col>
  71. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="cmformdata.cm9" id="cm9" readonly style="width: 65px;height: 40px;" /></el-col>
  72. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="cmformdata.cm10" id="cm10" readonly style="width: 65px;height: 40px;" /></el-col>
  73. <el-col :span="1"><el-input v-model="cmformdata.cm11" id="cm11" readonly style="width: 65px;height: 40px;" /></el-col>
  74. </el-row>
  75. <el-row :gutter="0">
  76. <el-col :span="2.5"><el-text style="font-size: 30px;margin-left: 30px;">制单数</el-text></el-col>
  77. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="zdslformdata.cmsl1" id="zdsc1" readonly style="width: 65px;height: 40px;" /></el-col>
  78. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="zdslformdata.cmsl2" id="zdsc2" readonly style="width: 65px;height: 40px;" /></el-col>
  79. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="zdslformdata.cmsl3" id="zdsc3" readonly style="width: 65px;height: 40px;" /></el-col>
  80. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="zdslformdata.cmsl4" id="zdsc4" readonly style="width: 65px;height: 40px;" /></el-col>
  81. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="zdslformdata.cmsl5" id="zdsc5" readonly style="width: 65px;height: 40px;" /></el-col>
  82. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="zdslformdata.cmsl6" id="zdsc6" readonly style="width: 65px;height: 40px;" /></el-col>
  83. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="zdslformdata.cmsl7" id="zdsc7" readonly style="width: 65px;height: 40px;" /></el-col>
  84. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="zdslformdata.cmsl8" id="zdsc8" readonly style="width: 65px;height: 40px;" /></el-col>
  85. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="zdslformdata.cmsl9" id="zdsc9" readonly style="width: 65px;height: 40px;" /></el-col>
  86. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="zdslformdata.cmsl10" id="zdsc10" readonly style="width: 65px;height: 40px;" /></el-col>
  87. <el-col :span="1"><el-input v-model="zdslformdata.zdtotal" id="zdtotal" readonly style="width: 65px;height: 40px;" /></el-col>
  88. </el-row>
  89. <el-row :gutter="0">
  90. <el-col :span="2.5"><el-text style="font-size: 30px;margin-left: 30px;">实裁数</el-text></el-col>
  91. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="scslformdata.scsl1" id="scsl1" readonly style="width: 65px;height: 40px;" /></el-col>
  92. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="scslformdata.scsl2" id="scsl2" readonly style="width: 65px;height: 40px;" /></el-col>
  93. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="scslformdata.scsl3" id="scsl3" readonly style="width: 65px;height: 40px;" /></el-col>
  94. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="scslformdata.scsl4" id="scsl4" readonly style="width: 65px;height: 40px;" /></el-col>
  95. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="scslformdata.scsl5" id="scsl5" readonly style="width: 65px;height: 40px;" /></el-col>
  96. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="scslformdata.scsl6" id="scsl6" readonly style="width: 65px;height: 40px;" /></el-col>
  97. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="scslformdata.scsl7" id="scsl7" readonly style="width: 65px;height: 40px;" /></el-col>
  98. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="scslformdata.scsl8" id="scsl8" readonly style="width: 65px;height: 40px;" /></el-col>
  99. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="scslformdata.scsl9" id="scsl9" readonly style="width: 65px;height: 40px;" /></el-col>
  100. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="scslformdata.scsl10" id="scsl10" readonly style="width: 65px;height: 40px;" /></el-col>
  101. <el-col :span="1"><el-input v-model="scslformdata.sctotal" id="cm11" readonly style="width: 65px;height: 40px;" /></el-col>
  102. </el-row>
  103. <el-row :gutter="0">
  104. <el-col :span="2.5"><el-text style="font-size: 30px;">上报数量</el-text></el-col>
  105. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="slformdata.sl1" id="sl1" :readonly="!zdslformdata.cmsl1" @input="updateTotal" style="width: 65px;height: 40px;" /></el-col>
  106. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="slformdata.sl2" id="sl2" :readonly="!zdslformdata.cmsl2" @input="updateTotal" style="width: 65px;height: 40px;" /></el-col>
  107. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="slformdata.sl3" id="sl3" :readonly="!zdslformdata.cmsl3" @input="updateTotal" style="width: 65px;height: 40px;" /></el-col>
  108. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="slformdata.sl4" id="sl4" :readonly="!zdslformdata.cmsl4" @input="updateTotal" style="width: 65px;height: 40px;" /></el-col>
  109. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="slformdata.sl5" id="sl5" :readonly="!zdslformdata.cmsl5" @input="updateTotal" style="width: 65px;height: 40px;" /></el-col>
  110. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="slformdata.sl6" id="sl6" :readonly="!zdslformdata.cmsl6" @input="updateTotal" style="width: 65px;height: 40px;" /></el-col>
  111. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="slformdata.sl7" id="sl7" :readonly="!zdslformdata.cmsl7" @input="updateTotal" style="width: 65px;height: 40px;" /></el-col>
  112. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="slformdata.sl8" id="sl8" :readonly="!zdslformdata.cmsl8" @input="updateTotal" style="width: 65px;height: 40px;" /></el-col>
  113. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="slformdata.sl9" id="sl9" :readonly="!zdslformdata.cmsl9" @input="updateTotal" style="width: 65px;height: 40px;" /></el-col>
  114. <el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="slformdata.sl10" id="sl10" :readonly="!zdslformdata.cmsl10" @input="updateTotal" style="width: 65px;height: 40px;" /></el-col>
  115. <el-col :span="2"><el-input v-model="slformdata.sctotal" id="cm11" readonly style="width: 65px;height: 40px;" /></el-col>
  116. <el-button type="primary" @click="add_Dialog"
  117. style="width: 100px;height: 60px;font-size: 20px;margin: 0px 0 0 0px">确认上报</el-button>
  118. <el-button type="primary" @click="add_printxp"
  119. style="width: 100px;height: 60px;font-size: 20px;margin: 0px 0 0 15px">打印预览</el-button>
  120. </el-row>
  121. <!-- 表格数据 -->
  122. <el-tabs v-model="activeName">
  123. <el-tab-pane label="报工历史记录" @click="showTable('报工历史记录')" name="first">
  124. <el-table ref="multipleTable" style="width: 100%;height: 52vh" tooltip-effect="dark"
  125. :row-style="{ height: '50px' }" :header-cell-style="{ padding: '5px', fontSize: '20px' }"
  126. :cell-style="{ padding: '10px', fontSize: '20px' }" :header-row-style="{ height: '20px' }"
  127. :data="add_tableData" border row-key="ID"
  128. size="small"
  129. highlight-current-row="true" @row-dblclick="updateCompanyFunc"
  130. @row-click="tableRowClick" :show-overflow-tooltip="true"
  131. @selection-change="handleSelectionChange">
  132. <!-- <el-table-column type="selection" width="50" /> -->
  133. <el-table-column v-slot="scope" align="left" label="操作" width="150">
  134. <el-button type="primary" @click="add_bdprintxp(scope.row)"
  135. style="width: 110px; height: 40px; font-size: 20px;">补打小票</el-button>
  136. </el-table-column>
  137. <el-table-column v-slot="scope" align="left" label="报工时间" width="150">
  138. <div style="margin-left: -9px">{{ scope.row.sys_rq }}</div>
  139. </el-table-column>
  140. <el-table-column v-slot="scope" align="left" label="子订单编号" width="110">
  141. <div style="margin-left: -9px">{{ scope.row.子订单编号 }}</div>
  142. </el-table-column>
  143. <el-table-column v-slot="scope" align="left" label="组别" width="80">
  144. <div style="margin-left: -9px">{{ scope.row.组别 }}</div>
  145. </el-table-column>
  146. <el-table-column v-for="item in sizeDatas" :key="item" align="center" :label="item"
  147. :prop="item" width="100" :cell-style="cellStyle">
  148. <template v-slot="scope">
  149. <div :class="{ 'highlight-cell': isCellHighlighted(scope.$index, item) }"
  150. style="margin-left: -5px;width: 80px;"
  151. @click="handleSizeClick(scope.$index, item, scope.row)">
  152. {{ scope.row[item] }}
  153. </div>
  154. </template>
  155. </el-table-column>
  156. <el-table-column v-slot="scope" align="left" label="数量" width="70">
  157. <div style="margin-left: -9px">{{ scope.row.数量 }}</div>
  158. </el-table-column>
  159. <el-table-column v-slot="scope" align="left" label="流水号" width="150">
  160. <div>{{ scope.row.serial }}</div>
  161. </el-table-column>
  162. </el-table>
  163. </el-tab-pane>
  164. <el-tab-pane label="技术附件" @click="showTable('技术附件')" name="fourth">
  165. <el-table ref="multipleTable"
  166. :row-style="{ height: '20px' }"
  167. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  168. :header-cell-style="{ padding: '0px' }"
  169. :show-overflow-tooltip="true"
  170. :cell-class-name="planUsageCellClass"
  171. highlight-current-row="true"
  172. @row-dblclick="ExcelShow"
  173. style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="jstableData" row-key="ID" @selection-change="handleSelectionChange">
  174. <!-- <el-table-column type="selection" width="55" /> -->
  175. <el-table-column align="left" label="备注" prop="附件备注" width="120"/>
  176. <el-table-column align="left" label="文件类型" prop="附件类型" width="120"/>
  177. <el-table-column align="left" label="关联产品" prop="关联编号" width="120"/>
  178. <el-table-column align="left" label="建档用户" prop="sys_id" width="120"/>
  179. <el-table-column align="left" label="建档时间" prop="sys_rq" width="160"/>
  180. <el-table-column align="left" label="更新时间" prop="mod_rq" width="120"/>
  181. </el-table>
  182. </el-tab-pane>
  183. </el-tabs>
  184. </div>
  185. <!-- 是否订单尾包确认弹窗 -->
  186. <el-dialog v-model="DialogVisible" title="是否订单尾包" destroy-on-close width="30%" style="top: 20%;">
  187. <h3>请再次确认是否该订单产品已全部报工,该批为订单尾包?</h3>
  188. <div class="dialog-footer" style="text-align: right;">
  189. <el-button @click="confirmDialogVisible">取消</el-button>
  190. <el-button type="primary" @click="handleConfirm">确认</el-button>
  191. </div>
  192. </el-dialog>
  193. <!-- 技术附件预览弹窗 -->
  194. <el-dialog v-model="luckyexcelVisible" :before-close="luckyexcelCloseDialog" width="100%" top="0vh">
  195. <div id="luckyexcel" style="width: 100%;height: 100vh;"></div>
  196. </el-dialog>
  197. </layout-content>
  198. </layout>
  199. </div>
  200. </template>
  201. <script>
  202. export default {
  203. data() {
  204. return {
  205. currentTable: '', // 当前展示的表格
  206. activeName: 'first',
  207. };
  208. },
  209. methods: {
  210. handleKeyDown(event, prevId, currentId, nextId) {
  211. const currentElement = document.getElementById(currentId);
  212. const isEmpty = currentElement.value === '';
  213. const atStart = currentElement.selectionStart === 0;
  214. const atEnd = currentElement.selectionStart === currentElement.value.length;
  215. switch (event.keyCode) {
  216. case 13: // Enter
  217. case 40: // 向下箭头
  218. if (nextId) {
  219. document.getElementById(nextId).focus();
  220. }
  221. break;
  222. case 38: // 向上箭头
  223. if (prevId) {
  224. document.getElementById(prevId).focus();
  225. }
  226. break;
  227. case 8: // 删除键
  228. if (prevId && (isEmpty || atStart)) {
  229. document.getElementById(prevId).focus();
  230. }
  231. break;
  232. case 37: // 向左箭头
  233. if (prevId && atStart) {
  234. document.getElementById(prevId).focus();
  235. }
  236. break;
  237. case 39: // 向右箭头
  238. if (nextId && atEnd) {
  239. document.getElementById(nextId).focus();
  240. }
  241. break;
  242. default:
  243. break;
  244. }
  245. },
  246. },
  247. };
  248. </script>
  249. <script setup>
  250. // 全量引入格式化工具 请按需保留
  251. import $script from 'scriptjs'
  252. import $ from 'jquery';
  253. import LuckyExcel from 'luckyexcel';
  254. import {
  255. Layout,
  256. LayoutSider,
  257. LayoutContent
  258. } from '@arco-design/web-vue';
  259. import {
  260. hiprint
  261. } from "vue-plugin-hiprint";
  262. import {
  263. ref,
  264. reactive,
  265. nextTick,
  266. watch,
  267. setBlockTracking
  268. } from 'vue'
  269. import {
  270. getSpotList,
  271. search,
  272. getTab,
  273. OrderAttachments
  274. } from '@/api/mes/job'
  275. import {
  276. getMachineMac
  277. } from '@/api/jixiaoguanli/jitairibaobiao'
  278. import {
  279. getMac
  280. } from '@/api/jixiaoguanli/baogong'
  281. import {
  282. ElMessage
  283. } from "element-plus";
  284. import {
  285. get
  286. } from 'scriptjs';
  287. defineOptions({
  288. name: 'Company'
  289. })
  290. // =========== 全局获取当前日期 ===========
  291. // currentDate 年月日 时分秒
  292. // currentDates 年月日
  293. const today = new Date();
  294. const year = today.getFullYear();
  295. const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,需要补零
  296. const day = String(today.getDate()).padStart(2, '0');
  297. const hours = String(today.getHours()).padStart(2, '0');
  298. const minutes = String(today.getMinutes()).padStart(2, '0');
  299. const seconds = String(today.getSeconds()).padStart(2, '0');
  300. const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  301. const currentDates = `${year}-${month}-${day}`;
  302. //全局获取code,接口接收code
  303. const _code = '车缝'
  304. //全局接口接受的物理地址
  305. const Machine = ref('')
  306. //全局获取UniqId
  307. const UniqId = ref('')
  308. //物理地址获取机台编号
  309. const getMachineMacdata = async () => {
  310. console.log("车缝机台获取物理地址", Machine.value)
  311. try {
  312. const data = await getMachineMac({
  313. sys_sbID: Machine.value
  314. });
  315. console.log('车缝机台数据')
  316. console.log(data)
  317. if (data.data === null) {
  318. ElMessage({
  319. type: 'error',
  320. message: '未获取到机台编号请确认MAC地址或与管理员联系'
  321. })
  322. } else {
  323. add_formData['机台号'] = data.data['机台号']
  324. add_formData['工序'] = data.data['生产工序']
  325. add_formData['组别'] = data.data['组别']
  326. add_formData['人员'] = data.data['组长']
  327. setTimeout(() => {
  328. const inputElement = document.getElementById('searchInput');
  329. if (inputElement) {
  330. inputElement.focus();
  331. }
  332. }, 100); // 延迟100毫秒
  333. }
  334. } catch (error) {
  335. console.error(error)
  336. }
  337. }
  338. //自动获取物理地址
  339. const GetAddr = () => {
  340. var xmlhttp = null;
  341. var res;
  342. if (window.XMLHttpRequest) {
  343. xmlhttp = new XMLHttpRequest();
  344. } else if (window.ActiveXObject) {
  345. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  346. }
  347. // 2. 设置回调函数
  348. xmlhttp.onreadystatechange = function() {
  349. if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
  350. res = eval('(' + xmlhttp.response + ')');
  351. let result = ''
  352. for (let i = 0; i < res.macAddress.length; i++) {
  353. if (i % 2 === 0 && i !== 0) {
  354. result += '-' // 根据实际需求修改分隔符
  355. }
  356. result += res.macAddress[i]
  357. }
  358. Machine.value = result
  359. getMachineMacdata(Machine.value)
  360. }
  361. }
  362. // 3. 打开一个连接
  363. xmlhttp.open("get", "http://127.0.0.1:8090/init")
  364. // 5. 发送
  365. xmlhttp.send();
  366. }
  367. // getMachineMacdata();
  368. GetAddr()
  369. // 尺码
  370. const cmformdata = reactive({
  371. cm1: '',
  372. cm2: '',
  373. cm3: '',
  374. cm4: '',
  375. cm5: '',
  376. cm6: '',
  377. cm7: '',
  378. cm8: '',
  379. cm9: '',
  380. cm10: '',
  381. cm11: '合计',
  382. });
  383. // 制单数
  384. const zdslformdata = reactive({
  385. cmsl1: '',
  386. cmsl2: '',
  387. cmsl3: '',
  388. cmsl4: '',
  389. cmsl5: '',
  390. cmsl6: '',
  391. cmsl7: '',
  392. cmsl8: '',
  393. cmsl9: '',
  394. cmsl10: '',
  395. zdtotal: '',
  396. });
  397. // 实裁量
  398. const scslformdata = reactive({
  399. scsl1: '',
  400. scsl2: '',
  401. scsl3: '',
  402. scsl4: '',
  403. scsl5: '',
  404. scsl6: '',
  405. scsl7: '',
  406. scsl8: '',
  407. scsl9: '',
  408. scsl10: '',
  409. sctotal: '',
  410. });
  411. // 数量
  412. const slformdata = reactive({
  413. sl1: '',
  414. sl2: '',
  415. sl3: '',
  416. sl4: '',
  417. sl5: '',
  418. sl6: '',
  419. sl7: '',
  420. sl8: '',
  421. sl9: '',
  422. sl10: '',
  423. sctotal: '',
  424. });
  425. //实裁相加
  426. function updateTotal() {
  427. // 直接指定要累加的属性名
  428. const relevantKeys = ['sl1', 'sl2', 'sl3', 'sl4', 'sl5', 'sl6', 'sl7', 'sl8', 'sl9', 'sl10'];
  429. const values = relevantKeys.map(key => parseInt(slformdata[key], 10) ||
  430. 0); // 使用 || 0 来处理可能的 NaN 或 undefined/null
  431. slformdata.sctotal = values.reduce((sum, value) => sum + value, 0);
  432. }
  433. //历史记录表格
  434. const add_tableData = reactive([]);
  435. //全局获取颜色款式款号
  436. const _yskskh = ref('')
  437. //全局获取新增流水号
  438. const _serial = ref('')
  439. //全局获取序号
  440. const _serial_num = ref('')
  441. //流水号补零
  442. function padNumber(num, length) {
  443. let str = '' + num;
  444. while (str.length < length) {
  445. str = '0' + str;
  446. }
  447. return str;
  448. }
  449. // 代表扫描两次自动保存
  450. const searcs = ref('')
  451. //尺寸列表
  452. const sizeDatas = reactive([])
  453. //搜索
  454. const add_searchInfo = ref('')
  455. //技术附件
  456. const jstableData = reactive([])
  457. //查询
  458. const add_onSubmit = async () => {
  459. if(add_formData['机台号'] === ''){
  460. ElMessage({type: 'warning',message: '未获取到机台'})
  461. return false;
  462. }
  463. sizeDatas.length = 0;
  464. add_tableData.length = 0;
  465. if (!add_searchInfo.value.startsWith('DC')) {
  466. // 如果没有以"DC"开头,则添加前缀
  467. add_searchInfo.value = 'DC' + add_searchInfo.value;
  468. }
  469. if (add_searchInfo.value === '' || add_searchInfo.value === undefined) {
  470. const WorkListdata = [];
  471. add_tableData.splice(0, add_tableData.length, ...WorkListdata);
  472. ElMessage({
  473. type: 'warning',
  474. message: '请扫描小票二维码'
  475. })
  476. } else {
  477. //获取下面报工历史记录
  478. const getSpotLists = await getSpotList({
  479. order: add_searchInfo.value,
  480. code: _code,
  481. sys_sbID: add_formData['机台号']
  482. });
  483. console.log(getSpotLists)
  484. if (!add_searchInfo.value.includes('-') && getSpotLists.data.records.length === 0) {
  485. ElMessage({
  486. type: 'warning',
  487. message: '未查询到报工历史数据'
  488. })
  489. return false;
  490. }
  491. //订单编号 获取 技术附件数据Excel
  492. const searchValue = add_searchInfo.value.split('-')[0];
  493. const jsOrderAttachments = await OrderAttachments({order:searchValue,desc:'技术附件'})
  494. console.log(jsOrderAttachments)
  495. jstableData.splice(0,jsOrderAttachments.data.length,...jsOrderAttachments.data);
  496. _yskskh.value = getSpotLists.data.list[0] //颜色、款式、款号
  497. _serial.value = getSpotLists.data.serial //流水号
  498. _serial_num.value = getSpotLists.data.serial_num //序号
  499. let number = parseInt(getSpotLists.data.serial_num, 10);
  500. _serial_num.value = number + 1,
  501. console.log(_serial_num.value)
  502. //获取尺码、制单数/实裁量上面信息
  503. const keys1 = ['cm1', 'cm2', 'cm3', 'cm4', 'cm5', 'cm6', 'cm7', 'cm8', 'cm9', 'cm10', ];
  504. const keys2 = ['cmsl1', 'cmsl2', 'cmsl3', 'cmsl4', 'cmsl5', 'cmsl6', 'cmsl7', 'cmsl8', 'cmsl9',
  505. 'cmsl10', 'zdtotal',
  506. ];
  507. const keys3 = ['scsl1', 'scsl2', 'scsl3', 'scsl4', 'scsl5', 'scsl6', 'scsl7', 'scsl8', 'scsl9',
  508. 'scsl10', 'sctotal',
  509. ];
  510. //如果搜索是子订单编号
  511. if (add_searchInfo.value.includes('-')) {
  512. for (let key of keys1) {
  513. if (getSpotLists.data.list[0].hasOwnProperty(key)) { // 确保键存在于对象中
  514. cmformdata[key] = getSpotLists.data.list[0][key];
  515. }
  516. }
  517. for (let key of keys2) {
  518. if (getSpotLists.data.list[0].hasOwnProperty(key)) { // 确保键存在于对象中
  519. zdslformdata[key] = getSpotLists.data.list[0][key];
  520. }
  521. }
  522. for (let key of keys3) {
  523. if (getSpotLists.data.list[0].hasOwnProperty(key)) { // 确保键存在于对象中
  524. scslformdata[key] = getSpotLists.data.list[0][key];
  525. }
  526. }
  527. setTimeout(() => {
  528. const inputElement = document.getElementById('sl1');
  529. if (inputElement) {
  530. inputElement.focus();
  531. }
  532. }, 100); // 延迟100毫秒
  533. } else {
  534. for (let key of keys1) {
  535. cmformdata[key] = '';
  536. }
  537. for (let key of keys2) {
  538. zdslformdata[key] = '';
  539. }
  540. }
  541. //历史记录
  542. if (getSpotLists.data.headers) {
  543. sizeDatas.splice(0, getSpotLists.data.headers.length, ...getSpotLists.data.headers); //型号数据
  544. add_tableData.splice(0, add_tableData.length, ...getSpotLists.data.records); //表格数据
  545. }
  546. }
  547. }
  548. //技术资料excel展示
  549. const ExcelShow = (row) =>{
  550. console.log("技术资料excel展示")
  551. console.log(row)
  552. if(!row.附件内容) return
  553. $.getScript('/luckysheet/plugins/js/plugin.js', () => {
  554. $script('/luckysheet/luckysheet.umd.js', () => {
  555. function dataURLtoBlob(dataUrl) {
  556. const byteString = atob(dataUrl.split(',')[1]);
  557. const ab = new ArrayBuffer(byteString.length);
  558. const ia = new Uint8Array(ab);
  559. for (let i = 0; i < byteString.length; i++) {
  560. ia[i] = byteString.charCodeAt(i);
  561. }
  562. return new Blob([ab], { type: 'application/octet-stream' });
  563. }
  564. const blob = dataURLtoBlob(row.附件内容);
  565. luckyexcelVisible.value = true
  566. LuckyExcel.transformExcelToLucky(blob, function(exportJson, luckysheetfile){
  567. if(exportJson.sheets==null || exportJson.sheets.length==0){
  568. alert("Failed to read the content of the excel file, currently does not support xls files!");
  569. return;
  570. }
  571. if(luckyExcel) luckyExcel.destroy();
  572. luckysheet.create({
  573. container: 'luckyexcel', //容器的ID
  574. data: exportJson.sheets,
  575. title: exportJson.info.name, // 工作簿名称
  576. lang: "zh", // 设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en")
  577. showtoolbar: false, // 是否显示工具栏
  578. showinfobar: false, // 是否显示顶部信息栏
  579. allowEdit: false, // 是否允许前台编辑
  580. enableAddRow: false, // 允许增加行
  581. enableAddCol: false, // 允许增加列
  582. userInfo: false, // 右上角的用户信息展示样式
  583. showRowBar: false, // 是否显示行号区域
  584. showColumnBar: false, // 是否显示列号区域
  585. sheetFormulaBar: false, // 是否显示公式栏
  586. enableAddBackTop: false,//返回头部按钮
  587. });
  588. luckyExcel = luckysheet;
  589. })
  590. })
  591. })
  592. $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/css/pluginsCss.css'));
  593. $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/plugins.css'));
  594. $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/css/luckysheet.css'));
  595. $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/assets/iconfont/iconfont.css'));
  596. }
  597. let luckyExcel = null
  598. const luckyexcelVisible = ref(false)
  599. const luckyexcelCloseDialog = () => {
  600. luckyexcelVisible.value = false
  601. }
  602. const AttendanceVisible = ref(false)
  603. //清空对象的属性值
  604. const gd_clearFormData = () => {
  605. Object.keys(add_formData).forEach(key => {
  606. add_formData[key] = '';
  607. });
  608. };
  609. const add_formData = reactive({
  610. 机台号: '',
  611. 工序: '',
  612. 组别: '',
  613. 人员: '',
  614. 尺码: '',
  615. 数量: '',
  616. 是否订单尾包: '0',
  617. });
  618. const currentSlValue = ref('')
  619. //车缝确认上报
  620. const add_Dialog = async () => {
  621. sizeDatas.length = 0;
  622. add_tableData.length = 0;
  623. console.log(_serial.value)
  624. if (_serial.value === NaN) {
  625. ElMessage({
  626. type: 'warning',
  627. message: '网络异常.请检查'
  628. })
  629. return fasle;
  630. }
  631. if (add_searchInfo.value === '') {
  632. ElMessage({
  633. type: 'warning',
  634. message: '请扫描子订单编号输入数量后,再进行上报'
  635. })
  636. return fasle;
  637. }
  638. //尺码
  639. let cmArray = [cmformdata.cm1, cmformdata.cm2, cmformdata.cm3, cmformdata.cm4, cmformdata.cm5, cmformdata
  640. .cm6, cmformdata.cm7, cmformdata.cm8, cmformdata.cm9, cmformdata.cm10
  641. ];
  642. //制单
  643. let zdsl1Array = [zdslformdata.zdsl1, zdslformdata.zdsl12, zdslformdata.zdsl13, zdslformdata.zdsl14,
  644. zdslformdata.zdsl15, zdslformdata.zdsl16, zdslformdata.zdsl17, zdslformdata.zdsl18, zdslformdata
  645. .zdsl19, zdslformdata.zdsl110
  646. ];
  647. let slArray = [slformdata.sl1, slformdata.sl2, slformdata.sl3, slformdata.sl4, slformdata.sl5, slformdata
  648. .sl6, slformdata.sl7, slformdata.sl8, slformdata.sl9, slformdata.sl10
  649. ];
  650. let resultArrays = [];
  651. for (let i = 0; i < slArray.length; i++) {
  652. // 创建一个新数组来存储当前索引下的所有值
  653. let currentValues = [add_formData['机台号'], cmArray[i], zdsl1Array[i], slArray[i]];
  654. // 添加到结果数组中
  655. resultArrays.push(currentValues);
  656. }
  657. let paramsList = []; // 用于存储每个元素的 cm 和 sl
  658. let serialNumber = parseInt(_serial.value, 10);
  659. for (let i = 0; i < resultArrays.length; i++) {
  660. if (slArray[i]) {
  661. let params = {};
  662. params.order_id = add_searchInfo.value;
  663. params.sczl_jtbh = add_formData['机台号'];
  664. params.gxmc = add_formData['工序'];
  665. params.sys_id = add_formData['人员'];
  666. params.wb = add_formData['是否订单尾包'];
  667. params.cm = resultArrays[i][1];
  668. params.sl = resultArrays[i][3];
  669. params.sys_rq = currentDates;
  670. params.code = '车缝';
  671. serialNumber++;
  672. params.serial = padNumber(serialNumber, 3);
  673. params.sczl_bh = add_formData['组别'];
  674. params.serial_num = _serial_num.value;
  675. paramsList.push(params);
  676. }
  677. }
  678. if (paramsList.length === 0) {
  679. ElMessage({
  680. type: 'info',
  681. message: '请填写报工尺码数量'
  682. });
  683. return;
  684. }
  685. console.log(paramsList)
  686. let allSuccess = true;
  687. for (let i = 0; i < paramsList.length; i++) {
  688. const cf_gettab = await search(paramsList[i]);
  689. if (cf_gettab.code !== 0) {
  690. // ElMessage({ type: 'error', message: '报工失败' });
  691. allSuccess = false;
  692. break; // 如果某个报工失败,则中断循环
  693. }
  694. }
  695. if (allSuccess) {
  696. const lsjltable = await getTab({
  697. order_id: add_searchInfo.value,
  698. sczl_jtbh: add_formData['机台号']
  699. });
  700. const getSpotLists = await getSpotList({
  701. order: add_searchInfo.value,
  702. code: _code,
  703. sys_sbID: add_formData['机台号']
  704. });
  705. sizeDatas.splice(0, getSpotLists.data.headers.length, ...getSpotLists.data.headers); //型号数据
  706. add_tableData.splice(0, add_tableData.length, ...getSpotLists.data.records); //表格数据
  707. add_printxp();
  708. searcs.value = '';
  709. add_searchInfo.value = '';
  710. ElMessage({
  711. type: 'success',
  712. message: '报工成功'
  713. });
  714. // 上报成功后 清空所有输入框上报数量
  715. if (slformdata) {
  716. for (let i = 1; i <= 10; i++) {
  717. slformdata['sl' + i] = '';
  718. }
  719. // 清空总和
  720. slformdata.sctotal = '';
  721. } else {
  722. console.error('未定义');
  723. }
  724. }
  725. }
  726. // 新增取消
  727. const add_closeDialog = () => {
  728. AttendanceVisible.value = false
  729. };
  730. //是否订单尾包选择是否按钮
  731. const activeButton = ref('no')
  732. const DialogVisible = ref(false)
  733. // 定义按钮的默认样式和激活样式
  734. const defaultButtonStyle = {
  735. backgroundColor: '#808080', //用于默认状态
  736. color: 'white',
  737. };
  738. const activeButtonStyle = {
  739. backgroundColor: 'red', //用于选中状态
  740. color: 'white',
  741. };
  742. //1 = 是 0 = 否
  743. const setActiveButton = (button) => {
  744. console.log("setActiveButton")
  745. activeButton.value = button;
  746. if (button === 'yes') {
  747. console.log("yes")
  748. add_formData['是否订单尾包'] = '1';
  749. DialogVisible.value = true;
  750. } else if (button === 'no') {
  751. console.log("no")
  752. add_formData['是否订单尾包'] = '0';
  753. DialogVisible.value = false;
  754. }
  755. };
  756. // 确定
  757. const handleConfirm = () => {
  758. add_formData['是否订单尾包'] = '1'
  759. activeButton.value = 'yes';
  760. DialogVisible.value = false
  761. };
  762. // 取消
  763. const confirmDialogVisible = () => {
  764. add_formData['是否订单尾包'] = '0'
  765. activeButton.value = 'no';
  766. DialogVisible.value = false
  767. };
  768. // =========== 新增打印小票 ===========
  769. const jsondata = {
  770. "panels": [{
  771. "index": 0,
  772. "name": 1,
  773. "height": 296.6,
  774. "width": 210,
  775. "paperHeader": 19.5,
  776. "paperFooter": 832.5,
  777. "printElements": [{
  778. "options": {
  779. "left": 226.5,
  780. "top": 25.5,
  781. "height": 61.5,
  782. "width": 349.5,
  783. "title": "这是更新后的元素",
  784. "right": 418.9921875,
  785. "bottom": 397.2421875,
  786. "vCenter": 313.2421875,
  787. "hCenter": 366.4921875,
  788. "field": "zddbh",
  789. "coordinateSync": false,
  790. "widthHeightSync": false,
  791. "hideTitle": true,
  792. "fontSize": 40,
  793. "textContentVerticalAlign": "middle",
  794. "qrCodeLevel": 0
  795. },
  796. "printElementType": {
  797. "title": "这是更新后的元素",
  798. "type": "text"
  799. }
  800. }, {
  801. "options": {
  802. "left": 0,
  803. "top": 25.5,
  804. "height": 60,
  805. "width": 220.5,
  806. "title": "子订单编号:",
  807. "coordinateSync": false,
  808. "widthHeightSync": false,
  809. "fontSize": 40,
  810. "textContentVerticalAlign": "middle",
  811. "qrCodeLevel": 0,
  812. "right": 187.74375915527344,
  813. "bottom": 392.25,
  814. "vCenter": 84.24375915527344,
  815. "hCenter": 360.75
  816. },
  817. "printElementType": {
  818. "title": "这是更新后的元素",
  819. "type": "text"
  820. }
  821. }, {
  822. "options": {
  823. "left": 100.5,
  824. "top": 325.5,
  825. "height": 60,
  826. "width": 478.5,
  827. "title": "这是更新后的元素",
  828. "right": 372.75,
  829. "bottom": 386.25,
  830. "vCenter": 241.5,
  831. "hCenter": 356.25,
  832. "field": "kh",
  833. "coordinateSync": false,
  834. "widthHeightSync": false,
  835. "hideTitle": true,
  836. "fontSize": 40,
  837. "textContentVerticalAlign": "middle",
  838. "qrCodeLevel": 0,
  839. "qid": "zddbh_1",
  840. "textContentWrap": "clip"
  841. },
  842. "printElementType": {
  843. "title": "这是更新后的元素",
  844. "type": "text"
  845. }
  846. }, {
  847. "options": {
  848. "left": 0,
  849. "top": 325.5,
  850. "height": 60,
  851. "width": 100,
  852. "title": "款号:",
  853. "coordinateSync": false,
  854. "widthHeightSync": false,
  855. "fontSize": 40,
  856. "textContentVerticalAlign": "middle",
  857. "qrCodeLevel": 0,
  858. "right": 97,
  859. "bottom": 361.5,
  860. "vCenter": 47,
  861. "hCenter": 331.5
  862. },
  863. "printElementType": {
  864. "title": "这是更新后的元素",
  865. "type": "text"
  866. }
  867. }, {
  868. "options": {
  869. "left": 421.5,
  870. "top": 93,
  871. "height": 159,
  872. "width": 159,
  873. "title": "二维码",
  874. "qrcodeType": "qrcode",
  875. "testData": "qrcode",
  876. "right": 577.5,
  877. "bottom": 251.25,
  878. "vCenter": 498,
  879. "hCenter": 171.75,
  880. "field": "emm",
  881. "qrCodeLevel": 0,
  882. "coordinateSync": false,
  883. "widthHeightSync": false,
  884. "hideTitle": true
  885. },
  886. "printElementType": {
  887. "title": "二维码",
  888. "type": "qrcode"
  889. }
  890. }, {
  891. "options": {
  892. "left": 100.5,
  893. "top": 85.5,
  894. "height": 60,
  895. "width": 262.5,
  896. "title": "这是更新后的元素",
  897. "right": 374.25,
  898. "bottom": 143.25,
  899. "vCenter": 243,
  900. "hCenter": 113.25,
  901. "field": "pm",
  902. "coordinateSync": false,
  903. "widthHeightSync": false,
  904. "hideTitle": true,
  905. "fontSize": 40,
  906. "textContentVerticalAlign": "middle",
  907. "qrCodeLevel": 0,
  908. "qid": "kh_1"
  909. },
  910. "printElementType": {
  911. "title": "这是更新后的元素",
  912. "type": "text"
  913. }
  914. }, {
  915. "options": {
  916. "left": 0,
  917. "top": 85.5,
  918. "height": 60,
  919. "width": 100,
  920. "title": "品名:",
  921. "coordinateSync": false,
  922. "widthHeightSync": false,
  923. "fontSize": 40,
  924. "textContentVerticalAlign": "middle",
  925. "qrCodeLevel": 0,
  926. "right": 68.5,
  927. "bottom": 263.25,
  928. "vCenter": 18.5,
  929. "hCenter": 233.25
  930. },
  931. "printElementType": {
  932. "title": "这是更新后的元素",
  933. "type": "text"
  934. }
  935. }, {
  936. "options": {
  937. "left": 100.5,
  938. "top": 145.5,
  939. "height": 60,
  940. "width": 261,
  941. "title": "这是更新后的元素",
  942. "right": 324,
  943. "bottom": 205.5,
  944. "vCenter": 218.25,
  945. "hCenter": 175.5,
  946. "field": "ys",
  947. "coordinateSync": false,
  948. "widthHeightSync": false,
  949. "hideTitle": true,
  950. "fontSize": 40,
  951. "textContentVerticalAlign": "middle",
  952. "qrCodeLevel": 0,
  953. "qid": "kh_2"
  954. },
  955. "printElementType": {
  956. "title": "这是更新后的元素",
  957. "type": "text"
  958. }
  959. }, {
  960. "options": {
  961. "left": 0,
  962. "top": 144,
  963. "height": 60,
  964. "width": 100,
  965. "title": "颜色:",
  966. "coordinateSync": false,
  967. "widthHeightSync": false,
  968. "fontSize": 40,
  969. "textContentVerticalAlign": "middle",
  970. "qrCodeLevel": 0,
  971. "right": 80.5,
  972. "bottom": 386.25,
  973. "vCenter": 30.5,
  974. "hCenter": 356.25
  975. },
  976. "printElementType": {
  977. "title": "这是更新后的元素",
  978. "type": "text"
  979. }
  980. }, {
  981. "options": {
  982. "left": 100.5,
  983. "top": 205.5,
  984. "height": 60,
  985. "width": 264,
  986. "title": "这是更新后的元素",
  987. "right": 324,
  988. "bottom": 264.75,
  989. "vCenter": 218.25,
  990. "hCenter": 234.75,
  991. "field": "cm",
  992. "coordinateSync": false,
  993. "widthHeightSync": false,
  994. "hideTitle": true,
  995. "fontSize": 40,
  996. "textContentVerticalAlign": "middle",
  997. "qrCodeLevel": 0,
  998. "qid": "kh_3"
  999. },
  1000. "printElementType": {
  1001. "title": "这是更新后的元素",
  1002. "type": "text"
  1003. }
  1004. }, {
  1005. "options": {
  1006. "left": 0,
  1007. "top": 204,
  1008. "height": 60,
  1009. "width": 100,
  1010. "title": "尺码",
  1011. "coordinateSync": false,
  1012. "widthHeightSync": false,
  1013. "fontSize": 40,
  1014. "textContentVerticalAlign": "middle",
  1015. "qrCodeLevel": 0,
  1016. "right": 100,
  1017. "bottom": 349.5,
  1018. "vCenter": 50,
  1019. "hCenter": 319.5
  1020. },
  1021. "printElementType": {
  1022. "title": "这是更新后的元素",
  1023. "type": "text"
  1024. }
  1025. }, {
  1026. "options": {
  1027. "left": 102,
  1028. "top": 385.5,
  1029. "height": 60,
  1030. "width": 246,
  1031. "title": "这是更新后的元素",
  1032. "right": 385.5,
  1033. "bottom": 388.5,
  1034. "vCenter": 247.5,
  1035. "hCenter": 357.75,
  1036. "field": "zb",
  1037. "coordinateSync": false,
  1038. "widthHeightSync": false,
  1039. "hideTitle": true,
  1040. "fontSize": 40,
  1041. "textContentVerticalAlign": "middle",
  1042. "qrCodeLevel": 0,
  1043. "qid": "kh_5"
  1044. },
  1045. "printElementType": {
  1046. "title": "这是更新后的元素",
  1047. "type": "text"
  1048. }
  1049. }, {
  1050. "options": {
  1051. "left": 0,
  1052. "top": 264,
  1053. "height": 60,
  1054. "width": 100,
  1055. "title": "数量:",
  1056. "coordinateSync": false,
  1057. "widthHeightSync": false,
  1058. "fontSize": 40,
  1059. "textContentVerticalAlign": "middle",
  1060. "qrCodeLevel": 0,
  1061. "right": 96.25,
  1062. "bottom": 322.5,
  1063. "vCenter": 46.25,
  1064. "hCenter": 292.5
  1065. },
  1066. "printElementType": {
  1067. "title": "这是更新后的元素",
  1068. "type": "text"
  1069. }
  1070. }, {
  1071. "options": {
  1072. "left": 453,
  1073. "top": 385.5,
  1074. "height": 61.5,
  1075. "width": 120,
  1076. "title": "这是更新后的元素",
  1077. "right": 573.75,
  1078. "bottom": 445.5,
  1079. "vCenter": 513.75,
  1080. "hCenter": 414.75,
  1081. "field": "wb",
  1082. "coordinateSync": false,
  1083. "widthHeightSync": false,
  1084. "hideTitle": true,
  1085. "fontSize": 40,
  1086. "textContentVerticalAlign": "middle",
  1087. "qrCodeLevel": 0,
  1088. "qid": "kh_7"
  1089. },
  1090. "printElementType": {
  1091. "title": "这是更新后的元素",
  1092. "type": "text"
  1093. }
  1094. }, {
  1095. "options": {
  1096. "left": 100.5,
  1097. "top": 265.5,
  1098. "height": 61.5,
  1099. "width": 262.5,
  1100. "title": "这是更新后的元素",
  1101. "right": 324.75,
  1102. "bottom": 324.75,
  1103. "vCenter": 219,
  1104. "hCenter": 294,
  1105. "field": "sl",
  1106. "coordinateSync": false,
  1107. "widthHeightSync": false,
  1108. "hideTitle": true,
  1109. "fontSize": 40,
  1110. "textContentVerticalAlign": "middle",
  1111. "qrCodeLevel": 0,
  1112. "qid": "kh_4"
  1113. },
  1114. "printElementType": {
  1115. "title": "这是更新后的元素",
  1116. "type": "text"
  1117. }
  1118. }, {
  1119. "options": {
  1120. "left": 354,
  1121. "top": 385.5,
  1122. "height": 60,
  1123. "width": 100,
  1124. "title": "尾包:",
  1125. "coordinateSync": false,
  1126. "widthHeightSync": false,
  1127. "fontSize": 40,
  1128. "textContentVerticalAlign": "middle",
  1129. "qrCodeLevel": 0,
  1130. "right": 440.25,
  1131. "bottom": 445.5,
  1132. "vCenter": 396.75,
  1133. "hCenter": 415.5
  1134. },
  1135. "printElementType": {
  1136. "title": "这是更新后的元素",
  1137. "type": "text"
  1138. }
  1139. }, {
  1140. "options": {
  1141. "left": 0,
  1142. "top": 385.5,
  1143. "height": 60,
  1144. "width": 100,
  1145. "title": "组别:",
  1146. "coordinateSync": false,
  1147. "widthHeightSync": false,
  1148. "fontSize": 40,
  1149. "textContentVerticalAlign": "middle",
  1150. "qrCodeLevel": 0,
  1151. "right": 100,
  1152. "bottom": 448.5,
  1153. "vCenter": 50,
  1154. "hCenter": 418.5
  1155. },
  1156. "printElementType": {
  1157. "title": "这是更新后的元素",
  1158. "type": "text"
  1159. }
  1160. }, {
  1161. "options": {
  1162. "left": 181.5,
  1163. "top": 445.5,
  1164. "height": 61.5,
  1165. "width": 259.5,
  1166. "title": "这是更新后的元素",
  1167. "right": 603,
  1168. "bottom": 505.5,
  1169. "vCenter": 393,
  1170. "hCenter": 474.75,
  1171. "field": "dyrq",
  1172. "coordinateSync": false,
  1173. "widthHeightSync": false,
  1174. "hideTitle": true,
  1175. "fontSize": 40,
  1176. "textContentVerticalAlign": "middle",
  1177. "qrCodeLevel": 0,
  1178. "qid": "kh_6"
  1179. },
  1180. "printElementType": {
  1181. "title": "这是更新后的元素",
  1182. "type": "text"
  1183. }
  1184. }, {
  1185. "options": {
  1186. "left": 0,
  1187. "top": 445.5,
  1188. "height": 60,
  1189. "width": 180,
  1190. "title": "打印日期:",
  1191. "coordinateSync": false,
  1192. "widthHeightSync": false,
  1193. "fontSize": 40,
  1194. "textContentVerticalAlign": "middle",
  1195. "qrCodeLevel": 0,
  1196. "right": 168,
  1197. "bottom": 505.5,
  1198. "vCenter": 84,
  1199. "hCenter": 475.5
  1200. },
  1201. "printElementType": {
  1202. "title": "这是更新后的元素",
  1203. "type": "text"
  1204. }
  1205. }, {
  1206. "options": {
  1207. "left": 421.5,
  1208. "top": 261,
  1209. "height": 52.5,
  1210. "width": 40.5,
  1211. "title": "第",
  1212. "right": 459,
  1213. "bottom": 313.5,
  1214. "vCenter": 438.75,
  1215. "hCenter": 287.25,
  1216. "coordinateSync": false,
  1217. "widthHeightSync": false,
  1218. "fontSize": 40,
  1219. "textContentVerticalAlign": "middle",
  1220. "qrCodeLevel": 0
  1221. },
  1222. "printElementType": {
  1223. "title": "文本",
  1224. "type": "text"
  1225. }
  1226. }, {
  1227. "options": {
  1228. "left": 540,
  1229. "top": 261,
  1230. "height": 52.5,
  1231. "width": 40.5,
  1232. "title": "包",
  1233. "right": 577.5,
  1234. "bottom": 312,
  1235. "vCenter": 557.25,
  1236. "hCenter": 285.75,
  1237. "coordinateSync": false,
  1238. "widthHeightSync": false,
  1239. "fontSize": 40,
  1240. "textContentVerticalAlign": "middle",
  1241. "qrCodeLevel": 0
  1242. },
  1243. "printElementType": {
  1244. "title": "文本",
  1245. "type": "text"
  1246. }
  1247. }, {
  1248. "options": {
  1249. "left": 460.5,
  1250. "top": 261,
  1251. "height": 52.5,
  1252. "width": 79.5,
  1253. "title": "1000",
  1254. "right": 538.5,
  1255. "bottom": 313.5,
  1256. "vCenter": 498.75,
  1257. "hCenter": 287.25,
  1258. "field": "lsh",
  1259. "coordinateSync": false,
  1260. "widthHeightSync": false,
  1261. "hideTitle": true,
  1262. "fontSize": 40,
  1263. "textAlign": "center",
  1264. "textContentVerticalAlign": "middle",
  1265. "qrCodeLevel": 0
  1266. },
  1267. "printElementType": {
  1268. "title": "文本",
  1269. "type": "text"
  1270. }
  1271. }],
  1272. "paperNumberLeft": 568.5,
  1273. "paperNumberTop": 330,
  1274. "paperNumberContinue": true,
  1275. "watermarkOptions": {
  1276. "content": "vue-plugin-hiprint",
  1277. "rotate": 25,
  1278. "timestamp": true,
  1279. "format": "YYYY-MM-DD HH:mm"
  1280. },
  1281. "panelLayoutOptions": {}
  1282. }]
  1283. }
  1284. // 右键点击行时触发
  1285. const roww = ref(null)
  1286. const selectedRows = ref([]);
  1287. const allPrintData = ref([]);
  1288. const printdata = ref({});
  1289. //单机
  1290. const add_tableRowClick = async (row) => {
  1291. roww.value = row
  1292. }
  1293. //双击
  1294. const add_updateCompanyFunc = async (row) => {
  1295. }
  1296. //右键
  1297. const handleRightClick = async (row) => {
  1298. }
  1299. //复选框
  1300. const add_xpSelectionChange = async (selection) => {
  1301. console.log(selection.length)
  1302. selectedRows.value = selection;
  1303. if (selection.length === 0) {
  1304. ElMessage({
  1305. type: 'warning',
  1306. message: '请勾选打印的数据'
  1307. });
  1308. return false;
  1309. } else if (selection.length > 0) {
  1310. allPrintData.value = selection.map((row) => {
  1311. console.log(111, row)
  1312. let weibao = row['是否尾包'] === '是' ? 1 : 0;
  1313. const ewm = `${row['订单子编号']},01,${row['尺码']},${row['数量']},${weibao}`;
  1314. return {
  1315. emm: ewm,
  1316. zddbh: row['子订单编号'],
  1317. kh: row['款号'],
  1318. pm: row['款式'],
  1319. ys: row['颜色'],
  1320. cm: row['尺码'],
  1321. sl: row['数量'],
  1322. zb: row['组别'],
  1323. dyrq: currentDates,
  1324. wb: row['尾包'],
  1325. lsh: row['serial']
  1326. };
  1327. });
  1328. } else {
  1329. allPrintData.value = [];
  1330. }
  1331. console.log(allPrintData.value)
  1332. }
  1333. const selectedSizes = ref([]);
  1334. // 存储所有高亮单元格的信息
  1335. const highlightedCells = ref([]);
  1336. let table_serial = ref('');
  1337. let table_order_id = ref('');
  1338. let table_kh = ref('');
  1339. let table_sczl_jtbh = ref('');
  1340. let table_gx = ref('');
  1341. let table_wb = ref('');
  1342. let table_ks = ref('');
  1343. let table_color = ref('');
  1344. function handleSizeClick(rowIndex, item, row) {
  1345. table_serial = row['serial']
  1346. table_order_id = row['子订单编号']
  1347. table_sczl_jtbh = row['机台号']
  1348. table_gx = row['工序名称']
  1349. table_ks = row['款式']
  1350. table_wb = row['尾包']
  1351. table_color = row['颜色']
  1352. table_kh = row['款号']
  1353. // 查找当前单元格是否已高亮
  1354. const index = highlightedCells.value.findIndex(hc => hc.rowIndex === rowIndex && hc.item === item);
  1355. if (index !== -1) {
  1356. // 如果已高亮,则移除
  1357. highlightedCells.value.splice(index, 1);
  1358. } else {
  1359. // 否则,添加新的高亮信息
  1360. highlightedCells.value.push({
  1361. rowIndex,
  1362. item
  1363. });
  1364. }
  1365. let newSizeItem = {
  1366. size: item
  1367. };
  1368. const quantityWithParentheses = row[item];
  1369. const match = quantityWithParentheses.match(/^([^()]+)\(([^()]+)\)$/);
  1370. if (match) {
  1371. newSizeItem.serial = match[1];
  1372. newSizeItem.sl = parseInt(match[2], 10);
  1373. const existingIndex = selectedSizes.value.findIndex(s => s.size === item);
  1374. if (existingIndex !== -1) {
  1375. selectedSizes.value.splice(existingIndex, 1);
  1376. }
  1377. selectedSizes.value.push(newSizeItem);
  1378. } else {
  1379. console.error('Invalid match format:', quantityWithParentheses);
  1380. }
  1381. }
  1382. //点击显示表格高亮
  1383. function isCellHighlighted(rowIndex, item) {
  1384. return highlightedCells.value.some(hc => hc.rowIndex === rowIndex && hc.item === item);
  1385. }
  1386. //补打小票
  1387. let _table_print = ref([]);
  1388. let allParams = [];
  1389. const add_bdprintxp = () => {
  1390. console.log(selectedSizes.value)
  1391. console.log(151, highlightedCells.value)
  1392. if (selectedSizes.value.length === 0) {
  1393. ElMessage({
  1394. type: 'warning',
  1395. message: '请选择要补打的数量'
  1396. });
  1397. return false;
  1398. }
  1399. allParams = [];
  1400. for (let i = 0; i < highlightedCells.value.length; i++) {
  1401. if (selectedSizes.value[i]) {
  1402. let params = {};
  1403. params.order_id = table_order_id;
  1404. params.kh = table_kh;
  1405. params.ks = table_ks;
  1406. params.color = table_color;
  1407. params.cm = selectedSizes.value[i].size;
  1408. params.sl = selectedSizes.value[i].sl;
  1409. params.sczl_jtbh = table_sczl_jtbh;
  1410. params.sys_rq = currentDate;
  1411. params.sys_rq = currentDate;
  1412. params.serial = selectedSizes.value[i].serial;
  1413. params.wb = table_wb;
  1414. allParams.push(params);
  1415. _table_print.value = allParams.map((row) => {
  1416. let weibao = table_wb === '是' ? '1' : '0';
  1417. const ewm =
  1418. `${row['order_id']},${add_formData['机台号']},3,${row['cm']},${row['sl']},${weibao}`;
  1419. return {
  1420. emm: ewm,
  1421. zddbh: row['order_id'],
  1422. kh: row['kh'],
  1423. pm: row['ks'],
  1424. ys: row['color'],
  1425. cm: row['cm'],
  1426. sl: row['sl'],
  1427. zb: row['sczl_jtbh'],
  1428. dyrq: currentDates,
  1429. wb: table_wb,
  1430. lsh: row['serial']
  1431. };
  1432. });
  1433. console.log(111, _table_print.value)
  1434. const hiprintTemplate = new hiprint.PrintTemplate({
  1435. template: jsondata
  1436. });
  1437. hiprintTemplate.print(_table_print.value)
  1438. }
  1439. }
  1440. };
  1441. const _print = ref('')
  1442. // 打印预览
  1443. const add_printxp = () => {
  1444. let cmArray = [cmformdata.cm1, cmformdata.cm2, cmformdata.cm3, cmformdata.cm4, cmformdata.cm5, cmformdata.cm6,
  1445. cmformdata.cm7, cmformdata.cm8, cmformdata.cm9, cmformdata.cm10
  1446. ];
  1447. let slArray = [slformdata.sl1, slformdata.sl2, slformdata.sl3, slformdata.sl4, slformdata.sl5, slformdata.sl6,
  1448. slformdata.sl7, slformdata.sl8, slformdata.sl9, slformdata.sl10
  1449. ];
  1450. let allParams = []; // 用于存储所有要打印的参数对象
  1451. let allParamss = ref([]); // 用于存储所有要打印的参数对象
  1452. if (!slArray.some(item => item !== "" && item !== null && item !== undefined)) {
  1453. ElMessage({
  1454. type: 'warning',
  1455. message: '请填写上报数量后再使用打印功能'
  1456. });
  1457. return;
  1458. } else {
  1459. let serialNumber = parseInt(_serial.value, 10);
  1460. for (let i = 0; i < slArray.length; i++) {
  1461. if (slArray[i]) {
  1462. let params = {};
  1463. serialNumber++
  1464. params.serial = padNumber(serialNumber, 3)
  1465. params.order_id = add_searchInfo.value;
  1466. params.sczl_jtbh = add_formData['组别'];
  1467. params.gx = add_formData['工序'];
  1468. params.sys_id = add_formData['人员'];
  1469. params.wb = add_formData['是否订单尾包'];
  1470. params.cm = cmArray[i];
  1471. params.sl = slArray[i];
  1472. params.sys_rq = currentDate;
  1473. allParams.push(params);
  1474. allParamss.value = allParams.map((row) => {
  1475. let weibao = add_formData['是否订单尾包'] === '1' ? '是' : '否';
  1476. //二维码数据:订单子编号,组别,工序(固定),尺码,数量,是否尾包(1代表是0代表否)如2408001-1,CF01,3,10,20,0
  1477. const ewm =
  1478. `${row['order_id']},${add_formData['机台号']},3,${row['cm']},${row['sl']},${add_formData['是否订单尾包']}`;
  1479. return {
  1480. emm: ewm,
  1481. zddbh: row['order_id'],
  1482. kh: _yskskh.value['款号'],
  1483. pm: _yskskh.value['款式'],
  1484. ys: _yskskh.value['颜色'],
  1485. cm: row['cm'],
  1486. sl: row['sl'],
  1487. zb: row['sczl_jtbh'],
  1488. dyrq: currentDates,
  1489. wb: weibao,
  1490. lsh: row['serial']
  1491. };
  1492. });
  1493. // const hiprintTemplate = new hiprint.PrintTemplate({ template: jsondata });
  1494. // hiprintTemplate.print2(allParamss.value);
  1495. const hiprintTemplate = new hiprint.PrintTemplate({
  1496. template: jsondata
  1497. });
  1498. hiprintTemplate.print(allParamss.value)
  1499. }
  1500. }
  1501. // console.log(allParamss.value)
  1502. }
  1503. };
  1504. // =========== 删除按钮 ===========
  1505. //记录复选框的值
  1506. const bgSelection = ref(null)
  1507. const baogong_del = () => {
  1508. if (bgSelection.value === null || bgSelection.value === '') {
  1509. ElMessage({
  1510. type: 'warning',
  1511. message: '请选择删除的数据'
  1512. })
  1513. } else {
  1514. console.log(bgSelection.value)
  1515. }
  1516. }
  1517. // 保存当前选中的行数据
  1518. const table_selectrows = ref([]);
  1519. // 表格复选框选中变化时触发
  1520. const table_SelectionChange = (val) => {
  1521. table_selectrows.value = val; // 将选中的行数据保存到 table_selectrows
  1522. }
  1523. // =========== 批量打印小票 ===========
  1524. const onxiaopiaoclick = async () => {
  1525. if (table_selectrows.value.length === 0) {
  1526. ElMessage({
  1527. type: 'warning',
  1528. message: '请勾选打印的数据'
  1529. });
  1530. return false;
  1531. }
  1532. const allPrintData = table_selectrows.value.map((row) => {
  1533. let weibao = row['是否尾包'] === '是' ? 1 : 0;
  1534. const ewm = `${row['订单子编号']},01,${row['尺码']},${row['数量']},${weibao}`;
  1535. return {
  1536. emm: ewm,
  1537. zddbh: row['订单子编号'],
  1538. kh: row['生产款号'],
  1539. pm: row['款式'],
  1540. ys: row['颜色'],
  1541. cm: row['尺码'],
  1542. sl: row['报工数量'],
  1543. zb: row['组别'],
  1544. dyrq: currentDate,
  1545. wb: row['是否尾包'],
  1546. };
  1547. });
  1548. // 将所有数据一次性传递给打印模板
  1549. const hiprintTemplate = new hiprint.PrintTemplate({
  1550. template: jsondata
  1551. });
  1552. hiprintTemplate.print(allPrintData);
  1553. }
  1554. // // 表格复选框
  1555. // const handleSelectionChange = (selection, type) => {
  1556. // const ids = selection.map(item => {
  1557. // return item.订单子编号
  1558. // })
  1559. // bgSelection.value = ids.join(',')
  1560. // }
  1561. // // 表格复选框
  1562. // const table_SelectionChange = (val, type) => {
  1563. // console.log(val)
  1564. // }
  1565. // // =========== 补打小票 ===========
  1566. // const onxiaopiaoclick = async () => {
  1567. // if(row_onclick.value === '' || row_onclick.value === null || row_onclick.value === undefined){
  1568. // ElMessage({type: 'warning',message: '请选择一条数据' })
  1569. // return false;
  1570. // }
  1571. // let weibao;
  1572. // if (row_onclick.value['是否尾包'] === '是') {
  1573. // weibao = 1;
  1574. // } else {
  1575. // weibao = 0;
  1576. // }
  1577. // const ewm = `${row_onclick.value['订单子编号']},01,${row_onclick.value['尺码']},${row_onclick.value['数量']},${weibao}`;
  1578. // printdata.value = {
  1579. // emm: ewm,
  1580. // zddbh: row_onclick.value['订单子编号'],
  1581. // kh: row_onclick.value['生产款号'],
  1582. // pm: row_onclick.value['款式'],
  1583. // ys: row_onclick.value['颜色'],
  1584. // cm: row_onclick.value['尺码'],
  1585. // sl: row_onclick.value['报工数量'],
  1586. // zb: row_onclick.value['组别'],
  1587. // dyrq: currentDate,
  1588. // wb: row_onclick.value['是否尾包'],
  1589. // };
  1590. // hiprint.init();
  1591. // const hiprintTemplate = new hiprint.PrintTemplate({ template: jsondata });
  1592. // hiprintTemplate.print(printdata.value);
  1593. // }
  1594. // =========== 修改 ===========
  1595. const dialogFormVisible = ref(false)
  1596. const edit_formData = ref({})
  1597. // 双击修改
  1598. const updateCompanyFunc = async (row) => {
  1599. console.log(row)
  1600. dialogFormVisible.value = true;
  1601. Object.assign(edit_formData.value, row);
  1602. edit_formData.value['是否订单尾包'] = row['是否尾包'];
  1603. // let code = row['员工编号'];
  1604. // const getStaffInfo_data = await getStaffInfo({code:code});
  1605. // formDataTest.value = getStaffInfo_data.data;
  1606. };
  1607. // 弹窗修改确定
  1608. const edit_Dialog = async () => {
  1609. _ygjbzledit();
  1610. }
  1611. // 弹窗修改关闭
  1612. const edit_closeDialog = () => {
  1613. dialogFormVisible.value = false
  1614. }
  1615. const _ygjbzledit = async () => {
  1616. // const formattedData = {
  1617. // '订单子编号': edit_formData.value['订单子编号'],
  1618. // '订单号': edit_formData.value['订单号'],
  1619. // '生产款号': edit_formData.value['生产款号'],
  1620. // '款式': edit_formData.value['款式'],
  1621. // '颜色': edit_formData.value['颜色'],
  1622. // '制单总数': edit_formData.value['制单总数'],
  1623. // '组别': edit_formData.value['组别'],
  1624. // '排产单数': edit_formData.value['排产单数'],
  1625. // '尺码': edit_formData.value['尺码'],
  1626. // '报工数量': edit_formData.value['报工数量'],
  1627. // '是否为尾包': edit_formData.value['是否为尾包'],
  1628. // '工序': edit_formData.value['工序'],
  1629. // '验片人': edit_formData.value['验片人'],
  1630. // '日期': edit_formData.value['日期'],
  1631. // };
  1632. // try {
  1633. // const edid_edit_formData = await 修改接口(formattedData);
  1634. // if (edid_edit_formData .code === 0) {
  1635. // dialogFormVisible.value = false;
  1636. // ElMessage({type: 'success',message: '更新成功'})
  1637. // } else {
  1638. // ElMessage({ type: 'error',message: '更新失败'})
  1639. // }
  1640. // } catch (error) {
  1641. // console.error(error);
  1642. // }
  1643. }
  1644. // =========== 分页 ===========
  1645. // 分页相关的响应式变量
  1646. const page = ref(1)
  1647. const total = ref(0)
  1648. const pageSize = ref(10)
  1649. // 分页
  1650. const handleCurrentChange = (val) => {
  1651. page.value = val;
  1652. _getStaffList();
  1653. };
  1654. // 修改页面容量 点击多少条/页
  1655. const handleSizeChange = (val) => {
  1656. page.value = 10; //默认显示
  1657. pageSize.value = val;
  1658. _getStaffList();
  1659. };
  1660. </script>
  1661. <style scoped>
  1662. .form-container {
  1663. display: flex;
  1664. flex-wrap: wrap;
  1665. }
  1666. .form-column {
  1667. /*flex: 1;*/
  1668. margin-right: 15px;
  1669. /* 调整列之间的间距 */
  1670. }
  1671. /* 左侧输入框宽度调整 */
  1672. .form-column .el-form-item .el-input {
  1673. width: 150px;
  1674. /* 调整左侧输入框的宽度 */
  1675. }
  1676. /* 媒体查询,根据需要调整断点 */
  1677. @media screen and (max-width: 768px) {
  1678. .form-column {
  1679. flex: 1 0 100%;
  1680. /* 在小屏幕下变成单列布局 */
  1681. margin-right: 0;
  1682. }
  1683. }
  1684. /* 表格复选框大小调整 */
  1685. :deep(.el-checkbox.el-checkbox--small .el-checkbox__inner) {
  1686. width: 30px;
  1687. /* 复选框宽度 */
  1688. height: 20px;
  1689. /* 复选框高度 */
  1690. }
  1691. :deep(.el-checkbox.el-checkbox--small.is-checked .el-checkbox__inner::after) {
  1692. transform: scale(1.2) rotate(45deg);
  1693. /* 调整选中后的对勾大小 */
  1694. top: 5%;
  1695. /* 调整对勾位置 */
  1696. left: 40%;
  1697. /* 调整对勾位置 */
  1698. width: 5px;
  1699. /* 调整对勾宽度 */
  1700. height: 9px;
  1701. /* 调整对勾高度 */
  1702. }
  1703. /*:deep(.el-table td .cell) {*/
  1704. /* line-height: 30px !important;*/
  1705. /*}*/
  1706. .JKWTree-container {
  1707. display: flex;
  1708. }
  1709. .JKWTree-tree {
  1710. /*width: 300px;*/
  1711. background-color: #fff;
  1712. padding: 10px;
  1713. margin-right: 20px;
  1714. }
  1715. .JKWTree-tree h3 {
  1716. font-size: 15px;
  1717. font-weight: 700;
  1718. margin: 10px 0;
  1719. }
  1720. .JKWTree-content {
  1721. flex: 1;
  1722. }
  1723. /* 图片上传 */
  1724. .upload-box {
  1725. width: 200px;
  1726. height: 200px;
  1727. border: 2px dashed #e2e2e2;
  1728. display: flex;
  1729. justify-content: center;
  1730. align-items: center;
  1731. position: relative;
  1732. cursor: pointer;
  1733. }
  1734. .uploaded-image {
  1735. width: 100%;
  1736. height: 100%;
  1737. object-fit: cover;
  1738. }
  1739. .upload-icon {
  1740. font-size: 40px;
  1741. color: #c0c4cc;
  1742. }
  1743. .file-input {
  1744. display: none;
  1745. }
  1746. .el-table .warning-row {
  1747. background: oldlace;
  1748. }
  1749. :deep(.el-input .is-disabled .cm_input) {
  1750. color: red;
  1751. }
  1752. /* 选中某行时的背景色 */
  1753. :deep(.el-table__body tr.current-row)>td {
  1754. background: #ff80ff !important;
  1755. }
  1756. </style>
  1757. <style scoped>
  1758. :deep(.el-table td .cell) {
  1759. line-height: 20px !important;
  1760. }
  1761. :deep(.el-tabs__header) {
  1762. margin-bottom: 0;
  1763. }
  1764. .search {
  1765. margin-left: 0px !important;
  1766. margin-right: 10px !important;
  1767. }
  1768. .bt {
  1769. margin-left: 2px !important;
  1770. padding: 3px !important;
  1771. font-size: 12px;
  1772. }
  1773. .el-tabs__header {
  1774. margin: 0px !important;
  1775. }
  1776. .gva-table-box {
  1777. max-width: 1400px;
  1778. padding: 0px !important;
  1779. margin-left: -10px !important;
  1780. }
  1781. .mab {
  1782. margin-bottom: 5px;
  1783. }
  1784. /* 点击按钮改变颜色 */
  1785. .active-button {
  1786. background-color: #ff0000;
  1787. }
  1788. .default-button {
  1789. background-color: #808080;
  1790. }
  1791. ::v-deep .el-input_inner {
  1792. font-size: 20px;
  1793. /* 更改为你想要的字体大小 */
  1794. }
  1795. /* 搜索样式 */
  1796. ::v-deep .el-input__wrapper #searchInput {
  1797. font-size: 16px;
  1798. }
  1799. ::v-deep .el-input__wrapper #jitaihao {
  1800. font-size: 18px;
  1801. }
  1802. ::v-deep .el-input__wrapper #gongxu {
  1803. font-size: 18px;
  1804. }
  1805. ::v-deep .el-input__wrapper #zubie {
  1806. font-size: 18px;
  1807. }
  1808. ::v-deep .el-input__wrapper #renyuan {
  1809. font-size: 18px;
  1810. }
  1811. ::v-deep .el-input__wrapper #shuliang {
  1812. font-size: 18px;
  1813. color: red;
  1814. }
  1815. ::v-deep .el-input__wrapper #chima {
  1816. font-size: 18px;
  1817. }
  1818. /* 尺码 */
  1819. ::v-deep .el-input__wrapper #cm1 {
  1820. font-size: 20px;
  1821. }
  1822. ::v-deep .el-input__wrapper #cm2 {
  1823. font-size: 20px;
  1824. }
  1825. ::v-deep .el-input__wrapper #cm3 {
  1826. font-size: 20px;
  1827. }
  1828. ::v-deep .el-input__wrapper #cm4 {
  1829. font-size: 20px;
  1830. }
  1831. ::v-deep .el-input__wrapper #cm5 {
  1832. font-size: 20px;
  1833. }
  1834. ::v-deep .el-input__wrapper #cm6 {
  1835. font-size: 20px;
  1836. }
  1837. ::v-deep .el-input__wrapper #cm7 {
  1838. font-size: 20px;
  1839. }
  1840. ::v-deep .el-input__wrapper #cm8 {
  1841. font-size: 20px;
  1842. }
  1843. ::v-deep .el-input__wrapper #cm9 {
  1844. font-size: 20px;
  1845. }
  1846. ::v-deep .el-input__wrapper #cm10 {
  1847. font-size: 20px;
  1848. }
  1849. ::v-deep .el-input__wrapper #cm11 {
  1850. font-size: 20px;
  1851. }
  1852. /* 制单数 */
  1853. ::v-deep .el-input__wrapper #zdsc1 {
  1854. font-size: 20px;
  1855. }
  1856. ::v-deep .el-input__wrapper #zdsc2 {
  1857. font-size: 20px;
  1858. }
  1859. ::v-deep .el-input__wrapper #zdsc3 {
  1860. font-size: 20px;
  1861. }
  1862. ::v-deep .el-input__wrapper #zdsc4 {
  1863. font-size: 20px;
  1864. }
  1865. ::v-deep .el-input__wrapper #zdsc5 {
  1866. font-size: 20px;
  1867. }
  1868. ::v-deep .el-input__wrapper #zdsc6 {
  1869. font-size: 20px;
  1870. }
  1871. ::v-deep .el-input__wrapper #zdsc7 {
  1872. font-size: 20px;
  1873. }
  1874. ::v-deep .el-input__wrapper #zdsc8 {
  1875. font-size: 20px;
  1876. }
  1877. ::v-deep .el-input__wrapper #zdsc9 {
  1878. font-size: 20px;
  1879. }
  1880. ::v-deep .el-input__wrapper #zdsc10 {
  1881. font-size: 20px;
  1882. }
  1883. ::v-deep .el-input__wrapper #zdtotal {
  1884. font-size: 20px;
  1885. }
  1886. /* 实裁数 */
  1887. ::v-deep .el-input__wrapper #scsl1 {
  1888. font-size: 20px;
  1889. color: red !important;
  1890. }
  1891. ::v-deep .el-input__wrapper #scsl2 {
  1892. font-size: 20px;
  1893. color: red !important;
  1894. }
  1895. ::v-deep .el-input__wrapper #scsl3 {
  1896. font-size: 20px;
  1897. color: red !important;
  1898. }
  1899. ::v-deep .el-input__wrapper #scsl4 {
  1900. font-size: 20px;
  1901. color: red !important;
  1902. }
  1903. ::v-deep .el-input__wrapper #scsl5 {
  1904. font-size: 20px;
  1905. color: red !important;
  1906. }
  1907. ::v-deep .el-input__wrapper #scsl6 {
  1908. font-size: 20px;
  1909. color: red !important;
  1910. }
  1911. ::v-deep .el-input__wrapper #scsl7 {
  1912. font-size: 20px;
  1913. color: red !important;
  1914. }
  1915. ::v-deep .el-input__wrapper #scsl8 {
  1916. font-size: 20px;
  1917. color: red !important;
  1918. }
  1919. ::v-deep .el-input__wrapper #scsl9 {
  1920. font-size: 20px;
  1921. color: red !important;
  1922. }
  1923. ::v-deep .el-input__wrapper #scsl10 {
  1924. font-size: 20px;
  1925. color: red !important;
  1926. }
  1927. ::v-deep .el-input__wrapper #sctotal {
  1928. font-size: 20px;
  1929. color: red !important;
  1930. }
  1931. /* 数量 */
  1932. ::v-deep .el-input__wrapper #sl1 {
  1933. font-size: 20px;
  1934. }
  1935. ::v-deep .el-input__wrapper #sl2 {
  1936. font-size: 20px;
  1937. }
  1938. ::v-deep .el-input__wrapper #sl3 {
  1939. font-size: 20px;
  1940. }
  1941. ::v-deep .el-input__wrapper #sl4 {
  1942. font-size: 20px;
  1943. }
  1944. ::v-deep .el-input__wrapper #sl5 {
  1945. font-size: 20px;
  1946. }
  1947. ::v-deep .el-input__wrapper #sl6 {
  1948. font-size: 20px;
  1949. }
  1950. ::v-deep .el-input__wrapper #sl7 {
  1951. font-size: 20px;
  1952. }
  1953. ::v-deep .el-input__wrapper #sl8 {
  1954. font-size: 20px;
  1955. }
  1956. ::v-deep .el-input__wrapper #sl9 {
  1957. font-size: 20px;
  1958. }
  1959. ::v-deep .el-input__wrapper #sl10 {
  1960. font-size: 20px;
  1961. }
  1962. ::v-deep .el-input__wrapper #sctotal {
  1963. font-size: 20px;
  1964. }
  1965. /* 选择历史记录改变颜色 */
  1966. .highlight-cell {
  1967. height: 40px;
  1968. /* 背景 */
  1969. background-color: rgba(190, 79, 79, 0.7) !important;
  1970. /* 使用 Flexbox 布局 */
  1971. display: flex;
  1972. /* 垂直居中 */
  1973. align-items: center;
  1974. /* 水平居中 */
  1975. justify-content: center;
  1976. /* 可选,确保 div 宽度填满单元格 */
  1977. width: 100%;
  1978. /* 可选,确保 padding 和 border 不会增加 div 的宽度 */
  1979. box-sizing: border-box;
  1980. }
  1981. /* :deep(.el-table__body tr.current-row) > td {
  1982. background: #ff80ff !important;
  1983. } */
  1984. .custom-button-text {
  1985. font-size: 25px;
  1986. /* 或者你想要的任何大小 */
  1987. }
  1988. </style>