Manualdocuments.vue 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850
  1. <template>
  2. <div>
  3. <!-- 左侧树形结构 -->
  4. <el-container>
  5. <!-- <el-aside width="250px">
  6. <div class="JKWTree-tree">
  7. <h3>手工检验计件单据维护</h3>
  8. <el-tree :data="treeData" :props="defaultProps" highlight-current="true"
  9. @node-click="handleNodeClick"></el-tree>
  10. </div>
  11. </el-aside> -->
  12. <layout-sider
  13. :resize-directions="['right']"
  14. :width="220"
  15. style="margin-right: 10px;"
  16. >
  17. <div
  18. class="JKWTree-tree"
  19. style="height: 70vh;"
  20. >
  21. <h3>手工检验计件单据维护</h3>
  22. <el-tree
  23. :data="treeData"
  24. highlight-current
  25. @node-click="handleNodeClick"
  26. />
  27. </div>
  28. </layout-sider>
  29. <el-container>
  30. <el-main>
  31. <!-- 按钮区域 -->
  32. <div class="gva-table-box">
  33. <el-form-item>
  34. <el-input v-model="positionvalue" placeholder="输入工单编号或产品名称" style="width: 180px;" />
  35. <el-button type="primary" class="search" icon="search" @click="onSearch"></el-button>
  36. <el-button type="primary" class="bt" icon="plus" @click="onAdd">新增</el-button>
  37. <!-- <el-button type="primary" class="bt" icon="copy-document" @click="onCountByGdbh">切换显示方式</el-button> -->
  38. <el-button type="primary" class="bt" icon="refresh" @click="onRefresh">刷新质检系数</el-button>
  39. <el-button type="primary" class="bt" icon="delete" @click="onDel">删除</el-button>
  40. <div style="margin-left: auto;">
  41. <el-button type="primary" :icon="Download" @click="exportExcel">导出到Excel</el-button>
  42. </div>
  43. </el-form-item>
  44. <!-- 数据展示 -->
  45. <el-table ref="multipleTable" style="width: 100%" tooltip-effect="dark" :data="tableData" row-key="ID"
  46. highlight-current-row="true" border @selection-change="handleSelectionChange" @row-click="Click"
  47. :show-overflow-tooltip="true" @row-dblclick="doubleClick">
  48. <el-table-column type="selection" width="55" />
  49. <el-table-column align="left" sortable label="工单印件" prop="combinedProp" width="340"/>
  50. <el-table-column align="left" sortable label="印件工序" prop="combinedProp2" width="150"/>
  51. <el-table-column align="left" sortable label="日期" prop="sczl_rq" width="120" />
  52. <el-table-column align="left" sortable label="产量" prop="sczl_cl" width="77" />
  53. <el-table-column align="left" sortable label="千件工价" prop="千件工价" width="105" />
  54. <el-table-column align="left" sortable label="检验类别" prop="sczl_检验类别" width="105" />
  55. <el-table-column align="left" sortable label="废品率系数" prop="sczl_废品率系数" width="120" />
  56. <el-table-column align="left" sortable label="日定额" prop="日定额" width="91" />
  57. <el-table-column align="left" sortable label="组长编号" prop="sczl_bh0" width="105" />
  58. <el-table-column align="left" sortable label="组长姓名" prop="员工姓名" width="105" />
  59. <el-table-column align="left" sortable label="流程单备注" prop="qczl_NumDesc" width="120" />
  60. <el-table-column align="left" sortable label="创建用户" prop="sys_id" width="120" />
  61. <el-table-column align="left" sortable label="创建时间" prop="sys_rq" width="160" />
  62. <el-table-column align="left" sortable label="修改时间" prop="mod_rq" width="160" />
  63. <el-table-column align="left" sortable label="UNIQID" prop="UniqId" width="120" />
  64. </el-table>
  65. <!-- 分页 -->
  66. <div class="gva-pagination">
  67. <el-pagination layout="total, sizes, prev, pager, next, jumper" v-model:current-page="page"
  68. v-model:page-size="limit"
  69. :page-sizes="[10, 30, 50, 100]" :total="total" @current-change="handleCurrentChange"
  70. @size-change="handleSizeChange" />
  71. </div>
  72. </div>
  73. <!-- 弹出框 -->
  74. <el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="type === 'create' ? '添加' : '修改'"
  75. destroy-on-close width="1000px">
  76. <el-form :model="formData" label-position="right" ref="elFormRef" :rules="rule" label-width="70px" >
  77. <el-row :gutter="24">
  78. <el-col :span="4">
  79. <el-form-item label="日期" prop="id" class="mab">
  80. <el-input type="date" max="9999-12-31" v-model="formData.sczl_rq" id="日期" @focus="rqHandleFocus()" @keydown="ent1($event)" style="width: 120px; " />
  81. </el-form-item>
  82. </el-col>
  83. <el-col :span="4">
  84. <el-form-item label="组别" prop="name" label-width="90px" class="mab">
  85. <el-input v-model="formData.sczl_bzdh" id="组别" @keydown="ent1($event)" @blur="getBzsubmit()" style="width: 80px; "/>
  86. </el-form-item>
  87. </el-col>
  88. <el-col :span="8">
  89. <el-form-item label="组长" prop="name" class="mab" label-width="50px">
  90. <el-input v-model="formData.sczl_bh0" id="bh0" @keydown="ent1($event)" @blur="getygsubmit($event, '0')" style="width: 100px; margin-right: 5px;" />
  91. <el-input v-model="formData.sczl_bh0_name" id="name0" :readonly=true @keydown="ent1($event)" style="width: 100px; " />
  92. </el-form-item>
  93. </el-col>
  94. <el-col :span="4">
  95. <el-form-item label="箱数" prop="name" class="mab" label-width="50px">
  96. <el-input v-model="formData.sczl_cl0" id="箱数" @keydown="ent1($event)" style="width: 100px; " />
  97. </el-form-item>
  98. </el-col>
  99. <el-col :span="4">
  100. <el-form-item label="每箱数" prop="name" class="mab" label-width="55px">
  101. <el-input v-model="formData.sczl_fp0" id="每箱数" @keydown="ent1($event)" style="width: 100px;" />
  102. </el-form-item>
  103. </el-col>
  104. </el-row>
  105. <el-row :gutter="24">
  106. <el-col :span="24">
  107. <el-form-item label="工单编号" prop="id" class="mab">
  108. <el-input v-model="formData.sczl_gdbh" id="工单编号" @keydown="ent1($event)" @blur="getGxMcsubmit" style="width: 118px; margin-right: 5px;"/>
  109. <el-input v-model="formData.sczl_yjgx" id="yjgx" :readonly="true" @keydown="ent1($event)" style="width: 80px; margin-right: 5px;"/>
  110. <el-input v-model="formData.sczl_gxmc" id="gxmc" :readonly="true" @keydown="ent1($event)" style="width: 135px; margin-right: 5px;"/>
  111. <el-input v-model="formData.yj_yjmc" id="yjmc" :readonly="true" @keydown="ent1($event)" style="width: 542px;"/>
  112. </el-form-item>
  113. </el-col>
  114. </el-row>
  115. <el-row :gutter="24">
  116. <el-col :span="6">
  117. <el-form-item label="产量合计" prop="id" class="mab">
  118. <el-input v-model="formData.sczl_cl" id="产量合计" @keydown="ent1($event)" style="width: 150px;" />
  119. </el-form-item>
  120. </el-col>
  121. <el-col :span="6">
  122. <el-form-item label="定额代号" prop="id" label-width="100px" class="mab">
  123. <el-input v-model="formData.sczl_dedh" id="定额代号" @keydown="ent1($event)" @blur="getDedhsubmit" style="width: 150px;" />
  124. </el-form-item>
  125. </el-col>
  126. <el-col :span="6">
  127. <el-form-item label="检验类别" prop="name" class="mab">
  128. <el-input v-model="formData.sczl_检验类别" id="检验类别" @keydown="ent1($event)" @blur="getLbsubmit" style="width: 150px;"/>
  129. </el-form-item>
  130. </el-col>
  131. <el-col :span="6">
  132. <el-form-item label="废品率系数" prop="name" label-width="100px" class="mab">
  133. <el-input v-model="formData.sczl_废品率系数" id="废品率系数" @keydown="ent1($event)" style="width: 150px;"/>
  134. </el-form-item>
  135. </el-col>
  136. </el-row>
  137. <el-row :gutter="24">
  138. <el-col :span="6">
  139. <el-form-item label="计时时数" prop="id" class="mab">
  140. <el-input v-model="formData.sczl_jsss" id="计时时数" @keydown="ent1($event)" style="width: 100px;"/>
  141. </el-form-item>
  142. </el-col>
  143. <el-col :span="6">
  144. <el-form-item label="冲月定额" prop="id" class="mab" label-width="100px">
  145. <el-input v-model="formData.sczl_冲定额" id="冲月定额" @keydown="ent1($event)" style="width: 100px;"/>
  146. </el-form-item>
  147. </el-col>
  148. </el-row>
  149. <el-row :gutter="24">
  150. <el-col :span="17">
  151. <el-form-item label="流程单号" prop="id" class="mab">
  152. <el-input v-model="formData.流程单号1" id="流程单号1" @keydown="ent1($event)" style="width: 60px; margin-right: 5px;"/>
  153. <el-input v-model="formData.流程单号2" id="流程单号2" @keydown="ent1($event)" style="width: 60px; margin-right: 5px;"/>
  154. <el-input v-model="formData.流程单号3" id="流程单号3" @keydown="ent1($event)" style="width: 60px; margin-right: 5px;"/>
  155. <el-input v-model="formData.流程单号4" id="流程单号4" @keydown="ent1($event)" style="width: 60px; margin-right: 5px;"/>
  156. <el-input v-model="formData.流程单号5" id="流程单号5" @keydown="ent1($event)" style="width: 60px; margin-right: 5px;"/>
  157. <el-input v-model="formData.流程单号6" id="流程单号6" @keydown="ent1($event)" style="width: 60px; margin-right: 5px;"/>
  158. <el-input v-model="formData.流程单号7" id="流程单号7" @keydown="ent1($event)" style="width: 60px; margin-right: 5px;"/>
  159. <el-input v-model="formData.流程单号8" id="流程单号8" @keydown="ent1($event)" style="width: 60px; margin-right: 5px;"/>
  160. <el-input v-model="formData.流程单号9" id="流程单号9" @keydown="ent1($event)" style="width: 60px;"/>
  161. </el-form-item>
  162. </el-col>
  163. <el-col :span="7">
  164. <el-form-item label="备注" prop="id" label-width="50px">
  165. <el-input v-model="formData.qczl_NumDesc" id="备注" @keydown="ent1($event)" />
  166. </el-form-item>
  167. </el-col>
  168. </el-row>
  169. <el-row :gutter="19" style="margin-bottom: 5px; margin-left: 30px;">
  170. <span style="margin-left: 25px; margin-right: 50px;">员工编号</span>
  171. <span style="margin-right: 50px;">员工姓名</span>
  172. <span style="margin-right: 50px;">&nbsp;&nbsp;箱数&nbsp;&nbsp;</span>
  173. <span style="margin-right: 120px;">每箱数量</span>
  174. <span style="margin-right: 50px;">员工编号</span>
  175. <span style="margin-right: 50px;">员工姓名</span>
  176. <span style="margin-right: 50px;">&nbsp;&nbsp;箱数&nbsp;&nbsp;</span>
  177. <span>每箱数量</span>
  178. </el-row>
  179. <el-row :gutter="24" style="margin-bottom: 5px; margin-left: 30px;">
  180. <div style="width: 450px;margin-right: 30px;">
  181. <div v-for="index in 6" :key="index">
  182. <el-input style="width: 100px; margin-right: 5px;" v-model="formData['sczl_bh' + index]" :id="'bh' + index" @keydown="ent($event, index.toString())" />
  183. <el-input style="width: 100px; margin-right: 5px; color: red;" :readonly="true" :value="formData['sczl_bh' + index + '_name']" :id="'name' + index" @keydown="ent1($event)"/>
  184. <el-input style="width: 100px; margin-right: 5px;" v-model="formData['sczl_cl' + index]" :id="'cl' + index" @keydown="ent1($event)"/>
  185. <el-input style="width: 100px;" v-model="formData['sczl_fp' + index]" :id="'fp' + index" @keydown="ent1($event)"/>
  186. </div>
  187. </div>
  188. <div style="width: 450px;">
  189. <div v-for="index in 6" :key="index + 6">
  190. <el-input style="width: 100px; margin-right: 5px;" v-model="formData['sczl_bh' + (index + 6)]" :id="'bh' + (index + 6)" @keydown="ent($event, (index + 6).toString())" />
  191. <el-input style="width: 100px; margin-right: 5px; color: red;" :readonly="true" :value="formData['sczl_bh' + (index + 6) + '_name']" :id="'name' + (index + 6)" @keydown="ent1($event)"/>
  192. <el-input style="width: 100px; margin-right: 5px;" :value="formData['sczl_cl' + (index + 6)]" :id="'cl' + (index + 6)" @keydown="ent1($event)"/>
  193. <el-input style="width: 100px;" :value="formData['sczl_fp' + (index + 6)]" :id="'fp' + (index + 6)" @keydown="ent1($event)"/>
  194. </div>
  195. </div>
  196. </el-row>
  197. <el-row :gutter="24">
  198. <el-col :span="24">
  199. <el-form-item label="其他备注" prop="id" class="mab">
  200. <el-input v-model="formData.sczl_desc" id="其他备注" @keydown="ent1($event)" />
  201. </el-form-item>
  202. </el-col>
  203. </el-row>
  204. </el-form>
  205. <el-dialog v-model="BzVisible" title="选择" destroy-on-close width="200px" @keydown="selectBZ($event)">
  206. <el-table tooltip-effect="dark" :data="selectDataBz" row-key="ID"
  207. highlight-current-row="true" border style="width:100%"
  208. @row-dblclick="SelectClickBz" @row-click="SelectClick" ref="table"
  209. >
  210. <el-table-column prop="sczl_bzdh" label="班组" width="150"/>
  211. </el-table>
  212. </el-dialog>
  213. <el-dialog v-model="dialogSelectVisible" title="选择"
  214. destroy-on-close width="800px" @keydown="selectGX($event)">
  215. <el-table tooltip-effect="dark" :data="selectData" row-key="ID"
  216. highlight-current-row="true" border style="width:100%"
  217. @row-dblclick="handleSelectClick" ref="table2" >
  218. <el-table-column prop="Gd_cpmc" label="印件名称" width="450" />
  219. <el-table-column prop="jyGx" label="检验工序" width="85" />
  220. <el-table-column prop="Gy0_gxmc" label="工序名称" width="225" />
  221. </el-table>
  222. </el-dialog>
  223. <template #footer>
  224. <div class="dialog-footer">
  225. <el-button @click="closeDialog">取 消</el-button>
  226. <el-button type="primary" @click="enterDialog">确 定</el-button>
  227. </div>
  228. </template>
  229. </el-dialog>
  230. <el-dialog
  231. v-model="GetDedhVisible"
  232. title="选择"
  233. destroy-on-close
  234. width="600px"
  235. >
  236. <el-aside width="250px">
  237. <div class="JKWTree-tree">
  238. <el-tree :data="GetDedhtreeData" :props="defaultProps" highlight-current="true"
  239. @node-click="GetDedhhandleNodeClick" @node-dblclick="handleNodeDoubleClick"></el-tree>
  240. </div>
  241. </el-aside>
  242. </el-dialog>
  243. <el-dialog v-model="LbVisible" title="选择" destroy-on-close width="200px" @keydown="selectJY($event)" >
  244. <el-table tooltip-effect="dark" :data="selectDataLb" row-key="ID"
  245. highlight-current-row="true" border style="width:100%"
  246. :row-style="{ height: '30px' }"
  247. @row-dblclick="SelectClickLb"
  248. ref="table3"
  249. >
  250. <el-table-column prop="sczl_检验类别" label="可选名称" width="150" />
  251. </el-table>
  252. </el-dialog>
  253. </el-main>
  254. </el-container>
  255. </el-container>
  256. </div>
  257. </template>
  258. <script setup>
  259. import {
  260. getDateList,
  261. getInspectCount,
  262. shougonglocate,
  263. shougonggetInfo,
  264. shougonggetGxMc,
  265. shougonggetDedh,
  266. shougonggetScrapFactor,
  267. shougongedit,
  268. shougongdel,
  269. getYg,
  270. getInspectCountByGdbh,
  271. inspectadd
  272. } from '@/api/jixiaoguanli/jitairibaobiao'
  273. // 全量引入格式化工具 请按需保留
  274. import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
  275. import { ElMessage, ElMessageBox } from 'element-plus'
  276. import { Search, Refresh, Download } from '@element-plus/icons-vue'
  277. import { ref, reactive, nextTick, onMounted, onBeforeMount } from 'vue'
  278. import { getPackingSideTable, getPackingTable } from '@/api/mes_api_gty/myapi'
  279. import { Layout, LayoutContent, LayoutHeader, LayoutSider } from '@arco-design/web-vue'
  280. import { useUserStore } from '@/pinia/modules/user'
  281. const userStore = useUserStore()
  282. const sys_id='['+userStore.userInfo.userName+'/'+userStore.userInfo.nickName+']'
  283. defineOptions({
  284. name: '06-packingDocuments'
  285. })
  286. // 侧边栏数据请求
  287. const treeData = reactive([]);
  288. const getTabdata = async () => {
  289. //接口调用函数
  290. const response = await getInspectCount();
  291. const transformedData = response.data.map(item => ({
  292. label: `${item.date.replace(/-/g, '.')}【单据数: ${item.counts}张】`,
  293. children: item.sys.map(sysItem => ({
  294. label: `${sysItem.sys_id} 【记录数: ${sysItem.count}张】`,
  295. params: {
  296. date: item.date.replace(/-/g, '.'),
  297. sys_id: sysItem.sys_id,
  298. total: sysItem.count,
  299. },
  300. })),
  301. }));
  302. treeData.splice(0, treeData.length, ...transformedData);
  303. displayMod.value = 'date'
  304. }
  305. getTabdata();
  306. // 自动化生成的字典(可能为空)以及字段
  307. const formData = ref({
  308. sczl_rq: '',
  309. sczl_bzdh: '',
  310. sczl_bh0: '',
  311. sczl_bh0_name: '',
  312. sczl_cl0: '',
  313. sczl_fp0: '',
  314. sczl_gdbh: '',
  315. sczl_yjgx: '',
  316. sczl_gxmc: '',
  317. yj_yjmc: '',
  318. sczl_cl: '',
  319. sczl_dedh: '',
  320. sczl_检验类别: '',
  321. sczl_废品率系数: '',
  322. sczl_jsss: '',
  323. sczl_冲定额: '',
  324. 流程单号1: '',
  325. 流程单号2: '',
  326. 流程单号3: '',
  327. 流程单号4: '',
  328. 流程单号5: '',
  329. 流程单号6: '',
  330. 流程单号7: '',
  331. 流程单号8: '',
  332. 流程单号9: '',
  333. qczl_NumDesc: '',
  334. sczl_desc: '',
  335. sczl_bh1: '',
  336. sczl_bh2: '',
  337. sczl_bh3:'',
  338. sczl_bh4: '',
  339. sczl_bh5: '',
  340. sczl_bh6: '',
  341. sczl_bh7: '',
  342. sczl_bh8: '',
  343. sczl_bh9: '',
  344. sczl_bh10: '',
  345. sczl_bh11: '',
  346. sczl_bh12: '',
  347. sczl_bh1_name: '',
  348. sczl_bh2_name: '',
  349. sczl_bh3_name: '',
  350. sczl_bh4_name: '',
  351. sczl_bh5_name: '',
  352. sczl_bh6_name: '',
  353. sczl_bh7_name: '',
  354. sczl_bh8_name: '',
  355. sczl_bh9_name: '',
  356. sczl_bh10_name: '',
  357. sczl_bh11_name: '',
  358. sczl_bh12_name: '',
  359. sczl_cl1: '',
  360. sczl_cl2: '',
  361. sczl_cl3: '',
  362. sczl_cl4: '',
  363. sczl_cl5: '',
  364. sczl_cl6: '',
  365. sczl_cl7: '',
  366. sczl_cl8: '',
  367. sczl_cl9: '',
  368. sczl_cl10: '',
  369. sczl_cl11:'',
  370. sczl_cl12: '',
  371. sczl_fp1: '',
  372. sczl_fp2: '',
  373. sczl_fp3: '',
  374. sczl_fp4: '',
  375. sczl_fp5: '',
  376. sczl_fp6: '',
  377. sczl_fp7: '',
  378. sczl_fp8: '',
  379. sczl_fp9: '',
  380. sczl_fp10: '',
  381. sczl_fp11: '',
  382. sczl_fp12: '',
  383. })
  384. const initFormData = () => {
  385. formData.value = {
  386. sczl_rq: '',
  387. sczl_bzdh: '',
  388. sczl_bh0: '',
  389. sczl_bh0_name: '',
  390. sczl_cl0: '0.00',
  391. sczl_fp0: '0',
  392. sczl_gdbh: '',
  393. sczl_yjgx: '',
  394. sczl_gxmc: '',
  395. yj_yjmc: '',
  396. sczl_cl: '0',
  397. sczl_dedh: '',
  398. sczl_检验类别: '',
  399. sczl_废品率系数: '0.000',
  400. sczl_jsss: '0.00',
  401. sczl_冲定额: '',
  402. 流程单号1: '',
  403. 流程单号2: '',
  404. 流程单号3: '',
  405. 流程单号4: '',
  406. 流程单号5: '',
  407. 流程单号6: '',
  408. 流程单号7: '',
  409. 流程单号8: '',
  410. 流程单号9: '',
  411. qczl_NumDesc: '',
  412. sczl_desc: '',
  413. sczl_bh1: '',
  414. sczl_bh2: '',
  415. sczl_bh3:'',
  416. sczl_bh4: '',
  417. sczl_bh5: '',
  418. sczl_bh6: '',
  419. sczl_bh7: '',
  420. sczl_bh8: '',
  421. sczl_bh9: '',
  422. sczl_bh10: '',
  423. sczl_bh11: '',
  424. sczl_bh12: '',
  425. sczl_bh1_name: '',
  426. sczl_bh2_name: '',
  427. sczl_bh3_name: '',
  428. sczl_bh4_name: '',
  429. sczl_bh5_name: '',
  430. sczl_bh6_name: '',
  431. sczl_bh7_name: '',
  432. sczl_bh8_name: '',
  433. sczl_bh9_name: '',
  434. sczl_bh10_name: '',
  435. sczl_bh11_name: '',
  436. sczl_bh12_name: '',
  437. sczl_cl1: '0',
  438. sczl_cl2: '0',
  439. sczl_cl3: '0',
  440. sczl_cl4: '0',
  441. sczl_cl5: '0',
  442. sczl_cl6: '0',
  443. sczl_cl7: '0',
  444. sczl_cl8: '0',
  445. sczl_cl9: '0',
  446. sczl_cl10: '0',
  447. sczl_cl11:'0',
  448. sczl_cl12: '0',
  449. sczl_fp1: '0',
  450. sczl_fp2: '0',
  451. sczl_fp3: '0',
  452. sczl_fp4: '0',
  453. sczl_fp5: '0',
  454. sczl_fp6: '0',
  455. sczl_fp7: '0',
  456. sczl_fp8: '0',
  457. sczl_fp9: '0',
  458. sczl_fp10: '0',
  459. sczl_fp11: '0',
  460. sczl_fp12: '0',
  461. };
  462. }
  463. // 验证规则
  464. const rule = reactive({
  465. })
  466. const elFormRef = ref()
  467. const elSearchFormRef = ref()
  468. // =========== 表格控制部分 ===========
  469. const tableData = reactive([])
  470. const detailData = reactive([])
  471. const total = ref(0)
  472. const page = ref(1)
  473. const limit = ref(10)
  474. const searchInfo = ref('')
  475. const params = {
  476. type: '',
  477. date: '',
  478. sys_id: '',
  479. gdbh: '',
  480. }
  481. // 分页设置
  482. const handleSizeChange = (val) => {
  483. switch (params.type) {
  484. case 'getTableData':
  485. getTableData()
  486. break
  487. case 'getLocateTable':
  488. GetLocate()
  489. break
  490. default:
  491. break
  492. }
  493. }
  494. // 页面跳转
  495. const handleCurrentChange = (val) => {
  496. switch (params.type) {
  497. case 'getTableData':
  498. getTableData()
  499. break
  500. case 'getLocateTable':
  501. GetLocate()
  502. break
  503. default:
  504. break
  505. }
  506. console.log(params.type)
  507. }
  508. const getTableData = async() => {
  509. // const response = await getDateList(params);
  510. // console.log(response)
  511. // if (response.code === 0) {
  512. // const processedData = response.data.data.map(item => {
  513. // return {
  514. // ...item,
  515. // combinedProp: item.sczl_gdbh + '--'+item.yj_yjmc,
  516. // combinedProp2: item.sczl_yjgx + '-'+item.sczl_gxmc
  517. // };
  518. // });
  519. // tableData.splice(0, tableData.length, ...processedData);
  520. // }
  521. const response = await getDateList({
  522. date: params.date, sys_id: params.sys_id,
  523. page: page.value.toString(), limit: limit.value.toString(),
  524. })
  525. if (response.code === 0) {
  526. const processedData = response.data.data.map(item => {
  527. return {
  528. ...item,
  529. combinedProp: item.sczl_gdbh + '--'+item.yj_yjmc,
  530. combinedProp2: item.sczl_yjgx + '-'+item.sczl_gxmc
  531. };
  532. });
  533. tableData.splice(0, tableData.length, ...processedData);
  534. }
  535. }
  536. const handleNodeClick = (node,check) => {
  537. //存放当前节点的nodeId
  538. if (node.params) {
  539. params.date = node.params.date.replace(/\./g, '-');
  540. params.sys_id = node.params.sys_id;
  541. params.type = 'getTableData'
  542. total.value = node.params.total;
  543. page.value = 1
  544. getTableData();
  545. }
  546. }
  547. //定位
  548. const GetLocate = async () => {
  549. const response = await shougonglocate({
  550. gdbh: params.gdbh,
  551. page: page.value.toString(), limit: limit.value.toString(),
  552. })
  553. if (response.code === 0) {
  554. const processedData = response.data.rows.map(item => {
  555. return {
  556. ...item,
  557. combinedProp: item.sczl_gdbh + '--'+item.yj_yjmc,
  558. combinedProp2: item.sczl_yjgx + '-'+item.sczl_gxmc
  559. };
  560. });
  561. total.value = response.data.total
  562. tableData.splice(0, tableData.length, ...processedData);
  563. }
  564. }
  565. let positionvalue=ref()
  566. // 搜索
  567. function onSearch() {
  568. params.gdbh = positionvalue.value
  569. params.type = 'getLocateTable'
  570. page.value = 1
  571. GetLocate()
  572. }
  573. //获取详细信息
  574. const GetInfo = async (value) => {
  575. const response = await shougonggetInfo({UniqId:value});
  576. if (response.code === 0) {
  577. formData.value=response.data;
  578. }
  579. }
  580. //键盘 input框跳转
  581. const ent1 = (event) => {
  582. const inputs = document.getElementsByTagName('input');
  583. const currentIndex = Array.from(inputs).indexOf(event.target);
  584. if (event.keyCode === 13 || event.keyCode === 40) { // Enter 或向下箭头
  585. if(event.target.id=='其他备注'){
  586. ElMessageBox.confirm('数据存盘?', '提示', {
  587. confirmButtonText: '确定',
  588. cancelButtonText: '取消',
  589. type: 'warning'
  590. }).then(() => {
  591. enterDialog()
  592. })
  593. }
  594. for (let i = currentIndex + 1; i < inputs.length; i++) {
  595. if (!inputs[i].readOnly) {
  596. nextTick(()=>{
  597. inputs[i].focus();
  598. inputs[i].select();
  599. })
  600. break;
  601. }
  602. }
  603. if(event.target.id.substring(0, 2)=='cl' || event.target.id.substring(0, 2)=='fp'){
  604. ent_sum()
  605. }
  606. } else if (event.keyCode === 38) { // 向上箭头
  607. for (let i = currentIndex - 1; i >= 0; i--) {
  608. if (!inputs[i].readOnly) {
  609. nextTick(()=>{
  610. inputs[i].focus();
  611. inputs[i].select();
  612. })
  613. break;
  614. }
  615. }
  616. if(event.target.id.substring(0, 2)=='cl' || event.target.id.substring(0, 2)=='fp'){
  617. ent_sum()
  618. }
  619. } else if (event.keyCode === 8) { // 删除箭头
  620. if (event.target.selectionStart === 0) {
  621. for (let i = currentIndex - 1; i >= 0; i--) {
  622. if (!inputs[i].readOnly) {
  623. nextTick(()=>{
  624. inputs[i].focus();
  625. inputs[i].setSelectionRange(0, 0);
  626. })
  627. break;
  628. }
  629. }
  630. if(event.target.id.substring(0, 2)=='cl' || event.target.id.substring(0, 2)=='fp'){
  631. ent_sum()
  632. }
  633. }
  634. } else if (event.keyCode === 37) { // 向左箭头
  635. if (event.target.selectionStart === 0) {
  636. for (let i = currentIndex - 1; i >= 0; i--) {
  637. if (!inputs[i].readOnly) {
  638. nextTick(()=>{
  639. inputs[i].focus();
  640. inputs[i].select();
  641. })
  642. break;
  643. }
  644. }
  645. if(event.target.id.substring(0, 2)=='cl' || event.target.id.substring(0, 2)=='fp'){
  646. ent_sum()
  647. }
  648. }
  649. } else if (event.keyCode === 39) { // 向右箭头
  650. if(event.target.id=='其他备注'){
  651. ElMessageBox.confirm('数据存盘?', '提示', {
  652. confirmButtonText: '确定',
  653. cancelButtonText: '取消',
  654. type: 'warning'
  655. }).then(() => {
  656. enterDialog()
  657. })
  658. }
  659. if (event.target.selectionStart === event.target.value.length) {
  660. for (let i = currentIndex + 1; i < inputs.length; i++) {
  661. if (!inputs[i].readOnly) {
  662. nextTick(()=>{
  663. inputs[i].focus();
  664. inputs[i].select();
  665. })
  666. break;
  667. }
  668. }
  669. }
  670. if(event.target.id.substring(0, 2)=='cl' || event.target.id.substring(0, 2)=='fp'){
  671. ent_sum()
  672. }
  673. }
  674. }
  675. //追加字体颜色和不可输入
  676. const setColorReadonly = (id) => {
  677. const newInput = document.getElementById(id)
  678. newInput.style.color = 'red';
  679. newInput.setAttribute('readonly', true);
  680. }
  681. //追加字体颜色和可输入
  682. const unsetColorReadonly = (id) => {
  683. const newInput = document.getElementById(id)
  684. newInput.style.color = 'black';
  685. newInput.removeAttribute('readonly');
  686. }
  687. //日期获得焦点事件
  688. const rqHandleFocus = () =>{
  689. if(formData.value.sczl_rq==''){
  690. formData.value.sczl_rq = new Date().toISOString().split('T')[0]
  691. }
  692. }
  693. const num=ref(0)
  694. //班组失去焦点事件
  695. const getBzsubmit = () => {
  696. //弹出选择
  697. const data = [{'sczl_bzdh':'A班'},{'sczl_bzdh':'B班'}]
  698. selectDataBz.splice(0, selectDataBz.length, ...data)
  699. BzVisible.value=true
  700. setCurrent(data[0])
  701. }
  702. const table = ref()
  703. const setCurrent = (row) => {
  704. setTimeout(()=>{
  705. table.value?.setCurrentRow(row)
  706. // SelectClick(row)
  707. // console.log(row)
  708. // console.log(table)
  709. const {sczl_bzdh } = row
  710. formData.value.sczl_bzdh=row.sczl_bzdh
  711. console.log(row)
  712. })
  713. }
  714. //班组选择
  715. const selectDataBz = reactive([])
  716. const BzVisible = ref(false)
  717. const SelectClickBz = (row, column, event) => {
  718. const {sczl_bzdh } = row
  719. formData.value.sczl_bzdh=row.sczl_bzdh
  720. console.log(row)
  721. BzVisible.value = false
  722. // removeEventListener('keyup', keyUp.bind(this));
  723. }
  724. const selectBZ = (event) => {
  725. // console.log(selectDataBz.length);
  726. if (event.keyCode === 40) { // Enter 或向下箭头
  727. setCurrent(selectDataBz[1]);
  728. // console.log(num.value+1)
  729. // if (parseInt(num.value+ 1) > selectDataBz.length||parseInt(num.value+ 1) ===selectDataBz.length) {
  730. // // setCurrent(selectDataBz[0]);
  731. // console.log('123')
  732. // } else {
  733. // // setCurrent(selectDataBz[num.value + 1]);
  734. // console.log("3333")
  735. // }
  736. } else if (event.keyCode === 38) {
  737. setCurrent(selectDataBz[0]);
  738. // if (num.value - 1 < 0) {
  739. // setCurrent(selectDataBz[selectDataBz.length - 1]);
  740. // } else {
  741. // setCurrent(selectDataBz[num.value - 1]);
  742. // }
  743. } else if (event.keyCode === 13) {
  744. BzVisible.value = false
  745. }
  746. }
  747. //员工编号失去焦点事件
  748. const getygsubmit = async (event, inputName) => {
  749. let combinedString = 'sczl_bh' + inputName;
  750. let value = eval('formData.value.' + combinedString);
  751. if(value){
  752. const response = await getYg({sczl_bh:value});
  753. console.log(response)
  754. if (response.code === 0) {
  755. let Bname = 'sczl_bh' + inputName+'_name';
  756. formData.value[Bname]=response.data[0].ygxm;
  757. //设置姓名样式
  758. if(inputName>0){
  759. unsetColorReadonly('cl'+inputName)
  760. unsetColorReadonly('fp'+inputName)
  761. }
  762. }
  763. }
  764. }
  765. const ent_sum = () =>{
  766. let sum = 0;
  767. for(var i=1;i<=12;i++){
  768. sum += formData.value['sczl_cl'+i] * formData.value['sczl_fp'+i]
  769. }
  770. formData.value.sczl_cl = sum
  771. }
  772. //员工编号键盘事件
  773. const ent = (event, inputName) => {
  774. let combinedString = 'sczl_bh' + inputName;
  775. let value = eval('formData.value.' + combinedString);
  776. if (event.keyCode === 13 || event.keyCode === 40) { // Enter 或向下箭头
  777. if(value){
  778. getYg({sczl_bh:value}).then(response => {
  779. if (response.code == 0) {
  780. let Bname = 'sczl_bh' + inputName+'_name';
  781. let Bbh = 'sczl_bh' + inputName;
  782. formData.value[Bname]=response.data[0].ygxm;
  783. formData.value[Bbh]=response.data[0].员工编号;
  784. //设置姓名样式
  785. unsetColorReadonly('cl'+inputName)
  786. unsetColorReadonly('fp'+inputName)
  787. document.getElementById('cl'+inputName).focus()
  788. document.getElementById('cl'+inputName).select()
  789. }else{
  790. formData.value['sczl_bh' + inputName+'_name']='';
  791. formData.value['sczl_cl' + inputName]='0';
  792. formData.value['sczl_fp' + inputName]='0';
  793. //设置姓名样式
  794. setColorReadonly('cl'+inputName);
  795. setColorReadonly('fp'+inputName);
  796. if(inputName!=12){
  797. document.getElementById('bh'+(parseInt(inputName)+1)).focus()
  798. document.getElementById('bh'+(parseInt(inputName)+1)).select()
  799. }else{
  800. document.getElementById('其他备注').focus()
  801. document.getElementById('其他备注').select()
  802. }
  803. }
  804. });
  805. }else{
  806. formData.value['sczl_bh' + inputName+'_name']='';
  807. formData.value['sczl_cl' + inputName]='0';
  808. formData.value['sczl_fp' + inputName]='0';
  809. //设置姓名样式
  810. setColorReadonly('cl'+inputName);
  811. setColorReadonly('fp'+inputName);
  812. if(inputName!=12){
  813. document.getElementById('bh'+(parseInt(inputName)+1)).focus()
  814. document.getElementById('bh'+(parseInt(inputName)+1)).select()
  815. }else{
  816. document.getElementById('其他备注').focus()
  817. document.getElementById('其他备注').select()
  818. }
  819. }
  820. ent_sum()
  821. } else if (event.keyCode === 38) { // 向上箭头
  822. if(value){
  823. getYg({sczl_bh:value}).then(response => {
  824. if (response.code == 0) {
  825. let Bname = 'sczl_bh' + inputName+'_name';
  826. formData.value[Bname]=response.data[0].ygxm;
  827. //设置姓名样式
  828. unsetColorReadonly('cl'+inputName)
  829. unsetColorReadonly('fp'+inputName)
  830. if(inputName!=1){
  831. if(document.getElementById('fp'+(parseInt(inputName)-1)).readOnly){
  832. document.getElementById('bh'+(parseInt(inputName)-1)).focus()
  833. document.getElementById('bh'+(parseInt(inputName)-1)).select()
  834. }else{
  835. document.getElementById('fp'+(parseInt(inputName)-1)).focus()
  836. document.getElementById('fp'+(parseInt(inputName)-1)).select()
  837. }
  838. }else{
  839. document.getElementById('备注').focus()
  840. document.getElementById('备注').select()
  841. }
  842. }else{
  843. formData.value['sczl_bh' + inputName+'_name']='';
  844. formData.value['sczl_cl' + inputName]='0';
  845. formData.value['sczl_fp' + inputName]='0';
  846. //设置姓名样式
  847. setColorReadonly('cl'+inputName);
  848. setColorReadonly('fp'+inputName);
  849. if(inputName!=1){
  850. if(document.getElementById('fp'+(parseInt(inputName)-1)).readOnly){
  851. document.getElementById('bh'+(parseInt(inputName)-1)).focus()
  852. document.getElementById('bh'+(parseInt(inputName)-1)).select()
  853. }else{
  854. document.getElementById('fp'+(parseInt(inputName)-1)).focus()
  855. document.getElementById('fp'+(parseInt(inputName)-1)).select()
  856. }
  857. }else{
  858. document.getElementById('备注').focus()
  859. document.getElementById('备注').select()
  860. }
  861. }
  862. });
  863. }else{
  864. formData.value['sczl_bh' + inputName+'_name']='';
  865. formData.value['sczl_cl' + inputName]='0';
  866. formData.value['sczl_fp' + inputName]='0';
  867. //设置姓名样式
  868. setColorReadonly('cl'+inputName);
  869. setColorReadonly('fp'+inputName);
  870. if(inputName!=1){
  871. if(document.getElementById('fp'+(parseInt(inputName)-1)).readOnly){
  872. document.getElementById('bh'+(parseInt(inputName)-1)).focus()
  873. document.getElementById('bh'+(parseInt(inputName)-1)).select()
  874. }else{
  875. document.getElementById('fp'+(parseInt(inputName)-1)).focus()
  876. document.getElementById('fp'+(parseInt(inputName)-1)).select()
  877. }
  878. }else{
  879. document.getElementById('备注').focus()
  880. document.getElementById('备注').select()
  881. }
  882. }
  883. ent_sum()
  884. } else if (event.keyCode === 8) { // 删除箭头
  885. if (event.target.selectionStart === 0) {
  886. if(value){
  887. getYg({sczl_bh:value}).then(response => {
  888. if (response.code == 0) {
  889. let Bname = 'sczl_bh' + inputName+'_name';
  890. formData.value[Bname]=response.data[0].ygxm;
  891. //设置姓名样式
  892. unsetColorReadonly('cl'+inputName)
  893. unsetColorReadonly('fp'+inputName)
  894. if(inputName!=1){
  895. if(document.getElementById('fp'+(parseInt(inputName)-1)).readOnly){
  896. document.getElementById('bh'+(parseInt(inputName)-1)).focus()
  897. document.getElementById('bh'+(parseInt(inputName)-1)).setSelectionRange(0, 0)
  898. }else{
  899. document.getElementById('fp'+(parseInt(inputName)-1)).focus()
  900. document.getElementById('fp'+(parseInt(inputName)-1)).setSelectionRange(0, 0)
  901. }
  902. }else{
  903. document.getElementById('备注').focus()
  904. document.getElementById('备注').setSelectionRange(0, 0)
  905. }
  906. }else{
  907. formData.value['sczl_bh' + inputName+'_name']='';
  908. formData.value['sczl_cl' + inputName]='0';
  909. formData.value['sczl_fp' + inputName]='0';
  910. //设置姓名样式
  911. setColorReadonly('cl'+inputName);
  912. setColorReadonly('fp'+inputName);
  913. if(inputName!=1){
  914. if(document.getElementById('fp'+(parseInt(inputName)-1)).readOnly){
  915. document.getElementById('bh'+(parseInt(inputName)-1)).focus()
  916. document.getElementById('bh'+(parseInt(inputName)-1)).setSelectionRange(0, 0)
  917. }else{
  918. document.getElementById('fp'+(parseInt(inputName)-1)).focus()
  919. document.getElementById('fp'+(parseInt(inputName)-1)).setSelectionRange(0, 0)
  920. }
  921. }else{
  922. document.getElementById('备注').focus()
  923. document.getElementById('备注').setSelectionRange(0, 0)
  924. }
  925. }
  926. });
  927. }else{
  928. formData.value['sczl_bh' + inputName+'_name']='';
  929. formData.value['sczl_cl' + inputName]='0';
  930. formData.value['sczl_fp' + inputName]='0';
  931. //设置姓名样式
  932. setColorReadonly('cl'+inputName);
  933. setColorReadonly('fp'+inputName);
  934. if(inputName!=1){
  935. if(document.getElementById('fp'+(parseInt(inputName)-1)).readOnly){
  936. document.getElementById('bh'+(parseInt(inputName)-1)).focus()
  937. document.getElementById('bh'+(parseInt(inputName)-1)).setSelectionRange(0, 0)
  938. }else{
  939. document.getElementById('fp'+(parseInt(inputName)-1)).focus()
  940. document.getElementById('fp'+(parseInt(inputName)-1)).setSelectionRange(0, 0)
  941. }
  942. }else{
  943. document.getElementById('备注').focus()
  944. document.getElementById('备注').setSelectionRange(0, 0)
  945. }
  946. }
  947. ent_sum()
  948. }
  949. } else if (event.keyCode === 37) { // 向左箭头
  950. if (event.target.selectionStart === 0) {
  951. if(value){
  952. getYg({sczl_bh:value}).then(response => {
  953. if (response.code == 0) {
  954. let Bname = 'sczl_bh' + inputName+'_name';
  955. formData.value[Bname]=response.data[0].ygxm;
  956. //设置姓名样式
  957. unsetColorReadonly('cl'+inputName)
  958. unsetColorReadonly('fp'+inputName)
  959. if(inputName!=1){
  960. if(document.getElementById('fp'+(parseInt(inputName)-1)).readOnly){
  961. document.getElementById('bh'+(parseInt(inputName)-1)).focus()
  962. document.getElementById('bh'+(parseInt(inputName)-1)).select()
  963. }else{
  964. document.getElementById('fp'+(parseInt(inputName)-1)).focus()
  965. document.getElementById('fp'+(parseInt(inputName)-1)).select()
  966. }
  967. }else{
  968. document.getElementById('备注').focus()
  969. document.getElementById('备注').select()
  970. }
  971. }else{
  972. formData.value['sczl_bh' + inputName+'_name']='';
  973. formData.value['sczl_cl' + inputName]='0';
  974. formData.value['sczl_fp' + inputName]='0';
  975. //设置姓名样式
  976. setColorReadonly('cl'+inputName);
  977. setColorReadonly('fp'+inputName);
  978. if(inputName!=1){
  979. if(document.getElementById('fp'+(parseInt(inputName)-1)).readOnly){
  980. document.getElementById('bh'+(parseInt(inputName)-1)).focus()
  981. document.getElementById('bh'+(parseInt(inputName)-1)).select()
  982. }else{
  983. document.getElementById('fp'+(parseInt(inputName)-1)).focus()
  984. document.getElementById('fp'+(parseInt(inputName)-1)).select()
  985. }
  986. }else{
  987. document.getElementById('备注').focus()
  988. document.getElementById('备注').select()
  989. }
  990. }
  991. });
  992. }else{
  993. formData.value['sczl_bh' + inputName+'_name']='';
  994. formData.value['sczl_cl' + inputName]='0';
  995. formData.value['sczl_fp' + inputName]='0';
  996. //设置姓名样式
  997. setColorReadonly('cl'+inputName);
  998. setColorReadonly('fp'+inputName);
  999. if(inputName!=1){
  1000. if(document.getElementById('fp'+(parseInt(inputName)-1)).readOnly){
  1001. document.getElementById('bh'+(parseInt(inputName)-1)).focus()
  1002. document.getElementById('bh'+(parseInt(inputName)-1)).select()
  1003. }else{
  1004. document.getElementById('fp'+(parseInt(inputName)-1)).focus()
  1005. document.getElementById('fp'+(parseInt(inputName)-1)).select()
  1006. }
  1007. }else{
  1008. document.getElementById('备注').focus()
  1009. document.getElementById('备注').select()
  1010. }
  1011. }
  1012. ent_sum()
  1013. }
  1014. } else if (event.keyCode === 39) { // 向右箭头
  1015. if (event.target.selectionStart === event.target.value.length) {
  1016. if(value){
  1017. getYg({sczl_bh:value}).then(response => {
  1018. if (response.code == 0) {
  1019. let Bname = 'sczl_bh' + inputName+'_name';
  1020. formData.value[Bname]=response.data[0].ygxm;
  1021. //设置姓名样式
  1022. unsetColorReadonly('cl'+inputName)
  1023. unsetColorReadonly('fp'+inputName)
  1024. document.getElementById('cl'+inputName).focus()
  1025. document.getElementById('cl'+inputName).select()
  1026. }else{
  1027. formData.value['sczl_bh' + inputName+'_name']='';
  1028. formData.value['sczl_cl' + inputName]='0';
  1029. formData.value['sczl_fp' + inputName]='0';
  1030. //设置姓名样式
  1031. setColorReadonly('cl'+inputName);
  1032. setColorReadonly('fp'+inputName);
  1033. if(inputName!=12){
  1034. document.getElementById('bh'+(parseInt(inputName)+1)).focus()
  1035. document.getElementById('bh'+(parseInt(inputName)+1)).select()
  1036. }else{
  1037. document.getElementById('其他备注').focus()
  1038. document.getElementById('其他备注').select()
  1039. }
  1040. }
  1041. });
  1042. }else{
  1043. formData.value['sczl_bh' + inputName+'_name']='';
  1044. formData.value['sczl_cl' + inputName]='0';
  1045. formData.value['sczl_fp' + inputName]='0';
  1046. //设置姓名样式
  1047. setColorReadonly('cl'+inputName);
  1048. setColorReadonly('fp'+inputName);
  1049. if(inputName!=12){
  1050. document.getElementById('bh'+(parseInt(inputName)+1)).focus()
  1051. document.getElementById('bh'+(parseInt(inputName)+1)).select()
  1052. }else{
  1053. document.getElementById('其他备注').focus()
  1054. document.getElementById('其他备注').select()
  1055. }
  1056. }
  1057. ent_sum()
  1058. }
  1059. }
  1060. }
  1061. const getGxMcsubmit = async() => {
  1062. if(formData.value.sczl_gdbh!=''){
  1063. const response = await shougonggetGxMc({gdbh:formData.value.sczl_gdbh});
  1064. if (response.code === 0) {
  1065. if(response.data.length==0){
  1066. ElMessage({
  1067. type: 'error',
  1068. message: '查无此编号的工单,请仔细检查后重新输入'
  1069. })
  1070. //设置输入框的值为空
  1071. formData.value.sczl_gdbh = ''
  1072. formData.value.sczl_yjgx = ''
  1073. formData.value.sczl_gxmc = ''
  1074. formData.value.yj_yjmc = ''
  1075. }else if(response.data.length==1){
  1076. const { Gd_cpmc, Gy0_yjno, Gy0_gxh, Gy0_gxmc,jyGx} = response.data[0]
  1077. formData.value.yj_yjmc=Gd_cpmc
  1078. formData.value.sczl_gxmc=Gy0_gxmc
  1079. formData.value.sczl_yjgx=jyGx
  1080. setColorReadonly('yjgx');
  1081. setColorReadonly('gxmc');
  1082. setColorReadonly('yjmc');
  1083. }else{
  1084. if(GetDedhVisible.value){
  1085. return false
  1086. }
  1087. selectData.splice(0, selectData.length, ...response.data)
  1088. dialogSelectVisible.value=true
  1089. setGXCurrent(selectData[0])
  1090. }
  1091. }
  1092. }else{
  1093. ElMessage({
  1094. type: 'error',
  1095. message: '请注意, 工单编号输入空置, 除非有特殊需要!'
  1096. })
  1097. formData.value.sczl_yjgx = ''
  1098. formData.value.sczl_gxmc = ''
  1099. formData.value.yj_yjmc = ''
  1100. }
  1101. }
  1102. const dialogSelectVisible = ref(false)
  1103. const selectData = reactive([])
  1104. // 工单选择框
  1105. const handleSelectClick = (row, column, event) => {
  1106. const { Gd_cpmc, Gy0_yjno, Gy0_gxh, Gy0_gxmc,jyGx } = row
  1107. formData.value.yj_yjmc=Gd_cpmc
  1108. formData.value.sczl_gxmc=Gy0_gxmc
  1109. formData.value.sczl_yjgx=jyGx
  1110. setColorReadonly('yjgx');
  1111. setColorReadonly('gxmc');
  1112. setColorReadonly('yjmc');
  1113. dialogSelectVisible.value = false
  1114. }
  1115. const currentIndex = ref(0);
  1116. const GXCurrent = ref(0);
  1117. const selectGX = (event) => {
  1118. if (event.keyCode === 40) { // 向下箭头
  1119. if (currentIndex.value < selectData.length - 1) {
  1120. currentIndex.value++;
  1121. setGXCurrent(selectData[currentIndex.value]);
  1122. } else {
  1123. currentIndex.value = 0;
  1124. setGXCurrent(selectData[currentIndex.value]); // 到达最后一行时回到第一行
  1125. }
  1126. } else if (event.keyCode === 38) { // 向上箭头
  1127. if (currentIndex.value > 0) {
  1128. currentIndex.value--;
  1129. setGXCurrent(selectData[currentIndex.value]);
  1130. } else {
  1131. currentIndex.value = selectData.length - 1;
  1132. setGXCurrent(selectData[currentIndex.value]); // 到达第一行时回到最后一行
  1133. }
  1134. } else if (event.keyCode === 13) { // 回车键
  1135. dialogSelectVisible.value = false;
  1136. }
  1137. }
  1138. const table2 = ref()
  1139. const setGXCurrent = (row) => {
  1140. setTimeout(()=>{
  1141. table2.value?.setCurrentRow(row)
  1142. const { Gd_cpmc, Gy0_yjno, Gy0_gxh, Gy0_gxmc,jyGx } = row
  1143. formData.value.yj_yjmc=Gd_cpmc
  1144. formData.value.sczl_gxmc=Gy0_gxmc
  1145. formData.value.sczl_yjgx=jyGx
  1146. })
  1147. }
  1148. //定额代号回车事件
  1149. const getDedhsubmit = () => {
  1150. if(dialogSelectVisible.value){
  1151. return false
  1152. }
  1153. if(LbVisible.value){
  1154. return false
  1155. }
  1156. GetDedh()
  1157. }
  1158. let GetDedhtreeData = reactive([]);
  1159. const GetDedhVisible = ref(false)
  1160. //获取定额代号
  1161. const GetDedh = async (value) => {
  1162. const response = await shougonggetDedh();
  1163. const treeData = {};
  1164. // const data = [];
  1165. // data[0] = response.data;
  1166. // //判断值是否在选项中存在
  1167. // const buildTree1 = (node) => {
  1168. // const arr = [];
  1169. // // 如果存在子节点,递归地添加它们
  1170. // if (node.bh_mc && Array.isArray(node.bh_mc)) {
  1171. // node.bh_mc.forEach(childNode => {
  1172. // arr.push(...buildTree1(childNode)); // 递归调用
  1173. // });
  1174. // }else{
  1175. // arr.push(node.sys_bh)
  1176. // }
  1177. // return arr;
  1178. // };
  1179. // // 构建树形结构的根节点
  1180. // const Data = data.map(buildTree1);
  1181. if(response.code==0){
  1182. const data = [];
  1183. data[0] = response.data;
  1184. // 递归函数来构建树形结构
  1185. const buildTree = (node) => {
  1186. const treeNode = {
  1187. label: node.sys_bh + '【' + node.sys_mc+'】',
  1188. children: []
  1189. };
  1190. // 如果存在子节点,递归地添加它们
  1191. if (node.bh_mc && Array.isArray(node.bh_mc)) {
  1192. node.bh_mc.forEach(childNode => {
  1193. treeNode.children.push(buildTree(childNode)); // 递归调用
  1194. });
  1195. }
  1196. return treeNode;
  1197. };
  1198. // 构建树形结构的根节点
  1199. const treeData = data.map(buildTree);
  1200. GetDedhtreeData = treeData;
  1201. GetDedhVisible.value=true
  1202. }
  1203. }
  1204. //定额代号树形结构单机
  1205. const GetDedhhandleNodeClick = (nodeData, node, component) => {
  1206. //存放当前节点的nodeId
  1207. if (!nodeData.children || nodeData.children.length === 0) {
  1208. // 点击的是子节点
  1209. formData.value.sczl_dedh=nodeData.label.split("【")[0]
  1210. GetDedhVisible.value=false
  1211. }
  1212. // 执行相应的父节点单击事件处理逻辑
  1213. }
  1214. //检验类别失去焦点事件
  1215. const getLbsubmit = () => {
  1216. if(GetDedhVisible.value){
  1217. return false
  1218. }
  1219. //弹出选择
  1220. const data = [{'sczl_检验类别':''},{'sczl_检验类别':'正品板'},{'sczl_检验类别':'次品板'},{'sczl_检验类别':'废品板'}]
  1221. selectDataLb.splice(0, selectDataLb.length, ...data)
  1222. setJYCurrent(selectDataLb[0])
  1223. LbVisible.value=true
  1224. }
  1225. //检验类别选择
  1226. const selectDataLb = reactive([])
  1227. const LbVisible = ref(false)
  1228. const SelectClickLb = (row, column, event) => {
  1229. const {sczl_检验类别 } = row
  1230. formData.value.sczl_检验类别=row.sczl_检验类别
  1231. //查询废品系数
  1232. if(row.sczl_检验类别!=''){
  1233. var value = {
  1234. 'gdbh':formData.value.sczl_gdbh,
  1235. 'yjno':parseInt(formData.value.sczl_yjgx.split('-')[0]),
  1236. 'gxh':parseInt(formData.value.sczl_yjgx.split('-')[1]),
  1237. 'type':formData.value.sczl_检验类别
  1238. }
  1239. shougonggetScrapFactor(value).then(response=>{
  1240. if(response.code==0){
  1241. if(response.data!=null){
  1242. formData.value.sczl_废品率系数 = response.data.num;
  1243. }
  1244. setColorReadonly('废品率系数')
  1245. }
  1246. });
  1247. }else{
  1248. unsetColorReadonly('废品率系数')
  1249. }
  1250. LbVisible.value = false
  1251. }
  1252. const table3=ref()
  1253. const setJYCurrent = (row) => {
  1254. setTimeout(()=>{
  1255. table3.value?.setCurrentRow(row)
  1256. const {sczl_检验类别 } = row
  1257. formData.value.sczl_检验类别=row.sczl_检验类别
  1258. //查询废品系数
  1259. if(row.sczl_检验类别!=''){
  1260. var value = {
  1261. 'gdbh':formData.value.sczl_gdbh,
  1262. 'yjno':parseInt(formData.value.sczl_yjgx.split('-')[0]),
  1263. 'gxh':parseInt(formData.value.sczl_yjgx.split('-')[1]),
  1264. 'type':formData.value.sczl_检验类别
  1265. }
  1266. shougonggetScrapFactor(value).then(response=>{
  1267. if(response.code==0){
  1268. if(response.data!=null){
  1269. formData.value.sczl_废品率系数 = response.data.num;
  1270. }
  1271. setColorReadonly('废品率系数')
  1272. }
  1273. });
  1274. }else{
  1275. unsetColorReadonly('废品率系数')
  1276. }
  1277. })
  1278. }
  1279. const JYIndex = ref(0);
  1280. const JYCurrent = ref(0);
  1281. const selectJY = (event) => {
  1282. if (event.keyCode === 40) { // 向下箭头
  1283. if (JYIndex.value < selectDataLb.length - 1) {
  1284. JYIndex.value++;
  1285. setJYCurrent(selectDataLb[JYIndex.value]);
  1286. } else {
  1287. JYIndex.value = 0;
  1288. setJYCurrent(selectDataLb[JYIndex.value]); // 到达最后一行时回到第一行
  1289. }
  1290. } else if (event.keyCode === 38) { // 向上箭头
  1291. if (JYIndex.value > 0) {
  1292. JYIndex.value--;
  1293. setJYCurrent(selectDataLb[JYIndex.value]);
  1294. } else {
  1295. JYIndex.value = selectDataLb.length - 1;
  1296. setJYCurrent(selectDataLb[JYIndex.value]); // 到达第一行时回到最后一行
  1297. }
  1298. } else if (event.keyCode === 13) { // 回车键
  1299. LbVisible.value = false
  1300. }
  1301. }
  1302. //刷新废品率系数
  1303. const GetScrapFactor = async (value) => {
  1304. const response = await shougonggetScrapFactor(value);
  1305. if(response.code==0){
  1306. const rowIndex = tableData.findIndex(row => row.UniqId === lastCellValue);
  1307. tableData[rowIndex].sczl_废品率系数 = response.data.num;
  1308. ElMessage({
  1309. type: 'success',
  1310. message: '刷新成功',
  1311. })
  1312. }else{
  1313. ElMessage({
  1314. type: 'error',
  1315. message: '刷新失败',
  1316. })
  1317. }
  1318. // console.log(response)
  1319. // const rowIndex = tableData.findIndex(row => row.UniqId === 123);
  1320. }
  1321. const ADD=ref('0')
  1322. //新增
  1323. function onAdd() {
  1324. ADD.value='新增'
  1325. type.value = 'create'
  1326. if(typeof(lastCellValue)=='number'){
  1327. GetInfo(lastCellValue)
  1328. }
  1329. initFormData()
  1330. dialogFormVisible.value = true
  1331. // Productionadd()
  1332. }
  1333. const ScrapFactor={
  1334. gdbh:'',
  1335. yjno:'',
  1336. gxh:'',
  1337. type:'',
  1338. }
  1339. // 刷新废品率系数
  1340. function onRefresh() {
  1341. if(params.date=='' || ScrapFactor.gdbh==''){
  1342. ElMessage({
  1343. type: 'warning',
  1344. message: '未选中记录',
  1345. })
  1346. return
  1347. }
  1348. if(ScrapFactor.type==''){
  1349. ElMessage({
  1350. type: 'warning',
  1351. message: '该记录检验类别为空',
  1352. })
  1353. return
  1354. }
  1355. GetScrapFactor(ScrapFactor)
  1356. }
  1357. // 更新数据
  1358. const updateDetailData = async() => {
  1359. const restoredData = {
  1360. UniqId: lastCellValue,
  1361. sczl_rq: formData.value.sczl_rq,
  1362. sczl_bzdh: formData.value.sczl_bzdh,
  1363. sczl_bh0: formData.value.sczl_bh0,
  1364. sczl_cl0: formData.value.sczl_cl0,
  1365. sczl_fp0: formData.value.sczl_fp0,
  1366. sczl_gdbh: formData.value.sczl_gdbh,
  1367. sczl_yjgx: formData.value.sczl_yjgx,
  1368. sczl_gxmc: formData.value.sczl_gxmc,
  1369. sczl_cl:formData.value.sczl_cl,
  1370. sczl_dedh: formData.value.sczl_dedh,
  1371. sczl_检验类别: formData.value.sczl_检验类别,
  1372. sczl_废品率系数: formData.value.sczl_废品率系数,
  1373. sczl_jsss: formData.value.sczl_jsss,
  1374. sczl_冲定额: formData.value.sczl_冲定额,
  1375. qczl_Num:formData.value.qczl_NumDesc,
  1376. qczl_NumDesc:formData.value.流程单号1,
  1377. qczl_NumDesc1: formData.value.流程单号2,
  1378. qczl_NumDesc2: formData.value.流程单号3,
  1379. qczl_NumDesc3: formData.value.流程单号4,
  1380. qczl_NumDesc4: formData.value.流程单号5,
  1381. qczl_NumDesc5: formData.value.流程单号6,
  1382. qczl_NumDesc6: formData.value.流程单号7,
  1383. qczl_NumDesc7: formData.value.流程单号8,
  1384. qczl_NumDesc8: formData.value.流程单号9,
  1385. sczl_desc: formData.value.sczl_desc,
  1386. sczl_bh1: formData.value.sczl_bh1,
  1387. sczl_bh2: formData.value.sczl_bh2,
  1388. sczl_bh3:formData.value.sczl_bh3,
  1389. sczl_bh4: formData.value.sczl_bh4,
  1390. sczl_bh5: formData.value.sczl_bh5,
  1391. sczl_bh6: formData.value.sczl_bh6,
  1392. sczl_bh7: formData.value.sczl_bh7,
  1393. sczl_bh8: formData.value.sczl_bh8,
  1394. sczl_bh9: formData.value.sczl_bh9,
  1395. sczl_bh10: formData.value.sczl_bh10,
  1396. sczl_bh11: formData.value.sczl_bh11,
  1397. sczl_bh12: formData.value.sczl_bh12,
  1398. sczl_cl1: formData.value.sczl_cl1,
  1399. sczl_cl2: formData.value.sczl_cl2,
  1400. sczl_cl3: formData.value.sczl_cl3,
  1401. sczl_cl4: formData.value.sczl_cl4,
  1402. sczl_cl5: formData.value.sczl_cl5,
  1403. sczl_cl6: formData.value.sczl_cl6,
  1404. sczl_cl7: formData.value.sczl_cl7,
  1405. sczl_cl8: formData.value.sczl_cl8,
  1406. sczl_cl9: formData.value.sczl_cl9,
  1407. sczl_cl10: formData.value.sczl_cl10,
  1408. sczl_cl11:formData.value.sczl_cl11,
  1409. sczl_cl12: formData.value.sczl_cl12,
  1410. sczl_fp1: formData.value.sczl_fp1,
  1411. sczl_fp2: formData.value.sczl_fp2,
  1412. sczl_fp3: formData.value.sczl_fp3,
  1413. sczl_fp4: formData.value.sczl_fp4,
  1414. sczl_fp5: formData.value.sczl_fp5,
  1415. sczl_fp6: formData.value.sczl_fp6,
  1416. sczl_fp7: formData.value.sczl_fp7,
  1417. sczl_fp8: formData.value.sczl_fp8,
  1418. sczl_fp9: formData.value.sczl_fp9,
  1419. sczl_fp10: formData.value.sczl_fp10,
  1420. sczl_fp11: formData.value.sczl_fp11,
  1421. sczl_fp12: formData.value.sczl_fp12,
  1422. sys_id:sys_id,
  1423. }
  1424. if(ADD.value=='新增'){
  1425. const response = await inspectadd(restoredData);
  1426. // ADD.value='1'
  1427. // console.log(ADD.value)
  1428. ADD.value='0'
  1429. console.log(response)
  1430. if(response.code==0){
  1431. ElMessage({
  1432. type: 'success',
  1433. message: '新增成功',
  1434. })
  1435. //刷新侧边栏
  1436. getTabdata()
  1437. if(params.date != ''){
  1438. //刷新页面
  1439. getTableData()
  1440. }
  1441. dialogFormVisible.value = false
  1442. }
  1443. }else{
  1444. const response = await shougongedit(restoredData);
  1445. if(response.code==0){
  1446. ElMessage({
  1447. type: 'success',
  1448. message: '更新成功',
  1449. })
  1450. }
  1451. dialogFormVisible.value = false
  1452. }
  1453. }
  1454. // 删除
  1455. function onDel() {
  1456. Del()
  1457. }
  1458. //删除
  1459. const Del = () => {
  1460. if(typeof(lastCellValue)=='object'){
  1461. ElMessage({
  1462. type: 'warning',
  1463. message: '未选中记录',
  1464. })
  1465. return
  1466. }
  1467. ElMessageBox.confirm(
  1468. `确认删除这条数据么?`,
  1469. '警告',
  1470. {
  1471. confirmButtonText: '确认',
  1472. cancelButtonText: '取消',
  1473. type: 'warning',
  1474. }
  1475. ).then(async() => {
  1476. const response = await shougongdel({UniqId:lastCellValue});
  1477. if (response.code === 0) {
  1478. ElMessage({
  1479. type: 'success',
  1480. message: '删除成功',
  1481. })
  1482. //刷新侧边栏
  1483. getTabdata()
  1484. //刷新页面
  1485. getTableData()
  1486. }
  1487. })
  1488. }
  1489. const displayMod = ref('')
  1490. // 按工单显示
  1491. function onCountByGdbh() {
  1492. console.log(displayMod.value)
  1493. if (displayMod.value === 'date') {
  1494. displayMod.value = 'gd'
  1495. CountByGdbh()
  1496. console.log(displayMod.value)
  1497. } else {
  1498. getTabdata()
  1499. }
  1500. // CountByGdbh()
  1501. }
  1502. //按工单显示
  1503. const CountByGdbh = async () => {
  1504. const response = await getInspectCountByGdbh();
  1505. // console.log(response)
  1506. if (response.code === 0) {
  1507. console.log(response)
  1508. const transformedData = response.data.map(item => ({
  1509. label: `${item.sczl_gdbh+item.cpmc}`,
  1510. children: item.sys.map(sysItem => ({
  1511. label: `${sysItem.sys_id} 【记录数: ${sysItem.count}张】`,
  1512. params: {
  1513. date: item.sczl_gdbh,
  1514. sys_id: sysItem.sys_id,
  1515. total: sysItem.count,
  1516. },
  1517. })),
  1518. }));
  1519. treeData.splice(0, treeData.length, ...transformedData);
  1520. }
  1521. // getTableData()
  1522. }
  1523. // ============== 表格控制部分结束 ===============
  1524. // 获取需要的字典 可能为空 按需保留
  1525. const setOptions = async () => {
  1526. }
  1527. // 获取需要的字典 可能为空 按需保留
  1528. setOptions()
  1529. // 多选数据
  1530. const multipleSelection = ref([])
  1531. // 多选
  1532. const handleSelectionChange = (val) => {
  1533. if(val.length>0){
  1534. multipleSelection.value = val
  1535. const lenth=val.length
  1536. ScrapFactor.gdbh=val[lenth-1].combinedProp.split('-')[0];
  1537. const parts = val[lenth-1].combinedProp2.split('-')
  1538. ScrapFactor.yjno=parts[0];
  1539. ScrapFactor.gxh=parts[1];
  1540. // ScrapFactor.type=val[lenth-1].sczl_检验类别
  1541. ScrapFactor.type='正品板'
  1542. console.log(ScrapFactor)
  1543. lastCellValue=val[lenth-1].UniqId
  1544. console.log(ScrapFactor)
  1545. val.splice(0, val.length); // 清空 val 数组
  1546. console.log(lastCellValue)
  1547. }
  1548. }
  1549. // 批量删除控制标记
  1550. const deleteVisible = ref(false)
  1551. // 多选删除
  1552. const onDelete = async () => {
  1553. const ids = []
  1554. if (multipleSelection.value.length === 0) {
  1555. ElMessage({
  1556. type: 'warning',
  1557. message: '请选择要删除的数据'
  1558. })
  1559. return
  1560. }
  1561. multipleSelection.value &&
  1562. multipleSelection.value.map(item => {
  1563. ids.push(item.ID)
  1564. })
  1565. const res = await deleteCompanyByIds({ ids })
  1566. if (res.code === 0) {
  1567. ElMessage({
  1568. type: 'success',
  1569. message: '删除成功'
  1570. })
  1571. if (tableData.value.length === ids.length && page.value > 1) {
  1572. page.value--
  1573. }
  1574. deleteVisible.value = false
  1575. getTableData()
  1576. }
  1577. }
  1578. // 行为控制标记(弹窗内部需要增还是改)
  1579. const type = ref('')
  1580. // 更新行
  1581. const updateCompanyFunc = async (row) => {
  1582. const res = await findCompany({ ID: row.ID })
  1583. type.value = 'update'
  1584. if (res.code === 0) {
  1585. formData.value = res.data.recompany
  1586. dialogFormVisible.value = true
  1587. }
  1588. }
  1589. // 弹窗控制标记
  1590. const dialogFormVisible = ref(false)
  1591. // 打开弹窗
  1592. const openDialog = () => {
  1593. type.value = 'create'
  1594. dialogFormVisible.value = true
  1595. }
  1596. // 关闭弹窗
  1597. const closeDialog = () => {
  1598. dialogFormVisible.value = false
  1599. formData.value = {
  1600. address: '',
  1601. image: '',
  1602. name: '',
  1603. }
  1604. }
  1605. // 弹窗确定
  1606. const enterDialog = async () => {
  1607. ElMessageBox.confirm('数据存盘?', '提示', {
  1608. confirmButtonText: '确定',
  1609. cancelButtonText: '取消',
  1610. type: 'warning'
  1611. }).then(() => {
  1612. if(formData.value.sczl_rq==''){
  1613. ElMessage({
  1614. type: 'error',
  1615. message: '请填写日期'
  1616. });
  1617. document.getElementById('日期').focus()
  1618. document.getElementById('日期').select()
  1619. return;
  1620. }
  1621. if(formData.value.sczl_gdbh==''){
  1622. ElMessage({
  1623. type: 'error',
  1624. message: '请填写工单编号'
  1625. });
  1626. document.getElementById('工单编号').focus()
  1627. document.getElementById('工单编号').select()
  1628. return;
  1629. }
  1630. if(formData.value.sczl_bzdh==''){
  1631. ElMessage({
  1632. type: 'error',
  1633. message: '请选择班组'
  1634. });
  1635. document.getElementById('组别').focus()
  1636. document.getElementById('组别').select()
  1637. return;
  1638. }
  1639. if(formData.value.sczl_dedh==''){
  1640. ElMessage({
  1641. type: 'error',
  1642. message: '请选择定额代号'
  1643. });
  1644. document.getElementById('定额代号').focus()
  1645. document.getElementById('定额代号').select()
  1646. return;
  1647. }
  1648. updateDetailData()
  1649. });
  1650. }
  1651. let tables=ref(5);
  1652. let lastCellValue=ref()
  1653. // 双击表格操作
  1654. function doubleClick(row, column, event) {
  1655. type.value = 'update';
  1656. lastCellValue= row['UniqId'];
  1657. tables.value=lastCellValue
  1658. dialogFormVisible.value = true
  1659. GetInfo(tables.value)
  1660. }
  1661. // 单击表格操作
  1662. function Click(row, column, event) {
  1663. lastCellValue= row['UniqId'];
  1664. console.log(row)
  1665. const parts = row['sczl_yjgx'].split('-')
  1666. ScrapFactor.yjno=parts[0]
  1667. ScrapFactor.gdbh=row['sczl_gdbh']
  1668. ScrapFactor.type=row['sczl_检验类别']
  1669. ScrapFactor.gxh=parts[1]
  1670. console.log(lastCellValue)
  1671. }
  1672. // 导出excel
  1673. function exportExcel() {
  1674. console.log('导出到excel');
  1675. }
  1676. // 生命周期钩子
  1677. onMounted(async () => {
  1678. });
  1679. </script>
  1680. <style>
  1681. .JKWTree-container {
  1682. display: flex;
  1683. }
  1684. .JKWTree-tree {
  1685. width: 300px;
  1686. background-color: #fff;
  1687. padding: 10px;
  1688. margin-right: 20px;
  1689. }
  1690. .JKWTree-tree h3 {
  1691. font-size: 15px;
  1692. font-weight: 700;
  1693. margin: 10px 0;
  1694. }
  1695. .JKWTree-content {
  1696. flex: 1;
  1697. }
  1698. /* 选中某行时的背景色*/
  1699. .el-table__body tr.current-row>td {
  1700. background: #ff80ff !important;
  1701. /* 背景颜色 */
  1702. }
  1703. </style>
  1704. <style scoped>
  1705. :deep(.el-table td .cell) {
  1706. line-height: 20px !important;
  1707. }
  1708. :deep(.el-tabs__header){
  1709. margin-bottom: 0;
  1710. }
  1711. .search{
  1712. margin-left: 0px !important;
  1713. margin-right: 10px !important;
  1714. }
  1715. .bt{
  1716. margin-left: 2px !important;
  1717. padding: 3px !important;
  1718. font-size: 12px;
  1719. }
  1720. .el-tabs__header{
  1721. margin: 0px !important;
  1722. }
  1723. .gva-table-box{
  1724. padding: 0px !important;
  1725. }
  1726. .mab{
  1727. margin-bottom: 5px;
  1728. }
  1729. </style>