Manualdocuments.vue 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295
  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. <div class="gva-btn-list">
  34. <el-row :span="6">
  35. <el-input v-model="positionvalue" placeholder="输入工单编号或产品名称" />
  36. </el-row>
  37. <el-button type="primary" class="search" icon="search" @click="onSearch"></el-button>
  38. <el-button type="primary" class="bt" icon="plus" @click="onAdd">新增</el-button>
  39. <el-button type="primary" class="bt" icon="refresh" @click="onRefresh">刷新质检系数</el-button>
  40. <el-button type="primary" class="bt" icon="thumb" @click="onCountByGdbh">切换显示方式</el-button>
  41. <el-button type="primary" class="bt" icon="delete" @click="onDel">删除</el-button>
  42. <div style="margin-left: auto;">
  43. <el-button type="primary" :icon="Download" @click="exportExcel">导出到Excel</el-button>
  44. </div>
  45. </div>
  46. <!-- 数据展示 -->
  47. <el-table ref="multipleTable" style="width: 100%" tooltip-effect="dark" :data="tableData" row-key="ID"
  48. highlight-current-row="true" border @selection-change="handleSelectionChange" @row-click="Click"
  49. :show-overflow-tooltip="true" @row-dblclick="doubleClick">
  50. <el-table-column type="selection" width="55" />
  51. <el-table-column align="left" label="工单印件" prop="combinedProp" width="340"/>
  52. <el-table-column align="left" label="印件工序" prop="combinedProp2" width="340"/>
  53. <el-table-column align="left" label="日期" prop="sczl_rq" width="120" />
  54. <el-table-column align="left" label="产量" prop="sczl_cl" width="120" />
  55. <el-table-column align="left" label="千件工价" prop="千件工价" width="120" />
  56. <el-table-column align="left" label="检验类别" prop="sczl_检验类别" width="120" />
  57. <el-table-column align="left" label="废品率系数" prop="sczl_废品率系数" width="120" />
  58. <el-table-column align="left" label="日定额" prop="日定额" width="120" />
  59. <el-table-column align="left" label="组长编号" prop="sczl_bh0" width="120" />
  60. <el-table-column align="left" label="组长姓名" prop="员工姓名" width="120" />
  61. <el-table-column align="left" label="流程单备注" prop="qczl_NumDesc" width="120" />
  62. <el-table-column align="left" label="创建用户" prop="sys_id" width="120" />
  63. <el-table-column align="left" label="创建时间" prop="sys_rq" width="160" />
  64. <el-table-column align="left" label="修改时间" prop="mod_rq" width="160" />
  65. <el-table-column align="left" label="UNIQID" prop="UniqId" width="120" />
  66. </el-table>
  67. <!-- 分页 -->
  68. <div class="gva-pagination">
  69. <el-pagination layout="total, sizes, prev, pager, next, jumper" v-model:current-page="page"
  70. v-model:page-size="limit"
  71. :page-sizes="[10, 30, 50, 100]" :total="total" @current-change="handleCurrentChange"
  72. @size-change="handleSizeChange" />
  73. </div>
  74. </div>
  75. <!-- 弹出框 -->
  76. <el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="type === 'create' ? '添加' : '修改'"
  77. destroy-on-close width="1000px">
  78. <el-form :model="formData" label-position="right" ref="elFormRef" :rules="rule" label-width="70px" >
  79. <el-row :gutter="24">
  80. <el-col :span="4">
  81. <el-form-item label="日期" prop="id" class="mab">
  82. <el-input type="date" max="9999-12-31" v-model="formData.sczl_rq" id="日期" @focus="rqHandleFocus()" @keydown="ent1($event, '其他备注', '日期', '组别')" style="width: 120px; " />
  83. </el-form-item>
  84. </el-col>
  85. <el-col :span="4">
  86. <el-form-item label="组别" prop="name" label-width="90px" class="mab">
  87. <el-input v-model="formData.sczl_bzdh" id="组别" @keydown="ent1($event, '日期', '组别', 'bh0')" @blur="getBzsubmit()" style="width: 80px; "/>
  88. </el-form-item>
  89. </el-col>
  90. <el-col :span="8">
  91. <el-form-item label="组长" prop="name" class="mab" label-width="50px">
  92. <el-input v-model="formData.sczl_bh0" id="bh0" @keydown="ent1($event, '组别', 'bh0', 'name0')" @blur="getygsubmit($event, '0')" style="width: 100px; margin-right: 5px;" />
  93. <el-input v-model="formData.sczl_bh0_name" id="name0" :readonly=true @keydown="ent1($event, 'bh0', 'name0', '箱数')" style="width: 100px; " />
  94. </el-form-item>
  95. </el-col>
  96. <el-col :span="4">
  97. <el-form-item label="箱数" prop="name" class="mab" label-width="50px">
  98. <el-input v-model="formData.sczl_cl0" id="箱数" @keydown="ent1($event, 'name0', '箱数', '每箱数')" style="width: 100px; " />
  99. </el-form-item>
  100. </el-col>
  101. <el-col :span="4">
  102. <el-form-item label="每箱数" prop="name" class="mab" label-width="55px">
  103. <el-input v-model="formData.sczl_fp0" id="每箱数" @keydown="ent1($event, '箱数', '每箱数', '工单编号')" style="width: 100px;" />
  104. </el-form-item>
  105. </el-col>
  106. </el-row>
  107. <el-row :gutter="24">
  108. <el-col :span="24">
  109. <el-form-item label="工单编号" prop="id" class="mab">
  110. <el-input v-model="formData.sczl_gdbh" id="工单编号" @keydown="ent1($event, '每箱数', '工单编号', 'yjgx')" @blur="getGxMcsubmit" style="width: 118px; margin-right: 5px;"/>
  111. <el-input v-model="formData.sczl_yjgx" id="yjgx" @keydown="ent1($event, '工单编号', 'yjgx', 'gxmc')" style="width: 80px; margin-right: 5px;"/>
  112. <el-input v-model="formData.sczl_gxmc" id="gxmc" @keydown="ent1($event, 'yjgx', 'gxmc', 'yjmc')" style="width: 135px; margin-right: 5px;"/>
  113. <el-input v-model="formData.yj_yjmc" id="yjmc" @keydown="ent1($event, 'gxmc', 'yjmc', '产量合计')" style="width: 542px;"/>
  114. </el-form-item>
  115. </el-col>
  116. </el-row>
  117. <el-row :gutter="24">
  118. <el-col :span="6">
  119. <el-form-item label="产量合计" prop="id" class="mab">
  120. <el-input v-model="formData.sczl_cl" id="产量合计" @keydown="ent1($event, 'gxmc', '产量合计', '定额代号')" style="width: 150px;" />
  121. </el-form-item>
  122. </el-col>
  123. <el-col :span="6">
  124. <el-form-item label="定额代号" prop="id" label-width="100px" class="mab">
  125. <el-input v-model="formData.sczl_dedh" id="定额代号" @keydown="ent1($event, '产量合计', '定额代号', '检验类别')" @blur="getDedhsubmit" style="width: 150px;" />
  126. </el-form-item>
  127. </el-col>
  128. <el-col :span="6">
  129. <el-form-item label="检验类别" prop="name" class="mab">
  130. <el-input v-model="formData.sczl_检验类别" id="检验类别" @keydown="ent1($event, '定额代号', '检验类别', '废品率系数')" style="width: 150px;"/>
  131. </el-form-item>
  132. </el-col>
  133. <el-col :span="6">
  134. <el-form-item label="废品率系数" prop="name" label-width="100px" class="mab">
  135. <el-input v-model="formData.sczl_废品率系数" id="废品率系数" @keydown="ent1($event, '检验类别', '废品率系数', '计时时数')" style="width: 150px;"/>
  136. </el-form-item>
  137. </el-col>
  138. </el-row>
  139. <el-row :gutter="24">
  140. <el-col :span="6">
  141. <el-form-item label="计时时数" prop="id" class="mab">
  142. <el-input v-model="formData.sczl_jsss" id="计时时数" @keydown="ent1($event, '废品率系数', '计时时数', '冲月定额')" style="width: 100px;"/>
  143. </el-form-item>
  144. </el-col>
  145. <el-col :span="6">
  146. <el-form-item label="冲月定额" prop="id" class="mab" label-width="100px">
  147. <el-input v-model="formData.sczl_冲定额" id="冲月定额" @keydown="ent1($event, '计时时数', '冲月定额', '流程单号1')" style="width: 100px;"/>
  148. </el-form-item>
  149. </el-col>
  150. </el-row>
  151. <el-row :gutter="24">
  152. <el-col :span="17">
  153. <el-form-item label="流程单号" prop="id" class="mab">
  154. <el-input v-model="formData.流程单号1" id="流程单号1" @keydown="ent1($event, '冲月定额', '流程单号1', '流程单号2')" style="width: 60px; margin-right: 5px;"/>
  155. <el-input v-model="formData.流程单号2" id="流程单号2" @keydown="ent1($event, '流程单号1', '流程单号2', '流程单号3')" style="width: 60px; margin-right: 5px;"/>
  156. <el-input v-model="formData.流程单号3" id="流程单号3" @keydown="ent1($event, '流程单号2', '流程单号3', '流程单号4')" style="width: 60px; margin-right: 5px;"/>
  157. <el-input v-model="formData.流程单号4" id="流程单号4" @keydown="ent1($event, '流程单号3', '流程单号4', '流程单号5')" style="width: 60px; margin-right: 5px;"/>
  158. <el-input v-model="formData.流程单号5" id="流程单号5" @keydown="ent1($event, '流程单号4', '流程单号5', '流程单号6')" style="width: 60px; margin-right: 5px;"/>
  159. <el-input v-model="formData.流程单号6" id="流程单号6" @keydown="ent1($event, '流程单号5', '流程单号6', '流程单号7')" style="width: 60px; margin-right: 5px;"/>
  160. <el-input v-model="formData.流程单号7" id="流程单号7" @keydown="ent1($event, '流程单号6', '流程单号7', '流程单号8')" style="width: 60px; margin-right: 5px;"/>
  161. <el-input v-model="formData.流程单号8" id="流程单号8" @keydown="ent1($event, '流程单号7', '流程单号8', '流程单号9')" style="width: 60px; margin-right: 5px;"/>
  162. <el-input v-model="formData.流程单号9" id="流程单号9" @keydown="ent1($event, '流程单号8', '流程单号9', '备注')" style="width: 60px;"/>
  163. </el-form-item>
  164. </el-col>
  165. <el-col :span="7">
  166. <el-form-item label="备注" prop="id" label-width="50px">
  167. <el-input v-model="formData.qczl_NumDesc" id="备注" @keydown="ent1($event, '流程单号9', '备注', 'bh1')" />
  168. </el-form-item>
  169. </el-col>
  170. </el-row>
  171. <el-row :gutter="19" style="margin-bottom: 5px; margin-left: 30px;">
  172. <span style="margin-left: 25px; margin-right: 50px;">员工编号</span>
  173. <span style="margin-right: 50px;">员工姓名</span>
  174. <span style="margin-right: 50px;">&nbsp;&nbsp;箱数&nbsp;&nbsp;</span>
  175. <span style="margin-right: 120px;">每箱数量</span>
  176. <span style="margin-right: 50px;">员工编号</span>
  177. <span style="margin-right: 50px;">员工姓名</span>
  178. <span style="margin-right: 50px;">&nbsp;&nbsp;箱数&nbsp;&nbsp;</span>
  179. <span>每箱数量</span>
  180. </el-row>
  181. <el-row :gutter="24" style="margin-bottom: 5px; margin-left: 30px;">
  182. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_bh1" id="bh1" @keydown="ent1($event, '备注', 'bh1', 'name')" @keyup.enter.native="getygsubmit($event, '1')"/>
  183. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_bh1_name" id="name1" @keydown="ent1($event, 'bh1', 'name', 'cl1')"/>
  184. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_cl1" id="cl1" @keydown="ent1($event, 'name', 'cl1', 'fp1')" />
  185. <el-input style="width: 100px; margin-right: 60px;" v-model="formData.sczl_fp1" id="fp1" @keydown="ent1($event, 'cl1', 'fp1', 'bh7')" />
  186. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_bh7" id="bh7" @keydown="ent1($event, 'fp1', 'bh7', 'name7')" @keyup.enter.native="getygsubmit($event, '7')" />
  187. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_bh7_name" id="name7" @keydown="ent1($event, 'bh7', 'name7', 'cl7')" />
  188. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_cl7" id="cl7" @keydown="ent1($event, 'name7', 'cl7', 'fp7')" />
  189. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_fp7" id="fp7" @keydown="ent1($event, 'cl7', 'fp7', 'bh2')" />
  190. </el-row>
  191. <el-row :gutter="24" style="margin-bottom: 5px; margin-left: 30px;">
  192. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_bh2" id="bh2" @keydown="ent1($event, 'fp7', 'bh2', 'name2')" @keyup.enter.native="getygsubmit($event, '2')" />
  193. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_bh2_name" id="name2" @keydown="ent1($event, 'bh2', 'name2', 'cl2')" />
  194. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_cl2" id="cl2" @keydown="ent1($event, 'name2', 'cl2', 'fp2')" />
  195. <el-input style="width: 100px; margin-right: 60px;" v-model="formData.sczl_fp2" id="fp2" @keydown="ent1($event, 'cl2', 'fp2', 'bh8')" />
  196. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_bh8" id="bh8" @keydown="ent1($event, 'fp2', 'bh8', 'name8')" @keyup.enter.native="getygsubmit($event, '8')" />
  197. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_bh8_name" id="name8" @keydown="ent1($event, 'bh8', 'name8', 'cl8')" />
  198. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_cl8" id="cl8" @keydown="ent1($event, 'name8', 'cl8', 'fp8')" />
  199. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_fp8" id="fp8" @keydown="ent1($event, 'cl8', 'fp8', 'bh3')" />
  200. </el-row>
  201. <el-row :gutter="24" style="margin-bottom: 5px; margin-left: 30px;">
  202. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_bh3" id="bh3" @keydown="ent1($event, 'fp8', 'bh3', 'name3')" @keyup.enter.native="getygsubmit($event, '3')" />
  203. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_bh3_name" id="name3" @keydown="ent1($event, 'bh3', 'name3', 'cl3')" />
  204. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_cl3" id="cl3" @keydown="ent1($event, 'name3', 'cl3', 'fp3')" />
  205. <el-input style="width: 100px; margin-right: 60px;" v-model="formData.sczl_fp3" id="fp3" @keydown="ent1($event, 'cl3', 'fp3', 'bh9')" />
  206. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_bh9" id="bh9" @keydown="ent1($event, 'fp3', 'bh9', 'name9')" @keyup.enter.native="getygsubmit($event, '9')" />
  207. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_bh9_name" id="name9" @keydown="ent1($event, 'bh9', 'name9', 'cl9')" />
  208. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_cl9" id="cl9" @keydown="ent1($event, 'name9', 'cl9', 'fp9')" />
  209. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_fp9" id="fp9" @keydown="ent1($event, 'cl9', 'fp9', 'bh4')" />
  210. </el-row>
  211. <el-row :gutter="24" style="margin-bottom: 5px; margin-left: 30px;">
  212. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_bh4" id="bh4" @keydown="ent1($event, 'fp9', 'bh4', 'name4')" @keyup.enter.native="getygsubmit($event, '4')" />
  213. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_bh4_name" id="name4" @keydown="ent1($event, 'bh4', 'name4', 'cl4')" />
  214. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_cl4" id="cl4" @keydown="ent1($event, 'name4', 'cl4', 'fp4')" />
  215. <el-input style="width: 100px; margin-right: 60px;" v-model="formData.sczl_fp4" id="fp4" @keydown="ent1($event, 'cl4', 'fp4', 'bh10')" />
  216. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_bh10" id="bh10" @keydown="ent1($event, 'fp4', 'bh10', 'name10')" @keyup.enter.native="getygsubmit($event, '10')" />
  217. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_bh10_name" id="name10" @keydown="ent1($event, 'bh10', 'name10', 'cl10')" />
  218. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_cl10" id="cl10" @keydown="ent1($event, 'name10', 'cl10', 'fp10')" />
  219. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_fp10" id="fp10" @keydown="ent1($event, 'cl10', 'fp10', 'bh5')" />
  220. </el-row>
  221. <el-row :gutter="24" style="margin-bottom: 5px; margin-left: 30px;">
  222. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_bh5" id="bh5" @keydown="ent1($event, 'fp10', 'bh5', 'name5')" @keyup.enter.native="getygsubmit($event, '5')" />
  223. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_bh5_name" id="name5" @keydown="ent1($event, 'bh5', 'name5', 'cl5')" />
  224. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_cl5" id="cl5" @keydown="ent1($event, 'name5', 'cl5', 'fp5')" />
  225. <el-input style="width: 100px; margin-right: 60px;" v-model="formData.sczl_fp5" id="fp5" @keydown="ent1($event, 'cl5', 'fp5', 'bh11')" />
  226. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_bh11" id="bh11" @keydown="ent1($event, 'fp5', 'bh11', 'name11')" @keyup.enter.native="getygsubmit($event, '11')" />
  227. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_bh11_name" id="name11" @keydown="ent1($event, 'bh11', 'name11', 'cl11')" />
  228. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_cl11" id="cl11" @keydown="ent1($event, 'name11', 'cl11', 'fp11')" />
  229. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_fp11" id="fp11" @keydown="ent1($event, 'cl11', 'fp11', 'bh6')" />
  230. </el-row>
  231. <el-row :gutter="24" style="margin-bottom: 5px; margin-left: 30px;">
  232. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_bh6" id="bh6" @keydown="ent1($event, 'fp11', 'bh6', 'name6')" @keyup.enter.native="getygsubmit($event, '6')" />
  233. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_bh6_name" id="name6" @keydown="ent1($event, 'bh6', 'name6', 'cl6')" />
  234. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_cl6" id="cl6" @keydown="ent1($event, 'name6', 'cl6', 'fp6')" />
  235. <el-input style="width: 100px; margin-right: 60px;" :readonly=true v-model="formData.sczl_fp6" id="fp6" @keydown="ent1($event, 'cl6', 'fp6', 'bh12')" />
  236. <el-input style="width: 100px; margin-right: 5px;" v-model="formData.sczl_bh12" id="bh12" @keydown="ent1($event, 'fp6', 'bh12', 'name12')" @keyup.enter.native="getygsubmit($event, '12')" />
  237. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_bh12_name" id="name12" @keydown="ent1($event, 'bh12', 'name12', 'cl12')" />
  238. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_cl12" id="cl12" @keydown="ent1($event, 'name12', 'cl12', 'fp12')" />
  239. <el-input style="width: 100px; margin-right: 5px;" :readonly=true v-model="formData.sczl_fp12" id="fp12" @keydown="ent1($event, 'cl12', 'fp12', '其他备注')" />
  240. </el-row>
  241. <el-row :gutter="24">
  242. <el-col :span="24">
  243. <el-form-item label="其他备注" prop="id" class="mab">
  244. <el-input type="textarea" rows="2" cols="50" v-model="formData.sczl_desc" id="其他备注" @keydown="ent1($event, 'fp12', '其他备注', '日期')" />
  245. </el-form-item>
  246. </el-col>
  247. </el-row>
  248. </el-form>
  249. <el-dialog
  250. v-model="dialogSelectVisible"
  251. title="选择"
  252. destroy-on-close
  253. width="600px"
  254. >
  255. <el-table
  256. tooltip-effect="dark"
  257. :data="selectData"
  258. row-key="ID"
  259. highlight-current-row="true"
  260. border
  261. style="width:100%"
  262. @row-dblclick="handleSelectClick"
  263. >
  264. <el-table-column
  265. prop="Gd_cpmc"
  266. label="印件名称"
  267. width="340"
  268. />
  269. <el-table-column
  270. prop="jyGx"
  271. label="检验工序"
  272. width="150"
  273. />
  274. <el-table-column
  275. prop="Gy0_gxmc"
  276. label="工序名称"
  277. width="150"
  278. />
  279. </el-table>
  280. </el-dialog>
  281. <template #footer>
  282. <div class="dialog-footer">
  283. <el-button @click="closeDialog">取 消</el-button>
  284. <el-button type="primary" @click="enterDialog">确 定</el-button>
  285. </div>
  286. </template>
  287. </el-dialog>
  288. <el-dialog
  289. v-model="GetDedhVisible"
  290. title="选择"
  291. destroy-on-close
  292. width="600px"
  293. >
  294. <el-aside width="250px">
  295. <div class="JKWTree-tree">
  296. <el-tree :data="GetDedhtreeData" :props="defaultProps" highlight-current="true"
  297. @node-click="GetDedhhandleNodeClick" @node-dblclick="handleNodeDoubleClick"></el-tree>
  298. </div>
  299. </el-aside>
  300. </el-dialog>
  301. <el-dialog v-model="BzVisible" title="选择" destroy-on-close width="200px" >
  302. <el-table tooltip-effect="dark" :data="selectDataBz" row-key="ID"
  303. highlight-current-row="true" border style="width:100%"
  304. @row-dblclick="SelectClickBz"
  305. >
  306. <el-table-column prop="sczl_bzdh" label="班组" width="150" />
  307. </el-table>
  308. </el-dialog>
  309. </el-main>
  310. </el-container>
  311. </el-container>
  312. </div>
  313. </template>
  314. <script setup>
  315. import {
  316. getDateList,
  317. getInspectCount,
  318. shougonglocate,
  319. shougonggetInfo,
  320. shougonggetGxMc,
  321. shougonggetDedh,
  322. shougonggetScrapFactor,
  323. shougongedit,
  324. shougongdel,
  325. getYg,
  326. getInspectCountByGdbh,
  327. inspectadd
  328. } from '@/api/jixiaoguanli/jitairibaobiao'
  329. // 全量引入格式化工具 请按需保留
  330. import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
  331. import { ElMessage, ElMessageBox } from 'element-plus'
  332. import { Search, Refresh, Download } from '@element-plus/icons-vue'
  333. import { ref, reactive, nextTick, onMounted, onBeforeMount } from 'vue'
  334. import { getPackingSideTable, getPackingTable } from '@/api/mes_api_gty/myapi'
  335. import { Layout, LayoutContent, LayoutHeader, LayoutSider } from '@arco-design/web-vue'
  336. defineOptions({
  337. name: '06-packingDocuments'
  338. })
  339. // 侧边栏数据请求
  340. const treeData = reactive([]);
  341. const getTabdata = async () => {
  342. //接口调用函数
  343. const response = await getInspectCount();
  344. console.log(response)
  345. const transformedData = response.data.map(item => ({
  346. label: `${item.date.replace(/-/g, '.')}【单据数: ${item.counts}张】`,
  347. children: item.sys.map(sysItem => ({
  348. label: `${sysItem.sys_id} 【记录数: ${sysItem.count}张】`,
  349. params: {
  350. date: item.date.replace(/-/g, '.'),
  351. sys_id: sysItem.sys_id,
  352. total: sysItem.count,
  353. },
  354. })),
  355. }));
  356. treeData.splice(0, treeData.length, ...transformedData);
  357. displayMod.value = 'date'
  358. }
  359. getTabdata();
  360. // 自动化生成的字典(可能为空)以及字段
  361. const formData = ref({
  362. sczl_rq: '',
  363. sczl_bzdh: '',
  364. sczl_bh0: '',
  365. sczl_bh0_name: '',
  366. sczl_cl0: '',
  367. sczl_fp0: '',
  368. sczl_gdbh: '',
  369. sczl_yjgx: '',
  370. sczl_gxmc: '',
  371. yj_yjmc: '',
  372. sczl_cl: '',
  373. sczl_dedh: '',
  374. sczl_检验类别: '',
  375. sczl_废品率系数: '',
  376. sczl_jsss: '',
  377. sczl_冲定额: '',
  378. 流程单号1: '',
  379. 流程单号2: '',
  380. 流程单号3: '',
  381. 流程单号4: '',
  382. 流程单号5: '',
  383. 流程单号6: '',
  384. 流程单号7: '',
  385. 流程单号8: '',
  386. 流程单号9: '',
  387. qczl_NumDesc: '',
  388. sczl_desc: '',
  389. sczl_bh1: '',
  390. sczl_bh2: '',
  391. sczl_bh3:'',
  392. sczl_bh4: '',
  393. sczl_bh5: '',
  394. sczl_bh6: '',
  395. sczl_bh7: '',
  396. sczl_bh8: '',
  397. sczl_bh9: '',
  398. sczl_bh10: '',
  399. sczl_bh11: '',
  400. sczl_bh12: '',
  401. sczl_bh1_name: '',
  402. sczl_bh2_name: '',
  403. sczl_bh3_name: '',
  404. sczl_bh4_name: '',
  405. sczl_bh5_name: '',
  406. sczl_bh6_name: '',
  407. sczl_bh7_name: '',
  408. sczl_bh8_name: '',
  409. sczl_bh9_name: '',
  410. sczl_bh10_name: '',
  411. sczl_bh11_name: '',
  412. sczl_bh12_name: '',
  413. sczl_cl1: '',
  414. sczl_cl2: '',
  415. sczl_cl3: '',
  416. sczl_cl4: '',
  417. sczl_cl5: '',
  418. sczl_cl6: '',
  419. sczl_cl7: '',
  420. sczl_cl8: '',
  421. sczl_cl9: '',
  422. sczl_cl10: '',
  423. sczl_cl11:'',
  424. sczl_cl12: '',
  425. sczl_fp1: '',
  426. sczl_fp2: '',
  427. sczl_fp3: '',
  428. sczl_fp4: '',
  429. sczl_fp5: '',
  430. sczl_fp6: '',
  431. sczl_fp7: '',
  432. sczl_fp8: '',
  433. sczl_fp9: '',
  434. sczl_fp10: '',
  435. sczl_fp11: '',
  436. sczl_fp12: '',
  437. })
  438. const initFormData = () => {
  439. formData.value = {
  440. sczl_rq: '',
  441. sczl_bzdh: '',
  442. sczl_bh0: '',
  443. sczl_bh0_name: '',
  444. sczl_cl0: '0.00',
  445. sczl_fp0: '0',
  446. sczl_gdbh: '',
  447. sczl_yjgx: '',
  448. sczl_gxmc: '',
  449. yj_yjmc: '',
  450. sczl_cl: '0',
  451. sczl_dedh: '',
  452. sczl_检验类别: '',
  453. sczl_废品率系数: '0.000',
  454. sczl_jsss: '0.00',
  455. sczl_冲定额: '',
  456. 流程单号1: '',
  457. 流程单号2: '',
  458. 流程单号3: '',
  459. 流程单号4: '',
  460. 流程单号5: '',
  461. 流程单号6: '',
  462. 流程单号7: '',
  463. 流程单号8: '',
  464. 流程单号9: '',
  465. qczl_NumDesc: '',
  466. sczl_desc: '',
  467. sczl_bh1: '',
  468. sczl_bh2: '',
  469. sczl_bh3:'',
  470. sczl_bh4: '',
  471. sczl_bh5: '',
  472. sczl_bh6: '',
  473. sczl_bh7: '',
  474. sczl_bh8: '',
  475. sczl_bh9: '',
  476. sczl_bh10: '',
  477. sczl_bh11: '',
  478. sczl_bh12: '',
  479. sczl_bh1_name: '',
  480. sczl_bh2_name: '',
  481. sczl_bh3_name: '',
  482. sczl_bh4_name: '',
  483. sczl_bh5_name: '',
  484. sczl_bh6_name: '',
  485. sczl_bh7_name: '',
  486. sczl_bh8_name: '',
  487. sczl_bh9_name: '',
  488. sczl_bh10_name: '',
  489. sczl_bh11_name: '',
  490. sczl_bh12_name: '',
  491. sczl_cl1: '0',
  492. sczl_cl2: '0',
  493. sczl_cl3: '0',
  494. sczl_cl4: '0',
  495. sczl_cl5: '0',
  496. sczl_cl6: '0',
  497. sczl_cl7: '0',
  498. sczl_cl8: '0',
  499. sczl_cl9: '0',
  500. sczl_cl10: '0',
  501. sczl_cl11:'0',
  502. sczl_cl12: '0',
  503. sczl_fp1: '0',
  504. sczl_fp2: '0',
  505. sczl_fp3: '0',
  506. sczl_fp4: '0',
  507. sczl_fp5: '0',
  508. sczl_fp6: '0',
  509. sczl_fp7: '0',
  510. sczl_fp8: '0',
  511. sczl_fp9: '0',
  512. sczl_fp10: '0',
  513. sczl_fp11: '0',
  514. sczl_fp12: '0',
  515. };
  516. }
  517. // 验证规则
  518. const rule = reactive({
  519. })
  520. const elFormRef = ref()
  521. const elSearchFormRef = ref()
  522. // =========== 表格控制部分 ===========
  523. const tableData = reactive([])
  524. const detailData = reactive([])
  525. const total = ref(0)
  526. const page = ref(1)
  527. const limit = ref(10)
  528. const searchInfo = ref('')
  529. const params = {
  530. type: '',
  531. date: '',
  532. sys_id: '',
  533. gdbh: '',
  534. }
  535. // 分页设置
  536. const handleSizeChange = (val) => {
  537. switch (params.type) {
  538. case 'getTableData':
  539. getTableData()
  540. break
  541. case 'getLocateTable':
  542. GetLocate()
  543. break
  544. default:
  545. break
  546. }
  547. }
  548. // 页面跳转
  549. const handleCurrentChange = (val) => {
  550. switch (params.type) {
  551. case 'getTableData':
  552. getTableData()
  553. break
  554. case 'getLocateTable':
  555. GetLocate()
  556. break
  557. default:
  558. break
  559. }
  560. console.log(params.type)
  561. }
  562. const getTableData = async() => {
  563. // const response = await getDateList(params);
  564. // console.log(response)
  565. // if (response.code === 0) {
  566. // const processedData = response.data.data.map(item => {
  567. // return {
  568. // ...item,
  569. // combinedProp: item.sczl_gdbh + '--'+item.yj_yjmc,
  570. // combinedProp2: item.sczl_yjgx + '-'+item.sczl_gxmc
  571. // };
  572. // });
  573. // tableData.splice(0, tableData.length, ...processedData);
  574. // }
  575. const response = await getDateList({
  576. date: params.date, sys_id: params.sys_id,
  577. page: page.value.toString(), limit: limit.value.toString(),
  578. })
  579. if (response.code === 0) {
  580. console.log(response)
  581. const processedData = response.data.data.map(item => {
  582. return {
  583. ...item,
  584. combinedProp: item.sczl_gdbh + '--'+item.yj_yjmc,
  585. combinedProp2: item.sczl_yjgx + '-'+item.sczl_gxmc
  586. };
  587. });
  588. tableData.splice(0, tableData.length, ...processedData);
  589. console.log(tableData)
  590. }
  591. }
  592. const handleNodeClick = (node,check) => {
  593. //存放当前节点的nodeId
  594. if (node.params) {
  595. params.date = node.params.date.replace(/\./g, '-');
  596. params.sys_id = node.params.sys_id;
  597. params.type = 'getTableData'
  598. total.value = node.params.total;
  599. page.value = 1
  600. getTableData();
  601. }
  602. }
  603. //定位
  604. const GetLocate = async () => {
  605. const response = await shougonglocate({
  606. gdbh: params.gdbh,
  607. page: page.value.toString(), limit: limit.value.toString(),
  608. })
  609. console.log(response)
  610. if (response.code === 0) {
  611. const processedData = response.data.rows.map(item => {
  612. return {
  613. ...item,
  614. combinedProp: item.sczl_gdbh + '--'+item.yj_yjmc,
  615. combinedProp2: item.sczl_yjgx + '-'+item.sczl_gxmc
  616. };
  617. });
  618. total.value = response.data.total
  619. tableData.splice(0, tableData.length, ...processedData);
  620. }
  621. }
  622. let positionvalue=ref()
  623. // 搜索
  624. function onSearch() {
  625. params.gdbh = positionvalue.value
  626. params.type = 'getLocateTable'
  627. page.value = 1
  628. GetLocate()
  629. }
  630. //获取详细信息
  631. const GetInfo = async (value) => {
  632. const response = await shougonggetInfo({UniqId:value});
  633. console.log(response)
  634. if (response.code === 0) {
  635. formData.value=response.data;
  636. }
  637. }
  638. //键盘 input框跳转
  639. const ent1 = (event) => {
  640. const inputs = document.getElementsByTagName('input');
  641. const currentIndex = Array.from(inputs).indexOf(event.target);
  642. if (event.keyCode === 13 || event.keyCode === 40) { // Enter 或向下箭头
  643. for (let i = currentIndex + 1; i < inputs.length; i++) {
  644. if (!inputs[i].readOnly) {
  645. nextTick(()=>{
  646. inputs[i].focus();
  647. inputs[i].select();
  648. })
  649. break;
  650. }
  651. }
  652. } else if (event.keyCode === 38) { // 向上箭头
  653. for (let i = currentIndex - 1; i >= 0; i--) {
  654. if (!inputs[i].readOnly) {
  655. nextTick(()=>{
  656. inputs[i].focus();
  657. inputs[i].select();
  658. })
  659. break;
  660. }
  661. }
  662. } else if (event.keyCode === 8) { // 删除箭头
  663. if (event.target.selectionStart === 0) {
  664. for (let i = currentIndex - 1; i >= 0; i--) {
  665. if (!inputs[i].readOnly) {
  666. nextTick(()=>{
  667. inputs[i].focus();
  668. inputs[i].setSelectionRange(0, 0);
  669. })
  670. break;
  671. }
  672. }
  673. }
  674. } else if (event.keyCode === 37) { // 向左箭头
  675. if (event.target.selectionStart === 0) {
  676. for (let i = currentIndex - 1; i >= 0; i--) {
  677. if (!inputs[i].readOnly) {
  678. nextTick(()=>{
  679. inputs[i].focus();
  680. inputs[i].select();
  681. })
  682. break;
  683. }
  684. }
  685. }
  686. } else if (event.keyCode === 39) { // 向右箭头
  687. if (event.target.selectionStart === event.target.value.length) {
  688. for (let i = currentIndex + 1; i < inputs.length; i++) {
  689. if (!inputs[i].readOnly) {
  690. nextTick(()=>{
  691. inputs[i].focus();
  692. inputs[i].select();
  693. })
  694. break;
  695. }
  696. }
  697. }
  698. }
  699. }
  700. //追加字体颜色和不可输入
  701. const setColorReadonly = (id) => {
  702. const newInput = document.getElementById(id)
  703. newInput.style.color = 'red';
  704. newInput.setAttribute('readonly', true);
  705. }
  706. //追加字体颜色和可输入
  707. const unsetColorReadonly = (id) => {
  708. const newInput = document.getElementById(id)
  709. newInput.style.color = 'black';
  710. newInput.removeAttribute('readonly');
  711. }
  712. //日期获得焦点事件
  713. const rqHandleFocus = () =>{
  714. if(formData.value.sczl_rq==''){
  715. formData.value.sczl_rq = new Date().toISOString().split('T')[0]
  716. }
  717. }
  718. //班组失去焦点事件
  719. const getBzsubmit = () => {
  720. //弹出选择
  721. const data = [{'sczl_bzdh':'A班'},{'sczl_bzdh':'B班'}]
  722. selectDataBz.splice(0, selectDataBz.length, ...data)
  723. BzVisible.value=true
  724. }
  725. //班组选择
  726. const selectDataBz = reactive([])
  727. const BzVisible = ref(false)
  728. const SelectClickBz = (row, column, event) => {
  729. const {sczl_bzdh } = row
  730. formData.value.sczl_bzdh=row.sczl_bzdh
  731. BzVisible.value = false
  732. }
  733. //员工编号失去焦点事件
  734. const getygsubmit = async (event, inputName) => {
  735. let combinedString = 'sczl_bh' + inputName;
  736. let value = eval('formData.value.' + combinedString);
  737. if(value){
  738. const response = await getYg({sczl_bh:value});
  739. console.log(response)
  740. if (response.code === 0) {
  741. let Bname = 'sczl_bh' + inputName+'_name';
  742. formData.value[Bname]=response.data.ygxm;
  743. //设置姓名样式
  744. setColorReadonly('name'+inputName);
  745. }
  746. }
  747. }
  748. //工单编号失去焦点事件
  749. // const getGxMcsubmit = async() => {
  750. // if(!formData.value.sczl_gdbh){
  751. // return false
  752. // }
  753. // if(GetDedhVisible.value){
  754. // return false
  755. // }
  756. // const response = await shougonggetGxMc({gdbh:formData.value.sczl_gdbh});
  757. // if (response.code === 0) {
  758. // if(response.data.length==0){
  759. // ElMessage({
  760. // type: 'error',
  761. // message: '查无此编号的工单,请仔细检查后重新输入'
  762. // })
  763. // //设置输入框的值为空
  764. // formData.value.sczl_gdbh = ''
  765. // formData.value.sczl_yjgx = ''
  766. // formData.value.sczl_gxmc = ''
  767. // formData.value.yj_yjmc = ''
  768. // }else if(response.data.length==1){
  769. // const { Gd_cpmc, Gy0_yjno, Gy0_gxh, Gy0_gxmc,jyGx} = response.data[0]
  770. // formData.value.yj_yjmc=Gd_cpmc
  771. // formData.value.sczl_gxmc=Gy0_gxmc
  772. // formData.value.sczl_yjgx=jyGx
  773. // setColorReadonly('yjgx');
  774. // setColorReadonly('gxmc');
  775. // setColorReadonly('yjmc');
  776. // }else{
  777. // selectData.splice(0, selectData.length, ...response.data)
  778. // dialogSelectVisible.value=true
  779. // }
  780. // }
  781. // }
  782. const dialogSelectVisible = ref(false)
  783. const selectData = reactive([])
  784. // 工单选择框
  785. const handleSelectClick = (row, column, event) => {
  786. const { Gd_cpmc, Gy0_yjno, Gy0_gxh, Gy0_gxmc,jyGx } = row
  787. formData.value.yj_yjmc=Gd_cpmc
  788. formData.value.sczl_gxmc=Gy0_gxmc
  789. formData.value.sczl_yjgx=jyGx
  790. setColorReadonly('yjgx');
  791. setColorReadonly('gxmc');
  792. setColorReadonly('yjmc');
  793. dialogSelectVisible.value = false
  794. }
  795. //定额代号回车事件
  796. const getDedhsubmit = () => {
  797. if(dialogSelectVisible.value){
  798. return false
  799. }
  800. GetDedh()
  801. }
  802. let GetDedhtreeData = reactive([]);
  803. const GetDedhVisible = ref(false)
  804. //获取定额代号
  805. const GetDedh = async (value) => {
  806. const response = await shougonggetDedh();
  807. const treeData = {};
  808. if(response.code==0){
  809. const data = [];
  810. data[0] = response.data;
  811. // 递归函数来构建树形结构
  812. const buildTree = (node) => {
  813. const treeNode = {
  814. label: node.sys_bh + '【' + node.sys_mc+'】',
  815. children: []
  816. };
  817. // 如果存在子节点,递归地添加它们
  818. if (node.bh_mc && Array.isArray(node.bh_mc)) {
  819. node.bh_mc.forEach(childNode => {
  820. treeNode.children.push(buildTree(childNode)); // 递归调用
  821. });
  822. }
  823. return treeNode;
  824. };
  825. // 构建树形结构的根节点
  826. const treeData = data.map(buildTree);
  827. GetDedhtreeData = treeData;
  828. GetDedhVisible.value=true
  829. }
  830. }
  831. //定额代号树形结构单机
  832. const GetDedhhandleNodeClick = (nodeData, node, component) => {
  833. //存放当前节点的nodeId
  834. if (!nodeData.children || nodeData.children.length === 0) {
  835. // 点击的是子节点
  836. formData.value.sczl_dedh=nodeData.label.split("【")[0]
  837. GetDedhVisible.value=false
  838. }
  839. // 执行相应的父节点单击事件处理逻辑
  840. }
  841. //刷新废品率系数
  842. const GetScrapFactor = async (value) => {
  843. const response = await shougonggetScrapFactor(value);
  844. if(response.code==0){
  845. console.log(response.data.num)
  846. const rowIndex = tableData.findIndex(row => row.UniqId === lastCellValue);
  847. console.log(rowIndex)
  848. tableData[rowIndex].sczl_废品率系数 = response.data.num;
  849. }
  850. // console.log(response)
  851. // const rowIndex = tableData.findIndex(row => row.UniqId === 123);
  852. }
  853. const ADD=ref('0')
  854. //新增
  855. function onAdd() {
  856. ADD.value='新增'
  857. type.value = 'create'
  858. if(typeof(lastCellValue)=='number'){
  859. GetInfo(lastCellValue)
  860. }
  861. initFormData()
  862. dialogFormVisible.value = true
  863. // Productionadd()
  864. }
  865. const ScrapFactor={
  866. gdbh:'',
  867. yjno:'',
  868. gxh:'',
  869. type:'',
  870. }
  871. // 刷新废品率系数
  872. function onRefresh() {
  873. GetScrapFactor(ScrapFactor)
  874. }
  875. // 更新数据
  876. const updateDetailData = async() => {
  877. const restoredData = {
  878. UniqId: lastCellValue,
  879. sczl_rq: formData.value.sczl_rq,
  880. sczl_bzdh: formData.value.sczl_bzdh,
  881. sczl_bh0: formData.value.sczl_bh0,
  882. sczl_cl0: formData.value.sczl_cl0,
  883. sczl_fp0: formData.value.sczl_fp0,
  884. sczl_gdbh: formData.value.sczl_gdbh,
  885. sczl_yjgx: formData.value.sczl_yjgx,
  886. sczl_gxmc: formData.value.sczl_gxmc,
  887. sczl_cl:formData.value.sczl_cl,
  888. sczl_dedh: formData.value.sczl_dedh,
  889. sczl_检验类别: formData.value.sczl_检验类别,
  890. sczl_废品率系数: formData.value.sczl_废品率系数,
  891. sczl_jsss: formData.value.sczl_jsss,
  892. sczl_冲定额: formData.value.sczl_冲定额,
  893. qczl_Num:formData.value.qczl_NumDesc,
  894. qczl_NumDesc:formData.value.流程单号1,
  895. qczl_NumDesc1: formData.value.流程单号2,
  896. qczl_NumDesc2: formData.value.流程单号3,
  897. qczl_NumDesc3: formData.value.流程单号4,
  898. qczl_NumDesc4: formData.value.流程单号5,
  899. qczl_NumDesc5: formData.value.流程单号6,
  900. qczl_NumDesc6: formData.value.流程单号7,
  901. qczl_NumDesc7: formData.value.流程单号8,
  902. qczl_NumDesc8: formData.value.流程单号9,
  903. sczl_desc: formData.value.sczl_desc,
  904. sczl_bh1: formData.value.sczl_bh1,
  905. sczl_bh2: formData.value.sczl_bh2,
  906. sczl_bh3:formData.value.sczl_bh3,
  907. sczl_bh4: formData.value.sczl_bh4,
  908. sczl_bh5: formData.value.sczl_bh5,
  909. sczl_bh6: formData.value.sczl_bh6,
  910. sczl_bh7: formData.value.sczl_bh7,
  911. sczl_bh8: formData.value.sczl_bh8,
  912. sczl_bh9: formData.value.sczl_bh9,
  913. sczl_bh10: formData.value.sczl_bh10,
  914. sczl_bh11: formData.value.sczl_bh11,
  915. sczl_bh12: formData.value.sczl_bh12,
  916. sczl_cl1: formData.value.sczl_cl1,
  917. sczl_cl2: formData.value.sczl_cl2,
  918. sczl_cl3: formData.value.sczl_cl3,
  919. sczl_cl4: formData.value.sczl_cl4,
  920. sczl_cl5: formData.value.sczl_cl5,
  921. sczl_cl6: formData.value.sczl_cl6,
  922. sczl_cl7: formData.value.sczl_cl7,
  923. sczl_cl8: formData.value.sczl_cl8,
  924. sczl_cl9: formData.value.sczl_cl9,
  925. sczl_cl10: formData.value.sczl_cl10,
  926. sczl_cl11:formData.value.sczl_cl11,
  927. sczl_cl12: formData.value.sczl_cl12,
  928. sczl_fp1: formData.value.sczl_fp1,
  929. sczl_fp2: formData.value.sczl_fp2,
  930. sczl_fp3: formData.value.sczl_fp3,
  931. sczl_fp4: formData.value.sczl_fp4,
  932. sczl_fp5: formData.value.sczl_fp5,
  933. sczl_fp6: formData.value.sczl_fp6,
  934. sczl_fp7: formData.value.sczl_fp7,
  935. sczl_fp8: formData.value.sczl_fp8,
  936. sczl_fp9: formData.value.sczl_fp9,
  937. sczl_fp10: formData.value.sczl_fp10,
  938. sczl_fp11: formData.value.sczl_fp11,
  939. sczl_fp12: formData.value.sczl_fp12,
  940. sys_id:'[1013/洪丽]',
  941. }
  942. // detailData.table.forEach((item, index, array) => {
  943. // const num = index + 1
  944. // restoredData[`sczl_gdbh${num}`] = item.sczl_gdbh
  945. // restoredData[`sczl_yjGx${num}`] = item.sczl_yjGx
  946. // restoredData[`sczl_gxmc${num}`] = item.sczl_gxmc
  947. // // restoredData[`Gd_cpmc${num}`] = item.Gd_cpmc
  948. // restoredData[`sczl_cl${num}`] = item.sczl_cl
  949. // restoredData[`sczl_PgCl${num}`] = item.sczl_PgCl
  950. // restoredData[`sczl_clAdd${num}`] = item.sczl_clAdd
  951. // })
  952. if(ADD.value=='新增'){
  953. // console.log('新增')
  954. console.log('新增')
  955. console.log(ADD.value)
  956. console.log(restoredData)
  957. const response = await inspectadd(restoredData);
  958. // ADD.value='1'
  959. // console.log(ADD.value)
  960. ADD.value='0'
  961. console.log(response)
  962. if(response.code==0){
  963. ElMessage({
  964. type: 'success',
  965. message: '新增成功',
  966. })
  967. }
  968. dialogFormVisible.value = false
  969. }else{
  970. const response = await shougongedit(restoredData);
  971. console.log('修改')
  972. console.log(ADD.value)
  973. console.log(response)
  974. if(response.code==0){
  975. ElMessage({
  976. type: 'success',
  977. message: '更新成功',
  978. })
  979. }
  980. dialogFormVisible.value = false
  981. // ADD.value='0'
  982. // console.log(ADD.value)
  983. }
  984. // console.log(restoredData)
  985. // console.log(lastCellValue)
  986. // formData.value.UniqId=lastCellValue
  987. // console.log(formData)
  988. // restoredData.UniqId='5'
  989. // console.log(FormData)
  990. // console.log(response)
  991. }
  992. // 删除
  993. function onDel() {
  994. Del()
  995. }
  996. //删除
  997. const Del = async () => {
  998. const response = await shougongdel({UniqId:lastCellValue});
  999. if (response.code === 0) {
  1000. ElMessage({
  1001. type: 'success',
  1002. message: '删除成功',
  1003. })
  1004. }
  1005. getTableData()
  1006. }
  1007. const displayMod = ref('')
  1008. // 按工单显示
  1009. function onCountByGdbh() {
  1010. console.log(displayMod.value)
  1011. if (displayMod.value === 'date') {
  1012. displayMod.value = 'gd'
  1013. CountByGdbh()
  1014. console.log(displayMod.value)
  1015. } else {
  1016. getTabdata()
  1017. }
  1018. // CountByGdbh()
  1019. }
  1020. //按工单显示
  1021. const CountByGdbh = async () => {
  1022. const response = await getInspectCountByGdbh();
  1023. // console.log(response)
  1024. if (response.code === 0) {
  1025. console.log(response)
  1026. const transformedData = response.data.map(item => ({
  1027. label: `${item.sczl_gdbh+item.cpmc}`,
  1028. children: item.sys.map(sysItem => ({
  1029. label: `${sysItem.sys_id} 【记录数: ${sysItem.count}张】`,
  1030. params: {
  1031. date: item.sczl_gdbh,
  1032. sys_id: sysItem.sys_id,
  1033. total: sysItem.count,
  1034. },
  1035. })),
  1036. }));
  1037. treeData.splice(0, treeData.length, ...transformedData);
  1038. }
  1039. // getTableData()
  1040. }
  1041. // ============== 表格控制部分结束 ===============
  1042. // 获取需要的字典 可能为空 按需保留
  1043. const setOptions = async () => {
  1044. }
  1045. // 获取需要的字典 可能为空 按需保留
  1046. setOptions()
  1047. // 多选数据
  1048. const multipleSelection = ref([])
  1049. // 多选
  1050. const handleSelectionChange = (val) => {
  1051. if(val.length>0){
  1052. multipleSelection.value = val
  1053. const lenth=val.length
  1054. ScrapFactor.gdbh=val[lenth-1].combinedProp.split('-')[0];
  1055. const parts = val[lenth-1].combinedProp2.split('-')
  1056. ScrapFactor.yjno=parts[0];
  1057. ScrapFactor.gxh=parts[1];
  1058. // ScrapFactor.type=val[lenth-1].sczl_检验类别
  1059. ScrapFactor.type='正品板'
  1060. console.log(ScrapFactor)
  1061. lastCellValue=val[lenth-1].UniqId
  1062. console.log(ScrapFactor)
  1063. val.splice(0, val.length); // 清空 val 数组
  1064. console.log(lastCellValue)
  1065. }
  1066. }
  1067. // 批量删除控制标记
  1068. const deleteVisible = ref(false)
  1069. // 多选删除
  1070. const onDelete = async () => {
  1071. const ids = []
  1072. if (multipleSelection.value.length === 0) {
  1073. ElMessage({
  1074. type: 'warning',
  1075. message: '请选择要删除的数据'
  1076. })
  1077. return
  1078. }
  1079. multipleSelection.value &&
  1080. multipleSelection.value.map(item => {
  1081. ids.push(item.ID)
  1082. })
  1083. const res = await deleteCompanyByIds({ ids })
  1084. if (res.code === 0) {
  1085. ElMessage({
  1086. type: 'success',
  1087. message: '删除成功'
  1088. })
  1089. if (tableData.value.length === ids.length && page.value > 1) {
  1090. page.value--
  1091. }
  1092. deleteVisible.value = false
  1093. getTableData()
  1094. }
  1095. }
  1096. // 行为控制标记(弹窗内部需要增还是改)
  1097. const type = ref('')
  1098. // 更新行
  1099. const updateCompanyFunc = async (row) => {
  1100. const res = await findCompany({ ID: row.ID })
  1101. type.value = 'update'
  1102. if (res.code === 0) {
  1103. formData.value = res.data.recompany
  1104. dialogFormVisible.value = true
  1105. }
  1106. }
  1107. // 弹窗控制标记
  1108. const dialogFormVisible = ref(false)
  1109. // 打开弹窗
  1110. const openDialog = () => {
  1111. type.value = 'create'
  1112. dialogFormVisible.value = true
  1113. }
  1114. // 关闭弹窗
  1115. const closeDialog = () => {
  1116. dialogFormVisible.value = false
  1117. formData.value = {
  1118. address: '',
  1119. image: '',
  1120. name: '',
  1121. }
  1122. }
  1123. // 弹窗确定
  1124. const enterDialog = async () => {
  1125. // elFormRef.value?.validate(async (valid) => {
  1126. // if (!valid) return
  1127. // let res
  1128. // switch (type.value) {
  1129. // case 'create':
  1130. // res = await createCompany(formData.value)
  1131. // break
  1132. // case 'update':
  1133. // res = await updateCompany(formData.value)
  1134. // break
  1135. // default:
  1136. // res = await createCompany(formData.value)
  1137. // break
  1138. // }
  1139. // if (res.code === 0) {
  1140. // ElMessage({
  1141. // type: 'success',
  1142. // message: '创建/更改成功'
  1143. // })
  1144. // closeDialog()
  1145. // getTableData()
  1146. // }
  1147. // })
  1148. updateDetailData()
  1149. }
  1150. let table=ref(5);
  1151. let lastCellValue=ref()
  1152. // 双击表格操作
  1153. function doubleClick(row, column, event) {
  1154. type.value = 'update';
  1155. lastCellValue= row['UniqId'];
  1156. console.log(lastCellValue)
  1157. table.value=lastCellValue
  1158. dialogFormVisible.value = true
  1159. // dialogSelectVisible.value = true
  1160. GetInfo(table.value)
  1161. // dialogFormVisible.value = true
  1162. }
  1163. // 单击表格操作
  1164. function Click(row, column, event) {
  1165. lastCellValue= row['UniqId'];
  1166. console.log(lastCellValue)
  1167. }
  1168. // 导出excel
  1169. function exportExcel() {
  1170. console.log('导出到excel');
  1171. }
  1172. // 生命周期钩子
  1173. onMounted(async () => {
  1174. });
  1175. </script>
  1176. <style>
  1177. .JKWTree-container {
  1178. display: flex;
  1179. }
  1180. .JKWTree-tree {
  1181. width: 300px;
  1182. background-color: #fff;
  1183. padding: 10px;
  1184. margin-right: 20px;
  1185. }
  1186. .JKWTree-tree h3 {
  1187. font-size: 15px;
  1188. font-weight: 700;
  1189. margin: 10px 0;
  1190. }
  1191. .JKWTree-content {
  1192. flex: 1;
  1193. }
  1194. /* 选中某行时的背景色*/
  1195. .el-table__body tr.current-row>td {
  1196. background: #ff80ff !important;
  1197. /* 背景颜色 */
  1198. }
  1199. </style>
  1200. <style scoped>
  1201. :deep(.el-table td .cell) {
  1202. line-height: 20px !important;
  1203. }
  1204. :deep(.el-tabs__header){
  1205. margin-bottom: 0;
  1206. }
  1207. .search{
  1208. margin-left: 0px !important;
  1209. margin-right: 10px !important;
  1210. }
  1211. .bt{
  1212. margin-left: 2px !important;
  1213. padding: 3px !important;
  1214. font-size: 12px;
  1215. }
  1216. .el-tabs__header{
  1217. margin: 0px !important;
  1218. }
  1219. .gva-table-box{
  1220. padding: 0px !important;
  1221. }
  1222. .mab{
  1223. margin-bottom: 5px;
  1224. }
  1225. </style>