yangyipihe.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. <template>
  2. <div>
  3. <layout>
  4. <layout-header>
  5. <div class="">
  6. <!-- 按钮部分-->
  7. <el-form ref="elSearchFormRef" class="demo-form-inline" :rules="searchRule" @keyup.enter="onSubmit">
  8. <el-form-item>
  9. <el-input v-model="searchInfo" placeholder="搜索订单编号" style="width: 180px;"></el-input>
  10. <el-button type="primary" icon="search" @click="onSubmit" >查询</el-button>
  11. <el-button type="primary" icon="edit" @click="hptg_onClick" :disabled="table_Selection === false" class="bt" title="核批通过">核批通过</el-button>
  12. </el-form-item>
  13. </el-form>
  14. </div>
  15. </layout-header>
  16. <layout>
  17. <!-- 右侧区域 -->
  18. <layout-content >
  19. <!-- <el-main> -->
  20. <div class="gva-table-box">
  21. <!-- 表格数据 -->
  22. <el-tabs v-model="activeName">
  23. <el-tab-pane label="样衣待核批列表" @click="showTable('样衣待核批列表')" name="first">
  24. <el-table ref="multipleTable" :row-style="{ height: '20px' }"
  25. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  26. :header-cell-style="{ padding: '0px' }"
  27. @row-click="yydp_clickybupdate"
  28. @row-dblclick="yydp_updateCompanyFunc"
  29. highlight-current-row="true"
  30. :show-overflow-tooltip="true"
  31. style="width: 100%;height: 65vh" border :data="tableData1" row-key="ID" @selection-change="handleSelectionChange">
  32. <el-table-column align="center" type="selection" width="40"/>
  33. <el-table-column align="center" label="附件状态" prop="status" width="100" />
  34. <el-table-column align="left" label="客户" prop="客户编号" width="70" />
  35. <el-table-column align="left" label="订单编号" prop="订单编号" width="120" />
  36. <el-table-column align="left" label="生产款号" prop="生产款号" width="150" />
  37. <el-table-column align="left" label="款式" prop="款式" width="110" />
  38. <el-table-column align="left" label="工单状态" prop="gd_statu" width="90" />
  39. <el-table-column align="left" label="订单数量" prop="订单数量" width="90" />
  40. <el-table-column align="left" label="船样合计" prop="船样合计" width="90" />
  41. <el-table-column align="left" label="船样描述" prop="船样描述" width="150" />
  42. <el-table-column align="left" label="单位" prop="单位" width="60" />
  43. <el-table-column align="left" label="粘衬" prop="粘衬" width="120" />
  44. <el-table-column align="left" label="要求" prop="要求" width="360" />
  45. <el-table-column align="left" label="箱唛要求" prop="箱唛要求" width="360" />
  46. <el-table-column align="left" label="工单完工数量" prop="工单完工数量" width="140" />
  47. <el-table-column align="left" label="工单完工日期" prop="工单完工日期" width="140" />
  48. <el-table-column align="left" label="制单人" prop="Sys_id" width="160" />
  49. <el-table-column align="left" label="制单日期" prop="Sys_rq" width="160" />
  50. <!-- <el-table-column align="left" label="接单日期" prop="接单日期" width="120" /> -->
  51. <el-table-column align="left" label="出库日期" prop="出库日期" width="120" />
  52. <el-table-column align="left" label="落货日期" prop="落货日期" width="120" />
  53. <el-table-column align="left" label="更新时间" prop="Mod_rq" width="120" />
  54. <el-table-column align="left" label="审核" prop="审核" width="100" />
  55. <el-table-column align="left" label="审核日期" prop="审核日期" width="120" />
  56. </el-table>
  57. </el-tab-pane>
  58. </el-tabs>
  59. <!-- 分页 -->
  60. <div class="gva-pagination">
  61. <el-pagination layout="total" :current-page="page" :page-size="pageSize"
  62. :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" />
  63. <!-- <el-pagination layout="total, sizes, prev, pager, next, jumper" :current-page="page" :page-size="pageSize" :page-sizes="[10, 30, 50, 100]"-->
  64. <!-- :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" />-->
  65. </div>
  66. </div>
  67. <!-- </el-main> -->
  68. </layout-content>
  69. </layout>
  70. </layout>
  71. </div>
  72. </template>
  73. <script>
  74. //点击按钮显示下方表格
  75. export default {
  76. data() {
  77. return {
  78. currentTable: '', // 当前展示的表格
  79. activeName: 'first',
  80. };
  81. },
  82. methods: {
  83. showTable(tableName) {
  84. this.currentTable = tableName;
  85. },
  86. }
  87. };
  88. </script>
  89. <script setup>
  90. // 全量引入格式化工具 请按需保留
  91. import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
  92. import {ref, reactive} from 'vue'
  93. import {UnapprovalList,Approval} from '@/api/mes/job'
  94. import {jcgetTab,workOrderDetail,getOrderProcessCount,PrintDetailList} from '@/api/yunyin/yunying'
  95. import PrintPage from './components/print.vue'
  96. import {ElMessage} from "element-plus";
  97. import { useUserStore } from '@/pinia/modules/user';
  98. defineOptions({name: 'Company'})
  99. //获取登录用户信息
  100. const userStore = useUserStore()
  101. const _username = ref('')
  102. _username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
  103. console.log('获取用户名称',_username.value)
  104. //全局获取当前日期
  105. const today = new Date();
  106. const year = today.getFullYear();
  107. const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,需要补零
  108. const day = String(today.getDate()).padStart(2, '0');
  109. const hours = String(today.getHours()).padStart(2, '0');
  110. const minutes = String(today.getMinutes()).padStart(2, '0');
  111. const seconds = String(today.getSeconds()).padStart(2, '0');
  112. const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  113. const currentDates = `${year}-${month}-${day}`;
  114. //进入页面显示所有数据
  115. const getUnapprovalList = async () => {
  116. try {
  117. const UnapprovalListtable = await UnapprovalList({search:''});
  118. console.log(1484,UnapprovalListtable)
  119. const workOrderDetaildata1 = UnapprovalListtable.data.table
  120. tableData1.splice(0,tableData1.length,...workOrderDetaildata1);
  121. total.value = UnapprovalListtable.data.total
  122. setTimeout(() => {
  123. const inputElement = document.getElementById('searchInput');
  124. if (inputElement) {
  125. inputElement.focus();
  126. }
  127. }, 100); // 延迟100毫秒
  128. } catch (error) {
  129. console.error(error)
  130. }
  131. }
  132. getUnapprovalList();
  133. // =========== 获取左侧树侧形结构 ===========
  134. // const treeData = ref({})
  135. // const _department_code = ref(null)
  136. // const getDepartmentdata = async () => {
  137. // try {
  138. // const data =
  139. // [{
  140. // label : '客户编号',
  141. // children : [
  142. // {label : 'DC-1'},
  143. // {label : 'DC-2'},
  144. // {label : 'DC-3'},
  145. // {label : 'DC-4'},
  146. // {label : 'DC-5'},
  147. // {label : 'DC-6'},
  148. // {label : 'DC-7'},
  149. // {label : 'DC-8'},
  150. // {label : 'DC-9'},
  151. // {label : 'DC-10'},
  152. // {label : 'DC-11'},
  153. // {label : 'DC-12'},
  154. // {label : 'DC-13'},
  155. // {label : 'DC-14'},
  156. // {label : 'DC-15'}
  157. // ]
  158. // }];
  159. // treeData.value = data
  160. // } catch (error) {
  161. // console.error(error)
  162. // }
  163. // }
  164. // getDepartmentdata();
  165. //全局调用左侧菜单编号
  166. const _code = ref(null);
  167. //全局调用工单编号
  168. const _Gd_gdbh = ref(null)
  169. //全局调用印件代号
  170. const _Gd_cpdh = ref(null)
  171. const tableData1 = reactive([]);
  172. const tableData2 = reactive([]);
  173. //点击左侧树形 获取右侧table列表
  174. const handleNodeClick = async (node) => {
  175. // 取消所有节点的颜色
  176. const allNodes = document.querySelectorAll('.treecolor .el-tree-node');
  177. allNodes.forEach(node => {
  178. node.querySelector('.el-tree-node__label').style.color = '';
  179. });
  180. // 获取点击的节点
  181. const clickedNodeId = node['$treeNodeId'];
  182. const clickedNode = document.querySelector(`.treecolor .el-tree-node[data-key="${clickedNodeId}"]`);
  183. if (clickedNode) {
  184. // 给当前点击的节点改变颜色
  185. clickedNode.querySelector('.el-tree-node__label').style.color = 'red';
  186. }
  187. searchInfo.value = ''; // 清空搜索信息
  188. if(node.label === '客户编号'){
  189. console.log(node.label)
  190. }else{
  191. console.log(node.label)
  192. const workOrderDetaildata2 = [
  193. {
  194. '序号':'1',
  195. '订单子编号':'XXX001-船',
  196. '颜色名称':'黑色',
  197. '生产款号':'2403-1622款',
  198. '客户':'DC-7',
  199. '船样':'否',
  200. 'S':'/',
  201. 'M':'2',
  202. 'L':'/',
  203. 'XL':'2',
  204. 'XXL':'/',
  205. '制单总数':'4',
  206. '建档用户':'xxx',
  207. '建档日期':'',
  208. '更新时间':'',
  209. '核批人':'/',
  210. '核批日期':'/',
  211. },
  212. ];
  213. // console.log(workOrderDetaildata1)
  214. // console.log(workOrderDetaildata2)
  215. tableData2.splice(0,tableData2.length,...workOrderDetaildata2);
  216. }
  217. };
  218. // =========== 表格 ===========
  219. //单机样衣待核批列表
  220. const yydp_clickybupdate = async (row) => {
  221. };
  222. //双击样衣待核批列表
  223. const yydp_updateCompanyFunc = async (row) => {
  224. };
  225. //单机样衣已核批列表
  226. const yyyp_clickybupdate = async (row) => {
  227. };
  228. //双击样衣已核批列表
  229. const yyyp_updateCompanyFunc = async (row) => {
  230. };
  231. // =========== 按钮 ===========
  232. // 搜索默认为空
  233. const searchInfo = ref('')
  234. const table_Selection = ref(false)
  235. //查询按钮
  236. const onSubmit = async () => {
  237. // if(searchInfo.value === ''){
  238. // ElMessage({type: 'warning',message: '请输入搜索的订单编号' })
  239. // return false;
  240. // }else{
  241. const UnapprovalListtable = await UnapprovalList({search:searchInfo.value});
  242. tableData1.splice(0,tableData1.length,...UnapprovalListtable.data);
  243. // }
  244. };
  245. //表格复选框
  246. const _Uniqid = ref('');
  247. const _Sys_id = ref('');
  248. const handleSelectionChange = (selection, type) => {
  249. console.log(selection);
  250. if(selection.length >= 1){
  251. table_Selection.value = true
  252. // 提取 Uniqid
  253. const Uniqid_ids = selection.map(item => item.Uniqid).join(',');
  254. _Uniqid.value = Uniqid_ids;
  255. // 提取 Sys_id
  256. const Sys_ids = selection.map(item => item.Sys_id).join(',');
  257. _Sys_id.value = Sys_ids;
  258. }else{
  259. table_Selection.value = false
  260. }
  261. };
  262. //核批通过按钮
  263. const hptg_onClick = async () => {
  264. console.log(_Uniqid.value)
  265. console.log(_Sys_id.value)
  266. const Approvals = await Approval({Uniqid:_Uniqid.value,sys_id:_Sys_id.value});
  267. if (Approvals.code === 0) {
  268. searchInfo.value = ''
  269. ElMessage({type: 'success',message: '核批成功'})
  270. const UnapprovalListtable = await UnapprovalList({search:searchInfo.value});
  271. const workOrderDetaildata1 = UnapprovalListtable.data
  272. tableData1.splice(0,tableData1.length,...workOrderDetaildata1);
  273. } else {
  274. ElMessage({ type: 'error',message: '核批失败'})
  275. }
  276. };
  277. // 分页相关的响应式变量
  278. const page = ref(1)
  279. const total = ref(0)
  280. const pageSize = ref(10)
  281. // 分页
  282. const handleCurrentChange = (val) => {
  283. page.value = val;
  284. _getStaffList();
  285. };
  286. // 修改页面容量 点击多少条/页
  287. const handleSizeChange = (val) => {
  288. page.value = 10;//默认显示
  289. pageSize.value = val;
  290. _getStaffList();
  291. };
  292. // 弹窗控制标记
  293. const dialogFormVisible = ref(false)
  294. //修改
  295. const formDataTest = ref({})
  296. </script>
  297. <style scoped>
  298. /* 选中某行时的背景色 */
  299. :deep(.el-table__body tr.current-row) > td {
  300. background: #ff80ff !important;
  301. }
  302. .form-container {
  303. display: flex;
  304. flex-wrap: wrap;
  305. }
  306. .form-column {
  307. /*flex: 1;*/
  308. margin-right: 15px; /* 调整列之间的间距 */
  309. }
  310. /* 左侧输入框宽度调整 */
  311. .form-column .el-form-item .el-input {
  312. width: 150px; /* 调整左侧输入框的宽度 */
  313. }
  314. :deep(.hui-plan-usage-lows div) {
  315. color: #8c939d !important;
  316. }
  317. :deep(.lan-plan-usage-lows div) {
  318. color: blue !important;
  319. font-weight: bold;
  320. }
  321. /* 媒体查询,根据需要调整断点 */
  322. @media screen and (max-width: 768px) {
  323. .form-column {
  324. flex: 1 0 100%; /* 在小屏幕下变成单列布局 */
  325. margin-right: 0;
  326. }
  327. }
  328. .JKWTree-container {
  329. display: flex;
  330. }
  331. .JKWTree-tree {
  332. /*width: 300px;*/
  333. background-color: #fff;
  334. padding: 10px;
  335. margin-right: 20px;
  336. }
  337. .JKWTree-tree h3 {
  338. font-size: 15px;
  339. font-weight: 700;
  340. margin: 10px 0;
  341. }
  342. .JKWTree-content {
  343. flex: 1;
  344. }
  345. /* 图片上传 */
  346. .upload-box {
  347. width: 200px;
  348. height: 200px;
  349. border: 2px dashed #e2e2e2;
  350. display: flex;
  351. justify-content: center;
  352. align-items: center;
  353. position: relative;
  354. cursor: pointer;
  355. }
  356. .uploaded-image {
  357. width: 100%;
  358. height: 100%;
  359. object-fit: cover;
  360. }
  361. .upload-icon {
  362. font-size: 40px;
  363. color: #c0c4cc;
  364. }
  365. .file-input {
  366. display: none;
  367. }
  368. .el-table .warning-row {
  369. background: oldlace;
  370. }
  371. /* 选中某行时的背景色 */
  372. :deep(.el-table__body tr.current-row) > td {
  373. background: #ff80ff !important;
  374. }
  375. </style>
  376. <style scoped>
  377. :deep(.el-table td .cell) {
  378. line-height: 20px !important;
  379. }
  380. :deep(.el-tabs__header){
  381. margin-bottom: 0;
  382. }
  383. .search{
  384. margin-left: 0px !important;
  385. margin-right: 10px !important;
  386. }
  387. .bt{
  388. margin-left: 2px !important;
  389. padding: 3px !important;
  390. font-size: 12px;
  391. }
  392. .el-tabs__header{
  393. margin: 0px !important;
  394. }
  395. .gva-table-box{
  396. padding: 0px !important;
  397. }
  398. .mab{
  399. margin-bottom: 5px;
  400. }
  401. </style>