shebeiyunxing.vue 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820
  1. <template>
  2. <div>
  3. <header>
  4. <el-button type="primary" @click="onBZ">班组维护</el-button>
  5. <el-button type="primary" @click="onDel">删除</el-button>
  6. <el-button type="primary" @click="onxuncha">管理巡查</el-button>
  7. <el-button type="primary" @click="ondianjian">设备点检</el-button>
  8. <el-button type="primary" @click="onyinban">印版领退</el-button>
  9. </header>
  10. <el-container>
  11. <el-aside width="200px">
  12. <div class="JKWTree-tree">
  13. <h3 >设备运行跟踪</h3>
  14. <el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
  15. </div>
  16. </el-aside>
  17. <el-container>
  18. <el-main>
  19. <div class="gva-search-box" v-if="JTMCOn" style="overflow: hidden; padding: 0; display: flex;">
  20. <div style="flex: 1; border: 0px magenta solid; margin: 0; padding: 0;">
  21. <el-row :gutter="20">
  22. <el-col :span="24">
  23. <el-form-item label="工单编号" prop="name">
  24. <el-row :gutter="20">
  25. <el-col :span="6">
  26. <el-input v-model="formData.工单编号" :clearable="true" />
  27. </el-col>
  28. <el-col :span="18">
  29. <el-input v-model="formData.产品名称" :clearable="true" />
  30. </el-col>
  31. </el-row>
  32. </el-form-item>
  33. </el-col>
  34. </el-row>
  35. <el-row :gutter="20">
  36. <el-col :span="6">
  37. <el-form-item label="印件编号" prop="id">
  38. <el-input v-model="formData.印件编号" :clearable="true" />
  39. </el-form-item>
  40. </el-col>
  41. <el-col :span="17">
  42. <el-form-item label="工序名称" prop="name">
  43. <el-input v-model="formData.工序名称" :clearable="true" />
  44. </el-form-item>
  45. </el-col>
  46. </el-row>
  47. <el-row :gutter="20">
  48. <el-col :span="4">
  49. <el-form-item label="班组成员" prop="id">
  50. </el-form-item>
  51. </el-col>
  52. </el-row>
  53. <el-row :gutter="1">
  54. <el-col :span="4">
  55. <el-input v-model="formData.sczl_bh1" :clearable="true" />
  56. </el-col>
  57. <el-col :span="4">
  58. <el-input v-model="formData.sczl_bh2" :clearable="true" />
  59. </el-col>
  60. <el-col :span="4">
  61. <el-input v-model="formData.sczl_bh3" :clearable="true" />
  62. </el-col>
  63. <el-col :span="4">
  64. <el-input v-model="formData.sczl_bh4" :clearable="true" />
  65. </el-col>
  66. <el-col :span="4">
  67. <el-input v-model="formData.sczl_bh5" :clearable="true" />
  68. </el-col>
  69. <el-col :span="4">
  70. <el-input v-model="formData.sczl_bh6" :clearable="true" />
  71. </el-col>
  72. </el-row>
  73. <el-row :gutter="1">
  74. <el-col :span="4">
  75. <el-input v-model="formData.sczl_name1" :clearable="true" />
  76. </el-col>
  77. <el-col :span="4">
  78. <el-input v-model="formData.sczl_name2" :clearable="true" />
  79. </el-col>
  80. <el-col :span="4">
  81. <el-input v-model="formData.sczl_name3" :clearable="true" />
  82. </el-col>
  83. <el-col :span="4">
  84. <el-input v-model="formData.sczl_name4" :clearable="true" />
  85. </el-col>
  86. <el-col :span="4">
  87. <el-input v-model="formData.sczl_name5" :clearable="true" />
  88. </el-col>
  89. <el-col :span="4">
  90. <el-input v-model="formData.sczl_name6" :clearable="true" />
  91. </el-col>
  92. </el-row>
  93. </div>
  94. <div style="flex: 1; border: 0px lawngreen solid; margin: 0; padding: 0; overflow: hidden;">
  95. <el-table
  96. tooltip-effect="dark"
  97. :data="selectData"
  98. row-key="ID"
  99. highlight-current-row="true"
  100. border
  101. style="width:100%;height: 30vh;"
  102. @row-dblclick="handleSelectClick"
  103. >
  104. <el-table-column
  105. prop="process"
  106. label="印件及工序"
  107. width="340"
  108. />
  109. <el-table-column
  110. prop="completed"
  111. label="已完成板数"
  112. width="150"
  113. />
  114. </el-table>
  115. </div>
  116. </div>
  117. <div v-if="JTMCOn" class="gva-table-box">
  118. <div class="gva-btn-list">
  119. </div>
  120. <el-tabs v-model="activName" type="card" @tab-click="handleClick">
  121. <el-tab-pane label="设备作业清单" @click="showTable('印件资料')" name="first">
  122. <el-table ref="multipleTable"
  123. :show-overflow-tooltip="true"
  124. highlight-current-row="true"
  125. :row-style="{ height: '20px' }"
  126. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  127. :header-cell-style="{ padding: '0px' }"
  128. @row-click="yjupdateCompanyFunc"
  129. style="width: 100%;height: 330px" border tooltip-effect="dark" :data="sbzyData" row-key="ID" @selection-change="handleSelectionChange">
  130. <!-- <el-table-column type="selection" width="55" />-->
  131. <!-- <el-table-column align="left" label="选择" prop="bh" width="80"/> -->
  132. <el-table-column align="left" label="工单编号|质量信息" prop="工单编号|质量信息" width="145" />
  133. <el-table-column align="left" label="印件资料" prop="印件资料" width="240" />
  134. <el-table-column align="left" label="工序名称" prop="工序名称" width="100" />
  135. <el-table-column align="left" label="计划产量/已完成" prop="计划产量/已完成" width="130"/>
  136. <el-table-column align="left" label="装版时数" prop="装版时数" width="85"/>
  137. <el-table-column align="left" label="工序产能" prop="工序产能" width="85"/>
  138. <el-table-column align="left" label="计划工时" prop="计划工时" width="85"/>
  139. <el-table-column align="left" label="计划生产时段" prop="计划生产时段" width="210" />
  140. <el-table-column align="left" label="排产备注" prop="排产备注" width="100" />
  141. <el-table-column align="left" label="产品名称" prop="产品名称" width="240" />
  142. </el-table>
  143. </el-tab-pane>
  144. <el-tab-pane label="班组人员及分配比例" @click="showTable('工艺资料')" name="second">
  145. <el-table ref="multipleTable"
  146. highlight-current-row="true"
  147. :show-overflow-tooltip="true"
  148. :row-style="{ height: '20px' }"
  149. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  150. :header-cell-style="{ padding: '0px' }"
  151. @row-dblclick="gyupdateCompanyFunc"
  152. :row-class-name="rowClassStyle"
  153. style="width: 100%;height: 400px" border tooltip-effect="dark" :data="FPData" row-key="ID" @selection-change="handleSelectionChange"
  154. @row-click="clickybupdate">
  155. <!-- <el-table-column type="selection" width="55" />-->
  156. <!-- <el-table-column align="left" label="选择" prop="方案" width="70"/> -->
  157. <el-table-column align="left" label="班组号" prop="班组号" width="70" />
  158. <el-table-column align="left" label="组员1" prop="0" width="200" />
  159. <el-table-column align="left" label="组员2" prop="1" width="200" />
  160. <el-table-column align="left" label="组员3" prop="2" width="200" />
  161. <el-table-column align="left" label="组员4" prop="3" width="200" />
  162. <el-table-column align="left" label="组员5" prop="4" width="200" />
  163. <el-table-column align="left" label="组员6" prop="5" width="70" />
  164. <el-table-column align="left" label="组员7" prop="6" width="70" />
  165. <el-table-column align="left" label="组员8" prop="7" width="70" />
  166. <el-table-column align="left" label="组员9" prop="8" width="70" />
  167. <el-table-column align="left" label="组员10" prop="9_正品版" width="70" />
  168. </el-table>
  169. </el-tab-pane>
  170. <el-tab-pane label="当班产量明细" @click="showTable('印版资料')" name="third">
  171. <el-table ref="multipleTable"
  172. highlight-current-row="true"
  173. :show-overflow-tooltip="true"
  174. :row-style="{ height: '20px' }"
  175. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  176. :header-cell-style="{ padding: '0px' }"
  177. @row-dblclick="ybupdateCompanyFunc"
  178. style="width: 100%;height: 400px" border tooltip-effect="dark" :data="CLMXData" row-key="ID" @selection-change="handleSelectionChange"
  179. >
  180. <!-- <el-table-column type="selection" width="55" />-->
  181. <el-table-column align="left" label="生产时段" prop="生产时间段" width="180"/>
  182. <el-table-column align="left" label="工单编号" prop="工单编号" width="85" />
  183. <el-table-column align="left" label="产品名称" prop="产品名称" width="150" />
  184. <el-table-column align="left" label="印件及工序" prop="印件及工序" width="320"/>
  185. <el-table-column align="left" label="标牌号" prop="标牌号" width="80"/>
  186. <el-table-column align="left" label="产量" prop="产量" width="100"/>
  187. <el-table-column align="left" label="制程废品" prop="制程废品" width="100" />
  188. <el-table-column align="left" label="制程次品" prop="制程次品" width="100" />
  189. <el-table-column align="left" label="前工序废" prop="前工序废" width="100" />
  190. <el-table-column align="left" label="来料异常" prop="来料异常" width="100"/>
  191. <el-table-column align="left" label="装版工时" prop="装版工时" width="100" />
  192. <el-table-column align="left" label="保养工时" prop="保养工时" width="100" />
  193. <el-table-column align="left" label="打样工时" prop="打样工时" width="100"/>
  194. <el-table-column align="left" label="异常停机工时" prop="异常停机工时" width="120"/>
  195. <el-table-column align="left" label="通电工时" prop="通电工时" width="100"/>
  196. <el-table-column align="left" label="码开始行" prop="码开始行" width="100" />
  197. <el-table-column align="left" label="码结束行" prop="码结束行" width="100" />
  198. <el-table-column align="left" label="码包" prop="码包" width="100" />
  199. <el-table-column align="left" label="主电表" prop="主电表" width="100"/>
  200. <el-table-column align="left" label="辅电表" prop="辅电表" width="100" />
  201. <el-table-column align="left" label="色度数" prop="色度数" width="100" />
  202. </el-table>
  203. </el-tab-pane>
  204. <el-tab-pane label="检验记录" @click="showTable('技术资料附件')" name="fourth">
  205. <el-table ref="multipleTable"
  206. :row-style="{ height: '20px' }"
  207. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  208. :header-cell-style="{ padding: '0px' }"
  209. :show-overflow-tooltip="true"
  210. highlight-current-row="true"
  211. style="width: 100%;height: 400px" border tooltip-effect="dark" :data="JYData" row-key="ID" @selection-change="handleSelectionChange">
  212. <!-- <el-table-column type="selection" width="55" />-->
  213. <el-table-column align="left" label="工单编号" prop="工单编号" width="85"/>
  214. <el-table-column align="left" label="印件号" prop="印件号" width="70" />
  215. <el-table-column align="left" label="工序名称" prop="工序名称" width="85" />
  216. <el-table-column align="left" label="检验项目" prop="检验项目" width="85"/>
  217. <el-table-column
  218. v-for="time in columnNames"
  219. :key="time"
  220. :label="time"
  221. :prop="time"
  222. align="center"
  223. width="80"
  224. ></el-table-column>
  225. </el-table>
  226. </el-tab-pane>
  227. </el-tabs>
  228. </div>
  229. <div v-if="dateOn" >
  230. <el-tabs v-model="activName" type="card" @tab-click="handleClick">
  231. <el-tab-pane label="当日上报产量" @click="showTable('工艺资料')" name="first">
  232. <el-table ref="multipleTable"
  233. :show-overflow-tooltip="true"
  234. :row-style="{ height: '20px' }"
  235. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  236. :header-cell-style="{ padding: '0px' }"
  237. highlight-current-row="true"
  238. style="width: 100%;height: 400px" border tooltip-effect="dark" :data="gytableData" row-key="ID" @selection-change="handleSelectionChange">
  239. <el-table-column type="selection" width="55" />
  240. <!-- <el-table-column align="left" label="选择" prop="工单编号" width="100"/> -->
  241. <el-table-column align="left" label="产品名称" prop="产品名称" width="200"/>
  242. <el-table-column align="left" label="工序" prop="工序" width="100"/>
  243. <el-table-column align="left" label="备注" prop="备注" width="100"/>
  244. <el-table-column align="left" label="产量" prop="产量" width="70"/>
  245. <el-table-column align="left" label="千件工价" prop="千件工价" width="85"/>
  246. <el-table-column align="left" label="日定额" prop="日定额" width="85"/>
  247. <el-table-column align="left" label="补产标准" prop="补产标准" width="85"/>
  248. <el-table-column align="left" label="难度系数" prop="难度系数" width="85"/>
  249. <el-table-column align="left" label="印刷方式" prop="印刷方式" width="85"/>
  250. <el-table-column align="left" label="组员1" prop="组员1" width="170" />
  251. <el-table-column align="left" label="组员2" prop="组员2" width="170" />
  252. <el-table-column align="left" label="组员3" prop="组员3" width="170" />
  253. <el-table-column align="left" label="组员4" prop="组员4" width="170" />
  254. <el-table-column align="left" label="组员5" prop="组员5" width="70" />
  255. <el-table-column align="left" label="组员6" prop="组员6" width="70" />
  256. <el-table-column align="left" label="组员7" prop="组员7" width="70" />
  257. <el-table-column align="left" label="组员8" prop="组员8" width="70" />
  258. <el-table-column align="left" label="组员9" prop="组员9" width="70" />
  259. <el-table-column align="left" label="组员10" prop="组员10" width="70" />
  260. <el-table-column align="left" label="制程废品" prop="制程废品" width="85" />
  261. <el-table-column align="left" label="制程次品" prop="制程次品" width="85" />
  262. <el-table-column align="left" label="前工序废" prop="前工序废" width="85" />
  263. <el-table-column align="left" label="来料异常" prop="来料异常" width="85"/>
  264. <el-table-column align="left" label="装版工时" prop="装版工时" width="85" />
  265. <el-table-column align="left" label="保养工时" prop="保养工时" width="85" />
  266. <el-table-column align="left" label="打样工时" prop="打样工时" width="85"/>
  267. <el-table-column align="left" label="异常停机工时" prop="异常总工时" width="110"/>
  268. <el-table-column align="left" label="通电工时" prop="通电工时" width="85"/>
  269. <el-table-column align="left" label="码开始行" prop="码开始行" width="85" />
  270. <el-table-column align="left" label="码结束行" prop="码结束行" width="85" />
  271. <el-table-column align="left" label="码包" prop="码包" width="70" />
  272. <el-table-column align="left" label="主电表" prop="主电表" width="70"/>
  273. <el-table-column align="left" label="辅电表" prop="辅电表" width="70" />
  274. <el-table-column align="left" label="色度数" prop="色度数" width="70" />
  275. <el-table-column align="left" label="用户" prop="用户" width="210" />
  276. <el-table-column align="left" label="更新时间" prop="更新时间" width="160" />
  277. </el-table>
  278. </el-tab-pane>
  279. <el-tab-pane label="当日制程检验记录" @click="showTable('印件资料')" name="second">
  280. <el-table ref="multipleTable"
  281. :row-style="{ height: '20px' }"
  282. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  283. :header-cell-style="{ padding: '0px' }"
  284. :show-overflow-tooltip="true"
  285. highlight-current-row="true"
  286. style="width: 100%;height: 400px" border tooltip-effect="dark" :data="drzcDatas" row-key="ID" @selection-change="handleSelectionChange">
  287. <el-table-column type="selection" width="55" />
  288. <el-table-column align="left" label="工单编号" prop="工单编号" width="85"/>
  289. <el-table-column align="left" label="印件号" prop="印件号" width="70" />
  290. <el-table-column align="left" label="工序名称" prop="工序名称" width="85" />
  291. <el-table-column align="left" label="检验项目" prop="检验项目" width="85"/>
  292. <el-table-column
  293. v-for="time in columnNames"
  294. :key="time"
  295. :label="time"
  296. :prop="time"
  297. align="center"
  298. width="80"
  299. ></el-table-column>
  300. </el-table>
  301. </el-tab-pane>
  302. </el-tabs>
  303. </div>
  304. <el-dialog v-model="detailShow" style="width: 1000px" lock-scroll :before-close="closeDetailShow" title="机台班组维护" destroy-on-close>
  305. <el-table ref="multipleTable"
  306. :row-style="{ height: '20px' }"
  307. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  308. :header-cell-style="{ padding: '0px' }"
  309. :show-overflow-tooltip="true"
  310. highlight-current-row="true" @row-click="BZhandle"
  311. style="width: 100%;height: 250px" border tooltip-effect="dark"
  312. :data="bzData" row-key="ID" @selection-change="BZSelectionChange">
  313. <el-table-column type="selection" width="55" />
  314. <el-table-column align="left" label="机台" prop="JTMC" width="120"/>
  315. <el-table-column align="left" label="班组" prop="班组号" width="120"/>
  316. <el-table-column align="left" label="组员1" prop="0" width="120"/>
  317. <el-table-column align="left" label="组员2" prop="1" width="120"/>
  318. <el-table-column align="left" label="组员3" prop="2" width="120"/>
  319. <el-table-column align="left" label="组员4" prop="3" width="160"/>
  320. <el-table-column align="left" label="组员5" prop="4" width="160"/>
  321. <el-table-column align="left" label="组员6" prop="5" width="120"/>
  322. <el-table-column align="left" label="组员7" prop="6" width="120"/>
  323. <el-table-column align="left" label="组员8" prop="7" width="120"/>
  324. <el-table-column align="left" label="组员9" prop="8" width="120"/>
  325. <el-table-column align="left" label="特殊组员" prop="9" width="120"/>
  326. <el-table-column align="left" label="UNIQID" prop="ID" width="120"/>
  327. </el-table>
  328. <el-row :gutter="20">
  329. <el-col :span="10">
  330. <el-form-item label="机台编号" prop="id">
  331. <el-select v-model="selectedOption" placeholder="请选择">
  332. <el-option
  333. v-for="item in dropdownOptions"
  334. :key="item.value"
  335. :label="item.label"
  336. :value="item.value"
  337. ></el-option>
  338. </el-select>
  339. </el-form-item>
  340. </el-col>
  341. <el-col :span="10">
  342. <el-form-item label="班组编号" prop="id">
  343. <el-input v-model="BZMC" :clearable="true" />
  344. </el-form-item>
  345. </el-col>
  346. </el-row>
  347. <div class="groupbox" style="height: 18vh; width: 920px;">
  348. <span class="grouptitle">组员及分配比例</span>
  349. <el-row :gutter="10" style="margin-top: 0px; height: 5vh;">
  350. <el-col :span="2">
  351. <span></span>
  352. </el-col>
  353. <el-col :span="2">
  354. </el-col>
  355. <el-col :span="2">
  356. </el-col>
  357. <el-col :span="2">
  358. </el-col>
  359. <el-col :span="2">
  360. </el-col>
  361. <el-col :span="2">
  362. </el-col>
  363. <el-col :span="2">
  364. </el-col>
  365. <el-col :span="2">
  366. </el-col>
  367. <el-col :span="2">
  368. </el-col>
  369. <el-col :span="3">
  370. </el-col>
  371. <el-col :span="3">
  372. <el-form-item label="特殊组员" prop="id">
  373. </el-form-item>
  374. </el-col>
  375. </el-row>
  376. <el-row :gutter="10" style="margin-top: 0px;">
  377. <el-col :span="3">
  378. <el-input v-model="formDatas.code1" :clearable="true" placeholder="" />
  379. </el-col>
  380. <el-col :span="3">
  381. <el-input v-model="formDatas.code2" :clearable="true" placeholder="" />
  382. </el-col>
  383. <el-col :span="3">
  384. <el-input v-model="formDatas.code3" :clearable="true" placeholder="" />
  385. </el-col>
  386. <el-col :span="3">
  387. <el-input v-model="formDatas.code4" :clearable="true" placeholder="" />
  388. </el-col>
  389. <el-col :span="3">
  390. <el-input v-model="formDatas.code5" :clearable="true" placeholder="" />
  391. </el-col>
  392. <el-col :span="3">
  393. <el-input v-model="formDatas.code6" :clearable="true" placeholder="" />
  394. </el-col>
  395. <el-col :span="3">
  396. <el-input v-model="formDatas.code7" :clearable="true" placeholder="" />
  397. </el-col>
  398. <el-col :span="3">
  399. <el-input v-model="formDatas.code8" :clearable="true" placeholder="" />
  400. </el-col>
  401. </el-row>
  402. <el-row :gutter="10" style="margin-top: 1px;">
  403. <el-col :span="3">
  404. <el-input v-model="formDatas.name1" :clearable="true" placeholder="" />
  405. </el-col>
  406. <el-col :span="3">
  407. <el-input v-model="formDatas.name2" :clearable="true" placeholder="" />
  408. </el-col>
  409. <el-col :span="3">
  410. <el-input v-model="formDatas.name3" :clearable="true" placeholder="" />
  411. </el-col>
  412. <el-col :span="3">
  413. <el-input v-model="formDatas.name4" :clearable="true" placeholder="" />
  414. </el-col>
  415. <el-col :span="3">
  416. <el-input v-model="formDatas.name5" :clearable="true" placeholder="" />
  417. </el-col>
  418. <el-col :span="3">
  419. <el-input v-model="formDatas.name6" :clearable="true" placeholder="" />
  420. </el-col>
  421. <el-col :span="3">
  422. <el-input v-model="formDatas.name7" :clearable="true" placeholder="" />
  423. </el-col>
  424. <el-col :span="3">
  425. <el-input v-model="formDatas.name8" :clearable="true" placeholder="" />
  426. </el-col>
  427. </el-row>
  428. <el-row :gutter="10" style="margin-top: 1px;">
  429. <el-col :span="3">
  430. <el-input v-model="formDatas.percentage1" :clearable="true" placeholder="" />
  431. </el-col>
  432. <el-col :span="3">
  433. <el-input v-model="formDatas.percentage2" :clearable="true" placeholder="" />
  434. </el-col>
  435. <el-col :span="3">
  436. <el-input v-model="formDatas.percentage3" :clearable="true" placeholder="" />
  437. </el-col>
  438. <el-col :span="3">
  439. <el-input v-model="formDatas.percentage4" :clearable="true" placeholder="" />
  440. </el-col>
  441. <el-col :span="3">
  442. <el-input v-model="formDatas.percentage5" :clearable="true" placeholder="" />
  443. </el-col>
  444. <el-col :span="3">
  445. <el-input v-model="formDatas.percentage6" :clearable="true" placeholder="" />
  446. </el-col>
  447. <el-col :span="3">
  448. <el-input v-model="formDatas.percentage5" :clearable="true" placeholder="" />
  449. </el-col>
  450. <el-col :span="3">
  451. <el-input v-model="formDatas.percentage6" :clearable="true" placeholder="" />
  452. </el-col>
  453. </el-row>
  454. </div>
  455. </el-dialog>
  456. <el-dialog
  457. v-model="dianjianVisible"
  458. title="设备点检记录"
  459. destroy-on-close
  460. width="1300px"
  461. style="height: 80%;"
  462. >
  463. <el-row :gutter="24">
  464. <el-col :span="3">
  465. <el-form-item label="设备编号" prop="id">
  466. <el-input v-model="formData.JTMC" :clearable="true" />
  467. </el-form-item>
  468. </el-col>
  469. <el-col :span="10">
  470. <el-row>
  471. <el-col>
  472. <el-input v-model="formData.产品名称" :clearable="true" />
  473. </el-col>
  474. </el-row>
  475. </el-col>
  476. </el-row>
  477. <div style="display: flex;">
  478. <div style="flex: 0.1;">
  479. <el-aside width="200px" style="margin: 0;">
  480. <div class="JKWTree-tree" style="height: 100%; border-right: 1px solid #ebeef5;">
  481. <el-tree :data="dianjiantreeData" :props="defaultProps" highlight-current="true"
  482. @node-click="dianjianNodeClick" @node-dblclick="handleNodeDoubleClick"></el-tree>
  483. </div>
  484. </el-aside>
  485. </div>
  486. <div style="flex: 1; margin: 0;">
  487. <el-table
  488. tooltip-effect="dark"
  489. :data="dianjianselectData"
  490. row-key="ID"
  491. highlight-current-row="true"
  492. :show-overflow-tooltip="true"
  493. border @row-click="dianjianhandle"
  494. style="width:100%; height:400px;"
  495. @row-dblclick="handleSelectClick"
  496. :row-class-name="rowClassName"
  497. >
  498. <el-table-column
  499. prop="检验项目"
  500. label="检验项目"
  501. width="300"
  502. />
  503. <el-table-column
  504. prop="点检方法"
  505. label="点检方法"
  506. width="180"
  507. />
  508. <el-table-column
  509. v-slot="scope"
  510. label="正常"
  511. width="80"
  512. >
  513. <el-checkbox v-model="scope.row.zc" @change="zcClick(scope.row)"></el-checkbox>
  514. </el-table-column>
  515. <el-table-column
  516. v-slot="scope"
  517. label="异常"
  518. width="80"
  519. >
  520. <el-checkbox v-model="scope.row.yc" @change="ycClick(scope.row)"></el-checkbox>
  521. </el-table-column>
  522. <el-table-column
  523. label="备注说明"
  524. width="180"
  525. >
  526. </el-table-column>
  527. <el-table-column
  528. v-slot="scope"
  529. label="不检测"
  530. width="80"
  531. >
  532. <el-checkbox v-model="scope.row.notjc" @change="notjcClick(scope.row)"></el-checkbox>
  533. </el-table-column>
  534. </el-table>
  535. <el-row :gutter="20">
  536. <el-col :span="20">
  537. <el-input v-model="pandingfangfa" style="height: 50px;" :clearable="true" />
  538. </el-col>
  539. </el-row>
  540. </div>
  541. </div>
  542. </el-dialog>
  543. <el-dialog
  544. v-model="yinbanVisible"
  545. title="选择"
  546. destroy-on-close
  547. width="1300px"
  548. style="height: 110%;"
  549. >
  550. <el-row :gutter="24">
  551. <el-col :span="4">
  552. <el-form-item label="工单编号" prop="id">
  553. <el-input v-model="formData.工单编号" :clearable="true" />
  554. </el-form-item>
  555. </el-col>
  556. <el-col :span="6">
  557. <el-form-item prop="id">
  558. <el-input v-model="formData.productCode" :clearable="true" />
  559. </el-form-item>
  560. </el-col>
  561. <el-col :span="14">
  562. <el-form-item prop="id">
  563. <el-input v-model="formData.产品名称" :clearable="true" />
  564. </el-form-item>
  565. </el-col>
  566. </el-row>
  567. <div style="display: flex;">
  568. <div style="flex: 1;">
  569. <el-aside width="250px" style="margin: 0;">
  570. <div class="JKWTree-tree" style="height: 100%; border-right: 1px solid #ebeef5;">
  571. <el-tree :data="yinbantreeData" :props="defaultProps" highlight-current="true"
  572. @node-click="yinbanNodeClick" @node-dblclick="handleNodeDoubleClick"></el-tree>
  573. </div>
  574. </el-aside>
  575. </div>
  576. <div style="flex: 1; margin: 0;">
  577. <el-table
  578. tooltip-effect="dark"
  579. :data="yinbanselectData"
  580. row-key="ID"
  581. highlight-current-row="true"
  582. border @row-click="dianjianhandle"
  583. style="width:1000px; height:400px;"
  584. @row-dblclick="handleSelectClick"
  585. :row-class-name="rowClassName"
  586. >
  587. <el-table-column
  588. prop="存货编码"
  589. label="存货编码"
  590. width="180"
  591. />
  592. <el-table-column
  593. prop="存货名称"
  594. label="存货名称"
  595. width="180"
  596. />
  597. <el-table-column
  598. prop="印版名称"
  599. label="印版名称"
  600. width="180"
  601. />
  602. <el-table-column
  603. prop="供方批号"
  604. label="供方批号"
  605. width="180"
  606. />
  607. <el-table-column
  608. prop="制造日期"
  609. label="制造日期"
  610. width="180"
  611. />
  612. <el-table-column
  613. prop="印数"
  614. label="印数"
  615. width="180"
  616. />
  617. <el-table-column
  618. prop="印版类别"
  619. label="印版类别"
  620. width="180"
  621. />
  622. <el-table-column
  623. prop="客户编号"
  624. label="客户编号"
  625. width="180"
  626. />
  627. <el-table-column
  628. prop="客户名称"
  629. label="客户名称"
  630. width="180"
  631. />
  632. <el-table-column
  633. prop="产品编号"
  634. label="产品编号"
  635. width="180"
  636. />
  637. <el-table-column
  638. prop="产品名称"
  639. label="产品名称"
  640. width="180"
  641. />
  642. <el-table-column
  643. prop="点检方法"
  644. label="备注说明"
  645. width="180"
  646. />
  647. <el-table-column
  648. prop="点检方法"
  649. label="备注说明"
  650. width="180"
  651. />
  652. </el-table>
  653. </div>
  654. </div>
  655. </el-dialog>
  656. <el-dialog
  657. v-model="xunchaVisible"
  658. title="管理人员现场巡查记录"
  659. destroy-on-close
  660. width="1300px"
  661. style="height: 65%;"
  662. >
  663. <div style="display: flex;">
  664. <div style="flex: 1;">
  665. <el-aside width="250px" style="margin: 0;">
  666. <div class="JKWTree-tree" style="height: 100%; border-right: 1px solid #ebeef5;">
  667. <el-tree :data="xunchatreeData" :props="defaultProps" highlight-current="true"
  668. @node-click="xunchaNodeClick"></el-tree>
  669. </div>
  670. </el-aside>
  671. </div>
  672. <div style="flex: 1; margin: 0;">
  673. <el-table
  674. tooltip-effect="dark"
  675. :data="xunchaselectData"
  676. row-key="ID"
  677. highlight-current-row="true"
  678. border @row-click="dianjianhandle"
  679. style="width:1000px; height:400px;"
  680. @row-dblclick="handleSelectClick"
  681. :row-class-name="rowClassName"
  682. :show-overflow-tooltip="true"
  683. >
  684. <el-table-column
  685. prop="工单编号"
  686. label="工序编号"
  687. width="85"
  688. />
  689. <el-table-column
  690. prop="印件号"
  691. label="印件号"
  692. width="70"
  693. />
  694. <el-table-column
  695. prop="工序名称"
  696. label="工序名称"
  697. width="180"
  698. />
  699. <el-table-column
  700. prop="流程单号"
  701. label="流程单号"
  702. width="85"
  703. />
  704. <el-table-column
  705. prop="设备编号"
  706. label="设备编号"
  707. width="85"
  708. />
  709. <el-table-column
  710. prop="班组编号"
  711. label="班组编号"
  712. width="85"
  713. />
  714. <el-table-column
  715. prop="检验备注"
  716. label="检验备注"
  717. width="85"
  718. />
  719. <el-table-column
  720. prop="现场管理人员"
  721. label="现场管理人员"
  722. width="145"
  723. />
  724. <el-table-column
  725. prop="提交时间"
  726. label="提交时间"
  727. width="160"
  728. />
  729. <el-table-column
  730. prop="开工时间"
  731. label="开工时间"
  732. width="160"
  733. />
  734. <el-table-column
  735. prop="分钟差数"
  736. label="分钟差数"
  737. width="85"
  738. />
  739. <el-table-column
  740. prop="归属时段"
  741. label="归属时段"
  742. width="160"
  743. />
  744. </el-table>
  745. </div>
  746. </div>
  747. <template #footer>
  748. <div class="dialog-footer">
  749. <!-- <el-button @click="closeDialog">关 闭</el-button> -->
  750. <!-- <el-button type="primary" @click="xunjianerDialog">提 交</el-button> -->
  751. </div>
  752. </template>
  753. </el-dialog>
  754. </el-main>
  755. </el-container>
  756. </el-container>
  757. </div>
  758. </template>
  759. <script setup>
  760. import {
  761. createCompany,
  762. deleteCompany,
  763. deleteCompanyByIds,
  764. updateCompany,
  765. findCompany,
  766. getCompanyList
  767. } from '@/api/company'
  768. import {
  769. facilityTab,
  770. facilitychanLiang,
  771. facilityInspect,
  772. facilityProduction,
  773. facilityTeam,
  774. facilityMachineList,
  775. facilitySpotCheckItem,
  776. facilityInspectionItem,
  777. reportProduceInfo,
  778. reportName,
  779. reportInfo,
  780. reportMachineMac,
  781. facilityWorklist,
  782. setProcessStatus,
  783. submitDailyProduction,
  784. facilityDetail,
  785. inspectionRecord,
  786. getYg,
  787. facilityProcedure,
  788. facilityPrintGetTab,
  789. facilityPrintDetail
  790. } from '@/api/jixiaoguanli/jitairibaobiao'
  791. import {
  792. FieldInspectionRecord
  793. } from "@/api/mes/job";
  794. // 全量引入格式化工具 请按需保留
  795. import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
  796. import { ElMessage, ElMessageBox } from 'element-plus'
  797. import { ref, reactive } from 'vue'
  798. defineOptions({
  799. name: 'Company'
  800. })
  801. const gytableData = ref([])
  802. const drzcDatas =ref([])
  803. const detailData = reactive([])
  804. const treeData=ref([])
  805. const yinbantreeData=ref([])
  806. let dianjiantreeData;
  807. let JTMC=ref()
  808. let date=ref()
  809. let JTMCOn=ref()
  810. let dateOn=ref()
  811. const activName = ref('first')
  812. let productCode=ref()
  813. const sbzyData = reactive([])
  814. const FPData = reactive([])
  815. const CLMXData = reactive([])
  816. let JYData = reactive([])
  817. const selectData = ref([])
  818. const handleNodeClick = (nodeData,node) => {
  819. //存放当前节点的nodeId
  820. if (nodeData.level === 1) {
  821. console.log(node.label); // 第一级节点
  822. } else if (nodeData.level === 2) {
  823. console.log(node.label); // 第二级节点
  824. JTMC=node.label.split("-")[0]
  825. JTMCOn.value=true
  826. dateOn.value=false
  827. FacilityProduction()
  828. FacilityWorklist()
  829. } else if (nodeData.level === 3) {
  830. JTMC=nodeData.machineName.split("-")[0]
  831. JTMCOn.value=false
  832. dateOn.value=true
  833. date=node.label
  834. gytableData.value=[]
  835. drzcDatas.value=[]
  836. columnNames=[]
  837. drzcData=[]
  838. FacilityInspect()
  839. FacilitychanLiang()
  840. console.log(node.label); // 第三级节点
  841. }
  842. }
  843. //当前生产订单
  844. const FacilityProduction = async () => {
  845. const response = await facilityProduction({machine:JTMC});
  846. if (response.code === 0) {
  847. console.log(response)
  848. // 填充formData对象的基本字段
  849. formData.value.工单编号 = response.data.工单编号;
  850. formData.value.印件编号 = response.data.印件号;
  851. formData.value.工序名称 = response.data.工序名称;
  852. formData.value.产品名称 = response.data.产品名称;
  853. formData.value.班组 = response.data.班组编号;
  854. let sczl_bhkey=''
  855. let sczl_namekey=''
  856. if (response.data.班组成员) {
  857. for (let i = 1; i <= Math.min(Object.keys(response.data.班组成员).length, 6); i++) {
  858. sczl_bhkey=`sczl_bh${i}`
  859. sczl_namekey=`sczl_name${i}`
  860. formData.value[sczl_bhkey] = response.data.班组成员[i]['编号'];
  861. formData.value[sczl_namekey] = response.data.班组成员[i]['姓名'];
  862. }
  863. }
  864. formData.value.JTMC=JTMC
  865. FacilityTeam(JTMC)
  866. }
  867. // getTableData()
  868. }
  869. //设备工作清单
  870. const FacilityWorklist = async () => {
  871. const response = await facilityWorklist({machine:JTMC});
  872. if (response.code === 0) {
  873. console.log(response)
  874. sbzyData.splice(0, sbzyData.length, ...response.data);
  875. const res = await facilityProcedure({ Gd_gdbh: sbzyData[0]['工单编号|质量信息'].substring(0, 7) })
  876. formData.value.productCode= response.data[0]['产品代号']
  877. console.log(res)
  878. if (res.code === 0) {
  879. selectData.value = res.data
  880. }
  881. }
  882. }
  883. //检验记录
  884. const InspectionRecord = async () => {
  885. console.log(formData.value.班组)
  886. const response = await inspectionRecord({machine:JTMC,Gd_gdbh:formData.value.工单编号,team:formData.value.班组});
  887. console.log(response)
  888. if(response.code==0){
  889. // 提取 inspectiontime 作为列名
  890. // Extract inspectiontime as columnNames
  891. columnNames = response.data.inspectiontime;
  892. // Populate drzcData with row data
  893. for (const key in response.data) {
  894. if (key !== 'inspectiontime') {
  895. const item = response.data[key];
  896. const rowData = {
  897. '工单编号': item['工单编号'],
  898. '印件号': item['印件号'],
  899. '工序名称': item['工序名称'],
  900. '检验项目': item['检验项目']
  901. };
  902. // Initialize time columns with '—'
  903. columnNames.forEach(time => {
  904. rowData[time] = '';
  905. });
  906. // Split inspectresult and fill the corresponding time columns
  907. const results = item['inspectresult'].split(',');
  908. results.forEach(result => {
  909. if (columnNames.includes(result)) {
  910. rowData[result] = '√';
  911. }else{rowData[result] = ''}
  912. });
  913. // Add the row data to drzcData
  914. JYData.push(rowData);
  915. }
  916. }
  917. console.log(JYData);
  918. }
  919. }
  920. //当班产量明细
  921. const FacilityDetail = async () => {
  922. const response = await facilityDetail({ machine: JTMC, Gd_gdbh: formData.value.工单编号, team: formData.value.班组 });
  923. if (response.code === 0) {
  924. console.log(response);
  925. CLMXData.splice(0, CLMXData.length, ...Object.values(response.data));
  926. }
  927. };
  928. //员工编号回车事件
  929. const getygsubmit = (event, inputName) => {
  930. console.log(inputName)
  931. let combinedString = 'sczl_bh' + inputName;
  932. console.log(combinedString)
  933. // let variableName = 'sczl_gdbh'+inputName;
  934. let variableValue = eval('formData3.value.' + combinedString);
  935. console.log(variableValue)
  936. GetYg(variableValue,inputName)
  937. }
  938. //获取员工信息
  939. const GetYg = async (value,inputName) => {
  940. const response = await getYg({sczl_bh:value});
  941. console.log(response)
  942. if (response.code === 0) {
  943. console.log(response.data.ygxm)
  944. let Bname = 'sczl_name' + inputName;
  945. formData3.value[Bname]=response.data.ygxm
  946. // console.log(formData.value[Bname])
  947. }
  948. }
  949. // 验证规则
  950. const rule = reactive({
  951. })
  952. const searchRule = reactive({
  953. createdAt: [
  954. { validator: (rule, value, callback) => {
  955. if (searchInfo.value.startCreatedAt && !searchInfo.value.endCreatedAt) {
  956. callback(new Error('请填写结束日期'))
  957. } else if (!searchInfo.value.startCreatedAt && searchInfo.value.endCreatedAt) {
  958. callback(new Error('请填写开始日期'))
  959. } else if (searchInfo.value.startCreatedAt && searchInfo.value.endCreatedAt && (searchInfo.value.startCreatedAt.getTime() === searchInfo.value.endCreatedAt.getTime() || searchInfo.value.startCreatedAt.getTime() > searchInfo.value.endCreatedAt.getTime())) {
  960. callback(new Error('开始日期应当早于结束日期'))
  961. } else {
  962. callback()
  963. }
  964. }, trigger: 'change' }
  965. ],
  966. })
  967. const elFormRef = ref()
  968. const elSearchFormRef = ref()
  969. // =========== 表格控制部分 ===========
  970. const page = ref(1)
  971. const total = ref(0)
  972. const pageSize = ref(10)
  973. const tableData = ref([])
  974. const searchInfo = ref({})
  975. const xunchaVisible = ref(false)
  976. const xunchatreeData=ref([{label: '现场巡查记录',} ])
  977. // 重置
  978. const onReset = () => {
  979. searchInfo.value = {}
  980. getTableData()
  981. }
  982. // 搜索
  983. const onSubmit = () => {
  984. elSearchFormRef.value?.validate(async(valid) => {
  985. if (!valid) return
  986. page.value = 1
  987. pageSize.value = 10
  988. getTableData()
  989. })
  990. }
  991. // 分页
  992. const handleSizeChange = (val) => {
  993. pageSize.value = val
  994. getTableData()
  995. }
  996. // 修改页面容量
  997. const handleCurrentChange = (val) => {
  998. page.value = val
  999. getTableData()
  1000. }
  1001. const getTableData = async () => {
  1002. const response = await facilityTab();
  1003. if (response.code === 0 && response.data) {
  1004. const workshops = response.data; // 车间数据
  1005. // 在推送新项之前将 treeData 重置为空数组
  1006. treeData.value = []; // 使用 .value 访问响应式引用的值
  1007. for (const workshopName in workshops) {
  1008. const workshopNode = {
  1009. label: workshopName,
  1010. children: [],
  1011. level: 1 // 添加层级属性
  1012. };
  1013. const machines = workshops[workshopName]; // 车间下的机器
  1014. for (const machineName in machines) {
  1015. const machineNode = {
  1016. label: machineName,
  1017. children: [],
  1018. level: 2, // 添加层级属性
  1019. parentNode: workshopNode
  1020. };
  1021. // Now that machineNode is initialized, you can refer to it
  1022. const childrenNodes = machines[machineName].map(dateTime => {
  1023. const dateOnly = dateTime.split(' ')[0];
  1024. return {
  1025. label: dateOnly,
  1026. machineName:machineName,
  1027. level: 3, // 添加层级属性
  1028. parentNode: machineNode
  1029. };
  1030. });
  1031. // Assign the childrenNodes to the machineNode's children property
  1032. machineNode.children = childrenNodes;
  1033. // Finally, push the machineNode to the workshopNode's children array
  1034. workshopNode.children.push(machineNode);
  1035. }
  1036. // 将 workshopNode 推送到响应式 treeData 数组
  1037. treeData.value.push(workshopNode);
  1038. }
  1039. }
  1040. };
  1041. // 查询
  1042. const getTableList = async() => {
  1043. const table = await getCompanyList({ page: page.value, pageSize: pageSize.value, ...searchInfo.value })
  1044. if (table.code === 0) {
  1045. tableData.value = table.data.list
  1046. total.value = table.data.total
  1047. page.value = table.data.page
  1048. pageSize.value = table.data.pageSize
  1049. }
  1050. }
  1051. getTableData()
  1052. //删除
  1053. function onDel() {
  1054. }
  1055. import { nextTick } from 'vue';
  1056. //设备点检
  1057. function ondianjian() {
  1058. getSpotCheckItem(JTMC).then(treeData => {
  1059. if (treeData) {
  1060. // 如果获取成功,treeData 就是我们需要的树形结构数据
  1061. dianjiantreeData = treeData;
  1062. console.log('222');
  1063. console.log(dianjiantreeData);
  1064. // 使用 nextTick 来确保在更新 dianjianVisible 后立即刷新视图
  1065. nextTick(() => {
  1066. dianjianVisible.value = true;
  1067. });
  1068. // 这里可以处理treeData,例如将其赋值给某个状态管理变量或者用于渲染界面
  1069. } else {
  1070. // 如果获取失败,则treeData为null
  1071. console.log('获取巡检项目树形结构数据失败');
  1072. }
  1073. });
  1074. }
  1075. const onyinban = async() => {
  1076. const res = await facilityPrintGetTab({productCode:formData.value.productCode})
  1077. if(res.code===0){
  1078. yinbantreeData.value=[{
  1079. label:'产品印版库',
  1080. children:res.data.map(item=>({
  1081. label:item.印版分类,
  1082. code:item.编号
  1083. }))
  1084. }]
  1085. console.log(res.data.map(item=>({
  1086. label:item.印版分类,
  1087. code:item.编号
  1088. })))
  1089. yinbanVisible.value = true;
  1090. }
  1091. }
  1092. const onxuncha = async() => {
  1093. xunchaVisible.value=true
  1094. }
  1095. //获取设备点检->检验项目
  1096. const FacilityInspectionItem = async (value) => {
  1097. try {
  1098. // 调用接口获取巡检项目数据
  1099. const response = await facilityInspectionItem({ unitName: value });
  1100. // 检查接口返回的状态码
  1101. if (response.code === 0) {
  1102. dianjianselectData.splice(0, dianjianselectData.length, ...response.data.map(item=>{
  1103. item.notjc=true;
  1104. item.zc=false;
  1105. item.yc=false;
  1106. return item
  1107. }))
  1108. console.log(dianjianselectData)
  1109. }
  1110. } catch (error) {
  1111. // 捕获并打印异常
  1112. console.error("获取巡检项目数据出错:" + error);
  1113. return null;
  1114. }
  1115. };
  1116. //机台印版领用->右侧详情
  1117. const facilityPrintDetailItem = async (value) => {
  1118. try {
  1119. // 调用接口获取巡检项目数据
  1120. // const response = await facilityPrintDetail({ workOrder: formData.value.工单编号,code:value,productCode:productCode.value });
  1121. const response = await facilityPrintDetail({ workOrder: '2312165',code:'0521',productCode:'104601001' });
  1122. // 检查接口返回的状态码
  1123. if (response.code === 0) {
  1124. console.log(response)
  1125. yinbanselectData.value=response.data
  1126. }
  1127. } catch (error) {
  1128. // 捕获并打印异常
  1129. console.error("获取数据出错:" + error);
  1130. return null;
  1131. }
  1132. };
  1133. //树形结构单机
  1134. const dianjianselectData = reactive([])
  1135. const yinbanselectData = ref([])
  1136. const xunchaselectData = ref([])
  1137. const dianjianNodeClick = (node, check, nodeData) => {
  1138. if (node.children && node.children.length > 0) {
  1139. // 点击的是父节点,且有子节点
  1140. // 执行相应的父节点单击事件处理逻辑
  1141. // 这里可以添加你想要的处理逻辑,比如展开/折叠节点等
  1142. } else {
  1143. // 点击的是子节点,或者没有子节点
  1144. // 执行相应的子节点单击事件处理逻辑
  1145. FacilityInspectionItem(node.label)
  1146. }
  1147. };
  1148. const yinbanNodeClick = (node, check, nodeData) => {
  1149. if (node.children && node.children.length > 0) {
  1150. // 点击的是父节点,且有子节点
  1151. // 执行相应的父节点单击事件处理逻辑
  1152. // 这里可以添加你想要的处理逻辑,比如展开/折叠节点等
  1153. } else {
  1154. // 点击的是子节点,或者没有子节点
  1155. // 执行相应的子节点单击事件处理逻辑
  1156. facilityPrintDetailItem(node.code)
  1157. }
  1158. };
  1159. const xunchaNodeClick = (node, check, nodeData) => {
  1160. if(node){
  1161. fieldInspectionRecord()
  1162. }
  1163. }
  1164. const fieldInspectionRecord = async () => {
  1165. const response = await FieldInspectionRecord({ workOrder: '2311114',team:'A班',start:'2024-01-19 08:30:00' });
  1166. if (response.code === 0) {
  1167. xunchaselectData.value=response.data
  1168. }
  1169. }
  1170. let pandingfangfa=ref()
  1171. //检验项目单击
  1172. const dianjianhandle = (val, row) => {
  1173. try {
  1174. pandingfangfa.value = val.判定标准;
  1175. } catch (error) {
  1176. console.error('An error occurred:', error);
  1177. }
  1178. };
  1179. const notjcClick = (val) => {
  1180. try {
  1181. if(val.notjc==false){
  1182. val.zc=true
  1183. }else{
  1184. val.zc=false
  1185. val.yc==false
  1186. }
  1187. } catch (error) {
  1188. console.error('An error occurred:', error);
  1189. }
  1190. };
  1191. const zcClick = (val) => {
  1192. try {
  1193. if(val.zc==false){
  1194. val.zc=true
  1195. }else{
  1196. val.zc=false
  1197. val.yc==false
  1198. }
  1199. } catch (error) {
  1200. console.error('An error occurred:', error);
  1201. }
  1202. };
  1203. const ycClick = (val) => {
  1204. try {
  1205. if(val.yc==false){
  1206. val.zc=true
  1207. }else{
  1208. val.zc=false
  1209. val.notjc==false
  1210. }
  1211. } catch (error) {
  1212. console.error('An error occurred:', error);
  1213. }
  1214. };
  1215. const rowClassName = (row, column) => {
  1216. try {
  1217. if (row.unchecked) {
  1218. return 'row-yellow';
  1219. }
  1220. return '';
  1221. } catch (error) {
  1222. console.error('An error occurred:', error);
  1223. return '';
  1224. }
  1225. };
  1226. // 异步函数,用于获取指定设备的巡检项目,并且将结果格式化为树形结构数据
  1227. const getSpotCheckItem = async (machineName) => {
  1228. try {
  1229. // 调用接口获取巡检项目数据
  1230. const response = await facilitySpotCheckItem({ machine: machineName });
  1231. // 检查接口返回的状态码
  1232. if (response.code === 0) {
  1233. // 构建树形结构数据
  1234. const childrenData = Object.entries(response.data).map(([id, label]) => {
  1235. return {
  1236. id, // 子节点的唯一标识
  1237. label, // 子节点的标签
  1238. children: [] // 初始化子节点数组
  1239. };
  1240. });
  1241. // 创建包含父节点的树形结构数据
  1242. const treeData = [{
  1243. id: machineName, // 父节点的唯一标识
  1244. label: machineName, // 父节点的标签
  1245. children: childrenData // 子节点数据
  1246. }];
  1247. // 返回构建好的树形结构数据
  1248. return treeData;
  1249. } else {
  1250. // 如果接口返回的状态码不是0,打印错误信息
  1251. console.error("接口返回错误:" + response.msg);
  1252. return null;
  1253. }
  1254. } catch (error) {
  1255. // 捕获并打印异常
  1256. console.error("获取巡检项目数据出错:" + error);
  1257. return null;
  1258. }
  1259. };
  1260. // 班组人员及分配比例
  1261. const FacilityTeam = async (value) => {
  1262. const response = await facilityTeam({ machine: value });
  1263. if (response.code === 0) {
  1264. // formData.value.班组 = response.data[0]['班组号'];
  1265. BZMC.value=response.data[0]['班组号']
  1266. // if(response.data[0][2]){
  1267. // // console.log(response.data[0][2].split(' '));
  1268. // for (let i = 1; i <= 3; i++) {
  1269. // const sczl_bh = `sczl_bh${i}`;
  1270. // const sczl_name = `sczl_name${i}`;
  1271. // formData.value[sczl_bh] = response.data[0][i-1].split(' ')[0];
  1272. // formData.value[sczl_name] = response.data[0][i-1].split(' ')[1];
  1273. // }
  1274. // }
  1275. // if(response.data[0][0]){
  1276. // // console.log(response.data[0][2].split(' '));
  1277. // for (let i = 1; i <= 1; i++) {
  1278. // const sczl_bh = `sczl_bh${i}`;
  1279. // const sczl_name = `sczl_name${i}`;
  1280. // formData.value[sczl_bh] = response.data[0][i-1].split(' ')[0];
  1281. // formData.value[sczl_name] = response.data[0][i-1].split(' ')[1];
  1282. // }
  1283. // }
  1284. // if(response.data[0][1]){
  1285. // // console.log(response.data[0][2].split(' '));
  1286. // for (let i = 1; i <= 2; i++) {
  1287. // const sczl_bh = `sczl_bh${i}`;
  1288. // const sczl_name = `sczl_name${i}`;
  1289. // formData.value[sczl_bh] = response.data[0][i-1].split(' ')[0];
  1290. // formData.value[sczl_name] = response.data[0][i-1].split(' ')[1];
  1291. // }
  1292. // }
  1293. // if(response.data[0][3]){
  1294. // // console.log(response.data[0][2].split(' '));
  1295. // for (let i = 1; i <= 4; i++) {
  1296. // const sczl_bh = `sczl_bh${i}`;
  1297. // const sczl_name = `sczl_name${i}`;
  1298. // formData.value[sczl_bh] = response.data[0][i-1].split(' ')[0];
  1299. // formData.value[sczl_name] = response.data[0][i-1].split(' ')[1];
  1300. // }
  1301. // }
  1302. InspectionRecord()
  1303. FacilityDetail()
  1304. // 清空 bzData 数组
  1305. bzData.splice(0, bzData.length);
  1306. // 遍历接口返回的数据,并给每个对象添加 JTMC 属性
  1307. const updatedData = response.data.map(item => {
  1308. return { ...item, JTMC: value }; // 添加 JTMC 属性
  1309. });
  1310. // 将更新后的数据添加到 bzData 数组
  1311. bzData.push(...updatedData);
  1312. FPData.push(...updatedData)
  1313. return 1
  1314. }
  1315. };
  1316. //班组维护
  1317. function onBZ() {
  1318. FacilityTeam(JTMC)
  1319. fetchData()
  1320. detailShow.value=true
  1321. console.log('2222')
  1322. }
  1323. // 下拉框选项数据
  1324. const dropdownOptions = ref([]);
  1325. // 选中的选项
  1326. const selectedOption = ref('');
  1327. // 获取接口数据并转换为下拉框需要的格式
  1328. const fetchData = async () => {
  1329. try {
  1330. // Simulate API call
  1331. const response = await facilityMachineList();
  1332. if (response.code === 0) {
  1333. // Transform data format
  1334. const options = response.data.map((item) => ({
  1335. label: item,
  1336. value: item
  1337. }));
  1338. dropdownOptions.value = options;
  1339. // Default to selecting the first option
  1340. const defaultOption = options.find(option => option.value === JTMC);
  1341. if (defaultOption) {
  1342. selectedOption.value = defaultOption.value;
  1343. } else if (options.length > 0) {
  1344. // 如果 myDefaultValue 不在选项中,选择第一个选项
  1345. selectedOption.value = options[0].value;
  1346. }
  1347. }
  1348. } catch (error) {
  1349. console.error('Error fetching data:', error);
  1350. // Handle the error appropriately
  1351. }
  1352. };
  1353. // formData
  1354. let BZMC=ref()
  1355. let lastCellValue=ref()
  1356. let parts =reactive([])
  1357. // 自动化生成的字典(可能为空)以及字段
  1358. const formData= ref({
  1359. 工单编号:'',
  1360. 印件编号:'',
  1361. 工序名称:'',
  1362. 产品名称:'',
  1363. sczl_bh1:'',
  1364. sczl_bh2:'',
  1365. sczl_bh3:'',
  1366. sczl_bh4:'',
  1367. sczl_bh5:'',
  1368. sczl_bh6:'',
  1369. sczl_bh7:'',
  1370. sczl_bh8:'',
  1371. sczl_bh9:'',
  1372. sczl_bh10:'',
  1373. sczl_name1:'',
  1374. sczl_name2:'',
  1375. sczl_name3:'',
  1376. sczl_name4:'',
  1377. sczl_name5:'',
  1378. sczl_name6:'',
  1379. sczl_name7:'',
  1380. sczl_name8:'',
  1381. sczl_name9:'',
  1382. sczl_name10:'',
  1383. })
  1384. const formDatasData= reactive([])
  1385. const formDatas = ref({
  1386. code1:'',
  1387. code2:'',
  1388. code3:'',
  1389. code4:'',
  1390. code5:'',
  1391. code6:'',
  1392. code7:'',
  1393. code8:'',
  1394. code9:'',
  1395. code10:'',
  1396. name1:'',
  1397. name2:'',
  1398. name3:'',
  1399. name4:'',
  1400. name5L:'',
  1401. name6:'',
  1402. name7:'',
  1403. name8:'',
  1404. name9:'',
  1405. name10:'',
  1406. percentage1:'',
  1407. percentage2:'',
  1408. percentage3:'',
  1409. percentage4:'',
  1410. percentage5:'',
  1411. percentage6:'',
  1412. percentage7:'',
  1413. percentage8:'',
  1414. percentage9:'',
  1415. percentage10:'',
  1416. })
  1417. //班组单击
  1418. const BZhandle = (val, row) => {
  1419. formDatas.value = {};
  1420. for (const key in val) {
  1421. if (val[key] === 0) {
  1422. break;
  1423. }
  1424. const parts = val[key].split(/[\s()]+/);
  1425. const code = parts[0];
  1426. const name = parts[1];
  1427. const percentage = parts[2];
  1428. // 根据索引填充不同的字段
  1429. const index = parseInt(key) + 1; // 索引从1开始
  1430. formDatas.value['code' + index] = code;
  1431. formDatas.value['name' + index] = name;
  1432. formDatas.value['percentage' + index] = percentage;
  1433. }
  1434. };
  1435. // ============== 表格控制部分结束 ===============
  1436. // 获取需要的字典 可能为空 按需保留
  1437. const setOptions = async () =>{
  1438. }
  1439. // 获取需要的字典 可能为空 按需保留
  1440. setOptions()
  1441. // 多选数据
  1442. const multipleSelection = ref([])
  1443. // 多选
  1444. const handleSelectionChange = (val) => {
  1445. multipleSelection.value = val
  1446. }
  1447. // 删除行
  1448. const deleteRow = (row) => {
  1449. ElMessageBox.confirm('确定要删除吗?', '提示', {
  1450. confirmButtonText: '确定',
  1451. cancelButtonText: '取消',
  1452. type: 'warning'
  1453. }).then(() => {
  1454. deleteCompanyFunc(row)
  1455. })
  1456. }
  1457. // 批量删除控制标记
  1458. const deleteVisible = ref(false)
  1459. // 多选删除
  1460. const onDelete = async() => {
  1461. const ids = []
  1462. if (multipleSelection.value.length === 0) {
  1463. ElMessage({
  1464. type: 'warning',
  1465. message: '请选择要删除的数据'
  1466. })
  1467. return
  1468. }
  1469. multipleSelection.value &&
  1470. multipleSelection.value.map(item => {
  1471. ids.push(item.ID)
  1472. })
  1473. const res = await deleteCompanyByIds({ ids })
  1474. if (res.code === 0) {
  1475. ElMessage({
  1476. type: 'success',
  1477. message: '删除成功'
  1478. })
  1479. if (tableData.value.length === ids.length && page.value > 1) {
  1480. page.value--
  1481. }
  1482. deleteVisible.value = false
  1483. getTableData()
  1484. }
  1485. }
  1486. // 行为控制标记(弹窗内部需要增还是改)
  1487. const type = ref('')
  1488. // 更新行
  1489. const updateCompanyFunc = async(row) => {
  1490. const res = await findCompany({ ID: row.ID })
  1491. type.value = 'update'
  1492. if (res.code === 0) {
  1493. formData.value = res.data.recompany
  1494. dialogFormVisible.value = true
  1495. }
  1496. }
  1497. const yjupdateCompanyFunc = async(row) => {
  1498. const res = await facilityProcedure({ Gd_gdbh: row['工单编号|质量信息'].substring(0, 7) })
  1499. console.log(res)
  1500. if (res.code === 0) {
  1501. selectData.value = res.data
  1502. }
  1503. }
  1504. // 删除行
  1505. const deleteCompanyFunc = async (row) => {
  1506. const res = await deleteCompany({ ID: row.ID })
  1507. if (res.code === 0) {
  1508. ElMessage({
  1509. type: 'success',
  1510. message: '删除成功'
  1511. })
  1512. if (tableData.value.length === 1 && page.value > 1) {
  1513. page.value--
  1514. }
  1515. getTableData()
  1516. }
  1517. }
  1518. // 弹窗控制标记
  1519. const dialogFormVisible = ref(false)
  1520. const dianjianVisible = ref(false)
  1521. const yinbanVisible = ref(false)
  1522. // 查看详情控制标记
  1523. const detailShow = ref(false)
  1524. const bzData = reactive([])
  1525. // 打开详情弹窗
  1526. const openDetailShow = () => {
  1527. detailShow.value = true
  1528. }
  1529. // 打开详情
  1530. const getDetails = async (row) => {
  1531. // 打开弹窗
  1532. const res = await findCompany({ ID: row.ID })
  1533. if (res.code === 0) {
  1534. formData.value = res.data.recompany
  1535. openDetailShow()
  1536. }
  1537. }
  1538. // 关闭详情弹窗
  1539. const closeDetailShow = () => {
  1540. detailShow.value = false
  1541. }
  1542. // 打开弹窗
  1543. const openDialog = () => {
  1544. // type.value = 'create'
  1545. console.log('222')
  1546. FacilityInspect()
  1547. FacilitychanLiang()
  1548. dialogFormVisible.value = true
  1549. }
  1550. let drzcData=[]
  1551. let columnNames=[]
  1552. //当日制程检验记录
  1553. const FacilityInspect = async () => {
  1554. const response = await facilityInspect({machine:JTMC,date:date});
  1555. console.log(response)
  1556. if(response.code==0){
  1557. // 提取 inspectiontime 作为列名
  1558. // Extract inspectiontime as columnNames
  1559. columnNames = response.data.InspectionTime;
  1560. // Populate drzcData with row data
  1561. for (const key in response.data.row[0]) {
  1562. if (key !== 'InspectionTime') {
  1563. const item = response.data.row[0][key];
  1564. const rowData = {
  1565. '工单编号': item['工单编号'],
  1566. '印件号': item['印件号'],
  1567. '工序名称': item['工序名称'],
  1568. '检验项目': item['检验项目']
  1569. };
  1570. // Initialize time columns with '—'
  1571. columnNames.forEach(time => {
  1572. rowData[time] = '';
  1573. });
  1574. // Split inspectresult and fill the corresponding time columns
  1575. const results = item['time'].split(',');
  1576. results.forEach(result => {
  1577. if (columnNames.includes(result)) {
  1578. rowData[result] = '√';
  1579. }else{rowData[result] = ''}
  1580. });
  1581. // Add the row data to drzcData
  1582. drzcData.push(rowData);
  1583. }
  1584. }
  1585. drzcDatas.value=drzcData
  1586. console.log(drzcData);
  1587. }
  1588. }
  1589. const FacilitychanLiang = async () => {
  1590. const response = await facilitychanLiang({machine:JTMC,date:date});
  1591. if(response.code==0){
  1592. delete response.data['totalA']
  1593. delete response.data['totalB']
  1594. gytableData.value=Object.values(response.data)
  1595. }
  1596. }
  1597. // 关闭弹窗
  1598. const closeDialog = () => {
  1599. dialogFormVisible.value = false
  1600. formData.value = {
  1601. address: '',
  1602. image: '',
  1603. name: '',
  1604. }
  1605. }
  1606. // 弹窗确定
  1607. const enterDialog = async () => {
  1608. elFormRef.value?.validate( async (valid) => {
  1609. if (!valid) return
  1610. let res
  1611. switch (type.value) {
  1612. case 'create':
  1613. res = await createCompany(formData.value)
  1614. break
  1615. case 'update':
  1616. res = await updateCompany(formData.value)
  1617. break
  1618. default:
  1619. res = await createCompany(formData.value)
  1620. break
  1621. }
  1622. if (res.code === 0) {
  1623. ElMessage({
  1624. type: 'success',
  1625. message: '创建/更改成功'
  1626. })
  1627. closeDialog()
  1628. getTableData()
  1629. }
  1630. })
  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. .groupbox
  1656. {margin:10px;
  1657. width:500px;
  1658. height:500px;
  1659. border:thin solid black;
  1660. padding:10px}
  1661. .grouptitle
  1662. {display:block;
  1663. margin-top:-24px;
  1664. margin-left:20px;
  1665. width:150px;
  1666. text-align:center;
  1667. background-color:white}
  1668. </style>