gongdanshengchan.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. <template>
  2. <div style="margin: 0 auto">
  3. <el-container>
  4. <el-aside width="200px">
  5. <div class="JKWTree-tree" style="height: 746px;">
  6. <!-- 排产进程及参数设置-->
  7. <el-tree :data="sctreeData" :props="defaultProps" @node-click="schandleNodeClick"></el-tree>
  8. <!-- 车间-->
  9. <el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
  10. </div>
  11. </el-aside>
  12. <el-container>
  13. <el-main>
  14. <!-- 搜索框 -->
  15. <div class="gva-search-box">
  16. <!-- 状态设置-->
  17. <el-dialog v-model="onstatuslist" title="工单状态设置" width="30%" style="top: 15%">
  18. <div style="width: 100%;height: 100%;">
  19. <div style="width: 100%; display: flex; align-items: center;">
  20. <el-form-item label="工单编号 :" prop="currentProcess">
  21. <el-input v-model="statusformData['gdbh']" placeholder="" />
  22. </el-form-item>
  23. </div>
  24. <div style="width: 100%; display: flex; align-items: center; margin-top: 30px;">
  25. <span>状态设置:</span>
  26. <el-radio-group v-model="status" style="margin-left: 10px;">
  27. <el-radio label="计划中">计划中</el-radio>
  28. <el-radio label="生产中">生产中</el-radio>
  29. <el-radio label="已完工">已完工</el-radio>
  30. </el-radio-group>
  31. </div>
  32. <div class="dialog-footer" style="text-align: right; margin-top: 40px;">
  33. <el-button @click="handleCancel">取消</el-button>
  34. <el-button type="primary" @click="handleConfirm">确认</el-button>
  35. </div>
  36. </div>
  37. </el-dialog>
  38. <!-- 工序状态更正-->
  39. <el-dialog v-model="gxztgzzlist" title="工序状态更正" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
  40. <el-button type="primary" @click="gxztgzzCancel">退出</el-button>
  41. <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; display: flex; align-items: center;">
  42. <el-form-item label="关键字 :" prop="currentProcess" style="margin-right: 20px; padding: 0px">
  43. <el-input v-model="gxztgzzformData['gdbh']"
  44. @keyup.enter="gxztgzzgetProductValue" placeholder="" style="width: 500px;"/>
  45. </el-form-item>
  46. </div>
  47. <el-table ref="multipleTable"
  48. :show-overflow-tooltip="true"
  49. :row-style="{ height: '0px' }"
  50. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
  51. :header-cell-style="{ padding: '0px' }"
  52. style="width: 100%;height: 710px" border tooltip-effect="dark"
  53. :data="gxztgzztableData" row-key="ID" @selection-change="handleSelectionChange">
  54. <el-table-column v-slot="scope" align="left" label=印件及工序 width="600" >
  55. <el-input disabled v-model="scope.row.印件及工序" :clearable="false"/>
  56. </el-table-column>
  57. <el-table-column v-slot="scope" align="left" label=计划产量/已完成 width="590" >
  58. <el-input disabled v-model="scope.row['计划产量/已完成']" :clearable="false"/>
  59. </el-table-column>
  60. <el-table-column v-slot="scope" align="left" label=完成率 width="240" >
  61. <el-input disabled v-model="scope.row.完成率" :clearable="false"/>
  62. </el-table-column>
  63. <el-table-column v-slot="scope" align="left" label=完工时间 width="210" >
  64. <el-input disabled v-model="scope.row.完工时间" :clearable="false"/>
  65. </el-table-column>
  66. <el-table-column v-slot="scope" align="left" label=设备代号 width="240" >
  67. <el-input disabled v-model="scope.row.设备代号" :clearable="false"/>
  68. </el-table-column>
  69. </el-table>
  70. </el-dialog>
  71. <el-form ref="elSearchFormRef" :inline="true" :model="searchInfo" class="demo-form-inline" :rules="searchRule" @keyup.enter="onSubmit">
  72. <el-form-item>
  73. <el-input v-model="searchInfo" placeholder="搜索" clearable style="width: 200px;"></el-input>
  74. <el-button type="primary" icon="search" @click="onSubmit" style="margin: 5px">查询</el-button>
  75. <el-button type="primary" icon="edit" @click="onStatusClick" style="margin: 5px">状态设置</el-button>
  76. <el-button type="primary" icon="edit" @click="onStatusgzClick" style="margin: 5px">工序状态更正</el-button>
  77. </el-form-item>
  78. </el-form>
  79. </div>
  80. <div class="gva-table-box">
  81. <el-table ref="multipleTable"
  82. style="width: 100%;height: 40vh"
  83. :row-style="{ height: '20px' }"
  84. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  85. :header-cell-style="{ padding: '0px' }"
  86. border
  87. tooltip-effect="dark"
  88. :data="tableData"
  89. row-key="ID"
  90. :highlight-current-row="true"
  91. size="small"
  92. @row-click="gdtableRowClick"
  93. @selection-change="handleSelectionChange"
  94. :show-overflow-tooltip="true">
  95. <template v-for="item in tableFields[currentNode]">
  96. <el-table-column :align="item.align" :label="item.title" :prop="item.prop" :width="item.width" />
  97. </template>
  98. </el-table>
  99. </div>
  100. <el-tabs v-model="activeName" type="card" @tab-click="handleClick" v-if="currentNode == 1 || currentNode == 4">
  101. <el-tab-pane label="工艺资料" @click="showTable('工艺资料')" name="first">
  102. <el-table ref="multipleTable"
  103. :show-overflow-tooltip="true"
  104. :row-style="{ height: '20px' }"
  105. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  106. :header-cell-style="{ padding: '0px' }"
  107. highlight-current-row="true"
  108. style="width: 100%;height: 400px" border tooltip-effect="dark" :data="gytableData" row-key="ID" @selection-change="handleSelectionChange">
  109. <el-table-column align="left" label="工单编号" prop="工单编号" width="100"/>
  110. <el-table-column align="left" label="重点工序" prop="重点工序" width="100"/>
  111. <el-table-column align="left" label="工序备注" prop="工序备注" width="240"/>
  112. <el-table-column align="left" label="机组" prop="机组" width="100"/>
  113. <el-table-column align="left" label="小时产能" prop="小时产能" width="100"/>
  114. <el-table-column align="left" label="生产工时" prop="生产工时" width="100"/>
  115. <el-table-column align="left" label="辅助工时" prop="辅助工时" width="100"/>
  116. <el-table-column align="left" label="印刷方式" prop="印刷方式" width="100"/>
  117. <el-table-column align="left" label="版距" prop="版距" width="100"/>
  118. <el-table-column align="left" label="创建用户" prop="创建用户" width="120"/>
  119. <el-table-column align="left" label="创建时间" prop="创建时间" width="160"/>
  120. <el-table-column align="left" label="修改时间" prop="修改时间" width="160"/>
  121. <el-table-column align="left" label="UNIQID" prop="UNIQID" width="100"/>
  122. <el-table-column align="left" label="印件工序及名称" prop="印件工序及名称" width="340"/>
  123. </el-table>
  124. </el-tab-pane>
  125. <el-tab-pane label="印件资料" @click="showTable('印件资料')" name="second">
  126. <el-table ref="multipleTable"
  127. :row-style="{ height: '20px' }"
  128. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  129. :header-cell-style="{ padding: '0px' }"
  130. :show-overflow-tooltip="true"
  131. :highlight-current-row="true"
  132. style="width: 100%;height: 400px" border tooltip-effect="dark" :data="yjtableData" row-key="ID" @selection-change="handleSelectionChange">
  133. <el-table-column align="left" label="工单编号" prop="工单编号" width="100"/>
  134. <el-table-column align="left" label="印件号" prop="印件号" width="100"/>
  135. <el-table-column align="left" label="印件代号" prop="印件代号" width="100"/>
  136. <el-table-column align="left" label="印件名称" prop="印件名称" width="100"/>
  137. <el-table-column align="left" label="纸张名称" prop="纸张名称" width="100"/>
  138. <el-table-column align="left" label="投料规格" prop="投料规格" width="100"/>
  139. <el-table-column align="left" label="成品数量" prop="成品数量" width="100"/>
  140. <el-table-column align="left" label="实际投料" prop="实际投料" width="100"/>
  141. <el-table-column align="left" label="投料单位" prop="投料单位" width="100"/>
  142. <el-table-column align="left" label="平张投料" prop="平张投料" width="100"/>
  143. <el-table-column align="left" label="联数" prop="联数" width="100"/>
  144. <el-table-column align="left" label="开数" prop="开数" width="100"/>
  145. <el-table-column align="left" label="创建用户" prop="创建用户" width="120"/>
  146. <el-table-column align="left" label="创建时间" prop="创建时间" width="160"/>
  147. <el-table-column align="left" label="修改时间" prop="修改时间" width="160"/>
  148. <el-table-column align="left" label="UNIQID" prop="UNIQID" width="100"/>
  149. </el-table>
  150. </el-tab-pane>
  151. </el-tabs>
  152. <el-table ref="multipleTable2"
  153. v-if="[2, 3].includes(currentNode)"
  154. :show-overflow-tooltip="true"
  155. :row-style="{ height: '20px' }"
  156. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  157. :header-cell-style="{ padding: '0px' }"
  158. :highlight-current-row="true"
  159. style="width: 100%;height: 400px" border tooltip-effect="dark" :data="bottomData" row-key="ID" @selection-change="handleSelectionChange">
  160. <template v-for="item in bottomTableF[currentNode]">
  161. <el-table-column :align="item.align" :label="item.title" :prop="item.prop" :width="item.width" />
  162. </template>
  163. </el-table>
  164. </el-main>
  165. </el-container>
  166. </el-container>
  167. </div>
  168. </template>
  169. <script>
  170. //点击按钮显示下方表格
  171. export default {
  172. data() {
  173. return {
  174. currentTable: '',
  175. activeName: 'first',
  176. // 其他表格数据...
  177. };
  178. },
  179. methods: {
  180. showTable(tableName) {
  181. console.log("点击了".tableName)
  182. // 根据点击的按钮设置当前展示的表格
  183. this.currentTable = tableName;
  184. },
  185. showTableChange() {
  186. // 处理表格选中事件
  187. },
  188. // 其他方法...
  189. }
  190. };
  191. </script>
  192. <script setup>
  193. // 全量引入格式化工具 请按需保留
  194. import {createCompany, deleteCompany, deleteCompanyByIds, updateCompany, findCompany, getCompanyList} from '@/api/company'
  195. import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
  196. import { ElMessage, ElMessageBox } from 'element-plus'
  197. import { ref, reactive } from 'vue'
  198. import {
  199. DataList,
  200. getProduct,
  201. getProductData,
  202. Project,StatusEdit,
  203. projectCraft,ProcessStatusCorrection,
  204. projectPrint, setProductStatus,
  205. workbench
  206. } from "@/api/yunyin/yunying";
  207. defineOptions({name: 'Company'})
  208. // =========== 左侧树侧形结构 ===========
  209. const sctreeData = ref([
  210. {
  211. label: '排产进程及参数设置',
  212. children:[
  213. {label: '1.计划中工单', number: 1},
  214. {label: '2.排程中工单', number: 2,},
  215. {label: '3.制程中工单', number: 3,},
  216. {label: '4.已完工工单', number: 4,}
  217. ],
  218. }
  219. ]);
  220. const tableFields = ref(
  221. {
  222. '1': [
  223. { title:'生产分类', prop: '生产分类', width: 90, align:'left', },
  224. { title: '工单编号', prop: '工单编号', width: 120, align:'left', },
  225. { title: '产品代号', prop: '产品代号', width: 120, align:'left', },
  226. { title: '产品名称', prop: '产品名称', width: 340, align:'left', },
  227. { title: '接单日期', prop: '接单日期', width: 160, align:'left', },
  228. { title: '交货日期', prop: '交货日期', width: 160, align:'left', },
  229. { title: '订单数量', prop: '订单数量', width: 120, align:'left', },
  230. { title: '计量单位', prop: '计量单位', width: 120, align:'left', },
  231. { title: '客户名称', prop: '客户名称', width: 200, align:'left', },
  232. { title: '客户编号', prop: '客户编号', width: 120, align:'left', },
  233. { title: '备注', prop: '备注', width: 400, align:'left', },
  234. { title: '客户料号', prop: '客户料号', width: 120, align:'left', },
  235. { title: '创建用户', prop: '创建用户', width: 160, align:'left', },
  236. { title: '创建时间', prop: '创建时间', width: 160, align:'left', },
  237. { title: '修改时间', prop: '修改时间', width: 160, align:'left', },
  238. { title: 'UNIQID', prop: 'UNIQID', width: 120, align:'left', },
  239. { title: '投料率', prop: '投料率', width: 120, align:'left', },
  240. { title: '销售订单号', prop: '销售订单号', width: 120, align:'left', },
  241. ],
  242. '2':[
  243. { title: '最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  244. { title: '工单编号', prop: '工单编号', width: 120, align:'left', },
  245. { title: '产品代号', prop: '产品代号', width: 120, align:'left', },
  246. { title: '产品名称', prop: '产品名称', width: 340, align:'left', },
  247. { title: '接单日期', prop: '接单日期', width: 160, align:'left', },
  248. { title: '交货日期', prop: '交货日期', width: 160, align:'left', },
  249. { title: '订单数量', prop: '订单数量', width: 120, align:'left', },
  250. { title: '计量单位', prop: '计量单位', width: 120, align:'left', },
  251. { title: '销售订单号', prop: '销售订单号', width: 200, align:'left', },
  252. { title: '排程类型', prop: '排程类型', width: 120, align:'left', },
  253. { title: '客户编号', prop: '客户编号', width: 120, align:'left', },
  254. { title: '客户名称', prop: '客户名称', width: 120, align:'left', },
  255. { title: '创建用户', prop: '创建用户', width: 160, align:'left', },
  256. { title: 'GDUID', prop: 'GDUID', width: 120, align:'left', },
  257. { title: 'GYUID', prop: 'GYUID', width: 120, align:'left', },
  258. ],
  259. '3': [
  260. { title: '最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  261. { title: '工单编号', prop: '工单编号', width: 120, align:'left', },
  262. { title: '产品代号', prop: '产品代号', width: 120, align:'left', },
  263. { title: '产品名称', prop: '产品名称', width: 340, align:'left', },
  264. { title: '接单日期', prop: '接单日期', width: 160, align:'left', },
  265. { title: '交货日期', prop: '交货日期', width: 160, align:'left', },
  266. { title: '订单数量', prop: '订单数量', width: 120, align:'left', },
  267. { title: '计量单位', prop: '计量单位', width: 120, align:'left', },
  268. { title: '销售订单号', prop: '销售订单号', width: 200, align:'left', },
  269. { title: '排程类型', prop: '排程类型', width: 120, align:'left', },
  270. { title: '客户编号', prop: '客户编号', width: 120, align:'left', },
  271. { title: '客户名称', prop: '客户名称', width: 120, align:'left', },
  272. { title: '客户料号', prop: '客户料号', width: 160, align:'left', },
  273. { title: 'GDUID', prop: 'GDUID', width: 120, align:'left', },
  274. { title: 'GYUID', prop: 'GYUID', width: 120, align:'left', },
  275. ],
  276. '4': [
  277. { title: '工单编号', prop: '工单编号', width: 120, align:'left', },
  278. { title: '产品代号', prop: '产品代号', width: 120, align:'left', },
  279. { title: '产品名称', prop: '产品名称', width: 340, align:'left', },
  280. { title: '接单日期', prop: '接单日期', width: 160, align:'left', },
  281. { title: '交货日期', prop: '交货日期', width: 160, align:'left', },
  282. { title: '订单数量', prop: '订单数量', width: 120, align:'left', },
  283. { title: '计量单位', prop: '计量单位', width: 120, align:'left', },
  284. { title: '销售订单号', prop: '销售订单号', width: 200, align:'left', },
  285. { title: '客户编号', prop: '客户编号', width: 120, align:'left', },
  286. { title: '客户名称', prop: '客户名称', width: 120, align:'left', },
  287. { title: '客户料号', prop: '客户料号', width: 160, align:'left', },
  288. { title: '排程类型', prop: '排程类型', width: 120, align:'left', },
  289. { title: 'GDUID', prop: 'GDUID', width: 120, align:'left', },
  290. ]
  291. }
  292. )
  293. const bottomTableF = ref({
  294. '2': [
  295. { title:'工单编号', prop: '工单编号', width: 120, align:'left', },
  296. { title:'印件工序及名称', prop: '印件工序及名称', width: 160, align:'left', },
  297. { title:'机组', prop: '机组', width: 120, align:'left', },
  298. { title:'设备编号', prop: '设备编号', width: 120, align:'left', },
  299. { title:'工序产量', prop: '工序产量', width: 120, align:'left', },
  300. { title:'已完成产量', prop: '已完成产量', width: 120, align:'left', },
  301. { title:'剩余产量', prop: '剩余产量', width: 120, align:'left', },
  302. { title:'小时产能', prop: '小时产能', width: 120, align:'left', },
  303. { title:'产能系数', prop: '产能系数', width: 120, align:'left', },
  304. { title:'生产工时', prop: '生产工时', width: 120, align:'left', },
  305. { title:'辅助工时', prop: '辅助工时', width: 120, align:'left', },
  306. { title:'最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  307. { title:'计划开工时间', prop: '计划开工时间', width: 120, align:'left', },
  308. { title:'计划完工时间', prop: '计划完工时间', width: 120, align:'left', },
  309. { title:'班次安排', prop: '班次安排', width: 120, align:'left', },
  310. { title:'设备名称', prop: '设备名称', width: 120, align:'left', },
  311. { title:'排单备注', prop: '排单备注', width: 120, align:'left', },
  312. { title:'工序完工', prop: '工序完工', width: 120, align:'left', },
  313. { title:'UNIQID', prop: 'UNIQID', width: 120, align:'left', },
  314. ],
  315. '3': [
  316. { title:'工单编号', prop: '工单编号', width: 120, align:'left', },
  317. { title:'印件工序及名称', prop: '印件工序及名称', width: 160, align:'left', },
  318. { title:'机组', prop: '机组', width: 120, align:'left', },
  319. { title:'设备编号', prop: '设备编号', width: 120, align:'left', },
  320. { title:'工序产量', prop: '工序产量', width: 120, align:'left', },
  321. { title:'已完成产量', prop: '已完成产量', width: 120, align:'left', },
  322. { title:'剩余产量', prop: '剩余产量', width: 120, align:'left', },
  323. { title:'小时产能', prop: '小时产能', width: 120, align:'left', },
  324. { title:'产能系数', prop: '产能系数', width: 120, align:'left', },
  325. { title:'生产工时', prop: '生产工时', width: 120, align:'left', },
  326. { title:'辅助工时', prop: '辅助工时', width: 120, align:'left', },
  327. { title:'最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  328. { title:'计划开工时间', prop: '计划开工时间', width: 120, align:'left', },
  329. { title:'计划完工时间', prop: '计划完工时间', width: 120, align:'left', },
  330. { title:'班次安排', prop: '班次安排', width: 120, align:'left', },
  331. { title:'设备名称', prop: '设备名称', width: 120, align:'left', },
  332. { title:'排单备注', prop: '排单备注', width: 120, align:'left', },
  333. { title:'工序完工', prop: '工序完工', width: 120, align:'left', },
  334. { title:'UNIQID', prop: 'UNIQID', width: 120, align:'left', },
  335. ],
  336. })
  337. const treeData = ref([]);
  338. const currentNode = ref('1')
  339. //印件资料
  340. const yjtableData = ref([])
  341. //工艺资料
  342. const gytableData = ref([])
  343. const bottomData = ref([])
  344. //点击 设备定额及分配参数设置
  345. const schandleNodeClick = async (node) => {
  346. currentNode.value = node.number
  347. bottomData.value = []
  348. yjtableData.value = []
  349. gytableData.value = []
  350. switch (node.number) {
  351. case 1:
  352. // 计划中工单
  353. const Projectdata = await Project();
  354. tableData.value = Projectdata.data
  355. break;
  356. case 2:
  357. //排程中工单
  358. tableData.value = [
  359. {
  360. '最早开工时间': '',
  361. '工单编号': '2011719',
  362. '产品代号': '100102003',
  363. '产品名称': '利群(休闲云端)手工条盒',
  364. '接单日期': '2020.11.04',
  365. '交货日期': '2020.11.14',
  366. '订单数量': '12.5',
  367. '计量单位': '万张',
  368. '销售订单号': '利群(休闲云端)手工条盒 201102',
  369. '排程类型': '2.排程中工单',
  370. '客户编号': '1001',
  371. '客户名称': '浙江中烟',
  372. '客户料号': '',
  373. 'GDUID': '5222',
  374. 'GYUID': '95913',
  375. },
  376. {
  377. '最早开工时间': '',
  378. '工单编号': '2380342',
  379. '产品代号': '',
  380. '产品名称': '检验改二维码专用印章',
  381. '接单日期': '2023.03.07',
  382. '交货日期': '',
  383. '订单数量': '',
  384. '计量单位': '张',
  385. '销售订单号': '',
  386. '排程类型': '2.排程中工单',
  387. '客户编号': '1001',
  388. '客户名称': '浙江中烟',
  389. '客户料号': '',
  390. 'GDUID': '14405',
  391. 'GYUID': '211808',
  392. },
  393. ]
  394. break;
  395. case 3:
  396. //制程中工单
  397. break;
  398. case 4:
  399. //已完工工单
  400. break;
  401. }
  402. };
  403. //进入页面自动加载数据
  404. const workbenchdata = async () => {
  405. try {
  406. const data = await workbench();
  407. const rawData = data.data;
  408. const dataArray =Object.keys(rawData).map(key => ({
  409. label: key,
  410. children: Object.keys(rawData[key]).map(subKey => ({
  411. label: subKey,
  412. children: rawData[key][subKey].map(item => ({
  413. label: item
  414. }))
  415. }))
  416. }));
  417. treeData.value = dataArray;
  418. // console.log(dataArray);
  419. } catch (error) {
  420. console.error(error);
  421. }
  422. };
  423. workbenchdata();
  424. //点击左侧树形获取列表
  425. const tableData = ref([])
  426. const handleNodeClick = async (node) => {
  427. const custom_code = node.label;
  428. console.log("↓↓↓↓点击了车间参数↓↓↓↓");
  429. console.log(custom_code);
  430. };
  431. //下方表格数据
  432. const gdtableRowClick = async (row) => {
  433. // 计划中
  434. if (currentNode.value == 1) {
  435. const Gd_gdbh = row.工单编号;
  436. // console.log(Gd_gdbh);
  437. //计划中工单->工艺资料接口
  438. const gyres = await projectCraft({Gd_gdbh: Gd_gdbh});
  439. //计划中工单->印件资料接口
  440. const yjres = await projectPrint({Gd_gdbh: Gd_gdbh});
  441. //工艺资料表格
  442. gytableData.value.splice(0, gytableData.value.length, ...gyres.data);
  443. //印件资料表格
  444. yjtableData.value.splice(0, yjtableData.value.length, ...(yjres?.data ?? []));
  445. }
  446. // 排程中 下方表格
  447. if (currentNode.value == 2) {
  448. bottomData.value = [
  449. {
  450. '工单编号' : '2305909',
  451. '印件工序及名称' : '01-01 裁切【光边】',
  452. '机组' : 'QZ01# QZ03#',
  453. '设备编号' : 'QZ01#',
  454. '工序产量' : '3000',
  455. '已完成产量' : '',
  456. '剩余产量' : '9000',
  457. '产能系数' : '1',
  458. '生产工时' : '',
  459. '辅助工时' : '1',
  460. '最早开工时间' : '',
  461. '计划完工时间' : '',
  462. '班次安排' : '007',
  463. '设备名称' : '海德堡波拉裁切刀(QZ-01)',
  464. }
  465. ]
  466. }
  467. };
  468. //搜索查询
  469. const searchInfo = ref('')
  470. //点击【查询】按钮
  471. const onSubmit = () => {
  472. // console.log("点击了搜索按钮")
  473. };
  474. // =========== 【工序状态更正】 ===========
  475. const gxztgzzlist = ref(false);
  476. const gxztgzzformData = reactive({gdbh: '',});
  477. const gxztgzztableData = ref([]);
  478. //工序状态更正【按钮】
  479. const onStatusgzClick = () => {
  480. // if(工单编号.value == null){
  481. // gxztgzzlist.value = false;
  482. // ElMessage({
  483. // type: 'warning',
  484. // message: '请选择树形后,再操作此功能'
  485. // })
  486. // }else{
  487. gxztgzzformData['gdbh'] = '2312192';
  488. _ProcessStatusCorrection();
  489. gxztgzzlist.value = true;
  490. // }
  491. };
  492. //工序状态更正【回车】
  493. const gxztgzzgetProductValue = () => {
  494. _ProcessStatusCorrection();
  495. };
  496. //工序状态更正
  497. const _ProcessStatusCorrection = async (row) => {
  498. const workOrder = gxztgzzformData['gdbh'];
  499. console.log(workOrder)
  500. const ProcessStatusCorrectiondata = await ProcessStatusCorrection({workOrder:workOrder});
  501. gxztgzztableData.value = ProcessStatusCorrectiondata.data;
  502. };
  503. //工序状态更正【退出】
  504. const gxztgzzCancel = () => {
  505. gxztgzzlist.value = false;
  506. };
  507. // =========== 状态设置 ===========
  508. const onstatuslist = ref(false);
  509. const statusformData = reactive({gdbh: '',});
  510. const status = ref('计划中'); // 默认选择在产
  511. // const _stacode = ref(null);
  512. //点击【状态设置】按钮
  513. const onStatusClick = () => {
  514. // if(_product_code.value == null){
  515. // onstatuslist.value = false;
  516. // ElMessage({
  517. // type: 'warning',
  518. // message: '请选择树形后,再操作此功能'
  519. // })
  520. // }else{
  521. statusformData['gdbh'] = '2401156';
  522. onstatuslist.value = true;
  523. // }
  524. };
  525. //工单状态设置放弃按钮
  526. const handleCancel = () => {
  527. onstatuslist.value = false;
  528. };
  529. //工单状态设置执行按钮
  530. const handleConfirm = async () => {
  531. //工单编号
  532. let workOrder = statusformData['gdbh'];
  533. //状态
  534. let statusCode;
  535. if (status.value === '计划中') {
  536. statusCode = "1-计划中";
  537. } else if (status.value === '生产中') {
  538. statusCode = "2-生产中";
  539. }else if (status.value === '已完工') {
  540. statusCode = "3-已完工";
  541. }
  542. const StatusEditdata = await StatusEdit({workOrder:workOrder,status:statusCode});
  543. if (StatusEditdata.code === 0) {
  544. ElMessage({
  545. type: 'success',
  546. message: '更新成功'
  547. })
  548. } else {
  549. ElMessage({
  550. type: 'error',
  551. message: '更新成功'
  552. })
  553. }
  554. onstatuslist.value = false;
  555. };
  556. // handleCancel(_stacode);
  557. const page = ref(1)
  558. const total = ref(0)
  559. const pageSize = ref(10)
  560. // 分页
  561. const handleSizeChange = (val) => {
  562. pageSize.value = val
  563. getTableData()
  564. }
  565. // 修改页面容量
  566. const handleCurrentChange = (val) => {
  567. page.value = val
  568. getTableData()
  569. }
  570. // 查询
  571. const getTableData = async() => {
  572. }
  573. getTableData()
  574. // ============== 表格控制部分结束 ===============
  575. // 获取需要的字典 可能为空 按需保留
  576. const setOptions = async () =>{
  577. }
  578. // 获取需要的字典 可能为空 按需保留
  579. setOptions()
  580. // 多选数据
  581. const multipleSelection = ref([])
  582. // 多选
  583. const handleSelectionChange = (val) => {
  584. multipleSelection.value = val
  585. }
  586. // 行为控制标记(弹窗内部需要增还是改)
  587. const type = ref('')
  588. //修改
  589. const updateCompanyFunc = async (row) => {
  590. console.log(row);
  591. dialogFormVisible.value = true;
  592. };
  593. // 打开弹窗
  594. const openDialog = () => {
  595. dialogFormVisible.value = true
  596. }
  597. // 弹窗确定
  598. const enterDialog = async () => {
  599. console.log("弹窗确定")
  600. }
  601. // 关闭弹窗
  602. const closeDialog = () => {dialogFormVisible.value = false}
  603. </script>
  604. <style scoped>
  605. :deep(.el-table td .cell) {
  606. line-height: 30px !important;
  607. }
  608. .JKWTree-container {
  609. display: flex;
  610. }
  611. .JKWTree-tree {
  612. width: 300px;
  613. background-color: #fff;
  614. padding: 10px;
  615. margin-right: 20px;
  616. }
  617. .JKWTree-tree h3 {
  618. font-size: 15px;
  619. font-weight: 700;
  620. margin: 10px 0;
  621. }
  622. .JKWTree-content {
  623. flex: 1;
  624. }
  625. /* 选中某行时的背景色 */
  626. :deep(.el-table__body tr.current-row) > td {
  627. background: #ff80ff !important;
  628. }
  629. </style>