gongdanshengchan.vue 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236
  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. <!--按钮-->
  10. <el-input v-model="searchInfo" placeholder="搜索工单编号" clearable style="width: 180px;"></el-input>
  11. <el-button type="primary" icon="search" @click="onSubmit"></el-button>
  12. <div v-if="treeType === 'customTree'">
  13. <el-button type="primary" icon="edit" @click="onStatusClick" class="bt">状态设置</el-button>
  14. <el-button type="primary" icon="edit" @click="ongxztgzClick" class="bt">工序状态更正</el-button>
  15. </div>
  16. <div v-else>
  17. <el-button type="primary" icon="edit" @click="onjrpcClick" class="bt">加入排产</el-button>
  18. <el-button type="primary" icon="edit" @click="onztwgClick" class="bt">暂停排产</el-button>
  19. <el-button type="primary" icon="edit" @click="ongxwgClick" class="bt">工序完工</el-button>
  20. <!-- <el-button type="primary" icon="edit" disabled @click="onjztzClick" style="margin: 5px">机组调整</el-button>-->
  21. <el-button type="primary" icon="edit" @click="oncjsbpcClick" style="margin: 5px">车间设备排程</el-button>
  22. </div>
  23. <!-- <el-button type="primary" icon="edit" disabled @click="onprintClick" style="margin: 5px">工单打印</el-button>-->
  24. <!-- <el-button type="primary" icon="edit" disabled @click="ongxclhcClick" style="margin: 5px">工序产量核查</el-button>-->
  25. <!-- <el-button type="primary" icon="edit" disabled @click="onlcdlistClick" style="margin: 5px">流程单查询</el-button>-->
  26. </el-form-item>
  27. </el-form>
  28. <!-- 状态设置【弹窗】-->
  29. <el-dialog v-model="onstatuslist" title="工单状态设置" width="30%" style="top: 15%">
  30. <div style="width: 100%;height: 100%;">
  31. <div style="width: 100%; display: flex; align-items: center;">
  32. <el-form-item label="工单编号 :" prop="currentProcess">
  33. <el-input v-model="statusformData['gdbh']" placeholder="" />
  34. </el-form-item>
  35. </div>
  36. <div style="width: 100%; display: flex; align-items: center; margin-top: 30px;">
  37. <span>状态设置:</span>
  38. <el-radio-group v-model="status" style="margin-left: 10px;">
  39. <el-radio label="计划中">计划中</el-radio>
  40. <el-radio label="生产中">生产中</el-radio>
  41. <el-radio label="已完工">已完工</el-radio>
  42. </el-radio-group>
  43. </div>
  44. <div class="dialog-footer" style="text-align: right; margin-top: 40px;">
  45. <el-button @click="handleCancel">取消</el-button>
  46. <el-button type="primary" @click="handleConfirm">确认</el-button>
  47. </div>
  48. </div>
  49. </el-dialog>
  50. <!-- 工序状态更正【弹窗】-->
  51. <el-dialog v-model="gxztgzzlist" title="工序状态更正" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
  52. <el-button type="" @click="gxztgzzCancel">退出</el-button>
  53. <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; display: flex; align-items: center;">
  54. <el-form-item label="关键字 :" prop="currentProcess" style="margin-right: 20px; padding: 0px">
  55. <el-input v-model="gxztgzzformData['gdbh']" @keyup.enter="gxztgzzgetProductValue" placeholder="" style="width: 500px;"/>
  56. </el-form-item>
  57. </div>
  58. <el-table ref="multipleTable"
  59. :show-overflow-tooltip="true"
  60. :row-style="{ height: '0px' }"
  61. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
  62. :header-cell-style="{ padding: '0px' }"
  63. style="width: 100%;height: 710px" border tooltip-effect="dark"
  64. :data="gxztgzztableData" row-key="ID" @selection-change="handleSelectionChange">
  65. <el-table-column v-slot="scope" align="left" label=印件及工序 width="600" >
  66. <el-input disabled v-model="scope.row.印件及工序" :clearable="false"/>
  67. </el-table-column>
  68. <el-table-column v-slot="scope" align="left" label=计划产量/已完成 width="590" >
  69. <el-input disabled v-model="scope.row['计划产量/已完成']" :clearable="false"/>
  70. </el-table-column>
  71. <el-table-column v-slot="scope" align="left" label=完成率 width="240" >
  72. <el-input disabled v-model="scope.row.完成率" :clearable="false"/>
  73. </el-table-column>
  74. <el-table-column v-slot="scope" align="left" label=完工时间 width="210" >
  75. <el-input disabled v-model="scope.row.完工时间" :clearable="false"/>
  76. </el-table-column>
  77. <el-table-column v-slot="scope" align="left" label=设备代号 width="240" >
  78. <el-input disabled v-model="scope.row.设备代号" :clearable="false"/>
  79. </el-table-column>
  80. </el-table>
  81. </el-dialog>
  82. <!--加入排产【弹窗】-->
  83. <!--暂停完工【弹窗】-->
  84. <!--暂停完工【弹窗】-->
  85. <!--机组调整【弹窗】-->
  86. <!--车间设备排程【弹窗】-->
  87. <el-dialog v-model="cjsbpclist" title="车间设备排程" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
  88. <el-button type="" icon="edit" @click="oneditpcClick">更新排程</el-button>
  89. <el-button type="" @click="cjsbpcCancel">退出</el-button>
  90. <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; ">
  91. <div style="width: 100%; height: 60px; padding: 0px; display: flex; align-items: center;">
  92. <el-form-item label="设备代号 :" prop="currentProcess" style="margin-right: 20px; padding: 0px">
  93. <el-input v-model="cjsbpcformData['sbdh']" disabled placeholder="" />
  94. </el-form-item>
  95. <el-form-item label="班次选择:" prop="originalName" style="margin-left: 20px;">
  96. <el-select v-model="cjsbpcformData.banci" placeholder="请选择" allow-create filterable @change="setBanci">
  97. <el-option
  98. v-for="(option, index) in cjsbpcformData.bancis"
  99. :key="index"
  100. :label="option.value"
  101. :value="option.value"
  102. >
  103. {{option.label}}
  104. </el-option>
  105. </el-select>
  106. </el-form-item>
  107. <el-form-item label="" prop="isBanciSelected" style="margin-left: 20px;">
  108. <el-checkbox v-model="cjsbpcformData.isBanciSelected">所有班次</el-checkbox>
  109. </el-form-item>
  110. </div>
  111. <el-table ref="paichengRef"
  112. :show-overflow-tooltip="true"
  113. :row-style="{ height: '0px' }"
  114. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
  115. :header-cell-style="{ padding: '0px' }"
  116. style="width: 100%;height: 74vh" border tooltip-effect="dark"
  117. :data="paichengData" row-key="ID"
  118. >
  119. <template v-for="(item, idx) in paichengColumns">
  120. <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width" >
  121. <div v-if="['优先次序', '生产工时', '辅助工时', '班次安排', '排单备注','最早开工时间', '计划开工时间'].includes(item.prop)">
  122. <el-input v-model="row[item.prop]" :clearable="false"
  123. :id="`input${idx}${$index}`"
  124. @keyup="handleKeyDown($event, idx, $index, item.prop)"
  125. />
  126. <!-- <el-date-picker v-model="row[item.prop]" v-if="['最早开工时间', '计划开工时间'].includes(item.prop)" type="datetime" :clearable="false"-->
  127. <!-- :id="`input${idx}${$index}`"-->
  128. <!-- @keyup="handleKeyDown($event, idx, $index , item.prop)"-->
  129. <!-- />-->
  130. </div>
  131. <div v-else>
  132. {{ row[item.prop] }}
  133. </div>
  134. </el-table-column>
  135. </template>
  136. </el-table>
  137. </div>
  138. </el-dialog>
  139. <!--工单打印【弹窗】-->
  140. <!--工序产量核查【弹窗】-->
  141. <el-dialog v-model="gxclhclist" title="工序产量核查" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
  142. <el-button type="" @click="gxclhcCancel">退出</el-button>
  143. <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; display: flex; align-items: center;">
  144. <div style="width: 100%; height: 60px; padding: 0px; display: flex; align-items: center;">
  145. <el-form-item label="工单编号" prop="currentProcess" style="margin-right: 20px; padding: 0px">
  146. <el-input v-model="gxclhcformData['gdbh']" @keyup.enter="gxclhcProductValue" placeholder="" />
  147. </el-form-item>
  148. <el-form-item label="" prop="currentProcess" style="margin-right: 20px; padding: 0px">
  149. <el-input v-model="gxclhcformData['gdmc']" disabled placeholder="" style="width: 340px;"/>
  150. </el-form-item>
  151. </div>
  152. </div>
  153. </el-dialog>
  154. </div>
  155. </layout-header>
  156. <layout>
  157. <layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
  158. <div class="JKWTree-tree" style="height: 200px">
  159. <el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
  160. </div>
  161. </layout-sider>
  162. <layout-content>
  163. <el-main>
  164. <div class="gva-table-box" v-if="treeType === 'customTree'">
  165. <el-table ref="multipleTable" style="width: 100%;height: 25vh"
  166. :row-style="{ height: '20px' }" :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  167. :header-cell-style="{ padding: '0px' }" border
  168. tooltip-effect="dark" :data="tableData" row-key="ID"
  169. :highlight-current-row="true" size="small" @row-click="gdtableRowClick"
  170. @selection-change="handleSelectionChange" :show-overflow-tooltip="true">
  171. <template v-for="item in tableFields[currentNode]">
  172. <el-table-column :align="item.align" :label="item.title" :prop="item.prop" :width="item.width" />
  173. </template>
  174. </el-table>
  175. </div>
  176. <el-tabs v-model="activeName" @tab-click="handleClick" v-if="(currentNode == '计划中' || currentNode == '已完工') && treeType === 'customTree'">
  177. <el-tab-pane label="工艺资料" @click="showTable('工艺资料')" name="first">
  178. <el-table ref="multipleTable" :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
  179. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  180. :header-cell-style="{ padding: '0px' }" highlight-current-row="true"
  181. style="width: 100%;height: 50vh" border tooltip-effect="dark" :data="gytableData" row-key="ID" @selection-change="handleSelectionChange">
  182. <el-table-column align="left" label="工单编号" prop="工单编号" width="90"/>
  183. <el-table-column align="left" label="重点工序" prop="重点工序" width="90"/>
  184. <el-table-column align="left" label="印件工序及名称" prop="印件工序及名称" width="500"/>
  185. <el-table-column align="left" label="工序备注" prop="工序备注" width="150"/>
  186. <el-table-column align="left" label="机组" prop="机组" width="80"/>
  187. <el-table-column align="left" label="小时产能" prop="小时产能" width="90"/>
  188. <el-table-column align="left" label="生产工时" prop="生产工时" width="90"/>
  189. <el-table-column align="left" label="辅助工时" prop="辅助工时" width="90"/>
  190. <el-table-column align="left" label="印刷方式" prop="印刷方式" width="90"/>
  191. <el-table-column align="left" label="版距" prop="版距" width="70"/>
  192. <el-table-column align="left" label="创建用户" prop="创建用户" width="100"/>
  193. <el-table-column align="left" label="创建时间" prop="创建时间" width="110"/>
  194. <el-table-column align="left" label="修改时间" prop="修改时间" width="110"/>
  195. <el-table-column align="left" label="UNIQID" prop="UNIQID" width="90"/>
  196. </el-table>
  197. </el-tab-pane>
  198. <el-tab-pane label="印件资料" @click="showTable('印件资料')" name="second">
  199. <el-table ref="multipleTable" :row-style="{ height: '20px' }"
  200. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  201. :header-cell-style="{ padding: '0px' }" :show-overflow-tooltip="true"
  202. :highlight-current-row="true"
  203. style="width: 100%;height: 50vh" border tooltip-effect="dark" :data="yjtableData" row-key="ID" @selection-change="handleSelectionChange">
  204. <el-table-column align="left" label="工单编号" prop="工单编号" width="90"/>
  205. <el-table-column align="left" label="印件号" prop="印件号" width="70"/>
  206. <el-table-column align="left" label="印件代号" prop="印件代号" width="100"/>
  207. <el-table-column align="left" label="印件名称" prop="印件名称" width="240"/>
  208. <el-table-column align="left" label="纸张名称" prop="纸张名称" width="230"/>
  209. <el-table-column align="left" label="投料规格" prop="投料规格" width="100"/>
  210. <el-table-column align="left" label="成品数量" prop="成品数量" width="90"/>
  211. <el-table-column align="left" label="实际投料" prop="实际投料" width="90"/>
  212. <el-table-column align="left" label="投料单位" prop="投料单位" width="85"/>
  213. <el-table-column align="left" label="平张投料" prop="平张投料" width="90"/>
  214. <el-table-column align="left" label="联数" prop="联数" width="70"/>
  215. <el-table-column align="left" label="开数" prop="开数" width="70"/>
  216. <el-table-column align="left" label="创建用户" prop="创建用户" width="110"/>
  217. <el-table-column align="left" label="创建时间" prop="创建时间" width="110"/>
  218. <el-table-column align="left" label="修改时间" prop="修改时间" width="110"/>
  219. <el-table-column align="left" label="UNIQID" prop="UNIQID" width="90"/>
  220. </el-table>
  221. </el-tab-pane>
  222. </el-tabs>
  223. <div v-if="treeType === 'customTree'">
  224. <el-table ref="multipleTable2"
  225. v-if="['排程中', '制程中'].includes(currentNode)"
  226. :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
  227. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  228. :header-cell-style="{ padding: '0px' }" :highlight-current-row="true"
  229. style="width: 100%;height: 50vh" border tooltip-effect="dark" :data="bottomData" row-key="ID" @selection-change="handleSelectionChange">
  230. <template v-for="item in bottomTableF[currentNode]">
  231. <el-table-column :align="item.align" :label="item.title" :prop="item.prop" :width="item.width" />
  232. </template>
  233. </el-table>
  234. </div>
  235. <div v-if="treeType === 'dataTree'">
  236. <el-table ref="chejianRef"
  237. :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
  238. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  239. :header-cell-style="{ padding: '0px' }" :highlight-current-row="true" @row-click="chejianRowClick"
  240. style="width: 100%;height: 25vh" border tooltip-effect="dark" :data="chejianData" row-key="ID" @selection-change="PC_handleChange">
  241. <el-table-column type="selection" width="30" />
  242. <template v-for="item in [
  243. { align:'left', title: '工单编号', prop: '工单编号', width: 85 },
  244. { align:'left', title: '销售订单号', prop: '销售订单号', width: 200 },
  245. { align:'left', title: '印件名称', prop: '印件名称', width: 320 },
  246. { align:'left', title: '印件工序及名称', prop: '印件工序及名称', width: 200 },
  247. { align:'left', title: '工序产量', prop: '工序产量', width: 90 },
  248. { align:'left', title: '已完成产量', prop: '已完成产量', width: 100 },
  249. { align:'left', title: '产品名称', prop: '产品名称', width: 320 },
  250. { align:'left', title: '订单数量', prop: '订单数量', width: 120 },
  251. { align:'left', title: '计量单位', prop: '计量单位', width: 120 },
  252. { align:'left', title: '交货日期', prop: '交货日期', width: 115 },
  253. { align:'left', title: '产品代号', prop: '产品代号', width: 140 },
  254. { align:'left', title: '工序名称', prop: '工序名称', width: 120 },
  255. { align:'left', title: '机组', prop: '机组', width: 90 },
  256. { align:'left', title: '设备编号', prop: '设备编号', width: 90 },
  257. { align:'left', title: 'UNIQID', prop: 'UNIQID', width: 90 },
  258. { align:'left', title: '印件号', prop: '印件号', width: 90 },
  259. { align:'left', title: '工序号', prop: '工序号', width: 90 },
  260. ]">
  261. <el-table-column :align="item.align" :label="item.title" :prop="item.prop" :width="item.width" />
  262. </template>
  263. </el-table>
  264. <el-table ref="chejianfuRef"
  265. :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
  266. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  267. :header-cell-style="{ padding: '0px' }" :highlight-current-row="true" @row-click="chejianfuRowClick"
  268. style="width: 100%;height: 50vh;margin-top: 10px" border tooltip-effect="dark" :data="chejianfuData" row-key="ID" @selection-change="ZP_handleChange">
  269. <el-table-column type="selection" width="30" />
  270. <template v-for="item in [
  271. { align:'left', title: '工单编号', prop: '工单编号', width: 85 },
  272. { align:'left', title: '销售订单号', prop: '销售订单号', width: 200 },
  273. { align:'left', title: '印件名称', prop: '印件名称', width: 320 },
  274. { align:'left', title: '印件工序及名称', prop: '印件工序及名称', width: 200 },
  275. { align:'left', title: '工序产量', prop: '工序产量', width: 90 },
  276. { align:'left', title: '已完成产量', prop: '已完成产量', width: 100 },
  277. { align:'left', title: '小时产能', prop: '小时产能', width: 90 },
  278. { align:'left', title: '产能系数', prop: '产能系数', width: 90 },
  279. { align:'left', title: '生产工时', prop: '生产工时', width: 90 },
  280. { align:'left', title: '辅助工时', prop: '辅助工时', width: 90 },
  281. { align:'left', title: '最早开工时间', prop: '最早开工时间', width: 160 },
  282. { align:'left', title: '计划开工时间', prop: '计划开工时间', width: 160 },
  283. { align:'left', title: '计划完工时间', prop: '计划完工时间', width: 160 },
  284. { align:'left', title: '班次安排', prop: '班次安排', width: 90 },
  285. { align:'left', title: '排单备注', prop: '排单备注', width: 120 },
  286. { align:'left', title: '产品名称', prop: '产品名称', width: 180 },
  287. { align:'left', title: '订单数量', prop: '订单数量', width: 120 },
  288. { align:'left', title: '计量单位', prop: '计量单位', width: 120 },
  289. { align:'left', title: '交货日期', prop: '交货日期', width: 115 },
  290. { align:'left', title: '优先次序', prop: '优先次序', width: 90 },
  291. { align:'left', title: '产品代号', prop: '产品代号', width: 100 },
  292. { align:'left', title: '工序名称', prop: '工序名称', width: 120 },
  293. { align:'left', title: '设备编号', prop: '设备编号', width: 90 },
  294. { align:'left', title: '车间名称', prop: '车间名称', width: 90 },
  295. { align:'left', title: 'GYUID', prop: 'GYUID', width: 90 },
  296. { align:'left', title: '印件号', prop: '印件号', width: 90 },
  297. { align:'left', title: '工序号', prop: '工序号', width: 90 },
  298. ]">
  299. <el-table-column :align="item.align" :label="item.title" :prop="item.prop" :width="item.width" />
  300. </template>
  301. </el-table>
  302. </div>
  303. </el-main>
  304. </layout-content>
  305. </layout>
  306. </layout>
  307. </div>
  308. </template>
  309. <script>
  310. //点击按钮显示下方表格
  311. export default {
  312. data() {
  313. return {
  314. currentTable: '',
  315. activeName: 'first',
  316. // 其他表格数据...
  317. };
  318. },
  319. methods: {
  320. showTable(tableName) {
  321. // console.log("点击了".tableName)
  322. // 根据点击的按钮设置当前展示的表格
  323. this.currentTable = tableName;
  324. },
  325. showTableChange() {
  326. // 处理表格选中事件
  327. },
  328. // 其他方法...
  329. }
  330. };
  331. </script>
  332. <script setup>
  333. // 全量引入格式化工具 请按需保留
  334. import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
  335. import {createCompany, deleteCompany, deleteCompanyByIds, updateCompany, findCompany, getCompanyList} from '@/api/company'
  336. import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
  337. import { ElMessage, ElMessageBox } from 'element-plus'
  338. import { ref, reactive } from 'vue'
  339. import {
  340. DataList, getProduct, getProductData,scheduleProcess,ProductionSchedulingAdd,
  341. Project, StatusEdit, EquipmentScheduling, ScheduleSelection,MachineWorkOrderList,
  342. projectCraft, ProcessStatusCorrection,ProductionSchedulingPause,
  343. projectPrint, setProductStatus, workbench, ProcessFlow, Schedule,complete
  344. } from "@/api/yunyin/yunying";
  345. defineOptions({name: 'Company'})
  346. const chejianData = ref([])
  347. const chejianfuData = ref([])
  348. // =========== 左侧树侧形结构 ===========
  349. const sctreeData = ref([
  350. {
  351. label: '排产进程及参数设置',
  352. children:[
  353. {label: '1.计划中工单', number: "计划中", type: '__customer'},
  354. {label: '2.排程中工单', number: "排程中",type: '__customer'},
  355. {label: '3.制程中工单', number: "制程中", type: '__customer'},
  356. {label: '4.已完工工单', number: "已完工", type: '__customer'}
  357. ],
  358. }
  359. ]);
  360. //上方表格
  361. const tableFields = ref(
  362. {
  363. "计划中": [
  364. { title:'获取状态', prop: 'statusColumn', width: 80, align:'center'},
  365. { title:'生产分类', prop: '生产分类', width: 80, align:'left', },
  366. { title: '工单编号', prop: '工单编号', width: 80, align:'center', },
  367. { title: '产品代号', prop: '产品代号', width: 90, align:'center', },
  368. { title: '产品名称', prop: '产品名称', width: 280, align:'left', },
  369. { title: '接单日期', prop: '接单日期', width: 110, align:'left', },
  370. { title: '交货日期', prop: '交货日期', width: 110, align:'left', },
  371. { title: '订单数量', prop: '订单数量', width: 80, align:'left', },
  372. { title: '计量单位', prop: '计量单位', width: 80, align:'center', },
  373. { title: '客户名称', prop: '客户名称', width: 200, align:'left', },
  374. { title: '客户编号', prop: '客户编号', width: 80, align:'center', },
  375. { title: '备注', prop: '备注', width: 230, align:'left', },
  376. { title: '客户料号', prop: '客户料号', width: 120, align:'left', },
  377. { title: '创建用户', prop: '创建用户', width: 110, align:'left', },
  378. { title: '创建时间', prop: '创建时间', width: 110, align:'left', },
  379. { title: '修改时间', prop: '修改时间', width: 110, align:'left', },
  380. { title: 'UNIQID', prop: 'UNIQID', width: 80 , align:'left', },
  381. { title: '投料率', prop: '投料率', width: 100, align:'left', },
  382. { title: '销售订单号', prop: '销售订单号', width: 120, align:'left', },
  383. ],
  384. "排程中": [
  385. // { title: '最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  386. { title: '工单编号', prop: '工单编号', width: 80, align:'left', },
  387. { title: '产品代号', prop: '产品代号', width: 90, align:'left', },
  388. { title: '产品名称', prop: '产品名称', width: 340, align:'left', },
  389. { title: '接单日期', prop: '接单日期', width: 110, align:'left', },
  390. { title: '交货日期', prop: '交货日期', width: 110, align:'left', },
  391. { title: '订单数量', prop: '订单数量', width: 80, align:'left', },
  392. { title: '计量单位', prop: '计量单位', width: 80, align:'left', },
  393. { title: '销售订单号', prop: '销售订单号', width: 200, align:'left', },
  394. // { title: '排程类型', prop: '排程类型', width: 120, align:'left', },
  395. { title: '客户编号', prop: '客户编号', width: 120, align:'left', },
  396. { title: '客户名称', prop: '客户名称', width: 230, align:'left', },
  397. { title: '创建用户', prop: '创建用户', width: 120, align:'left', },
  398. // { title: 'GDUID', prop: 'GDUID', width: 120, align:'left', },
  399. { title: 'GYUID', prop: 'GYUID', width: 100, align:'left', },
  400. ],
  401. "制程中": [
  402. // { title: '最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  403. { title: '工单编号', prop: '工单编号', width: 80, align:'left', },
  404. { title: '产品代号', prop: '产品代号', width: 90, align:'left', },
  405. { title: '产品名称', prop: '产品名称', width: 340, align:'left', },
  406. { title: '接单日期', prop: '接单日期', width: 110, align:'left', },
  407. { title: '交货日期', prop: '交货日期', width: 110, align:'left', },
  408. { title: '订单数量', prop: '订单数量', width: 80, align:'left', },
  409. { title: '计量单位', prop: '计量单位', width: 80, align:'left', },
  410. { title: '销售订单号', prop: '销售订单号', width: 200, align:'left', },
  411. // { title: '排程类型', prop: '排程类型', width: 120, align:'left', },
  412. { title: '客户编号', prop: '客户编号', width: 120, align:'left', },
  413. { title: '客户名称', prop: '客户名称', width: 120, align:'left', },
  414. { title: '客户料号', prop: '客户料号', width: 160, align:'left', },
  415. // { title: 'GDUID', prop: 'GDUID', width: 120, align:'left', },
  416. { title: 'GYUID', prop: 'GYUID', width: 100, align:'left', },
  417. ],
  418. "已完工": [
  419. { title: '工单编号', prop: '工单编号', width: 80, align:'left', },
  420. { title: '产品代号', prop: '产品代号', width: 110, align:'left', },
  421. { title: '产品名称', prop: '产品名称', width: 340, align:'left', },
  422. { title: '接单日期', prop: '接单日期', width: 110, align:'left', },
  423. { title: '交货日期', prop: '交货日期', width: 110, align:'left', },
  424. { title: '订单数量', prop: '订单数量', width: 80, align:'left', },
  425. { title: '计量单位', prop: '计量单位', width: 80, align:'left', },
  426. { title: '销售订单号', prop: '销售订单号', width: 120, align:'left', },
  427. { title: '客户编号', prop: '客户编号', width: 80, align:'left', },
  428. { title: '客户名称', prop: '客户名称', width: 120, align:'left', },
  429. { title: '客户料号', prop: '客户料号', width: 120, align:'left', },
  430. // { title: '排程类型', prop: '排程类型', width: 120, align:'left', },
  431. { title: 'GDUID', prop: 'GDUID', width: 80, align:'left', },
  432. ]
  433. }
  434. )
  435. //下方表格
  436. const bottomTableF = ref({
  437. "排程中": [
  438. { title:'工单编号', prop: '工单编号', width: 90, align:'left', },
  439. { title:'印件工序及名称', prop: '印件工序及名称', width: 160, align:'left', },
  440. { title:'机组', prop: '机组', width: 120, align:'left', },
  441. { title:'设备编号', prop: '设备编号', width: 120, align:'left', },
  442. { title:'工序产量', prop: '工序产量', width: 120, align:'left', },
  443. { title:'已完成产量', prop: '已完成产量', width: 120, align:'left', },
  444. { title:'剩余产量', prop: '剩余产量', width: 120, align:'left', },
  445. { title:'小时产能', prop: '小时产能', width: 120, align:'left', },
  446. { title:'产能系数', prop: '产能系数', width: 120, align:'left', },
  447. { title:'生产工时', prop: '生产工时', width: 120, align:'left', },
  448. { title:'辅助工时', prop: '辅助工时', width: 120, align:'left', },
  449. { title:'最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  450. { title:'计划开工时间', prop: '计划开工时间', width: 120, align:'left', },
  451. { title:'计划完工时间', prop: '计划完工时间', width: 120, align:'left', },
  452. { title:'班次安排', prop: '班次安排', width: 120, align:'left', },
  453. { title:'设备名称', prop: '设备名称', width: 120, align:'left', },
  454. { title:'排单备注', prop: '排单备注', width: 120, align:'left', },
  455. { title:'工序完工', prop: '工序完工', width: 120, align:'left', },
  456. { title:'UNIQID', prop: 'UNIQID', width: 120, align:'left', },
  457. ],
  458. "制程中": [
  459. { title:'工单编号', prop: '工单编号', width: 90, align:'left', },
  460. { title:'印件工序及名称', prop: '印件工序及名称', width: 160, align:'left', },
  461. { title:'机组', prop: '机组', width: 120, align:'left', },
  462. { title:'设备编号', prop: '设备编号', width: 120, align:'left', },
  463. { title:'工序产量', prop: '工序产量', width: 120, align:'left', },
  464. { title:'已完成产量', prop: '已完成产量', width: 120, align:'left', },
  465. { title:'剩余产量', prop: '剩余产量', width: 120, align:'left', },
  466. { title:'小时产能', prop: '小时产能', width: 120, align:'left', },
  467. { title:'产能系数', prop: '产能系数', width: 120, align:'left', },
  468. { title:'生产工时', prop: '生产工时', width: 120, align:'left', },
  469. { title:'辅助工时', prop: '辅助工时', width: 120, align:'left', },
  470. { title:'最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  471. { title:'计划开工时间', prop: '计划开工时间', width: 120, align:'left', },
  472. { title:'计划完工时间', prop: '计划完工时间', width: 120, align:'left', },
  473. { title:'班次安排', prop: '班次安排', width: 120, align:'left', },
  474. { title:'设备名称', prop: '设备名称', width: 120, align:'left', },
  475. { title:'排单备注', prop: '排单备注', width: 120, align:'left', },
  476. { title:'工序完工', prop: '工序完工', width: 120, align:'left', },
  477. { title:'UNIQID', prop: 'UNIQID', width: 120, align:'left', },
  478. ],
  479. })
  480. //左侧左边栏
  481. const treeData = ref([]);
  482. //默认显示计划中表格
  483. const currentNode = ref("计划中")
  484. //计划中、已完工下方印件资料
  485. const yjtableData = ref([])
  486. //计划中、已完工下方工艺资料
  487. const gytableData = ref([])
  488. //排程中、制程中下方表格
  489. const bottomData = ref([])
  490. //工单侧边栏 设备定额及分配参数设置
  491. const schandleNodeClick = async (node) => {
  492. currentNode.value = node.number
  493. bottomData.value = []
  494. yjtableData.value = []
  495. gytableData.value = []
  496. switch (node.number) {
  497. case "计划中":
  498. console.log(currentNode.value)
  499. const jhz_Projectdata = await Project({status:currentNode.value});
  500. console.log(jhz_Projectdata)
  501. for (let i = 0; i < jhz_Projectdata.data.length; i++) {
  502. const item = jhz_Projectdata.data[i];
  503. if (item.status === 0) {
  504. item.statusColumn = "*";
  505. }
  506. // 如果 status 为 1,可以在相应列中添加其他内容
  507. else if (item.status === 1) {
  508. item.statusColumn = "";
  509. }
  510. }
  511. tableData.value = jhz_Projectdata.data;
  512. break;
  513. case "排程中":
  514. console.log(currentNode.value)
  515. // /Manufacture/Schedule
  516. const pc_Schedule = await Schedule({status:currentNode.value,search:''});
  517. console.log(pc_Schedule)
  518. tableData.value = pc_Schedule.data;
  519. break;
  520. case "制程中":
  521. console.log(currentNode.value)
  522. const zc_Schedule = await Schedule({status:currentNode.value,search:''});
  523. console.log(zc_Schedule)
  524. tableData.value = zc_Schedule.data;
  525. break;
  526. case "已完工":
  527. console.log(currentNode.value)
  528. const ywg_Project = await Project({status:currentNode.value});
  529. for (let i = 0; i < ywg_Project.data.length; i++) {
  530. const item = ywg_Project.data[i];
  531. // 如果 status 为 0,在某一列(比如 statusColumn)中添加 "*"
  532. if (item.status === 0) {
  533. item.statusColumn = "*";
  534. }
  535. else if (item.status === 1) {
  536. item.statusColumn = "";
  537. }
  538. }
  539. tableData.value = ywg_Project.data;
  540. break;
  541. }
  542. };
  543. //车间侧边栏 进入页面自动加载【车间】数据
  544. const workbenchdata = async () => {
  545. try {
  546. const data = await workbench();
  547. const rawData = data.data;
  548. const dataArray =Object.keys(rawData).map(key => ({
  549. label: key,
  550. children: Object.keys(rawData[key]).map(subKey => ({
  551. label: subKey,
  552. children: rawData[key][subKey].map(item => ({
  553. label: item
  554. }))
  555. }))
  556. }));
  557. treeData.value = dataArray;
  558. treeData.value.unshift(sctreeData.value[0])
  559. } catch (error) {
  560. console.error(error);
  561. }
  562. };
  563. workbenchdata();
  564. //全局获取工单编号
  565. const _Gd_gdbh = ref(null)
  566. //点击表格 通过【工单编号】获取下方表格数据
  567. const gdtableRowClick = async (row) => {
  568. _Gd_gdbh.value = row.工单编号;
  569. console.log(_Gd_gdbh.value);
  570. if (currentNode.value == "计划中") {
  571. if(row['statusColumn'] === "*"){
  572. gytableData.value = [];
  573. yjtableData.value = [];
  574. return false;
  575. }else{
  576. //计划中工单->工艺资料接口
  577. const gyres = await projectCraft({Gd_gdbh: _Gd_gdbh.value});
  578. //工艺资料表格
  579. gytableData.value.splice(0, gytableData.value.length, ...gyres.data);
  580. //计划中工单->印件资料接口
  581. const yjres = await projectPrint({Gd_gdbh: _Gd_gdbh.value});
  582. //印件资料表格
  583. yjtableData.value.splice(0, yjtableData.value.length, ...(yjres?.data ?? []));
  584. }
  585. }
  586. if (currentNode.value == "排程中") {
  587. const pc_scheduleProcess = await scheduleProcess({Gd_gdbh: _Gd_gdbh.value});
  588. bottomData.value = pc_scheduleProcess.data;
  589. }
  590. if (currentNode.value == "制程中") {
  591. const zc_scheduleProcess = await scheduleProcess({Gd_gdbh: _Gd_gdbh.value});
  592. bottomData.value = zc_scheduleProcess.data;
  593. }
  594. if (currentNode.value == "已完工") {
  595. //工艺资料
  596. const ywg_gyres = await projectCraft({Gd_gdbh: _Gd_gdbh.value});
  597. gytableData.value.splice(0, gytableData.value.length, ...ywg_gyres.data);
  598. //印件资料
  599. const ywg_yjres = await projectPrint({Gd_gdbh: _Gd_gdbh.value});
  600. yjtableData.value.splice(0, yjtableData.value.length, ...ywg_yjres.data);
  601. }
  602. };
  603. //点击左侧树形获取表格列表//机台侧边栏
  604. const tableData = ref([]);
  605. const _machine = ref(null);
  606. const treeType = ref('customTree') // dataTree // 计划中,排产中 ,dataTree 车间
  607. const handleNodeClick = async (node) => {
  608. if (node.type && node.type === '__customer') {
  609. treeType.value = 'customTree'
  610. schandleNodeClick(node)
  611. } else if (!node.children) {
  612. treeType.value = 'dataTree'
  613. const custom_code = node.label;
  614. // 使用字符串分割获取#前面的数据
  615. const dataBeforeHash = custom_code.split('#')[0].trim();
  616. _machine.value = dataBeforeHash + '#';
  617. console.log(_machine.value)
  618. const zhubiao = await MachineWorkOrderList({ machine:_machine.value})
  619. chejianData.value = zhubiao.data['排程'];
  620. chejianfuData.value = zhubiao.data['制程'];
  621. }
  622. };
  623. //计划中已完工搜索
  624. const searchInfo = ref('');
  625. // 提交搜索
  626. const onSubmit = () => {
  627. // console.log(searchInfo.value)
  628. // console.log(currentNode.value)
  629. // console.log(_machine.value)
  630. if(_machine.value){
  631. // console.log(2131211111111111111111111111111)
  632. _MachineWorkOrderList();
  633. }else{
  634. if(searchInfo.value === '' || searchInfo.value === null ){
  635. ElMessage({type: 'warning',message: '请选择具体的工单后,再操作此功能'})
  636. return false;
  637. }
  638. if(currentNode.value === '计划中' || currentNode.value === '已完工'){
  639. _Project();
  640. return false;
  641. }
  642. if(currentNode.value === '排程中' || currentNode.value === '制程中'){
  643. _Schedule();
  644. return false;
  645. }
  646. }
  647. };
  648. // 搜索计划中、已完工一条工单
  649. const _Project = async () => {
  650. const status = currentNode.value;
  651. const search = searchInfo.value;
  652. const Project_search = await Project({status:status,search:search});
  653. console.log(Project_search);
  654. if(Project_search.msg === '成功'){
  655. tableData.value = Project_search.data;
  656. }else{
  657. ElMessage({type: 'warning',message: '查不到具体条件的工单'})
  658. return false;
  659. }
  660. };
  661. // 搜索排程、制程一条工单
  662. const _Schedule = async () => {
  663. const status = currentNode.value;
  664. const search = searchInfo.value;
  665. console.log(status)
  666. console.log(search)
  667. const Schedule_search = await Schedule({status:status,search:search});
  668. console.log(Schedule_search);
  669. if(Schedule_search.msg === '成功'){
  670. chejianData.value = Schedule_search.data;
  671. }else{
  672. ElMessage({type: 'warning',message: '查不到具体条件的工单'})
  673. return false;
  674. }
  675. };
  676. //机台搜索一条工单
  677. const _MachineWorkOrderList = async () => {
  678. console.log(123)
  679. let params = {}
  680. params.search = searchInfo.value;
  681. params.machine = _machine.value;
  682. console.log(params)
  683. const MachineWorkOrderList_search = await MachineWorkOrderList(params);
  684. if(MachineWorkOrderList_search.code === 0){
  685. chejianfuData.value = MachineWorkOrderList_search.data['制程'];
  686. chejianData.value = MachineWorkOrderList_search.data['排程'];
  687. }else{
  688. ElMessage({type: 'warning',message: '查不到具体条件的工单'})
  689. return false;
  690. }
  691. };
  692. // const paichengForm = ref([])
  693. // const paichengData = ref([
  694. // {
  695. // 优先次序: 1, 工单编号: 1000, 印件名称: 'test',接货数: 111,
  696. // 小时产能: 1, 产能系数: 1.5, 生产工时: 333, 辅助工时: 222,
  697. // 班次安排: '1111', 排单备注: '备注备注', 最早开工时间: '2023-01-01 08:08:08',
  698. // 计划开工时间: '2023-01-01 08:08:08', 计划完工时间: '2023-01-01 08:08:08',
  699. // 销售订单号: '3335555', '印件/工序': '321312',
  700. // }
  701. // ])
  702. // =========== 【工序状态更正】 ===========
  703. const gxztgzzlist = ref(false);
  704. const gxztgzzformData = reactive({gdbh: '',});
  705. const gxztgzztableData = ref([]);
  706. //工序状态更正【按钮】
  707. const ongxztgzClick = () => {
  708. if(_Gd_gdbh.value == null){
  709. gxztgzzlist.value = false;
  710. ElMessage({type: 'warning',message: '请选择树形后,再操作此功能'})
  711. }else{
  712. gxztgzzformData['gdbh'] = _Gd_gdbh.value;
  713. _ProcessStatusCorrection();
  714. gxztgzzlist.value = true;
  715. }
  716. };
  717. //工序状态更正【回车】
  718. const gxztgzzgetProductValue = () => {
  719. _ProcessStatusCorrection();
  720. };
  721. //工序状态更正
  722. const _ProcessStatusCorrection = async (row) => {
  723. const workOrder = gxztgzzformData['gdbh'];
  724. console.log(workOrder)
  725. const ProcessStatusCorrectiondata = await ProcessStatusCorrection({workOrder:workOrder});
  726. gxztgzztableData.value = ProcessStatusCorrectiondata.data;
  727. };
  728. //工序状态更正【退出】
  729. const gxztgzzCancel = () => {
  730. gxztgzzlist.value = false;
  731. };
  732. //加入排产【按钮】
  733. const onjrpcClick = async () => {
  734. searchInfo.value = '';
  735. if(_PC_gdbh.value == null || _PC_gdbh.value == ''){
  736. ElMessage({type: 'warning',message: '请选择排程中工单'})
  737. }else{
  738. console.log(_PC_xscn.value)
  739. if (_PC_xscn.value === '' || _PC_xscn.value === null || _PC_xscn.value === '0') {
  740. ElMessage({type: 'warning',message: '选择中小时产量为 0'})
  741. return false;
  742. }else{
  743. let params = {}
  744. params.workOrder = _PC_gdbh.value;
  745. params.machine = _machine.value;
  746. params.printCode = _PC_yjno.value;
  747. params.processCode = _PC_gxh.value;
  748. console.log(params)
  749. const ProductionSchedulingAdd_add = await ProductionSchedulingAdd(params);
  750. if (ProductionSchedulingAdd_add.code === 0) {
  751. const pc_zc_table = await MachineWorkOrderList({machine:_machine.value});
  752. chejianData.value = pc_zc_table.data['排程'];
  753. chejianfuData.value = pc_zc_table.data['制程'];
  754. ElMessage({type: 'success',message: '加入排产 更新成功'});
  755. } else {
  756. ElMessage({ type: 'error',message: '更新失败'})
  757. }
  758. }
  759. }
  760. };
  761. //暂停排产【按钮】
  762. const onztwgClick = async () => {
  763. searchInfo.value = '';
  764. if(_ZC_gdbh.value == null || _ZC_gdbh.value == ''){
  765. ElMessage({type: 'warning', message: '请选择制程中工单'})
  766. }else{
  767. let params = {}
  768. params.workOrder = _ZC_gdbh.value;
  769. params.machine = _machine.value;
  770. params.printCode = _ZC_yjno.value;
  771. params.processCode = _ZC_gxh.value;
  772. console.log(params)
  773. const ProductionSchedulingAdd_stop = await ProductionSchedulingPause(params);
  774. if (ProductionSchedulingAdd_stop.code === 0) {
  775. const pc_zc_table = await MachineWorkOrderList({machine:_machine.value});
  776. console.log(pc_zc_table)
  777. chejianData.value = pc_zc_table.data['排程'];
  778. chejianfuData.value = pc_zc_table.data['制程'];
  779. ElMessage({type: 'success',message: '暂停排产 更新成功'});
  780. } else {
  781. ElMessage({ type: 'error',message: '更新失败'})
  782. }
  783. }
  784. };
  785. //工序完工【按钮】
  786. const ongxwgClick = async () => {
  787. searchInfo.value = '';
  788. if(_ZC_gdbh.value == null || _ZC_gdbh.value == ''){
  789. onstatuslist.value = false;
  790. ElMessage({
  791. type: 'warning',
  792. message: '请选择制程中工单'
  793. })
  794. }else{
  795. let params = {}
  796. params.workOrder = _ZC_gdbh.value;
  797. params.processCode = _ZC_gxh.value;
  798. const complete_get = await complete(params);
  799. if (complete_get.code === 0) {
  800. const pc_zc_table = await MachineWorkOrderList({ machine:_machine.value});
  801. // chejianData.value = pc_zc_table.data['排程'];
  802. chejianfuData.value = pc_zc_table.data['制程'];
  803. ElMessage({type: 'success',message: '工序完工 更新成功'})
  804. } else {
  805. ElMessage({ type: 'error',message: '更新失败'})
  806. }
  807. }
  808. };
  809. //加入排程【上面到下面】
  810. const _PC_gxh = ref(null)
  811. const _PC_yjno = ref(null)
  812. const _PC_gdbh = ref(null)
  813. const _PC_xscn = ref(null)
  814. const PC_handleChange = (arr) => {
  815. let gxh = arr.map((val) => val['gxh']).join(",");
  816. let yjno = arr.map((val) => val['yjno']).join(",");
  817. let str = arr.map((val) => val['工单编号']).join(",");
  818. let xscn = arr.map((val) => val['小时产能']).join(",");
  819. _PC_gxh.value = gxh;
  820. _PC_yjno.value = yjno;
  821. _PC_gdbh.value = str;
  822. _PC_xscn.value = xscn;
  823. }
  824. //加入制程【下面到上面】
  825. const _ZC_gxh = ref(null)
  826. const _ZC_yjno = ref(null)
  827. const _ZC_gdbh = ref(null)
  828. const _ZC_xscn = ref(null)
  829. const ZP_handleChange = (arr) => {
  830. console.log(arr)
  831. let gxh = arr.map((val) => val['gxh']).join(",");
  832. let yjno = arr.map((val) => val['yjno']).join(",");
  833. let str = arr.map((val) => val['工单编号']).join(",");
  834. let xscn = arr.map((val) => val['小时产能']).join(",");
  835. _ZC_gxh.value = gxh;
  836. _ZC_yjno.value = yjno;
  837. _ZC_gdbh.value = str;
  838. _ZC_xscn.value = xscn;
  839. }
  840. //机组调整【按钮】
  841. const onjztzClick = async () => {
  842. };
  843. //工序产量核查【按钮】
  844. const onprintClick = async () => {
  845. };
  846. //=========工序产量核查===========
  847. const gxclhclist = ref(false);
  848. const gxclhcformData = reactive({
  849. gdbh: '',
  850. gdmc: '',
  851. });
  852. //工序产量核查【按钮】
  853. const ongxclhcClick = async () => {
  854. gxclhclist.value = true;
  855. };
  856. //工序产量核查【回车】
  857. const _gxclhcgdbh = ref(null)
  858. const gxclhcProductValue = () => {
  859. if(fjformData['dqprocessName'] === ''){
  860. fjformData['dqprocessName'] = '';
  861. }
  862. _gxclhcgdbh.value = gxclhcformData['gdbh'];
  863. _ongetProductclick();
  864. }
  865. const paichengColumns = ref(
  866. [
  867. { label: '优先次序', prop: '优先次序', width: '120' },
  868. { label: '工单编号', prop: '工单编号', width: '200' },
  869. { label: '印件名称', prop: '印件名称', width: '220' },
  870. { label: '接货数', prop: '接货数', width: '110' },
  871. { label: '小时产能', prop: '小时产能', width: '110' },
  872. { label: '生产工时', prop: '生产工时', width: '110' },
  873. { label: '辅助工时', prop: '辅助工时', width: '110' },
  874. { label: '班次安排', prop: '班次安排', width: '110' },
  875. { label: '排单备注', prop: '排单备注', width: '110' },
  876. { label: '最早开工时间', prop: '最早开工时间', width: '200' },
  877. { label: '计划开工时间', prop: '计划开工时间', width: '200' },
  878. { label: '计划完工时间', prop: '计划完工时间', width: '200' },
  879. { label: '销售订单号', prop: '销售订单号', width: '120' },
  880. { label: '印件/工序', prop: '印件/工序', width: '120' },
  881. ]
  882. )
  883. const handleKeyDown = (event, x, y, prop) => {
  884. const currentElement = document.getElementById(`input${x}${y}`);
  885. if (currentElement === null && currentElement === undefined) return
  886. let move = 0
  887. switch (event.keyCode) {
  888. case 13: // Enter
  889. case 40: // 向下箭头
  890. if (y < paichengData.value.length )
  891. document.getElementById(`input${x}${y + 1}`).focus();
  892. break;
  893. case 38: // 向上箭头
  894. if ( y > 0) {
  895. document.getElementById(`input${x}${y - 1}`).focus();
  896. }
  897. break;
  898. case 39: // 向左箭头
  899. if ( x === 0) {
  900. move = x + 5
  901. } else if (x >= 5 && x <10) {
  902. move = x + 1
  903. }
  904. document.getElementById(`input${move}${y}`).focus();
  905. break;
  906. case 37: // 向右箭头
  907. if ( x === 5) {
  908. move = x - 5
  909. } else if (x >= 5 && x <=10) {
  910. move = x - 1
  911. }
  912. document.getElementById(`input${move}${y}`).focus();
  913. break;
  914. default:
  915. break;
  916. }
  917. }
  918. //工序产量核查【退出】
  919. const gxclhcCancel = async () => {
  920. gxclhclist.value = false;
  921. };
  922. //流程单查询【按钮】
  923. const onlcdlistClick = async () => {
  924. };
  925. //状态设置【按钮】
  926. const onstatuslist = ref(false);
  927. const statusformData = reactive({gdbh: '',});
  928. const status = ref('计划中'); // 默认选择在产
  929. const onStatusClick = () => {
  930. if(_Gd_gdbh.value == null){
  931. onstatuslist.value = false;
  932. ElMessage({
  933. type: 'warning',
  934. message: '请选择树形后,再操作此功能'
  935. })
  936. }else{
  937. statusformData['gdbh'] = _Gd_gdbh.value;
  938. onstatuslist.value = true;
  939. }
  940. };
  941. //工单状态设置【放弃按钮】
  942. const handleCancel = () => {
  943. onstatuslist.value = false;
  944. };
  945. //工单状态设置【执行按钮】
  946. const handleConfirm = async () => {
  947. //工单编号
  948. let workOrder = statusformData['gdbh'];
  949. //状态
  950. let statusCode;
  951. if (status.value === '计划中') {
  952. statusCode = "1-计划中";
  953. } else if (status.value === '生产中') {
  954. statusCode = "2-生产中";
  955. }else if (status.value === '已完工') {
  956. statusCode = "3-已完工";
  957. }
  958. const StatusEditdata = await StatusEdit({workOrder:workOrder,status:statusCode});
  959. if (StatusEditdata.code === 0) {
  960. ElMessage({
  961. type: 'success',
  962. message: '更新成功'
  963. })
  964. } else {
  965. ElMessage({
  966. type: 'error',
  967. message: '更新成功'
  968. })
  969. }
  970. onstatuslist.value = false;
  971. };
  972. // handleCancel(_stacode);
  973. const page = ref(1)
  974. const total = ref(0)
  975. const pageSize = ref(10)
  976. // 分页
  977. const handleSizeChange = (val) => {
  978. pageSize.value = val
  979. getTableData()
  980. }
  981. // 修改页面容量
  982. const handleCurrentChange = (val) => {
  983. page.value = val
  984. getTableData()
  985. }
  986. // 查询
  987. const getTableData = async() => {
  988. }
  989. getTableData()
  990. // ============== 表格控制部分结束 ===============
  991. // 获取需要的字典 可能为空 按需保留
  992. const setOptions = async () =>{
  993. }
  994. // 获取需要的字典 可能为空 按需保留
  995. setOptions()
  996. // 多选数据
  997. const multipleSelection = ref([])
  998. // 多选
  999. const handleSelectionChange = (val) => {
  1000. multipleSelection.value = val
  1001. console.log(multipleSelection.value)
  1002. }
  1003. // 行为控制标记(弹窗内部需要增还是改)
  1004. const type = ref('')
  1005. //修改
  1006. const updateCompanyFunc = async (row) => {
  1007. console.log(row);
  1008. dialogFormVisible.value = true;
  1009. };
  1010. // 打开弹窗
  1011. const openDialog = () => {
  1012. dialogFormVisible.value = true
  1013. }
  1014. // 弹窗确定
  1015. const enterDialog = async () => {
  1016. console.log("弹窗确定")
  1017. }
  1018. // 关闭弹窗
  1019. const closeDialog = () => {dialogFormVisible.value = false}
  1020. const cjsbpclist = ref(false);
  1021. const cjsbpcformData = reactive({
  1022. //设备代号
  1023. sbdh: '',
  1024. // 下拉框选项数据
  1025. bancis: [],
  1026. // 设置默认值
  1027. banci: '',
  1028. isBanciSelected: false,
  1029. });
  1030. //=============车间设备排程================
  1031. //车间设备排程【按钮】
  1032. const oncjsbpcClick = () => {
  1033. cjsbpcformData['sbdh'] = _machine.value;
  1034. _EquipmentSchedulingdata();
  1035. _ScheduleSelectiondata();
  1036. cjsbpclist.value = true;
  1037. };
  1038. //班次选择列表
  1039. const _ScheduleSelectiondata = async ()=>{
  1040. try {
  1041. const ScheduleSelectiondata = await ScheduleSelection();
  1042. // 清空之前的数据
  1043. cjsbpcformData.bancis = [];
  1044. // 循环遍历数组并将每个班次的detail添加到bancis数组中
  1045. for (const option of ScheduleSelectiondata.data) {
  1046. cjsbpcformData.bancis.push({ label: option.detail, value: option.detail.split('||')[0], rename:option.detail});
  1047. }
  1048. console.log("赋值后的数据:", cjsbpcformData.bancis);
  1049. } catch (error) {
  1050. console.error(error);
  1051. }
  1052. }
  1053. //车间设备排程->数据展示
  1054. const paichengData = ref([])
  1055. const setBanci = (v) => {
  1056. paichengData.value.map( item => item.班次安排 = v)
  1057. }
  1058. const _EquipmentSchedulingdata = async ()=>{
  1059. // let machine = 'WY01#';
  1060. let machine = _machine.value;
  1061. try {
  1062. const EquipmentSchedulingdata = await EquipmentScheduling({machine:machine});
  1063. if (EquipmentSchedulingdata.code === 0) {
  1064. paichengData.value = EquipmentSchedulingdata.data
  1065. }
  1066. } catch (error) {
  1067. console.error(error);
  1068. }
  1069. }
  1070. //车间设备排程->数据编辑
  1071. //车间设备排程【更新排程】
  1072. const oneditpcClick = () => {
  1073. console.log("更新排程")
  1074. cjsbpclist.value = true;
  1075. };
  1076. //车间设备排程【退出】
  1077. const cjsbpcCancel = () => {
  1078. cjsbpclist.value = false;
  1079. };
  1080. </script>
  1081. <style scoped>
  1082. :deep(.el-tabs__header){
  1083. margin-bottom: 0;
  1084. }
  1085. :deep(.el-table td .cell) {
  1086. line-height: 30px !important;
  1087. }
  1088. .JKWTree-container {
  1089. display: flex;
  1090. }
  1091. .JKWTree-tree {
  1092. width: 300px;
  1093. background-color: #fff;
  1094. padding: 10px;
  1095. margin-right: 20px;
  1096. }
  1097. .JKWTree-tree h3 {
  1098. font-size: 15px;
  1099. font-weight: 700;
  1100. margin: 10px 0;
  1101. }
  1102. .JKWTree-content {
  1103. flex: 1;
  1104. }
  1105. /* 选中某行时的背景色 */
  1106. :deep(.el-table__body tr.current-row) > td {
  1107. background: #ff80ff !important;
  1108. }
  1109. </style>
  1110. <style scoped>
  1111. :deep(.el-tabs__header){
  1112. margin-bottom: 0;
  1113. }
  1114. .search{
  1115. margin-left: 0px !important;
  1116. margin-right: 10px !important;
  1117. }
  1118. .bt{
  1119. margin-left: 2px !important;
  1120. padding: 3px !important;
  1121. font-size: 12px;
  1122. }
  1123. .el-tabs__header{
  1124. margin: 0px !important;
  1125. }
  1126. .gva-table-box{
  1127. padding: 0px !important;
  1128. }
  1129. .mab{
  1130. margin-bottom: 5px;
  1131. }
  1132. </style>
  1133. <style scoped>
  1134. :deep(.el-table td .cell) {
  1135. line-height: 20px !important;
  1136. }
  1137. :deep(.el-tabs__header){
  1138. margin-bottom: 0;
  1139. }
  1140. .search{
  1141. margin-left: 0px !important;
  1142. margin-right: 10px !important;
  1143. }
  1144. .bt{
  1145. margin-left: 2px !important;
  1146. padding: 3px !important;
  1147. font-size: 12px;
  1148. }
  1149. .el-tabs__header{
  1150. margin: 0px !important;
  1151. }
  1152. .gva-table-box{
  1153. padding: 0px !important;
  1154. }
  1155. .mab{
  1156. margin-bottom: 5px;
  1157. }
  1158. .focusdiv:focus {
  1159. border: 1px solid red;
  1160. }
  1161. </style>