yangyipihe.vue 13 KB

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