gongdanshengchan.vue 70 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604
  1. <template>
  2. <div>
  3. <layout>
  4. <layout-header>
  5. <div class="">
  6. <!-- 按钮部分-->
  7. <el-form ref="elSearchFormRef" :model="searchInfo" class="demo-form-inline" :rules="searchRule" @keyup.enter="onSubmit">
  8. <el-form-item>
  9. <!--按钮 clearable-->
  10. <el-input v-model="searchInfo" placeholder="搜索工单编号" style="width: 180px;"></el-input>
  11. <el-button type="primary" title="搜索" icon="search" @click="onSubmit"></el-button>
  12. <el-button type="primary" title="设置工单的状态-->【计划中】 【生产中】 【已完成】" icon="edit" @click="onStatusClick" class="bt">工单状态设置</el-button>
  13. <div v-if="treeType === 'customTree'">
  14. <el-button type="primary" title="设置工单各个工序的 【完工】 状态" icon="edit" @click="ongxztgzClick" class="bt">工序状态更正</el-button>
  15. <el-button type="primary" title="引用当前产品最近一次的生产参数【设备、显示产能、辅助工时】" icon="edit" @click="pd_yysjcsonClick" class="bt">引用实际参数</el-button>
  16. <el-button type="primary" title="批量维护工序生产的排程参数" icon="edit" disabled @click="pd_pccswhonClick" class="bt">排程参数维护</el-button>
  17. <el-button type="primary" title="将已经维护好的排产参数,复制给对应产品的对应工艺" icon="edit" disabled @click="pd_pdcsfzonClick" class="bt">排单参数复制</el-button>
  18. <el-button type="primary" title="根据当前生产任务设备状态排程 编辑生产计划" icon="edit" disabled @click="pd_editscjhonClick" class="bt">编辑生产计划</el-button>
  19. </div>
  20. <div v-else>
  21. <el-button type="primary" title="将当前已选的生产任务,【加入到设备生产任务清单中】" icon="edit" @click="onjrpcClick" class="bt">加入排产</el-button>
  22. <el-button type="primary" title="暂停工序生产任务,【返回当前设备待产任务清单中】" icon="edit" @click="onztwgClick" class="bt">暂停排产</el-button>
  23. <el-button type="primary" title="将工序佘总为【完工状态】" icon="edit" @click="ongxwgClick" class="bt">工序完工</el-button>
  24. <el-button type="primary" title="设置工单各个工序的【完工】状态" icon="edit" @click="ongxztgzClick" class="bt">工序状态更正</el-button>
  25. <el-button type="primary" title="可【批量设置】所选择的生产任务的生产机台" icon="edit" disabled @click="onjztzClick" class="bt">机组调整</el-button>
  26. <el-button type="primary" title="给担负起那设备做生产任务排程" icon="edit" @click="oncjsbpcClick" class="bt">车间设备制程排序</el-button>
  27. </div>
  28. <el-button type="primary" title="打印生产工单" icon="edit" @click="pd_gdprintonClick" class="bt">工单打印</el-button>
  29. <el-button type="primary" icon="edit" @click="pd_gxclhconClick" class="bt">工序产量核查</el-button>
  30. <el-button type="primary" icon="edit" @click="pd_lcdlistonClick" class="bt">流程单查询</el-button>
  31. </el-form-item>
  32. </el-form>
  33. <!-- 状态设置【弹窗】-->
  34. <el-dialog v-model="onstatuslist" title="工单状态设置" width="30%" style="top: 15%">
  35. <div style="width: 100%;height: 100%;">
  36. <div style="width: 100%; display: flex; align-items: center;">
  37. <el-form-item label="工单编号 :" prop="currentProcess">
  38. <el-input v-model="statusformData['gdbh']" placeholder="" />
  39. </el-form-item>
  40. </div>
  41. <div style="width: 100%; display: flex; align-items: center; margin-top: 30px;">
  42. <span>状态设置:</span>
  43. <el-radio-group v-model="status" style="margin-left: 10px;">
  44. <el-radio label="计划中">计划中</el-radio>
  45. <el-radio label="生产中">生产中</el-radio>
  46. <el-radio label="已完工">已完工</el-radio>
  47. </el-radio-group>
  48. </div>
  49. <div class="dialog-footer" style="text-align: right; margin-top: 40px;">
  50. <el-button @click="handleCancel">取消</el-button>
  51. <el-button type="primary" @click="handleConfirm">确认</el-button>
  52. </div>
  53. </div>
  54. </el-dialog>
  55. <!-- 工序状态更正【弹窗】-->
  56. <el-dialog v-model="gxztgzzlist" title="工序状态更正" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
  57. <el-button type="primary" @click="edit_gxztgzzCancel">更新时间</el-button>
  58. <el-button type="" @click="gxztgzzCancel">退出</el-button>
  59. <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; display: flex; align-items: center;">
  60. <el-form-item label="工单编号 :" prop="currentProcess" style="margin-right: 20px; padding: 0px">
  61. <el-input v-model="gxztgzzformData['gdbh']" @keyup.enter="gxztgzzgetProductValue" placeholder="" style="width: 200px;"/>
  62. </el-form-item>
  63. </div>
  64. <el-table ref="paichengRef"
  65. :show-overflow-tooltip="true"
  66. :row-style="{ height: '0px' }"
  67. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
  68. :header-cell-style="{ padding: '0px' }"
  69. style="width: 100%;height: 74vh" border tooltip-effect="dark"
  70. :data="gxztgzztableData" row-key="ID"
  71. :cell-class-name="gxztgzzCellClass">
  72. <template v-for="(item, idx) in gxztgzztableColumns">
  73. <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width" >
  74. <!-- <div v-if="['完工时间'].includes(item.prop)">-->
  75. <!-- <el-input v-model="row[item.prop]"-->
  76. <!-- :id="`input${idx}${$index}`" @keyup="gxztgzz_handleKeyDown($event, idx, $index, item.prop)"/>-->
  77. <!-- </div>-->
  78. <div v-if="['完工时间'].includes(item.prop)">
  79. <el-date-picker
  80. v-model="row[item.prop]"
  81. type="datetime"
  82. :id="`datepicker${idx}${$index}`"
  83. placeholder="选择日期和时间">
  84. </el-date-picker>
  85. </div>
  86. <div v-else>{{ row[item.prop] }}</div>
  87. </el-table-column>
  88. </template>
  89. </el-table>
  90. </el-dialog>
  91. <!--加入排产【弹窗】-->
  92. <!--暂停完工【弹窗】-->
  93. <!--暂停完工【弹窗】-->
  94. <!--机组调整【弹窗】-->
  95. <!--车间设备排程【弹窗】-->
  96. <el-dialog v-model="cjsbpclist" title="车间设备制程排序" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
  97. <el-button type="" @click="cjsbpcCancel">退出</el-button>
  98. <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; ">
  99. <div style="width: 100%; height: 60px; padding: 0px; display: flex; align-items: center;">
  100. <el-form-item label="设备代号 :" prop="currentProcess" style="margin-right: 20px; padding: 0px">
  101. <el-input v-model="cjsbpcformData['sbdh']" disabled placeholder="" />
  102. </el-form-item>
  103. <el-form-item label="班次选择:" prop="originalName" style="margin-left: 20px;">
  104. <el-select v-model="cjsbpcformData.banci" placeholder="请选择" style="width: 230px;" allow-create filterable @change="setBanci">
  105. <el-option
  106. v-for="(option, index) in cjsbpcformData.bancis"
  107. :key="index"
  108. :label="option.value"
  109. :value="option.value"
  110. >
  111. {{option.label}}
  112. </el-option>
  113. </el-select>
  114. </el-form-item>
  115. <el-form-item label="" prop="isBanciSelected" style="margin-left: 20px;">
  116. <el-checkbox v-model="cjsbpcformData.isBanciSelected">所有班次</el-checkbox>
  117. </el-form-item>
  118. <el-form-item label="" prop="" style="margin-left: 25px;">
  119. <el-button type="" icon="edit" disabled @click="oneditpcClick">更新排程</el-button>
  120. </el-form-item>
  121. </div>
  122. <el-table ref="paichengRef"
  123. :show-overflow-tooltip="true"
  124. :row-style="{ height: '0px' }"
  125. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
  126. :header-cell-style="{ padding: '0px' }"
  127. style="width: 100%;height: 74vh" border tooltip-effect="dark"
  128. highlight-current-row="true"
  129. @row-click="cjpc_tableRowClick"
  130. :data="paichengData" row-key="ID"
  131. :cell-class-name="cjzcCellClass"
  132. >
  133. <template v-for="(item, idx) in paichengColumns">
  134. <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width" >
  135. <div v-if="['优先次序', '生产工时', '辅助工时', '班次安排', '排单备注','最早开工时间', '计划开工时间'].includes(item.prop)">
  136. <el-input v-model="row[item.prop]" :clearable="false"
  137. :id="`input${idx}${$index}`"
  138. @keyup="handleKeyDown($event, idx, $index, item.prop)"
  139. />
  140. <!-- <el-date-picker v-model="row[item.prop]" v-if="['最早开工时间', '计划开工时间'].includes(item.prop)" type="datetime" :clearable="false"-->
  141. <!-- :id="`input${idx}${$index}`"-->
  142. <!-- @keyup="handleKeyDown($event, idx, $index , item.prop)"-->
  143. <!-- />-->
  144. </div>
  145. <div v-else>
  146. {{ row[item.prop] }}
  147. </div>
  148. </el-table-column>
  149. </template>
  150. </el-table>
  151. </div>
  152. </el-dialog>
  153. <!--工序产量核查【弹窗】-->
  154. <el-dialog v-model="pd_gxclhclist" title="工序产量核查" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
  155. <el-button type="" @click="gxclhcCancel">退出</el-button>
  156. <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; display: flex; align-items: center;">
  157. <div style="width: 100%; height: 60px; padding: 0px; display: flex; align-items: center;">
  158. <el-form-item label="工单编号" prop="currentProcess" style="margin-right: 20px; padding: 0px">
  159. <el-input v-model="gxclhcformData['gdbh']" @keyup.enter="gxclhcProductValue" placeholder="" />
  160. </el-form-item>
  161. </div>
  162. </div>
  163. <el-table ref="paichengRef"
  164. :show-overflow-tooltip="true"
  165. :row-style="{ height: '0px' }"
  166. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
  167. :header-cell-style="{ padding: '0px' }"
  168. style="width: 100%;height: 70vh" border tooltip-effect="dark"
  169. highlight-current-row="true"
  170. @row-click="gxclhc_tableRowClick"
  171. :data="gxclhc_Data" row-key="ID"
  172. :cell-class-name="gxclhcCellClass"
  173. >
  174. <template v-for="(item, idx) in gxclhc_Columns">
  175. <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width" >
  176. {{row[item.prop]}}
  177. </el-table-column>
  178. </template>
  179. </el-table>
  180. </el-dialog>
  181. <!--流程单查询【弹窗】-->
  182. <el-dialog v-model="pd_lcdlist" title="工单工序生产进程" style="width: 100%;height: 100%;margin: 0px;padding: 0px;">
  183. <div style="width: 100%;height: 100%;">
  184. <el-button type="" @click="pd_lcdCancel">退出</el-button>
  185. </div>
  186. <div style="width: 100%; height: 100%; display: flex; align-items: center;">
  187. <el-form-item label="工单编号" style="margin-right: 20px; padding: 0;">
  188. <el-input v-model="pd_lcdformData['gdbh']" @keyup.enter="pd_lcdProductValue"/>
  189. </el-form-item>
  190. <el-form-item label="" style="margin-right: 5px; padding: 0;">
  191. <el-input v-model="pd_lcdformData['code']" disabled/>
  192. </el-form-item>
  193. <el-form-item label="" style="margin-right: 5px; padding: 0;">
  194. <el-input v-model="pd_lcdformData['name']" disabled style="width: 500px"/>
  195. </el-form-item>
  196. </div>
  197. <div style="width: 100%; height: 70vh; display: flex;">
  198. <layout>
  199. <layout-sider :resize-directions="['right']" :width="240" style="margin-right: 10px;height: 70vh;">
  200. <div class="JKWTree-tree">
  201. <el-tree :data="pd_lcd_treeData" @node-click="pd_lcd_handleNodeClick" default-expand-all></el-tree>
  202. </div>
  203. </layout-sider>
  204. <layout-main>
  205. <!-- 这里放右侧的内容 -->
  206. <el-space wrap>
  207. <!-- 右侧内容 -->
  208. <template v-for="item in processList.total_process">
  209. <el-button disabled :type="! processList.process.includes(item) ? 'danger' : 'info'" plain style="width: 50px">{{ item }}</el-button>
  210. </template>
  211. </el-space>
  212. </layout-main>
  213. </layout>
  214. </div>
  215. </el-dialog>
  216. </div>
  217. </layout-header>
  218. <layout>
  219. <layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
  220. <div class="JKWTree-tree" style="height: 200px">
  221. <el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
  222. </div>
  223. </layout-sider>
  224. <layout-content>
  225. <el-main>
  226. <div class="gva-table-box" v-if="treeType === 'customTree'">
  227. <el-table ref="multipleTable" style="width: 100%;height: 25vh"
  228. :row-style="{ height: '20px' }" :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  229. :header-cell-style="{ padding: '0px' }" border
  230. tooltip-effect="dark" :data="tableData" row-key="ID"
  231. :highlight-current-row="true" size="small" @row-click="gdtableRowClick"
  232. @selection-change="handleSelectionChange" :show-overflow-tooltip="true">
  233. <template v-for="item in tableFields[currentNode]">
  234. <el-table-column :align="item.align" :label="item.title" sortable :prop="item.prop" :width="item.width" />
  235. </template>
  236. </el-table>
  237. <!-- 分页 -->
  238. <div class="gva-pagination" v-if="(currentNode == '计划中' || currentNode == '已完工') && treeType === 'customTree'">
  239. <el-pagination
  240. @size-change="jhz_handleSizeChange"
  241. @current-change="jhz_handleCurrentChange"
  242. :current-page="jhz_page"
  243. :page-sizes="[10,30,50,100]"
  244. :page-size="30"
  245. layout="total, sizes, prev, pager, next, jumper"
  246. :total="jhz_total">
  247. </el-pagination>
  248. </div>
  249. </div>
  250. <el-tabs v-model="activeName" @tab-click="handleClick" v-if="(currentNode == '计划中' || currentNode == '已完工') && treeType === 'customTree'">
  251. <el-tab-pane label="工艺资料" @click="showTable('工艺资料')" name="first">
  252. <el-table ref="multipleTable" :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
  253. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  254. :header-cell-style="{ padding: '0px' }" highlight-current-row="true"
  255. style="width: 100%;height: 45vh" border tooltip-effect="dark" :data="gytableData" row-key="ID" @selection-change="handleSelectionChange">
  256. <el-table-column align="left" sortable label="工单编号" prop="工单编号" width="90"/>
  257. <el-table-column align="left" sortable label="重点工序" prop="重点工序" width="90"/>
  258. <el-table-column align="left" sortable label="印件工序及名称" prop="印件工序及名称" width="500"/>
  259. <el-table-column align="left" sortable label="工序备注" prop="工序备注" width="150"/>
  260. <el-table-column align="left" sortable label="机组" prop="机组" width="80"/>
  261. <el-table-column align="left" sortable label="小时产能" prop="小时产能" width="90"/>
  262. <el-table-column align="left" sortable label="生产工时" prop="生产工时" width="90"/>
  263. <el-table-column align="left" sortable label="辅助工时" prop="辅助工时" width="90"/>
  264. <el-table-column align="left" sortable label="印刷方式" prop="印刷方式" width="90"/>
  265. <el-table-column align="left" sortable label="版距" prop="版距" width="70"/>
  266. <el-table-column align="left" sortable label="创建用户" prop="创建用户" width="100"/>
  267. <el-table-column align="left" sortable label="创建时间" prop="创建时间" width="110"/>
  268. <el-table-column align="left" sortable label="修改时间" prop="修改时间" width="110"/>
  269. <el-table-column align="left" sortable label="UNIQID" prop="UNIQID" width="90"/>
  270. </el-table>
  271. </el-tab-pane>
  272. <el-tab-pane label="印件资料" @click="showTable('印件资料')" name="second">
  273. <el-table ref="multipleTable" :row-style="{ height: '20px' }"
  274. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  275. :header-cell-style="{ padding: '0px' }" :show-overflow-tooltip="true"
  276. :highlight-current-row="true"
  277. style="width: 100%;height: 45vh" border tooltip-effect="dark" :data="yjtableData" row-key="ID" @selection-change="handleSelectionChange">
  278. <el-table-column align="left" sortable label="工单编号" prop="工单编号" width="90"/>
  279. <el-table-column align="left" sortable label="印件号" prop="印件号" width="70"/>
  280. <el-table-column align="left" sortable label="印件代号" prop="印件代号" width="100"/>
  281. <el-table-column align="left" sortable label="印件名称" prop="印件名称" width="240"/>
  282. <el-table-column align="left" sortable label="纸张名称" prop="纸张名称" width="230"/>
  283. <el-table-column align="left" sortable label="投料规格" prop="投料规格" width="100"/>
  284. <el-table-column align="left" sortable label="成品数量" prop="成品数量" width="90"/>
  285. <el-table-column align="left" sortable label="实际投料" prop="实际投料" width="90"/>
  286. <el-table-column align="left" sortable label="投料单位" prop="投料单位" width="85"/>
  287. <el-table-column align="left" sortable label="平张投料" prop="平张投料" width="90"/>
  288. <el-table-column align="left" sortable label="联数" prop="联数" width="70"/>
  289. <el-table-column align="left" sortable label="开数" prop="开数" width="70"/>
  290. <el-table-column align="left" sortable label="创建用户" prop="创建用户" width="110"/>
  291. <el-table-column align="left" sortable label="创建时间" prop="创建时间" width="110"/>
  292. <el-table-column align="left" sortable label="修改时间" prop="修改时间" width="110"/>
  293. <el-table-column align="left" sortable label="UNIQID" prop="UNIQID" width="90"/>
  294. </el-table>
  295. </el-tab-pane>
  296. </el-tabs>
  297. <div v-if="treeType === 'customTree'">
  298. <el-table ref="multipleTable2"
  299. v-if="['排程中', '制程中'].includes(currentNode)"
  300. :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
  301. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  302. :header-cell-style="{ padding: '0px' }" :highlight-current-row="true"
  303. :cell-class-name="pczc_planUsageCellClass"
  304. style="width: 100%;height: 45vh" border tooltip-effect="dark" :data="bottomData" row-key="ID" @selection-change="handleSelectionChange">
  305. <template v-for="item in bottomTableF[currentNode]">
  306. <el-table-column :align="item.align" :label="item.title" :prop="item.prop" :width="item.width" />
  307. </template>
  308. </el-table>
  309. </div>
  310. <div v-if="treeType === 'dataTree'">
  311. <el-table ref="chejianRef"
  312. :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
  313. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  314. :header-cell-style="{ padding: '0px' }" :highlight-current-row="true" @row-click="chejianRowClick"
  315. style="width: 100%;height: 25vh" border tooltip-effect="dark" :data="chejianData" row-key="ID" @selection-change="PC_handleChange">
  316. <el-table-column type="selection" width="30" />
  317. <template v-for="item in [
  318. { align:'left', title: '工单编号', prop: '工单编号', width: 85 },
  319. { align:'left', title: '销售订单号', prop: '销售订单号', width: 200 },
  320. { align:'left', title: '印件名称', prop: '印件名称', width: 320 },
  321. { align:'left', title: '印件工序及名称', prop: '印件工序及名称', width: 200 },
  322. { align:'left', title: '工序产量', prop: '工序产量', width: 90 },
  323. { align:'left', title: '已完成产量', prop: '已完成产量', width: 100 },
  324. { align:'left', title: '产品名称', prop: '产品名称', width: 320 },
  325. { align:'left', title: '订单数量', prop: '订单数量', width: 120 },
  326. { align:'left', title: '计量单位', prop: '计量单位', width: 120 },
  327. { align:'left', title: '交货日期', prop: '交货日期', width: 115 },
  328. { align:'left', title: '产品代号', prop: '产品代号', width: 140 },
  329. { align:'left', title: '工序名称', prop: '工序名称', width: 120 },
  330. { align:'left', title: '机组', prop: '机组', width: 90 },
  331. { align:'left', title: '设备编号', prop: '设备编号', width: 90 },
  332. { align:'left', title: 'UNIQID', prop: 'UNIQID', width: 90 },
  333. { align:'left', title: '印件号', prop: '印件号', width: 90 },
  334. { align:'left', title: '工序号', prop: '工序号', width: 90 },
  335. ]">
  336. <el-table-column :align="item.align" :label="item.title" :prop="item.prop" :width="item.width" />
  337. </template>
  338. </el-table>
  339. <el-table ref="chejianfuRef"
  340. :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
  341. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  342. :header-cell-style="{ padding: '0px' }" :highlight-current-row="true" @row-click="chejianfuRowClick"
  343. style="width: 100%;height: 50vh;margin-top: 10px" border tooltip-effect="dark" :data="chejianfuData" row-key="ID" @selection-change="ZP_handleChange">
  344. <el-table-column type="selection" width="30" />
  345. <template v-for="item in [
  346. { align:'left', title: '工单编号', prop: '工单编号', width: 85 },
  347. { align:'left', title: '销售订单号', prop: '销售订单号', width: 200 },
  348. { align:'left', title: '印件名称', prop: '印件名称', width: 320 },
  349. { align:'left', title: '印件工序及名称', prop: '印件工序及名称', width: 200 },
  350. { align:'left', title: '工序产量', prop: '工序产量', width: 90 },
  351. { align:'left', title: '已完成产量', prop: '已完成产量', width: 100 },
  352. { align:'left', title: '小时产能', prop: '小时产能', width: 90 },
  353. { align:'left', title: '产能系数', prop: '产能系数', width: 90 },
  354. { align:'left', title: '生产工时', prop: '生产工时', width: 90 },
  355. { align:'left', title: '辅助工时', prop: '辅助工时', width: 90 },
  356. { align:'left', title: '最早开工时间', prop: '最早开工时间', width: 160 },
  357. { align:'left', title: '计划开工时间', prop: '计划开工时间', width: 160 },
  358. { align:'left', title: '计划完工时间', prop: '计划完工时间', width: 160 },
  359. { align:'left', title: '班次安排', prop: '班次安排', width: 90 },
  360. { align:'left', title: '排单备注', prop: '排单备注', width: 120 },
  361. { align:'left', title: '产品名称', prop: '产品名称', width: 180 },
  362. { align:'left', title: '订单数量', prop: '订单数量', width: 120 },
  363. { align:'left', title: '计量单位', prop: '计量单位', width: 120 },
  364. { align:'left', title: '交货日期', prop: '交货日期', width: 115 },
  365. { align:'left', title: '优先次序', prop: '优先次序', width: 90 },
  366. { align:'left', title: '产品代号', prop: '产品代号', width: 100 },
  367. { align:'left', title: '工序名称', prop: '工序名称', width: 120 },
  368. { align:'left', title: '设备编号', prop: '设备编号', width: 90 },
  369. { align:'left', title: '车间名称', prop: '车间名称', width: 90 },
  370. { align:'left', title: 'GYUID', prop: 'GYUID', width: 90 },
  371. { align:'left', title: '印件号', prop: '印件号', width: 90 },
  372. { align:'left', title: '工序号', prop: '工序号', width: 90 },
  373. ]">
  374. <el-table-column :align="item.align" :label="item.title" :prop="item.prop" :width="item.width" />
  375. </template>
  376. </el-table>
  377. </div>
  378. </el-main>
  379. </layout-content>
  380. </layout>
  381. </layout>
  382. <PrintPage ref="printPageRef" />
  383. </div>
  384. </template>
  385. <script>
  386. //点击按钮显示下方表格
  387. export default {
  388. data() {
  389. return {
  390. currentTable: '',
  391. activeName: 'first',
  392. // 其他表格数据...
  393. };
  394. },
  395. methods: {
  396. showTable(tableName) {
  397. // 根据点击的按钮设置当前展示的表格
  398. this.currentTable = tableName;
  399. },
  400. showTableChange() {
  401. // 处理表格选中事件
  402. },
  403. // 其他方法...
  404. }
  405. };
  406. </script>
  407. <script setup>
  408. // 全量引入格式化工具 请按需保留
  409. import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
  410. import {createCompany, deleteCompany, deleteCompanyByIds, updateCompany, findCompany, getCompanyList} from '@/api/company'
  411. import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
  412. import { ElMessage, ElMessageBox } from 'element-plus'
  413. import { ref, reactive } from 'vue'
  414. import {
  415. DataList,
  416. getProduct,
  417. getProductData,
  418. scheduleProcess,
  419. ProductionSchedulingAdd,
  420. Project,
  421. StatusEdit,
  422. EquipmentScheduling,
  423. ScheduleSelection,
  424. MachineWorkOrderList,
  425. projectCraft,
  426. ProcessStatusCorrection,
  427. ProductionSchedulingPause,
  428. ProcessStatusCorrectionEdit,
  429. projectPrint,
  430. setProductStatus,
  431. workbench,
  432. ProcessFlow,
  433. Schedule,
  434. complete,
  435. getOrderProcessCount,
  436. getOrderProcessLeft,
  437. getOrderProcessRight
  438. } from "@/api/yunyin/yunying";
  439. import PrintPage from './components/print.vue'
  440. defineOptions({name: 'Company'})
  441. const printPageRef = ref()
  442. // =========== 左侧树侧形结构 ===========
  443. const sctreeData = ref([
  444. {
  445. label: '排产进程及参数设置',
  446. children:[
  447. {label: '1.计划中工单', number: "计划中", type: '__customer'},
  448. {label: '2.排程中工单', number: "排程中",type: '__customer'},
  449. {label: '3.制程中工单', number: "制程中", type: '__customer'},
  450. {label: '4.已完工工单', number: "已完工", type: '__customer'}
  451. ],
  452. }
  453. ]);
  454. //上方表格
  455. const tableFields = ref({
  456. "计划中": [
  457. { title:'获取状态', prop: 'statusColumn', width: 80, align:'center'},
  458. { title:'生产分类', prop: '生产分类', width: 80, align:'left', },
  459. { title: '工单编号', prop: '工单编号', width: 80, align:'center', },
  460. { title: '产品代号', prop: '产品代号', width: 90, align:'center', },
  461. { title: '产品名称', prop: '产品名称', width: 280, align:'left', },
  462. { title: '接单日期', prop: '接单日期', width: 110, align:'left', },
  463. { title: '交货日期', prop: '交货日期', width: 110, align:'left', },
  464. { title: '订单数量', prop: '订单数量', width: 80, align:'left', },
  465. { title: '计量单位', prop: '计量单位', width: 80, align:'center', },
  466. { title: '客户名称', prop: '客户名称', width: 200, align:'left', },
  467. { title: '客户编号', prop: '客户编号', width: 80, align:'center', },
  468. { title: '备注', prop: '备注', width: 230, align:'left', },
  469. { title: '客户料号', prop: '客户料号', width: 120, align:'left', },
  470. { title: '创建用户', prop: '创建用户', width: 110, align:'left', },
  471. { title: '创建时间', prop: '创建时间', width: 110, align:'left', },
  472. { title: '修改时间', prop: '修改时间', width: 110, align:'left', },
  473. { title: 'UNIQID', prop: 'UNIQID', width: 80 , align:'left', },
  474. { title: '投料率', prop: '投料率', width: 100, align:'left', },
  475. { title: '销售订单号', prop: '销售订单号', width: 120, align:'left', },
  476. ],
  477. "排程中": [
  478. // { title: '最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  479. { title: '工单编号', prop: '工单编号', width: 80, align:'left', },
  480. { title: '产品代号', prop: '产品代号', width: 90, align:'left', },
  481. { title: '产品名称', prop: '产品名称', width: 340, align:'left', },
  482. { title: '接单日期', prop: '接单日期', width: 110, align:'left', },
  483. { title: '交货日期', prop: '交货日期', width: 110, align:'left', },
  484. { title: '订单数量', prop: '订单数量', width: 80, align:'left', },
  485. { title: '计量单位', prop: '计量单位', width: 80, align:'left', },
  486. { title: '销售订单号', prop: '销售订单号', width: 200, align:'left', },
  487. // { title: '排程类型', prop: '排程类型', width: 120, align:'left', },
  488. { title: '客户编号', prop: '客户编号', width: 120, align:'left', },
  489. { title: '客户名称', prop: '客户名称', width: 230, align:'left', },
  490. { title: '创建用户', prop: '创建用户', width: 120, align:'left', },
  491. // { title: 'GDUID', prop: 'GDUID', width: 120, align:'left', },
  492. { title: 'GYUID', prop: 'GYUID', width: 100, align:'left', },
  493. ],
  494. "制程中": [
  495. // { title: '最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  496. { title: '工单编号', prop: '工单编号', width: 80, align:'left', },
  497. { title: '产品代号', prop: '产品代号', width: 90, align:'left', },
  498. { title: '产品名称', prop: '产品名称', width: 340, align:'left', },
  499. { title: '接单日期', prop: '接单日期', width: 110, align:'left', },
  500. { title: '交货日期', prop: '交货日期', width: 110, align:'left', },
  501. { title: '订单数量', prop: '订单数量', width: 80, align:'left', },
  502. { title: '计量单位', prop: '计量单位', width: 80, align:'left', },
  503. { title: '销售订单号', prop: '销售订单号', width: 200, align:'left', },
  504. // { title: '排程类型', prop: '排程类型', width: 120, align:'left', },
  505. { title: '客户编号', prop: '客户编号', width: 120, align:'left', },
  506. { title: '客户名称', prop: '客户名称', width: 120, align:'left', },
  507. { title: '客户料号', prop: '客户料号', width: 160, align:'left', },
  508. // { title: 'GDUID', prop: 'GDUID', width: 120, align:'left', },
  509. { title: 'GYUID', prop: 'GYUID', width: 100, align:'left', },
  510. ],
  511. "已完工": [
  512. { title: '工单编号', prop: '工单编号', width: 80, align:'left', },
  513. { title: '产品代号', prop: '产品代号', width: 110, align:'left', },
  514. { title: '产品名称', prop: '产品名称', width: 340, align:'left', },
  515. { title: '接单日期', prop: '接单日期', width: 110, align:'left', },
  516. { title: '交货日期', prop: '交货日期', width: 110, align:'left', },
  517. { title: '订单数量', prop: '订单数量', width: 80, align:'left', },
  518. { title: '计量单位', prop: '计量单位', width: 80, align:'left', },
  519. { title: '销售订单号', prop: '销售订单号', width: 120, align:'left', },
  520. { title: '客户编号', prop: '客户编号', width: 80, align:'left', },
  521. { title: '客户名称', prop: '客户名称', width: 120, align:'left', },
  522. { title: '客户料号', prop: '客户料号', width: 120, align:'left', },
  523. // { title: '排程类型', prop: '排程类型', width: 120, align:'left', },
  524. { title: 'GDUID', prop: 'GDUID', width: 80, align:'left', },
  525. ]
  526. })
  527. //排程中、制程中下方表格列表
  528. const bottomTableF = ref({
  529. "排程中": [
  530. { title:'工单编号', prop: '工单编号', width: 90, align:'left', },
  531. { title:'印件工序及名称', prop: '印件工序及名称', width: 160, align:'left', },
  532. { title:'机组', prop: '机组', width: 120, align:'left', },
  533. { title:'设备编号', prop: '设备编号', width: 120, align:'left', },
  534. { title:'工序产量', prop: '工序产量', width: 120, align:'left', },
  535. { title:'已完成产量', prop: '已完成产量', width: 120, align:'left', },
  536. { title:'剩余产量', prop: '剩余产量', width: 120, align:'left', },
  537. { title:'小时产能', prop: '小时产能', width: 120, align:'left', },
  538. { title:'产能系数', prop: '产能系数', width: 120, align:'left', },
  539. { title:'生产工时', prop: '生产工时', width: 120, align:'left', },
  540. { title:'辅助工时', prop: '辅助工时', width: 120, align:'left', },
  541. { title:'最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  542. { title:'计划开工时间', prop: '计划开工时间', width: 120, align:'left', },
  543. { title:'计划完工时间', prop: '计划完工时间', width: 120, align:'left', },
  544. { title:'班次安排', prop: '班次安排', width: 120, align:'left', },
  545. { title:'设备名称', prop: '设备名称', width: 120, align:'left', },
  546. { title:'排单备注', prop: '排单备注', width: 120, align:'left', },
  547. { title:'工序完工', prop: '工序完工', width: 160, align:'left', },
  548. { title:'UNIQID', prop: 'UNIQID', width: 120, align:'left', },
  549. ],
  550. "制程中": [
  551. { title:'工单编号', prop: '工单编号', width: 90, align:'left', },
  552. { title:'印件工序及名称', prop: '印件工序及名称', width: 160, align:'left', },
  553. { title:'机组', prop: '机组', width: 120, align:'left', },
  554. { title:'设备编号', prop: '设备编号', width: 120, align:'left', },
  555. { title:'工序产量', prop: '工序产量', width: 120, align:'left', },
  556. { title:'已完成产量', prop: '已完成产量', width: 120, align:'left', },
  557. { title:'剩余产量', prop: '剩余产量', width: 120, align:'left', },
  558. { title:'小时产能', prop: '小时产能', width: 120, align:'left', },
  559. { title:'产能系数', prop: '产能系数', width: 120, align:'left', },
  560. { title:'生产工时', prop: '生产工时', width: 120, align:'left', },
  561. { title:'辅助工时', prop: '辅助工时', width: 120, align:'left', },
  562. { title:'最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  563. { title:'计划开工时间', prop: '计划开工时间', width: 120, align:'left', },
  564. { title:'计划完工时间', prop: '计划完工时间', width: 120, align:'left', },
  565. { title:'班次安排', prop: '班次安排', width: 120, align:'left', },
  566. { title:'设备名称', prop: '设备名称', width: 120, align:'left', },
  567. { title:'排单备注', prop: '排单备注', width: 120, align:'left', },
  568. { title:'工序完工', prop: '工序完工', width: 160, align:'left', },
  569. { title:'UNIQID', prop: 'UNIQID', width: 120, align:'left', },
  570. ],
  571. })
  572. //左侧左边栏
  573. const treeData = ref([]);
  574. //车间侧边栏 进入页面自动加载【车间】数据
  575. const workbenchdata = async () => {
  576. try {
  577. const data = await workbench();
  578. const rawData = data.data;
  579. const dataArray =Object.keys(rawData).map(key => ({
  580. label: key,
  581. children: Object.keys(rawData[key]).map(subKey => ({
  582. label: subKey,
  583. children: rawData[key][subKey].map(item => ({
  584. label: item
  585. }))
  586. }))
  587. }));
  588. treeData.value = dataArray;
  589. treeData.value.unshift(sctreeData.value[0])
  590. } catch (error) {
  591. console.error(error);
  592. }
  593. };
  594. workbenchdata();
  595. //全局获取工单编号
  596. const _Gd_gdbh = ref(null)
  597. //点击表格 通过上方表格【工单编号】获取下方表格数据
  598. const chejianRowClick = async (row) => {
  599. _Gd_gdbh.value = row.工单编号;
  600. }
  601. const gdtableRowClick = async (row) => {
  602. _Gd_gdbh.value = row.工单编号;
  603. if (currentNode.value == "计划中") {
  604. if(row['statusColumn'] === "*"){
  605. gytableData.value = [];
  606. yjtableData.value = [];
  607. return false;
  608. }else{
  609. //计划中工单->工艺资料接口
  610. const gyres = await projectCraft({Gd_gdbh: _Gd_gdbh.value});
  611. //工艺资料表格
  612. gytableData.value.splice(0, gytableData.value.length, ...gyres.data);
  613. //计划中工单->印件资料接口
  614. const yjres = await projectPrint({Gd_gdbh: _Gd_gdbh.value});
  615. //印件资料表格
  616. yjtableData.value.splice(0, yjtableData.value.length, ...(yjres?.data ?? []));
  617. }
  618. }
  619. if (currentNode.value == "排程中") {
  620. const pc_scheduleProcess = await scheduleProcess({Gd_gdbh: _Gd_gdbh.value});
  621. bottomData.value = pc_scheduleProcess.data;
  622. }
  623. if (currentNode.value == "制程中") {
  624. const zc_scheduleProcess = await scheduleProcess({Gd_gdbh: _Gd_gdbh.value});
  625. bottomData.value = zc_scheduleProcess.data;
  626. }
  627. if (currentNode.value == "已完工") {
  628. //工艺资料
  629. const ywg_gyres = await projectCraft({Gd_gdbh: _Gd_gdbh.value});
  630. gytableData.value.splice(0, gytableData.value.length, ...ywg_gyres.data);
  631. //印件资料
  632. const ywg_yjres = await projectPrint({Gd_gdbh: _Gd_gdbh.value});
  633. yjtableData.value.splice(0, yjtableData.value.length, ...ywg_yjres.data);
  634. }
  635. };
  636. //点击左侧树形获取机台侧边栏列表
  637. const tableData = ref([]);
  638. const _machine = ref(null);
  639. const treeType = ref('customTree') // dataTree // 计划中,排产中 ,dataTree 车间
  640. const handleNodeClick = async (node) => {
  641. if (node.type && node.type === '__customer') {
  642. treeType.value = 'customTree'
  643. schandleNodeClick(node)
  644. } else if (!node.children) {
  645. treeType.value = 'dataTree'
  646. const custom_code = node.label;
  647. // 使用字符串分割获取#前面的数据
  648. const dataBeforeHash = custom_code.split('#')[0].trim();
  649. _machine.value = dataBeforeHash + '#';
  650. console.log(_machine.value)
  651. const zhubiao = await MachineWorkOrderList({ machine:_machine.value})
  652. chejianData.value = zhubiao.data['排程'];
  653. chejianfuData.value = zhubiao.data['制程'];
  654. }
  655. };
  656. //默认显示计划中表格
  657. const currentNode = ref("计划中")
  658. //计划中、已完工下方印件资料
  659. const yjtableData = ref([])
  660. //计划中、已完工下方工艺资料
  661. const gytableData = ref([])
  662. //排程中、制程中下方表格
  663. const bottomData = ref([])
  664. //车间机台排程列表
  665. const chejianData = ref([])
  666. //车间机台制程列表
  667. const chejianfuData = ref([])
  668. //点击侧边栏获取参数
  669. const _cname = ref(null)
  670. //工单侧边栏 设备定额及分配参数设置
  671. const schandleNodeClick = async (node) => {
  672. currentNode.value = node.number
  673. bottomData.value = []
  674. yjtableData.value = []
  675. gytableData.value = []
  676. console.log(node.number)
  677. switch (node.number) {
  678. case "计划中":
  679. const jhz_Projectdata = await Project({status:currentNode.value,search:'',page:1,limit:30});
  680. for (let i = 0; i < jhz_Projectdata.data.data.length; i++) {
  681. const item = jhz_Projectdata.data.data[i];
  682. if (item.status === 0) {
  683. //获取状态
  684. item.statusColumn = "*";
  685. }
  686. else if (item.status === 1) {
  687. item.statusColumn = "";
  688. }
  689. }
  690. tableData.value = jhz_Projectdata.data.data;
  691. //共多少条数据
  692. jhz_total.value = jhz_Projectdata.data.total;
  693. _cname.value = '计划中';
  694. _jhz_Projectdata_page();
  695. break;
  696. case "排程中":
  697. const pc_Schedule = await Schedule({status:currentNode.value,search:''});
  698. tableData.value = pc_Schedule.data;
  699. break;
  700. case "制程中":
  701. const zc_Schedule = await Schedule({status:currentNode.value,search:''});
  702. tableData.value = zc_Schedule.data;
  703. break;
  704. case "已完工":
  705. const ywg_Project = await Project({status:currentNode.value,search:'',page:1,limit:30});
  706. jhz_total.value = ywg_Project.data.total;//共多少条
  707. for (let i = 0; i < ywg_Project.data.data.length; i++) {
  708. const item = ywg_Project.data.data[i];
  709. // 如果 status 为 0,在某一列(比如 statusColumn)中添加 "*"
  710. if (item.status === 0) {
  711. item.statusColumn = "*";
  712. }
  713. else if (item.status === 1) {
  714. item.statusColumn = "";
  715. }
  716. }
  717. tableData.value = ywg_Project.data.data;
  718. jhz_total.value = ywg_Project.data.total;//共多少条
  719. _cname.value = '已完工';
  720. break;
  721. }
  722. };
  723. //分页
  724. const jhz_page = ref(1)//前往多少页
  725. const jhz_total = ref(0)//共多少条
  726. const jhz_pageSize = ref(30)//一页多少条
  727. const jhz_handleCurrentChange = (val) => {
  728. jhz_page.value = val;
  729. _jhz_Projectdata_page();
  730. };
  731. // 修改页面容量 点击多少条/页
  732. const jhz_handleSizeChange = (val) => {
  733. jhz_pageSize.value = val;
  734. _jhz_Projectdata_page();
  735. };
  736. //分页查询调用接口
  737. const _jhz_Projectdata_page = async () => {
  738. if( _cname.value === null || _cname.value === ''){
  739. return false;
  740. }
  741. const jhz_Projectdata = await Project({status: _cname.value,search:'',page:jhz_page.value,limit:jhz_pageSize.value});
  742. for (let i = 0; i < jhz_Projectdata.data.data.length; i++) {
  743. const item = jhz_Projectdata.data.data[i];
  744. if (item.status === 0) {
  745. //获取状态
  746. item.statusColumn = "*";
  747. }
  748. // 如果 status 为 1,可以在相应列中添加其他内容
  749. else if (item.status === 1) {
  750. item.statusColumn = "";
  751. }
  752. }
  753. tableData.value = jhz_Projectdata.data.data;
  754. jhz_total.value = jhz_Projectdata.data.total;//共多少条
  755. };
  756. //左上角搜索计划中、已完工工单编号
  757. const searchInfo = ref('');
  758. //搜索按钮
  759. const onSubmit = () => {
  760. if (!searchInfo.value) {
  761. ElMessage({ type: 'warning', message: '搜索条件为空' });
  762. return false;
  763. }
  764. if(!_machine.value){
  765. if (currentNode.value === '计划中' || currentNode.value === '已完工') {
  766. _Project();
  767. } else if (currentNode.value === '排程中' || currentNode.value === '制程中') {
  768. _Schedule();
  769. } else {
  770. ElMessage({ type: 'warning', message: '查询不到具体条件的工单' });
  771. }
  772. }else{
  773. _MachineWorkOrderList();
  774. }
  775. };
  776. //搜索计划中、已完工一条工单接口
  777. const _Project = async () => {
  778. const status = currentNode.value;
  779. const search = searchInfo.value;
  780. const Project_search = await Project({status:status,search:search,page:1,limit:30});
  781. if(Project_search.msg === '成功'){
  782. tableData.value = Project_search.data.data;
  783. }else{
  784. ElMessage({type: 'warning',message: '查不到具体条件的工单'})
  785. return false;
  786. }
  787. };
  788. // 搜索排程、制程一条工单接口
  789. const _Schedule = async () => {
  790. const status = currentNode.value;
  791. const search = searchInfo.value;
  792. const Schedule_search = await Schedule({status:status,search:search});
  793. if(Schedule_search.msg === '成功'){
  794. tableData.value = Schedule_search.data;
  795. }else{
  796. ElMessage({type: 'warning',message: '查不到具体条件的工单'})
  797. return false;
  798. }
  799. };
  800. //机台搜索一条工单接口
  801. const _MachineWorkOrderList = async () => {
  802. let params = {}
  803. params.search = searchInfo.value;
  804. params.machine = _machine.value;
  805. const MachineWorkOrderList_search = await MachineWorkOrderList(params);
  806. if(MachineWorkOrderList_search.msg === ''){
  807. ElMessage({type: 'warning',message: '查不到具体条件的工单'})
  808. return false;
  809. }else{
  810. chejianfuData.value = MachineWorkOrderList_search.data['制程'];
  811. chejianData.value = MachineWorkOrderList_search.data['排程'];
  812. }
  813. };
  814. //加入排产按钮
  815. const onjrpcClick = async () => {
  816. searchInfo.value = '';
  817. if(_PC_gdbh.value == null || _PC_gdbh.value == ''){
  818. ElMessage({type: 'warning',message: '请勾选排程中工单'})
  819. }else{
  820. if (_PC_xscn.value === '' || _PC_xscn.value === null || _PC_xscn.value === '0') {
  821. ElMessage({type: 'warning',message: '选择中小时产量为 0'})
  822. return false;
  823. }else{
  824. let params = {}
  825. params.workOrder = _PC_gdbh.value;
  826. params.machine = _machine.value;
  827. params.printCode = _PC_yjno.value;
  828. params.processCode = _PC_gxh.value;
  829. const ProductionSchedulingAdd_add = await ProductionSchedulingAdd(params);
  830. if (ProductionSchedulingAdd_add.code === 0) {
  831. const pc_zc_table = await MachineWorkOrderList({machine:_machine.value});
  832. chejianData.value = pc_zc_table.data['排程'];
  833. chejianfuData.value = pc_zc_table.data['制程'];
  834. ElMessage({type: 'success',message: '加入排产 更新成功'});
  835. } else {
  836. ElMessage({ type: 'error',message: '更新失败'})
  837. }
  838. }
  839. }
  840. };
  841. //暂停排产按钮
  842. const onztwgClick = async () => {
  843. searchInfo.value = '';
  844. if(_ZC_gdbh.value == null || _ZC_gdbh.value == ''){
  845. ElMessage({type: 'warning', message: '请勾选制程中工单'})
  846. }else{
  847. let params = {}
  848. params.workOrder = _ZC_gdbh.value;
  849. params.machine = _machine.value;
  850. params.printCode = _ZC_yjno.value;
  851. params.processCode = _ZC_gxh.value;
  852. const ProductionSchedulingAdd_stop = await ProductionSchedulingPause(params);
  853. if (ProductionSchedulingAdd_stop.code === 0) {
  854. const pc_zc_table = await MachineWorkOrderList({machine:_machine.value});
  855. chejianData.value = pc_zc_table.data['排程'];
  856. chejianfuData.value = pc_zc_table.data['制程'];
  857. ElMessage({type: 'success',message: '暂停排产 更新成功'});
  858. } else {
  859. ElMessage({ type: 'error',message: '更新失败'})
  860. }
  861. }
  862. };
  863. //工序完工按钮
  864. const ongxwgClick = async () => {
  865. searchInfo.value = '';
  866. if(_ZC_gdbh.value == null || _ZC_gdbh.value == ''){
  867. onstatuslist.value = false;
  868. ElMessage({type: 'warning',message: '请勾选制程中工单'})
  869. }else{
  870. let params = {}
  871. params.workOrder = _ZC_gdbh.value;
  872. params.processCode = _ZC_gxh.value;
  873. const complete_get = await complete(params);
  874. if (complete_get.code === 0) {
  875. const pc_zc_table = await MachineWorkOrderList({ machine:_machine.value});
  876. // chejianData.value = pc_zc_table.data['排程'];
  877. chejianfuData.value = pc_zc_table.data['制程'];
  878. ElMessage({type: 'success',message: '工序完工 更新成功'})
  879. } else {
  880. ElMessage({ type: 'error',message: '更新失败'})
  881. }
  882. }
  883. };
  884. //加入排程【上面到下面】
  885. const _PC_gxh = ref(null)
  886. const _PC_yjno = ref(null)
  887. const _PC_gdbh = ref(null)
  888. const _PC_xscn = ref(null)
  889. const PC_handleChange = (arr) => {
  890. let gxh = arr.map((val) => val['gxh']).join(",");
  891. let yjno = arr.map((val) => val['yjno']).join(",");
  892. let str = arr.map((val) => val['工单编号']).join(",");
  893. let xscn = arr.map((val) => val['小时产能']).join(",");
  894. _PC_gxh.value = gxh;
  895. _PC_yjno.value = yjno;
  896. _PC_gdbh.value = str;
  897. _PC_xscn.value = xscn;
  898. }
  899. //加入制程【下面到上面】
  900. const _ZC_gxh = ref(null)
  901. const _ZC_yjno = ref(null)
  902. const _ZC_gdbh = ref(null)
  903. const _ZC_xscn = ref(null)
  904. const ZP_handleChange = (arr) => {
  905. let gxh = arr.map((val) => val['gxh']).join(",");
  906. let yjno = arr.map((val) => val['yjno']).join(",");
  907. let str = arr.map((val) => val['工单编号']).join(",");
  908. let xscn = arr.map((val) => val['小时产能']).join(",");
  909. _ZC_gxh.value = gxh;
  910. _ZC_yjno.value = yjno;
  911. _ZC_gdbh.value = str;
  912. _ZC_xscn.value = xscn;
  913. }
  914. //=========工序产量核查===========
  915. const pd_gxclhclist = ref(false);
  916. const gxclhc_Data = ref([]);
  917. const gxclhc_Columns = ref(
  918. [
  919. { label: '印件及工序名称', prop: 'concatenatedData', width: '380' },
  920. // { label: '印件', prop: 'Gy0_yjno', width: '130' },
  921. // { label: '工序', prop: 'Gy0_gxh', width: '130' },
  922. // { label: '名称', prop: 'Gy0_gxmc', width: '130' },
  923. { label: '工序计划产量', prop: 'Gy0_计划接货数', width: '120' },
  924. { label: '联数', prop: 'Gy0_ls', width: '70' },
  925. { label: '折算车头产量', prop: '折算车头产量', width: '120' },
  926. { label: '实际上报产量', prop: 'sczl_cl', width: '120' },
  927. { label: '制程废品', prop: 'sczl_zcfp', width: '120' },
  928. { label: '制程废品率', prop: '制程废品率', width: '120' },
  929. { label: '来料异常', prop: '来料异常', width: '90' },
  930. { label: '流程单数', prop: 'process_num', width: '90' },
  931. { label: '当前设备', prop: 'Gy0_sbbh', width: '120' },
  932. { label: '工序状态', prop: 'PD_WG', width: '90'},
  933. { label: '首板生产日期', prop: 'sczl_rq', width: '160' },
  934. ]
  935. )
  936. const gxclhcformData = reactive({
  937. gdbh: '',
  938. gdmc: '',
  939. });
  940. // 工序产量核查按钮
  941. const pd_gxclhconClick = async () => {
  942. if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
  943. ElMessage({type: 'warning',message: '请选择具体的工单,在进行操作'})
  944. return false;
  945. }
  946. gxclhcformData['gdbh'] = _Gd_gdbh.value;
  947. pd_gxclhclist.value = true;
  948. _getOrderProcessCount();
  949. };
  950. //工序产量核查回车
  951. const gxclhcProductValue = async () => {
  952. _getOrderProcessCount();
  953. }
  954. //工序产量核查退出
  955. const gxclhcCancel = async () => {
  956. pd_gxclhclist.value = false;
  957. };
  958. //工序产量核查方法接口
  959. const _getOrderProcessCount = async () => {
  960. const order = gxclhcformData['gdbh'];
  961. const getOrderProcessCount_list = await getOrderProcessCount({order:order});
  962. const concatenatedData = getOrderProcessCount_list.data.map(item => {
  963. // 优化后的代码,使用模板字符串连接字段值并在单个数字前添加零
  964. const formattedYjno = item.Gy0_yjno.length === 1 ? `0${item.Gy0_yjno}` : item.Gy0_yjno;
  965. const formattedGxh = item.Gy0_gxh.length === 1 ? `0${item.Gy0_gxh}` : item.Gy0_gxh;
  966. const concatenatedValue = `${formattedYjno}-${formattedGxh} ${item.Gy0_gxmc}`;
  967. return {
  968. ...item,
  969. concatenatedData: concatenatedValue, // 使用新属性名
  970. };
  971. });
  972. gxclhc_Data.value = concatenatedData;
  973. };
  974. //工序产量核查
  975. const gxclhcCellClass = ({row, column, rowIndex, columnIndex}) =>{
  976. if (column.label === '实际上报产量' ||column.label === '制程废品' || column.label === '制程废品率' ||
  977. column.label === '来料异常' || column.label === '流程单数' || column.label === '当前设备') {
  978. return 'lan-plan-usage-lows';
  979. }
  980. if (column.label === '折算车头产量') {
  981. return 'gxclhc—color-column-red';
  982. }
  983. // 如果不是 'PD_WG' 列,返回空字符串或其他样式类
  984. if (column.label === '工序状态'){
  985. if(row['PD_WG'] === '完工'){
  986. return 'lan-plan-usage-lowshui';
  987. }else{
  988. return 'pczccolor-column-lan';
  989. }
  990. }
  991. }
  992. //===========工单状态设置按钮=======
  993. const onstatuslist = ref(false);
  994. const statusformData = reactive({gdbh: '',});
  995. const status = ref('计划中'); // 默认选择
  996. const onStatusClick = () => {
  997. if(_Gd_gdbh.value === null || _Gd_gdbh.value === ''){
  998. onstatuslist.value = false;
  999. ElMessage({
  1000. type: 'warning',
  1001. message: '请选择树形后,再操作此功能'
  1002. })
  1003. }else{
  1004. statusformData['gdbh'] = _Gd_gdbh.value;
  1005. onstatuslist.value = true;
  1006. }
  1007. };
  1008. //工单状态设置【放弃按钮】
  1009. const handleCancel = () => {
  1010. onstatuslist.value = false;
  1011. };
  1012. //工单状态设置【执行按钮】
  1013. const handleConfirm = async () => {
  1014. //工单编号
  1015. let workOrder = statusformData['gdbh'];
  1016. //状态
  1017. let statusCode;
  1018. if (status.value === '计划中') {
  1019. statusCode = "1-计划中";
  1020. } else if (status.value === '生产中') {
  1021. statusCode = "2-生产中";
  1022. }else if (status.value === '已完工') {
  1023. statusCode = "3-已完工";
  1024. }
  1025. const StatusEditdata = await StatusEdit({workOrder:workOrder,status:statusCode});
  1026. if (StatusEditdata.code === 0) {
  1027. ElMessage({
  1028. type: 'success',
  1029. message: '更新成功'
  1030. })
  1031. } else {
  1032. ElMessage({
  1033. type: 'error',
  1034. message: '更新失败'
  1035. })
  1036. }
  1037. onstatuslist.value = false;
  1038. };
  1039. // =========== 【工序状态更正】 ===========
  1040. const gxztgzztableColumns = ref(
  1041. [
  1042. { label: '印件及工序', prop: '印件及工序', width: '600' },
  1043. { label: '计划产量/已完成', prop:['计划产量/已完成'], width: '500' },
  1044. { label: '完成率', prop: '完成率', width: '240' },
  1045. { label: '完工时间', prop: '完工时间', width: '300' },
  1046. { label: '设备代号', prop: '设备代号', width: '240' },
  1047. ]
  1048. )
  1049. const gxztgzztableData = ref([]);
  1050. const gxztgzzlist = ref(false);
  1051. const gxztgzzformData = reactive({gdbh: '',});
  1052. //工序状态更正按钮
  1053. const ongxztgzClick = () => {
  1054. if(_Gd_gdbh.value == null){
  1055. gxztgzzlist.value = false;
  1056. ElMessage({type: 'warning',message: '请选择树形后,再操作此功能'})
  1057. }else{
  1058. gxztgzzformData['gdbh'] = _Gd_gdbh.value;
  1059. _ProcessStatusCorrection();
  1060. gxztgzzlist.value = true;
  1061. }
  1062. };
  1063. //工序状态更正回车
  1064. const gxztgzzgetProductValue = () => {
  1065. _ProcessStatusCorrection();
  1066. };
  1067. //工序状态更正接口获取
  1068. const _ProcessStatusCorrection = async (row) => {
  1069. const workOrder = gxztgzzformData['gdbh'];
  1070. const ProcessStatusCorrectiondata = await ProcessStatusCorrection({workOrder:workOrder});
  1071. gxztgzztableData.value = ProcessStatusCorrectiondata.data;
  1072. };
  1073. //工序状态更正更新
  1074. const edit_gxztgzzCancel = async () => {
  1075. const formatDate = (inputDateString) => {
  1076. const timestamp = Date.parse(inputDateString);
  1077. if (isNaN(timestamp)) {
  1078. return ''; // 返回空字符串表示日期无效
  1079. }
  1080. const date = new Date(timestamp);
  1081. const year = date.getFullYear();
  1082. const month = ('0' + (date.getMonth() + 1)).slice(-2);
  1083. const day = ('0' + date.getDate()).slice(-2);
  1084. const hour = ('0' + date.getHours()).slice(-2);
  1085. const minute = ('0' + date.getMinutes()).slice(-2);
  1086. const second = ('0' + date.getSeconds()).slice(-2);
  1087. return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
  1088. };
  1089. const formattedData = gxztgzztableData.value.map(item => {
  1090. return {
  1091. UniqId: item['UniqId'],
  1092. PD_WG: formatDate(item['完工时间']),
  1093. };
  1094. });
  1095. const ProcessStatusCorrectionEdit_status = await ProcessStatusCorrectionEdit(formattedData);
  1096. if (ProcessStatusCorrectionEdit_status.code === 0) {
  1097. ElMessage({ type: 'success',message: '更新成功' })
  1098. } else {
  1099. ElMessage({type: 'error',message: '更新失败'})
  1100. }
  1101. gxztgzzlist.value = false;
  1102. };
  1103. //工序状态更正退出
  1104. const gxztgzzCancel = () => {
  1105. gxztgzzlist.value = false;
  1106. };
  1107. //机组调整按钮
  1108. const onjztzClick = async () => {
  1109. };
  1110. //=============引用实际参数================
  1111. const pd_yysjcsonClick = () => {
  1112. if(_Gd_gdbh.value == null){
  1113. gxztgzzlist.value = false;
  1114. ElMessage({type: 'warning',message: '请选择树形后,再操作此功能'})
  1115. }else{
  1116. console.log(_Gd_gdbh.value)
  1117. ElMessage({type: 'warning',message: '没有找到该产品的入仓完工记录,不能继续进行'})
  1118. }
  1119. };
  1120. //=============车间设备排程================
  1121. const paichengColumns = ref(
  1122. [
  1123. { label: '优先次序', prop: '优先次序', width: '105' },
  1124. { label: '工单编号', prop: '工单编号', width: '100' },
  1125. { label: '印件名称', prop: '印件名称', width: '220' },
  1126. { label: '接货数', prop: '接货数', width: '105' },
  1127. { label: '小时产能', prop: '小时产能', width: '100' },
  1128. { label: '生产工时', prop: '生产工时', width: '100' },
  1129. { label: '辅助工时', prop: '辅助工时', width: '100' },
  1130. { label: '班次安排', prop: '班次安排', width: '100' },
  1131. { label: '排单备注', prop: '排单备注', width: '150' },
  1132. { label: '最早开工时间', prop: '最早开工时间', width: '180' },
  1133. { label: '计划开工时间', prop: '计划开工时间', width: '180' },
  1134. { label: '计划完工时间', prop: '计划完工时间', width: '180' },
  1135. { label: '销售订单号', prop: '销售订单号', width: '120' },
  1136. { label: '印件/工序', prop: '印件/工序', width: '110' },
  1137. ]
  1138. )
  1139. const handleKeyDown = (event, x, y, prop) => {
  1140. const currentElement = document.getElementById(`input${x}${y}`);
  1141. if (currentElement === null && currentElement === undefined) return
  1142. let move = 0
  1143. switch (event.keyCode) {
  1144. case 13: // Enter
  1145. if (x === 0 && y === +y) {
  1146. console.log("排序前的值");
  1147. console.log(paichengData.value);
  1148. paichengData.value.sort((a, b) => {
  1149. const priorityA = parseFloat(a['优先次序']);
  1150. const priorityB = parseFloat(b['优先次序']);
  1151. // 将空白值放在最后
  1152. if (isNaN(priorityA)) return 1;
  1153. if (isNaN(priorityB)) return -1;
  1154. // 按优先次序升序排序
  1155. return priorityA - priorityB;
  1156. });
  1157. console.log("排序后的值");
  1158. console.log(paichengData.value);
  1159. // 封装时间格式化函数
  1160. function formatTimestamp(timestamp) {
  1161. const date = new Date(timestamp * 1000);
  1162. const year = date.getFullYear();
  1163. const month = (date.getMonth() + 1).toString().padStart(2, '0');
  1164. const day = date.getDate().toString().padStart(2, '0');
  1165. const hours = date.getHours().toString().padStart(2, '0');
  1166. const minutes = date.getMinutes().toString().padStart(2, '0');
  1167. const seconds = date.getSeconds().toString().padStart(2, '0');
  1168. const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  1169. return formattedDate;
  1170. }
  1171. // 获取第一行数据
  1172. const firstRow = paichengData.value[+y];
  1173. // 初始化上一行的计划完工时间为第一行的计划开工时间
  1174. let prevCompletionTime = new Date(firstRow['计划开工时间']).getTime() / 1000;
  1175. // 遍历每一行数据
  1176. paichengData.value.forEach(row => {
  1177. const roundedValue = (Math.floor(row['生产工时'] * 10) % 10 === 5) ? row['生产工时'] : Math.round(row['生产工时']);
  1178. const result = parseFloat(roundedValue) + parseFloat(row['辅助工时']);
  1179. const resultTimestamp = result * 3600;
  1180. // 计算【计划开工时间】最终时间戳,使用上一行的计划完工时间
  1181. const finalTimestamp = prevCompletionTime + resultTimestamp;
  1182. // 将计划完工时间赋值到当前行
  1183. row['计划完工时间'] = formatTimestamp(finalTimestamp);
  1184. // 更新上一行的计划完工时间为当前行的计划完工时间
  1185. prevCompletionTime = finalTimestamp;
  1186. console.log("=============================");
  1187. console.log("x是 y是 生产工时 + 辅助工时 * 3600 + 计划开工时间 = 时间戳↓↓↓↓↓↓↓↓↓");
  1188. console.log(`x是 ${x} Y是 ${y} --- ${roundedValue} + ${row['辅助工时']} * 3600 + ${new Date(row['计划开工时间']).getTime() / 1000} = ${finalTimestamp}`);
  1189. console.log("=============================");
  1190. });
  1191. }
  1192. const nextInputElement = document.getElementById(`input${x}${y + 1}`);
  1193. if (nextInputElement) {
  1194. nextInputElement.focus();
  1195. }
  1196. break;
  1197. case 40: // 向下箭头
  1198. if (y < paichengData.value.length ){
  1199. const nextInputElement = document.getElementById(`input${x}${y + 1}`);
  1200. if (nextInputElement) {
  1201. nextInputElement.focus();
  1202. }
  1203. }
  1204. break;
  1205. case 38: // 向上箭头
  1206. if ( y > 0) {
  1207. document.getElementById(`input${x}${y - 1}`).focus();
  1208. }
  1209. break;
  1210. case 39: // 向右箭头
  1211. if ( x === 0) {
  1212. move = x + 5
  1213. } else if (x >= 5 && x <=10) {
  1214. move = x + 1
  1215. }
  1216. const nextInputElements = document.getElementById(`input${move}${y}`);
  1217. if (nextInputElements) {
  1218. nextInputElements.focus();
  1219. }
  1220. break;
  1221. case 37: // 向左箭头
  1222. if ( x === 5) {
  1223. move = x - 5
  1224. } else if (x >= 5 && x <=10) {
  1225. move = x - 1
  1226. }
  1227. document.getElementById(`input${move}${y}`).focus();
  1228. break;
  1229. default:
  1230. break;
  1231. }
  1232. }
  1233. const cjsbpclist = ref(false);
  1234. const cjsbpcformData = reactive({
  1235. //设备代号
  1236. sbdh: '',
  1237. // 下拉框选项数据
  1238. bancis: [],
  1239. // 设置默认值
  1240. banci: '',
  1241. isBanciSelected: false,
  1242. });
  1243. const pd_gdprintonClick = () => {
  1244. printPageRef.value.open(_Gd_gdbh.value)
  1245. }
  1246. //车间设备排程【按钮】
  1247. const oncjsbpcClick = () => {
  1248. cjsbpcformData['sbdh'] = _machine.value;
  1249. _EquipmentSchedulingdata();
  1250. _ScheduleSelectiondata();
  1251. cjsbpclist.value = true;
  1252. };
  1253. //调用班次选择列表接口
  1254. const _ScheduleSelectiondata = async ()=>{
  1255. try {
  1256. const ScheduleSelectiondata = await ScheduleSelection();
  1257. // 清空之前的数据
  1258. cjsbpcformData.bancis = [];
  1259. // 循环遍历数组并将每个班次的detail添加到bancis数组中
  1260. for (const option of ScheduleSelectiondata.data) {
  1261. cjsbpcformData.bancis.push({ label: option.detail, value: option.detail.split('||')[0], rename:option.detail});
  1262. }
  1263. } catch (error) {
  1264. console.error(error);
  1265. }
  1266. }
  1267. //车间设备排程->数据展示
  1268. const paichengData = ref([])
  1269. //点击车间排程行
  1270. const _bcxz_val = ref(null)
  1271. //点击表格行的时候触发的方法
  1272. const cjpc_tableRowClick = (row) => {
  1273. _bcxz_val.value = row; // 保存点击的行数据
  1274. }
  1275. //班次选择列表下拉框
  1276. const setBanci = (v) => {
  1277. if(cjsbpcformData['isBanciSelected'] === true){
  1278. paichengData.value.map( item => item.班次安排 = v)
  1279. }else{
  1280. if (_bcxz_val.value) {
  1281. _bcxz_val.value['班次安排'] = v;
  1282. }
  1283. }
  1284. }
  1285. const _EquipmentSchedulingdata = async ()=>{
  1286. // let machine = 'WY01#';
  1287. let machine = _machine.value;
  1288. try {
  1289. const EquipmentSchedulingdata = await EquipmentScheduling({machine:machine});
  1290. if (EquipmentSchedulingdata.code === 0) {
  1291. paichengData.value = EquipmentSchedulingdata.data
  1292. }
  1293. } catch (error) {
  1294. console.error(error);
  1295. }
  1296. }
  1297. //车间设备制程->数据编辑
  1298. //车间设备制程【更新排程】
  1299. const oneditpcClick = async () => {
  1300. const rawValueArray = paichengData._rawValue;
  1301. const formattedData = rawValueArray.map(item => {
  1302. return {
  1303. capacity: item.小时产能,
  1304. ProductionHours: item.生产工时,
  1305. AuxiliaryHours: item.辅助工时,
  1306. shift: item.班次安排,
  1307. remark: item.排单备注,
  1308. start: item.计划开工时间,
  1309. projectTime: item.计划完工时间,
  1310. UniqId: item.UniqId
  1311. };
  1312. });
  1313. console.log(formattedData)
  1314. // const EquipmentSchedulingEdit_edit = await EquipmentSchedulingEdit(formattedData);
  1315. // console.log(EquipmentSchedulingEdit_edit)
  1316. // cjsbpclist.value = true;
  1317. };
  1318. //车间设备制程【退出】
  1319. const cjsbpcCancel = () => {
  1320. cjsbpclist.value = false;
  1321. };
  1322. // =========== 流程单查询 ===========
  1323. const pd_lcdlist = ref(false);
  1324. const pd_lcdformData = reactive({
  1325. gdbh: '',
  1326. code: '',
  1327. name: '',
  1328. });
  1329. // 流程单查询按钮
  1330. const processList = ref([]);
  1331. const pd_lcdlistonClick = async () => {
  1332. if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
  1333. ElMessage({type: 'warning',message: '请选择具体的工单,在进行操作'})
  1334. return false;
  1335. }else{
  1336. pd_lcdformData['gdbh'] = _Gd_gdbh.value;
  1337. pd_lcdlist.value = true;
  1338. processList.value = []
  1339. _getOrderProcessLeft_list();
  1340. }
  1341. }
  1342. const pd_lcdProductValue = async () => {
  1343. _getOrderProcessLeft_list();
  1344. }
  1345. const pd_lcd_treeData = ref([]);
  1346. const _getOrderProcessLeft_list = async () => {
  1347. const order = pd_lcdformData['gdbh'];
  1348. // console.log(order)
  1349. try {
  1350. //5.1流程单查询-工单工序生产进程菜单栏
  1351. const getOrderProcessLeft_list = await getOrderProcessLeft({ order:order});
  1352. console.log(getOrderProcessLeft_list)
  1353. pd_lcdformData['code'] = getOrderProcessLeft_list.data.Gd_info['code'];
  1354. pd_lcdformData['name'] = getOrderProcessLeft_list.data.Gd_info['name'];
  1355. pd_lcd_treeData.value = [{
  1356. label: order + '-' + getOrderProcessLeft_list.data.Gd_info['name'],
  1357. // label: order + '-' + getOrderProcessLeft_list.data.Gd_info['code'] + '-' + getOrderProcessLeft_list.data.Gd_info['name'],
  1358. value: undefined,
  1359. children: []
  1360. }]
  1361. const newData = [];
  1362. for (let key in getOrderProcessLeft_list.data.Gy_info) {
  1363. let temp = getOrderProcessLeft_list.data.Gy_info[key];
  1364. let concatenatedValue = `${temp.Gy0_yjno}-${temp.Gy0_gxh} ---> ${temp.Gy0_gxmc}`;
  1365. newData.push({ label: concatenatedValue,value: temp.Gy0_gxh });
  1366. }
  1367. pd_lcd_treeData.value[0].children = newData;
  1368. //5.2流程单查询-获取工单工序生产进程右侧【进入页面默认显示第一个】
  1369. const getOrderProcessRight_list = await getOrderProcessRight({order:order, gxNo:newData[0].value});
  1370. processList.value = getOrderProcessRight_list.data
  1371. } catch (error) {
  1372. console.error(error);
  1373. }
  1374. };
  1375. const pd_lcd_handleNodeClick = async (node) => {
  1376. if (node.value === undefined) return
  1377. const order = pd_lcdformData['gdbh'];
  1378. ////5.2流程单查询-获取工单工序生产进程右侧
  1379. const getOrderProcessRight_list = await getOrderProcessRight({order:order, gxNo:node.value});
  1380. console.log(getOrderProcessRight_list)
  1381. processList.value = getOrderProcessRight_list.data
  1382. };
  1383. // 流程单查询退出
  1384. const pd_lcdCancel = async () => {
  1385. pd_lcdlist.value = false;
  1386. }
  1387. //颜色
  1388. //工序状态更正颜色
  1389. const gxztgzzCellClass = ({row, column, rowIndex, columnIndex}) =>{
  1390. if(row['完工时间'] === ''){
  1391. return 'lan-plan-usage-low';
  1392. }else{
  1393. return 'hui-plan-usage-low';
  1394. }
  1395. }
  1396. //车间设备制程排序背景
  1397. const cjzcCellClass = ({row, column, rowIndex, columnIndex}) =>{
  1398. if (column.label === '优先次序' || column.label === '生产工时' || column.label === '辅助工时' || column.label === '班次安排' || column.label === '排单备注' || column.label === '最早开工时间' || column.label === '计划开工时间') {
  1399. return 'background-color-column-fen';
  1400. }
  1401. if (row) {
  1402. return 'color-column-lan';
  1403. }
  1404. }
  1405. //排程中、制程中 下方表格文字变色
  1406. const pczc_planUsageCellClass = ({row, column, rowIndex, columnIndex}) =>{
  1407. if (row['工序完工'].substring(0, 2) === "20") {
  1408. return 'pczccolor-column-hui';
  1409. } else {
  1410. return 'pczccolor-column-lan';
  1411. }
  1412. }
  1413. </script>
  1414. <style scoped>
  1415. /* 选中某行背景粉色 */
  1416. :deep(.el-table__body tr.current-row) > td {
  1417. background: #ff80ff !important;
  1418. }
  1419. /*工序产量核查*/
  1420. :deep(.gxclhc—color-column-red div) {
  1421. color: red !important;
  1422. }
  1423. :deep(.lan-plan-usage-lows div) {
  1424. color: blue !important;
  1425. font-weight: bold;
  1426. }
  1427. :deep(.lan-plan-usage-lowshui div) {
  1428. color: #8c939d !important;
  1429. }
  1430. /*排程中、制程中 下方表格文字变色*/
  1431. :deep(.pczccolor-column-hui div) {
  1432. color: #8c939d !important;
  1433. }
  1434. :deep(.pczccolor-column-lan div) {
  1435. color: blue !important;
  1436. }
  1437. /*车间设备制程背景粉色*/
  1438. /*:deep(.el-table__body .background-color-column-fen div div div) {*/
  1439. /* background: #ff80ff !important;*/
  1440. /*}*/
  1441. /*文字蓝色*/
  1442. :deep(.color-column-lan div) {
  1443. color: red !important;
  1444. }
  1445. :deep(.color-column-lan div div div) {
  1446. color: blue !important;
  1447. }
  1448. /*文字灰色*/
  1449. :deep(.hui-plan-usage-low div) {
  1450. color: #8c939d !important;
  1451. }
  1452. /*工序状态更正颜色【蓝色】*/
  1453. :deep(.lan-plan-usage-low div) {
  1454. color: blue !important;
  1455. }
  1456. :deep(.el-tabs__header){
  1457. margin-bottom: 0;
  1458. }
  1459. :deep(.el-table td .cell) {
  1460. line-height: 30px !important;
  1461. }
  1462. .JKWTree-container {
  1463. display: flex;
  1464. }
  1465. .JKWTree-tree {
  1466. width: 300px;
  1467. background-color: #fff;
  1468. padding: 10px;
  1469. margin-right: 20px;
  1470. }
  1471. .JKWTree-tree h3 {
  1472. font-size: 15px;
  1473. font-weight: 700;
  1474. margin: 10px 0;
  1475. }
  1476. .JKWTree-content {
  1477. flex: 1;
  1478. }
  1479. /*分页*/
  1480. .el-pagination{
  1481. margin-top: 0px !important;
  1482. }
  1483. </style>
  1484. <style scoped>
  1485. :deep(.el-tabs__header){
  1486. margin-bottom: 0;
  1487. }
  1488. .search{
  1489. margin-left: 0px !important;
  1490. margin-right: 10px !important;
  1491. }
  1492. .bt{
  1493. margin-left: 2px !important;
  1494. padding: 3px !important;
  1495. font-size: 12px;
  1496. }
  1497. .el-tabs__header{
  1498. margin: 0px !important;
  1499. }
  1500. .gva-table-box{
  1501. padding: 0px !important;
  1502. }
  1503. .mab{
  1504. margin-bottom: 5px;
  1505. }
  1506. </style>
  1507. <style scoped>
  1508. :deep(.el-table td .cell) {
  1509. line-height: 20px !important;
  1510. }
  1511. :deep(.el-tabs__header){
  1512. margin-bottom: 0;
  1513. }
  1514. .search{
  1515. margin-left: 0px !important;
  1516. margin-right: 10px !important;
  1517. }
  1518. .bt{
  1519. margin-left: 2px !important;
  1520. padding: 3px !important;
  1521. font-size: 12px;
  1522. }
  1523. .el-tabs__header{
  1524. margin: 0px !important;
  1525. }
  1526. .gva-table-box{
  1527. padding: 0px !important;
  1528. }
  1529. .mab{
  1530. margin-bottom: 5px;
  1531. }
  1532. .focusdiv:focus {
  1533. border: 1px solid red;
  1534. }
  1535. </style>