Manualdocuments.vue 56 KB

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