Manualdocuments.vue 56 KB

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