yangyipihe.vue 15 KB

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