Manualdocuments.vue 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792
  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.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. formData.value[Bname]=response.data.ygxm;
  782. //设置姓名样式
  783. unsetColorReadonly('cl'+inputName)
  784. unsetColorReadonly('fp'+inputName)
  785. document.getElementById('cl'+inputName).focus()
  786. document.getElementById('cl'+inputName).select()
  787. }else{
  788. formData.value['sczl_bh' + inputName+'_name']='';
  789. formData.value['sczl_cl' + inputName]='0';
  790. formData.value['sczl_fp' + inputName]='0';
  791. //设置姓名样式
  792. setColorReadonly('cl'+inputName);
  793. setColorReadonly('fp'+inputName);
  794. if(inputName!=12){
  795. document.getElementById('bh'+(parseInt(inputName)+1)).focus()
  796. document.getElementById('bh'+(parseInt(inputName)+1)).select()
  797. }else{
  798. document.getElementById('其他备注').focus()
  799. document.getElementById('其他备注').select()
  800. }
  801. }
  802. });
  803. }else{
  804. formData.value['sczl_bh' + inputName+'_name']='';
  805. formData.value['sczl_cl' + inputName]='0';
  806. formData.value['sczl_fp' + inputName]='0';
  807. //设置姓名样式
  808. setColorReadonly('cl'+inputName);
  809. setColorReadonly('fp'+inputName);
  810. if(inputName!=12){
  811. document.getElementById('bh'+(parseInt(inputName)+1)).focus()
  812. document.getElementById('bh'+(parseInt(inputName)+1)).select()
  813. }else{
  814. document.getElementById('其他备注').focus()
  815. document.getElementById('其他备注').select()
  816. }
  817. }
  818. ent_sum()
  819. } else if (event.keyCode === 38) { // 向上箭头
  820. if(value){
  821. getYg({sczl_bh:value}).then(response => {
  822. if (response.code == 0) {
  823. let Bname = 'sczl_bh' + inputName+'_name';
  824. formData.value[Bname]=response.data.ygxm;
  825. //设置姓名样式
  826. unsetColorReadonly('cl'+inputName)
  827. unsetColorReadonly('fp'+inputName)
  828. if(inputName!=1){
  829. if(document.getElementById('fp'+(parseInt(inputName)-1)).readOnly){
  830. document.getElementById('bh'+(parseInt(inputName)-1)).focus()
  831. document.getElementById('bh'+(parseInt(inputName)-1)).select()
  832. }else{
  833. document.getElementById('fp'+(parseInt(inputName)-1)).focus()
  834. document.getElementById('fp'+(parseInt(inputName)-1)).select()
  835. }
  836. }else{
  837. document.getElementById('备注').focus()
  838. document.getElementById('备注').select()
  839. }
  840. }else{
  841. formData.value['sczl_bh' + inputName+'_name']='';
  842. formData.value['sczl_cl' + inputName]='0';
  843. formData.value['sczl_fp' + inputName]='0';
  844. //设置姓名样式
  845. setColorReadonly('cl'+inputName);
  846. setColorReadonly('fp'+inputName);
  847. if(inputName!=1){
  848. if(document.getElementById('fp'+(parseInt(inputName)-1)).readOnly){
  849. document.getElementById('bh'+(parseInt(inputName)-1)).focus()
  850. document.getElementById('bh'+(parseInt(inputName)-1)).select()
  851. }else{
  852. document.getElementById('fp'+(parseInt(inputName)-1)).focus()
  853. document.getElementById('fp'+(parseInt(inputName)-1)).select()
  854. }
  855. }else{
  856. document.getElementById('备注').focus()
  857. document.getElementById('备注').select()
  858. }
  859. }
  860. });
  861. }else{
  862. formData.value['sczl_bh' + inputName+'_name']='';
  863. formData.value['sczl_cl' + inputName]='0';
  864. formData.value['sczl_fp' + inputName]='0';
  865. //设置姓名样式
  866. setColorReadonly('cl'+inputName);
  867. setColorReadonly('fp'+inputName);
  868. if(inputName!=1){
  869. if(document.getElementById('fp'+(parseInt(inputName)-1)).readOnly){
  870. document.getElementById('bh'+(parseInt(inputName)-1)).focus()
  871. document.getElementById('bh'+(parseInt(inputName)-1)).select()
  872. }else{
  873. document.getElementById('fp'+(parseInt(inputName)-1)).focus()
  874. document.getElementById('fp'+(parseInt(inputName)-1)).select()
  875. }
  876. }else{
  877. document.getElementById('备注').focus()
  878. document.getElementById('备注').select()
  879. }
  880. }
  881. ent_sum()
  882. } else if (event.keyCode === 8) { // 删除箭头
  883. if (event.target.selectionStart === 0) {
  884. if(value){
  885. getYg({sczl_bh:value}).then(response => {
  886. if (response.code == 0) {
  887. let Bname = 'sczl_bh' + inputName+'_name';
  888. formData.value[Bname]=response.data.ygxm;
  889. //设置姓名样式
  890. unsetColorReadonly('cl'+inputName)
  891. unsetColorReadonly('fp'+inputName)
  892. if(inputName!=1){
  893. if(document.getElementById('fp'+(parseInt(inputName)-1)).readOnly){
  894. document.getElementById('bh'+(parseInt(inputName)-1)).focus()
  895. document.getElementById('bh'+(parseInt(inputName)-1)).setSelectionRange(0, 0)
  896. }else{
  897. document.getElementById('fp'+(parseInt(inputName)-1)).focus()
  898. document.getElementById('fp'+(parseInt(inputName)-1)).setSelectionRange(0, 0)
  899. }
  900. }else{
  901. document.getElementById('备注').focus()
  902. document.getElementById('备注').setSelectionRange(0, 0)
  903. }
  904. }else{
  905. formData.value['sczl_bh' + inputName+'_name']='';
  906. formData.value['sczl_cl' + inputName]='0';
  907. formData.value['sczl_fp' + inputName]='0';
  908. //设置姓名样式
  909. setColorReadonly('cl'+inputName);
  910. setColorReadonly('fp'+inputName);
  911. if(inputName!=1){
  912. if(document.getElementById('fp'+(parseInt(inputName)-1)).readOnly){
  913. document.getElementById('bh'+(parseInt(inputName)-1)).focus()
  914. document.getElementById('bh'+(parseInt(inputName)-1)).setSelectionRange(0, 0)
  915. }else{
  916. document.getElementById('fp'+(parseInt(inputName)-1)).focus()
  917. document.getElementById('fp'+(parseInt(inputName)-1)).setSelectionRange(0, 0)
  918. }
  919. }else{
  920. document.getElementById('备注').focus()
  921. document.getElementById('备注').setSelectionRange(0, 0)
  922. }
  923. }
  924. });
  925. }else{
  926. formData.value['sczl_bh' + inputName+'_name']='';
  927. formData.value['sczl_cl' + inputName]='0';
  928. formData.value['sczl_fp' + inputName]='0';
  929. //设置姓名样式
  930. setColorReadonly('cl'+inputName);
  931. setColorReadonly('fp'+inputName);
  932. if(inputName!=1){
  933. if(document.getElementById('fp'+(parseInt(inputName)-1)).readOnly){
  934. document.getElementById('bh'+(parseInt(inputName)-1)).focus()
  935. document.getElementById('bh'+(parseInt(inputName)-1)).setSelectionRange(0, 0)
  936. }else{
  937. document.getElementById('fp'+(parseInt(inputName)-1)).focus()
  938. document.getElementById('fp'+(parseInt(inputName)-1)).setSelectionRange(0, 0)
  939. }
  940. }else{
  941. document.getElementById('备注').focus()
  942. document.getElementById('备注').setSelectionRange(0, 0)
  943. }
  944. }
  945. ent_sum()
  946. }
  947. } else if (event.keyCode === 37) { // 向左箭头
  948. if (event.target.selectionStart === 0) {
  949. if(value){
  950. getYg({sczl_bh:value}).then(response => {
  951. if (response.code == 0) {
  952. let Bname = 'sczl_bh' + inputName+'_name';
  953. formData.value[Bname]=response.data.ygxm;
  954. //设置姓名样式
  955. unsetColorReadonly('cl'+inputName)
  956. unsetColorReadonly('fp'+inputName)
  957. if(inputName!=1){
  958. if(document.getElementById('fp'+(parseInt(inputName)-1)).readOnly){
  959. document.getElementById('bh'+(parseInt(inputName)-1)).focus()
  960. document.getElementById('bh'+(parseInt(inputName)-1)).select()
  961. }else{
  962. document.getElementById('fp'+(parseInt(inputName)-1)).focus()
  963. document.getElementById('fp'+(parseInt(inputName)-1)).select()
  964. }
  965. }else{
  966. document.getElementById('备注').focus()
  967. document.getElementById('备注').select()
  968. }
  969. }else{
  970. formData.value['sczl_bh' + inputName+'_name']='';
  971. formData.value['sczl_cl' + inputName]='0';
  972. formData.value['sczl_fp' + inputName]='0';
  973. //设置姓名样式
  974. setColorReadonly('cl'+inputName);
  975. setColorReadonly('fp'+inputName);
  976. if(inputName!=1){
  977. if(document.getElementById('fp'+(parseInt(inputName)-1)).readOnly){
  978. document.getElementById('bh'+(parseInt(inputName)-1)).focus()
  979. document.getElementById('bh'+(parseInt(inputName)-1)).select()
  980. }else{
  981. document.getElementById('fp'+(parseInt(inputName)-1)).focus()
  982. document.getElementById('fp'+(parseInt(inputName)-1)).select()
  983. }
  984. }else{
  985. document.getElementById('备注').focus()
  986. document.getElementById('备注').select()
  987. }
  988. }
  989. });
  990. }else{
  991. formData.value['sczl_bh' + inputName+'_name']='';
  992. formData.value['sczl_cl' + inputName]='0';
  993. formData.value['sczl_fp' + inputName]='0';
  994. //设置姓名样式
  995. setColorReadonly('cl'+inputName);
  996. setColorReadonly('fp'+inputName);
  997. if(inputName!=1){
  998. if(document.getElementById('fp'+(parseInt(inputName)-1)).readOnly){
  999. document.getElementById('bh'+(parseInt(inputName)-1)).focus()
  1000. document.getElementById('bh'+(parseInt(inputName)-1)).select()
  1001. }else{
  1002. document.getElementById('fp'+(parseInt(inputName)-1)).focus()
  1003. document.getElementById('fp'+(parseInt(inputName)-1)).select()
  1004. }
  1005. }else{
  1006. document.getElementById('备注').focus()
  1007. document.getElementById('备注').select()
  1008. }
  1009. }
  1010. ent_sum()
  1011. }
  1012. } else if (event.keyCode === 39) { // 向右箭头
  1013. if (event.target.selectionStart === event.target.value.length) {
  1014. if(value){
  1015. getYg({sczl_bh:value}).then(response => {
  1016. if (response.code == 0) {
  1017. let Bname = 'sczl_bh' + inputName+'_name';
  1018. formData.value[Bname]=response.data.ygxm;
  1019. //设置姓名样式
  1020. unsetColorReadonly('cl'+inputName)
  1021. unsetColorReadonly('fp'+inputName)
  1022. document.getElementById('cl'+inputName).focus()
  1023. document.getElementById('cl'+inputName).select()
  1024. }else{
  1025. formData.value['sczl_bh' + inputName+'_name']='';
  1026. formData.value['sczl_cl' + inputName]='0';
  1027. formData.value['sczl_fp' + inputName]='0';
  1028. //设置姓名样式
  1029. setColorReadonly('cl'+inputName);
  1030. setColorReadonly('fp'+inputName);
  1031. if(inputName!=12){
  1032. document.getElementById('bh'+(parseInt(inputName)+1)).focus()
  1033. document.getElementById('bh'+(parseInt(inputName)+1)).select()
  1034. }else{
  1035. document.getElementById('其他备注').focus()
  1036. document.getElementById('其他备注').select()
  1037. }
  1038. }
  1039. });
  1040. }else{
  1041. formData.value['sczl_bh' + inputName+'_name']='';
  1042. formData.value['sczl_cl' + inputName]='0';
  1043. formData.value['sczl_fp' + inputName]='0';
  1044. //设置姓名样式
  1045. setColorReadonly('cl'+inputName);
  1046. setColorReadonly('fp'+inputName);
  1047. if(inputName!=12){
  1048. document.getElementById('bh'+(parseInt(inputName)+1)).focus()
  1049. document.getElementById('bh'+(parseInt(inputName)+1)).select()
  1050. }else{
  1051. document.getElementById('其他备注').focus()
  1052. document.getElementById('其他备注').select()
  1053. }
  1054. }
  1055. ent_sum()
  1056. }
  1057. }
  1058. }
  1059. const getGxMcsubmit = async() => {
  1060. if(formData.value.sczl_gdbh!=''){
  1061. const response = await shougonggetGxMc({gdbh:formData.value.sczl_gdbh});
  1062. if (response.code === 0) {
  1063. if(response.data.length==0){
  1064. ElMessage({
  1065. type: 'error',
  1066. message: '查无此编号的工单,请仔细检查后重新输入'
  1067. })
  1068. //设置输入框的值为空
  1069. formData.value.sczl_gdbh = ''
  1070. formData.value.sczl_yjgx = ''
  1071. formData.value.sczl_gxmc = ''
  1072. formData.value.yj_yjmc = ''
  1073. }else if(response.data.length==1){
  1074. const { Gd_cpmc, Gy0_yjno, Gy0_gxh, Gy0_gxmc,jyGx} = response.data[0]
  1075. formData.value.yj_yjmc=Gd_cpmc
  1076. formData.value.sczl_gxmc=Gy0_gxmc
  1077. formData.value.sczl_yjgx=jyGx
  1078. setColorReadonly('yjgx');
  1079. setColorReadonly('gxmc');
  1080. setColorReadonly('yjmc');
  1081. }else{
  1082. if(GetDedhVisible.value){
  1083. return false
  1084. }
  1085. selectData.splice(0, selectData.length, ...response.data)
  1086. dialogSelectVisible.value=true
  1087. setGXCurrent(selectData[0])
  1088. }
  1089. }
  1090. }else{
  1091. ElMessage({
  1092. type: 'error',
  1093. message: '请注意, 工单编号输入空置, 除非有特殊需要!'
  1094. })
  1095. formData.value.sczl_yjgx = ''
  1096. formData.value.sczl_gxmc = ''
  1097. formData.value.yj_yjmc = ''
  1098. }
  1099. }
  1100. const dialogSelectVisible = ref(false)
  1101. const selectData = reactive([])
  1102. // 工单选择框
  1103. const handleSelectClick = (row, column, event) => {
  1104. const { Gd_cpmc, Gy0_yjno, Gy0_gxh, Gy0_gxmc,jyGx } = row
  1105. formData.value.yj_yjmc=Gd_cpmc
  1106. formData.value.sczl_gxmc=Gy0_gxmc
  1107. formData.value.sczl_yjgx=jyGx
  1108. setColorReadonly('yjgx');
  1109. setColorReadonly('gxmc');
  1110. setColorReadonly('yjmc');
  1111. dialogSelectVisible.value = false
  1112. }
  1113. const currentIndex = ref(0);
  1114. const GXCurrent = ref(0);
  1115. const selectGX = (event) => {
  1116. if (event.keyCode === 40) { // 向下箭头
  1117. if (currentIndex.value < selectData.length - 1) {
  1118. currentIndex.value++;
  1119. setGXCurrent(selectData[currentIndex.value]);
  1120. } else {
  1121. currentIndex.value = 0;
  1122. setGXCurrent(selectData[currentIndex.value]); // 到达最后一行时回到第一行
  1123. }
  1124. } else if (event.keyCode === 38) { // 向上箭头
  1125. if (currentIndex.value > 0) {
  1126. currentIndex.value--;
  1127. setGXCurrent(selectData[currentIndex.value]);
  1128. } else {
  1129. currentIndex.value = selectData.length - 1;
  1130. setGXCurrent(selectData[currentIndex.value]); // 到达第一行时回到最后一行
  1131. }
  1132. } else if (event.keyCode === 13) { // 回车键
  1133. dialogSelectVisible.value = false;
  1134. }
  1135. }
  1136. const table2 = ref()
  1137. const setGXCurrent = (row) => {
  1138. setTimeout(()=>{
  1139. table2.value?.setCurrentRow(row)
  1140. const { Gd_cpmc, Gy0_yjno, Gy0_gxh, Gy0_gxmc,jyGx } = row
  1141. formData.value.yj_yjmc=Gd_cpmc
  1142. formData.value.sczl_gxmc=Gy0_gxmc
  1143. formData.value.sczl_yjgx=jyGx
  1144. })
  1145. }
  1146. //定额代号回车事件
  1147. const getDedhsubmit = () => {
  1148. if(dialogSelectVisible.value){
  1149. return false
  1150. }
  1151. if(LbVisible.value){
  1152. return false
  1153. }
  1154. GetDedh()
  1155. }
  1156. let GetDedhtreeData = reactive([]);
  1157. const GetDedhVisible = ref(false)
  1158. //获取定额代号
  1159. const GetDedh = async (value) => {
  1160. const response = await shougonggetDedh();
  1161. const treeData = {};
  1162. // const data = [];
  1163. // data[0] = response.data;
  1164. // //判断值是否在选项中存在
  1165. // const buildTree1 = (node) => {
  1166. // const arr = [];
  1167. // // 如果存在子节点,递归地添加它们
  1168. // if (node.bh_mc && Array.isArray(node.bh_mc)) {
  1169. // node.bh_mc.forEach(childNode => {
  1170. // arr.push(...buildTree1(childNode)); // 递归调用
  1171. // });
  1172. // }else{
  1173. // arr.push(node.sys_bh)
  1174. // }
  1175. // return arr;
  1176. // };
  1177. // // 构建树形结构的根节点
  1178. // const Data = data.map(buildTree1);
  1179. if(response.code==0){
  1180. const data = [];
  1181. data[0] = response.data;
  1182. // 递归函数来构建树形结构
  1183. const buildTree = (node) => {
  1184. const treeNode = {
  1185. label: node.sys_bh + '【' + node.sys_mc+'】',
  1186. children: []
  1187. };
  1188. // 如果存在子节点,递归地添加它们
  1189. if (node.bh_mc && Array.isArray(node.bh_mc)) {
  1190. node.bh_mc.forEach(childNode => {
  1191. treeNode.children.push(buildTree(childNode)); // 递归调用
  1192. });
  1193. }
  1194. return treeNode;
  1195. };
  1196. // 构建树形结构的根节点
  1197. const treeData = data.map(buildTree);
  1198. GetDedhtreeData = treeData;
  1199. GetDedhVisible.value=true
  1200. }
  1201. }
  1202. //定额代号树形结构单机
  1203. const GetDedhhandleNodeClick = (nodeData, node, component) => {
  1204. //存放当前节点的nodeId
  1205. if (!nodeData.children || nodeData.children.length === 0) {
  1206. // 点击的是子节点
  1207. formData.value.sczl_dedh=nodeData.label.split("【")[0]
  1208. GetDedhVisible.value=false
  1209. }
  1210. // 执行相应的父节点单击事件处理逻辑
  1211. }
  1212. //检验类别失去焦点事件
  1213. const getLbsubmit = () => {
  1214. if(GetDedhVisible.value){
  1215. return false
  1216. }
  1217. //弹出选择
  1218. const data = [{'sczl_检验类别':''},{'sczl_检验类别':'正品板'},{'sczl_检验类别':'次品板'},{'sczl_检验类别':'废品板'}]
  1219. selectDataLb.splice(0, selectDataLb.length, ...data)
  1220. setJYCurrent(selectDataLb[0])
  1221. LbVisible.value=true
  1222. }
  1223. //检验类别选择
  1224. const selectDataLb = reactive([])
  1225. const LbVisible = ref(false)
  1226. const SelectClickLb = (row, column, event) => {
  1227. const {sczl_检验类别 } = row
  1228. formData.value.sczl_检验类别=row.sczl_检验类别
  1229. //查询废品系数
  1230. if(row.sczl_检验类别!=''){
  1231. var value = {
  1232. 'gdbh':formData.value.sczl_gdbh,
  1233. 'yjno':parseInt(formData.value.sczl_yjgx.split('-')[0]),
  1234. 'gxh':parseInt(formData.value.sczl_yjgx.split('-')[1]),
  1235. 'type':formData.value.sczl_检验类别
  1236. }
  1237. shougonggetScrapFactor(value).then(response=>{
  1238. if(response.code==0){
  1239. if(response.data!=null){
  1240. formData.value.sczl_废品率系数 = response.data.num;
  1241. }
  1242. setColorReadonly('废品率系数')
  1243. }
  1244. });
  1245. }else{
  1246. unsetColorReadonly('废品率系数')
  1247. }
  1248. LbVisible.value = false
  1249. }
  1250. const table3=ref()
  1251. const setJYCurrent = (row) => {
  1252. setTimeout(()=>{
  1253. table3.value?.setCurrentRow(row)
  1254. const {sczl_检验类别 } = row
  1255. formData.value.sczl_检验类别=row.sczl_检验类别
  1256. //查询废品系数
  1257. if(row.sczl_检验类别!=''){
  1258. var value = {
  1259. 'gdbh':formData.value.sczl_gdbh,
  1260. 'yjno':parseInt(formData.value.sczl_yjgx.split('-')[0]),
  1261. 'gxh':parseInt(formData.value.sczl_yjgx.split('-')[1]),
  1262. 'type':formData.value.sczl_检验类别
  1263. }
  1264. shougonggetScrapFactor(value).then(response=>{
  1265. if(response.code==0){
  1266. if(response.data!=null){
  1267. formData.value.sczl_废品率系数 = response.data.num;
  1268. }
  1269. setColorReadonly('废品率系数')
  1270. }
  1271. });
  1272. }else{
  1273. unsetColorReadonly('废品率系数')
  1274. }
  1275. })
  1276. }
  1277. const JYIndex = ref(0);
  1278. const JYCurrent = ref(0);
  1279. const selectJY = (event) => {
  1280. if (event.keyCode === 40) { // 向下箭头
  1281. if (JYIndex.value < selectDataLb.length - 1) {
  1282. JYIndex.value++;
  1283. setJYCurrent(selectDataLb[JYIndex.value]);
  1284. } else {
  1285. JYIndex.value = 0;
  1286. setJYCurrent(selectDataLb[JYIndex.value]); // 到达最后一行时回到第一行
  1287. }
  1288. } else if (event.keyCode === 38) { // 向上箭头
  1289. if (JYIndex.value > 0) {
  1290. JYIndex.value--;
  1291. setJYCurrent(selectDataLb[JYIndex.value]);
  1292. } else {
  1293. JYIndex.value = selectDataLb.length - 1;
  1294. setJYCurrent(selectDataLb[JYIndex.value]); // 到达第一行时回到最后一行
  1295. }
  1296. } else if (event.keyCode === 13) { // 回车键
  1297. LbVisible.value = false
  1298. }
  1299. }
  1300. //刷新废品率系数
  1301. const GetScrapFactor = async (value) => {
  1302. const response = await shougonggetScrapFactor(value);
  1303. if(response.code==0){
  1304. console.log(response.data.num)
  1305. const rowIndex = tableData.findIndex(row => row.UniqId === lastCellValue);
  1306. console.log(rowIndex)
  1307. tableData[rowIndex].sczl_废品率系数 = response.data.num;
  1308. }
  1309. // console.log(response)
  1310. // const rowIndex = tableData.findIndex(row => row.UniqId === 123);
  1311. }
  1312. const ADD=ref('0')
  1313. //新增
  1314. function onAdd() {
  1315. ADD.value='新增'
  1316. type.value = 'create'
  1317. if(typeof(lastCellValue)=='number'){
  1318. GetInfo(lastCellValue)
  1319. }
  1320. initFormData()
  1321. dialogFormVisible.value = true
  1322. // Productionadd()
  1323. }
  1324. const ScrapFactor={
  1325. gdbh:'',
  1326. yjno:'',
  1327. gxh:'',
  1328. type:'',
  1329. }
  1330. // 刷新废品率系数
  1331. function onRefresh() {
  1332. GetScrapFactor(ScrapFactor)
  1333. }
  1334. // 更新数据
  1335. const updateDetailData = async() => {
  1336. const restoredData = {
  1337. UniqId: lastCellValue,
  1338. sczl_rq: formData.value.sczl_rq,
  1339. sczl_bzdh: formData.value.sczl_bzdh,
  1340. sczl_bh0: formData.value.sczl_bh0,
  1341. sczl_cl0: formData.value.sczl_cl0,
  1342. sczl_fp0: formData.value.sczl_fp0,
  1343. sczl_gdbh: formData.value.sczl_gdbh,
  1344. sczl_yjgx: formData.value.sczl_yjgx,
  1345. sczl_gxmc: formData.value.sczl_gxmc,
  1346. sczl_cl:formData.value.sczl_cl,
  1347. sczl_dedh: formData.value.sczl_dedh,
  1348. sczl_检验类别: formData.value.sczl_检验类别,
  1349. sczl_废品率系数: formData.value.sczl_废品率系数,
  1350. sczl_jsss: formData.value.sczl_jsss,
  1351. sczl_冲定额: formData.value.sczl_冲定额,
  1352. qczl_Num:formData.value.qczl_NumDesc,
  1353. qczl_NumDesc:formData.value.流程单号1,
  1354. qczl_NumDesc1: formData.value.流程单号2,
  1355. qczl_NumDesc2: formData.value.流程单号3,
  1356. qczl_NumDesc3: formData.value.流程单号4,
  1357. qczl_NumDesc4: formData.value.流程单号5,
  1358. qczl_NumDesc5: formData.value.流程单号6,
  1359. qczl_NumDesc6: formData.value.流程单号7,
  1360. qczl_NumDesc7: formData.value.流程单号8,
  1361. qczl_NumDesc8: formData.value.流程单号9,
  1362. sczl_desc: formData.value.sczl_desc,
  1363. sczl_bh1: formData.value.sczl_bh1,
  1364. sczl_bh2: formData.value.sczl_bh2,
  1365. sczl_bh3:formData.value.sczl_bh3,
  1366. sczl_bh4: formData.value.sczl_bh4,
  1367. sczl_bh5: formData.value.sczl_bh5,
  1368. sczl_bh6: formData.value.sczl_bh6,
  1369. sczl_bh7: formData.value.sczl_bh7,
  1370. sczl_bh8: formData.value.sczl_bh8,
  1371. sczl_bh9: formData.value.sczl_bh9,
  1372. sczl_bh10: formData.value.sczl_bh10,
  1373. sczl_bh11: formData.value.sczl_bh11,
  1374. sczl_bh12: formData.value.sczl_bh12,
  1375. sczl_cl1: formData.value.sczl_cl1,
  1376. sczl_cl2: formData.value.sczl_cl2,
  1377. sczl_cl3: formData.value.sczl_cl3,
  1378. sczl_cl4: formData.value.sczl_cl4,
  1379. sczl_cl5: formData.value.sczl_cl5,
  1380. sczl_cl6: formData.value.sczl_cl6,
  1381. sczl_cl7: formData.value.sczl_cl7,
  1382. sczl_cl8: formData.value.sczl_cl8,
  1383. sczl_cl9: formData.value.sczl_cl9,
  1384. sczl_cl10: formData.value.sczl_cl10,
  1385. sczl_cl11:formData.value.sczl_cl11,
  1386. sczl_cl12: formData.value.sczl_cl12,
  1387. sczl_fp1: formData.value.sczl_fp1,
  1388. sczl_fp2: formData.value.sczl_fp2,
  1389. sczl_fp3: formData.value.sczl_fp3,
  1390. sczl_fp4: formData.value.sczl_fp4,
  1391. sczl_fp5: formData.value.sczl_fp5,
  1392. sczl_fp6: formData.value.sczl_fp6,
  1393. sczl_fp7: formData.value.sczl_fp7,
  1394. sczl_fp8: formData.value.sczl_fp8,
  1395. sczl_fp9: formData.value.sczl_fp9,
  1396. sczl_fp10: formData.value.sczl_fp10,
  1397. sczl_fp11: formData.value.sczl_fp11,
  1398. sczl_fp12: formData.value.sczl_fp12,
  1399. sys_id:sys_id,
  1400. }
  1401. if(ADD.value=='新增'){
  1402. const response = await inspectadd(restoredData);
  1403. // ADD.value='1'
  1404. // console.log(ADD.value)
  1405. ADD.value='0'
  1406. console.log(response)
  1407. if(response.code==0){
  1408. ElMessage({
  1409. type: 'success',
  1410. message: '新增成功',
  1411. })
  1412. }
  1413. dialogFormVisible.value = false
  1414. }else{
  1415. const response = await shougongedit(restoredData);
  1416. if(response.code==0){
  1417. ElMessage({
  1418. type: 'success',
  1419. message: '更新成功',
  1420. })
  1421. }
  1422. dialogFormVisible.value = false
  1423. }
  1424. }
  1425. // 删除
  1426. function onDel() {
  1427. Del()
  1428. }
  1429. //删除
  1430. const Del = async () => {
  1431. const response = await shougongdel({UniqId:lastCellValue});
  1432. if (response.code === 0) {
  1433. ElMessage({
  1434. type: 'success',
  1435. message: '删除成功',
  1436. })
  1437. }
  1438. getTableData()
  1439. }
  1440. const displayMod = ref('')
  1441. // 按工单显示
  1442. function onCountByGdbh() {
  1443. console.log(displayMod.value)
  1444. if (displayMod.value === 'date') {
  1445. displayMod.value = 'gd'
  1446. CountByGdbh()
  1447. console.log(displayMod.value)
  1448. } else {
  1449. getTabdata()
  1450. }
  1451. // CountByGdbh()
  1452. }
  1453. //按工单显示
  1454. const CountByGdbh = async () => {
  1455. const response = await getInspectCountByGdbh();
  1456. // console.log(response)
  1457. if (response.code === 0) {
  1458. console.log(response)
  1459. const transformedData = response.data.map(item => ({
  1460. label: `${item.sczl_gdbh+item.cpmc}`,
  1461. children: item.sys.map(sysItem => ({
  1462. label: `${sysItem.sys_id} 【记录数: ${sysItem.count}张】`,
  1463. params: {
  1464. date: item.sczl_gdbh,
  1465. sys_id: sysItem.sys_id,
  1466. total: sysItem.count,
  1467. },
  1468. })),
  1469. }));
  1470. treeData.splice(0, treeData.length, ...transformedData);
  1471. }
  1472. // getTableData()
  1473. }
  1474. // ============== 表格控制部分结束 ===============
  1475. // 获取需要的字典 可能为空 按需保留
  1476. const setOptions = async () => {
  1477. }
  1478. // 获取需要的字典 可能为空 按需保留
  1479. setOptions()
  1480. // 多选数据
  1481. const multipleSelection = ref([])
  1482. // 多选
  1483. const handleSelectionChange = (val) => {
  1484. if(val.length>0){
  1485. multipleSelection.value = val
  1486. const lenth=val.length
  1487. ScrapFactor.gdbh=val[lenth-1].combinedProp.split('-')[0];
  1488. const parts = val[lenth-1].combinedProp2.split('-')
  1489. ScrapFactor.yjno=parts[0];
  1490. ScrapFactor.gxh=parts[1];
  1491. // ScrapFactor.type=val[lenth-1].sczl_检验类别
  1492. ScrapFactor.type='正品板'
  1493. console.log(ScrapFactor)
  1494. lastCellValue=val[lenth-1].UniqId
  1495. console.log(ScrapFactor)
  1496. val.splice(0, val.length); // 清空 val 数组
  1497. console.log(lastCellValue)
  1498. }
  1499. }
  1500. // 批量删除控制标记
  1501. const deleteVisible = ref(false)
  1502. // 多选删除
  1503. const onDelete = async () => {
  1504. const ids = []
  1505. if (multipleSelection.value.length === 0) {
  1506. ElMessage({
  1507. type: 'warning',
  1508. message: '请选择要删除的数据'
  1509. })
  1510. return
  1511. }
  1512. multipleSelection.value &&
  1513. multipleSelection.value.map(item => {
  1514. ids.push(item.ID)
  1515. })
  1516. const res = await deleteCompanyByIds({ ids })
  1517. if (res.code === 0) {
  1518. ElMessage({
  1519. type: 'success',
  1520. message: '删除成功'
  1521. })
  1522. if (tableData.value.length === ids.length && page.value > 1) {
  1523. page.value--
  1524. }
  1525. deleteVisible.value = false
  1526. getTableData()
  1527. }
  1528. }
  1529. // 行为控制标记(弹窗内部需要增还是改)
  1530. const type = ref('')
  1531. // 更新行
  1532. const updateCompanyFunc = async (row) => {
  1533. const res = await findCompany({ ID: row.ID })
  1534. type.value = 'update'
  1535. if (res.code === 0) {
  1536. formData.value = res.data.recompany
  1537. dialogFormVisible.value = true
  1538. }
  1539. }
  1540. // 弹窗控制标记
  1541. const dialogFormVisible = ref(false)
  1542. // 打开弹窗
  1543. const openDialog = () => {
  1544. type.value = 'create'
  1545. dialogFormVisible.value = true
  1546. }
  1547. // 关闭弹窗
  1548. const closeDialog = () => {
  1549. dialogFormVisible.value = false
  1550. formData.value = {
  1551. address: '',
  1552. image: '',
  1553. name: '',
  1554. }
  1555. }
  1556. // 弹窗确定
  1557. const enterDialog = async () => {
  1558. ElMessageBox.confirm('数据存盘?', '提示', {
  1559. confirmButtonText: '确定',
  1560. cancelButtonText: '取消',
  1561. type: 'warning'
  1562. }).then(() => {
  1563. if(formData.value.sczl_rq==''){
  1564. ElMessage({
  1565. type: 'error',
  1566. message: '请填写日期'
  1567. });
  1568. document.getElementById('日期').focus()
  1569. document.getElementById('日期').select()
  1570. return;
  1571. }
  1572. if(formData.value.sczl_gdbh==''){
  1573. ElMessage({
  1574. type: 'error',
  1575. message: '请填写工单编号'
  1576. });
  1577. document.getElementById('工单编号').focus()
  1578. document.getElementById('工单编号').select()
  1579. return;
  1580. }
  1581. if(formData.value.sczl_bzdh==''){
  1582. ElMessage({
  1583. type: 'error',
  1584. message: '请选择班组'
  1585. });
  1586. document.getElementById('组别').focus()
  1587. document.getElementById('组别').select()
  1588. return;
  1589. }
  1590. if(formData.value.sczl_dedh==''){
  1591. ElMessage({
  1592. type: 'error',
  1593. message: '请选择定额代号'
  1594. });
  1595. document.getElementById('定额代号').focus()
  1596. document.getElementById('定额代号').select()
  1597. return;
  1598. }
  1599. updateDetailData()
  1600. });
  1601. }
  1602. let tables=ref(5);
  1603. let lastCellValue=ref()
  1604. // 双击表格操作
  1605. function doubleClick(row, column, event) {
  1606. type.value = 'update';
  1607. lastCellValue= row['UniqId'];
  1608. tables.value=lastCellValue
  1609. dialogFormVisible.value = true
  1610. GetInfo(tables.value)
  1611. }
  1612. // 单击表格操作
  1613. function Click(row, column, event) {
  1614. lastCellValue= row['UniqId'];
  1615. console.log(lastCellValue)
  1616. }
  1617. // 导出excel
  1618. function exportExcel() {
  1619. console.log('导出到excel');
  1620. }
  1621. // 生命周期钩子
  1622. onMounted(async () => {
  1623. });
  1624. </script>
  1625. <style>
  1626. .JKWTree-container {
  1627. display: flex;
  1628. }
  1629. .JKWTree-tree {
  1630. width: 300px;
  1631. background-color: #fff;
  1632. padding: 10px;
  1633. margin-right: 20px;
  1634. }
  1635. .JKWTree-tree h3 {
  1636. font-size: 15px;
  1637. font-weight: 700;
  1638. margin: 10px 0;
  1639. }
  1640. .JKWTree-content {
  1641. flex: 1;
  1642. }
  1643. /* 选中某行时的背景色*/
  1644. .el-table__body tr.current-row>td {
  1645. background: #ff80ff !important;
  1646. /* 背景颜色 */
  1647. }
  1648. </style>
  1649. <style scoped>
  1650. :deep(.el-table td .cell) {
  1651. line-height: 20px !important;
  1652. }
  1653. :deep(.el-tabs__header){
  1654. margin-bottom: 0;
  1655. }
  1656. .search{
  1657. margin-left: 0px !important;
  1658. margin-right: 10px !important;
  1659. }
  1660. .bt{
  1661. margin-left: 2px !important;
  1662. padding: 3px !important;
  1663. font-size: 12px;
  1664. }
  1665. .el-tabs__header{
  1666. margin: 0px !important;
  1667. }
  1668. .gva-table-box{
  1669. padding: 0px !important;
  1670. }
  1671. .mab{
  1672. margin-bottom: 5px;
  1673. }
  1674. </style>