yangyipihe.vue 14 KB

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