yangyipihe.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <div style="margin: 0px;">
  3. <layout>
  4. <layout-header>
  5. <el-form>
  6. <el-form-item>
  7. <el-input v-model="searchInfo" placeholder="模糊搜索订单编号或者生产款号" @keyup.enter="onSubmit()" style="width: 220px;"></el-input>
  8. <el-button type="primary" icon="search" @click="onSubmit" >查询</el-button>
  9. <el-button type="primary" icon="edit" @click="hptg_onClick" :disabled="table_Selection === false" class="bt" title="核批通过">核批通过</el-button>
  10. <el-button type="primary" icon="edit" @click="ztgg_onClick" :disabled="table_Selection === false" class="bt" title="状态更改">状态更改</el-button>
  11. </el-form-item>
  12. <el-tag type="danger" style="font-size: 14px;">
  13. <span>附件状态带有 “ </span>
  14. <span style="font-size: 16px;"> * </span>
  15. <span>” 的代表新订单未上传附件</span>
  16. </el-tag>
  17. </el-form>
  18. </layout-header>
  19. <layout>
  20. <layout-content >
  21. <div class="gva-table-box">
  22. <el-tabs v-model="activeName">
  23. <el-tab-pane label="订单资料列表" 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. highlight-current-row="true"
  28. :show-overflow-tooltip="true"
  29. style="width: 100%;height: 65vh" border :data="tableData1" row-key="ID" @selection-change="handleSelectionChange">
  30. <el-table-column align="center" type="selection" width="40"/>
  31. <el-table-column align="center" label="技术附件状态" prop="status" width="110" />
  32. <el-table-column align="center" label="订单附件状态" prop="orderstatus" width="110" />
  33. <el-table-column align="left" label="客户" prop="客户编号" width="70" />
  34. <el-table-column align="left" label="订单编号" prop="订单编号" width="115" />
  35. <el-table-column align="left" label="生产款号" prop="生产款号" width="150" />
  36. <el-table-column align="left" label="款式" prop="款式" width="110" />
  37. <el-table-column align="center" label="状态" prop="gd_statu" width="130" >
  38. <template #default="{ row }">
  39. <el-tag :type="row.gd_statu === '1-计划中' ? 'warning' :
  40. (row.gd_statu === '已裁剪' ? 'primary' :
  41. (row.gd_statu === '已车缝' ? '' :
  42. (row.gd_statu === '2-生产中' ? 'success' :
  43. (row.gd_statu.includes('总检已') ?
  44. (parseInt(row.gd_statu.match(/\d+/))?.[0] >= 95 ? 'success' : 'info') :
  45. (row.gd_statu === '已完工' ? 'success' : 'info')))))">
  46. {{ row.gd_statu === '1-计划中' ? '计划中' :
  47. (row.gd_statu === '已裁剪' ? '已裁剪' :
  48. (row.gd_statu === '已车缝' ? '已车缝' :
  49. (row.gd_statu === '2-生产中' ? '生产中' :
  50. (row.gd_statu.includes('总检已') ?
  51. (parseInt(row.gd_statu.match(/\d+/))?.[0] >= 95 ? '已完工' : row.gd_statu.replace('总检已', '总检')) :
  52. row.gd_statu)))) }}
  53. </el-tag>
  54. </template>
  55. </el-table-column>
  56. <el-table-column align="left" label="订单数量" prop="订单数量" width="90" />
  57. <el-table-column align="left" label="包装完工数量" prop="工单完工数量" width="110" />
  58. <el-table-column align="left" label="单位" prop="单位" width="55" />
  59. <el-table-column align="left" label="面料" prop="面料" width="360" />
  60. <el-table-column align="left" label="粘衬" prop="粘衬" width="360" />
  61. <el-table-column align="left" label="要求" prop="要求" width="360" />
  62. <el-table-column align="left" label="船样合计" prop="船样合计" width="90" />
  63. <el-table-column align="left" label="船样描述" prop="船样描述" width="200" />
  64. <el-table-column align="left" label="箱唛要求" prop="箱唛要求" width="360" />
  65. <el-table-column align="left" label="制单人" prop="Sys_id" width="160" />
  66. <el-table-column align="left" label="制单日期" prop="Sys_rq" width="160" />
  67. <el-table-column align="left" label="出库日期" prop="出库日期" width="160" />
  68. <el-table-column align="left" label="落货日期" prop="落货日期" width="100" />
  69. <el-table-column align="left" label="审核" prop="审核" width="100" />
  70. <el-table-column align="left" label="审核日期" prop="审核日期" width="160" />
  71. </el-table>
  72. </el-tab-pane>
  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="状态更改">
  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 @click="dialogVisible = false">取消</el-button>
  99. <el-button type="primary" @click="handleStatusConfirm">确认</el-button>
  100. </template>
  101. </el-dialog>
  102. </layout-content>
  103. </layout>
  104. </layout>
  105. </div>
  106. </template>
  107. <script setup>
  108. // 全量引入格式化工具 请按需保留
  109. import { Layout, LayoutContent } from '@arco-design/web-vue';
  110. import {ref, reactive} from 'vue'
  111. import {UnapprovalList, Approval, Apigdstatus} from '@/api/mes/job'
  112. import {ElMessage} from "element-plus";
  113. import { useUserStore } from '@/pinia/modules/user';
  114. defineOptions({name: 'Company'})
  115. //获取登录用户信息
  116. const userStore = useUserStore()
  117. // 分页相关的响应式变量
  118. const page = ref(1)
  119. const total = ref(0)
  120. const pageSize = ref(50)
  121. const activeName = ref('first')
  122. // 分页
  123. const handleCurrentChange = (val) => {
  124. page.value = val;
  125. onSubmit();
  126. };
  127. // 修改页面容量 点击多少条/页
  128. const handleSizeChange = (val) => {
  129. pageSize.value = val;
  130. onSubmit();
  131. };
  132. const getUnapprovalList = async () => {
  133. try {
  134. const UnapprovalListtable = await UnapprovalList({search:'', page:page.value, limit:pageSize.value});
  135. const workOrderDetaildata1 = UnapprovalListtable.data.table;
  136. tableData1.splice(0, tableData1.length, ...workOrderDetaildata1);
  137. total.value = UnapprovalListtable.data.total;
  138. } catch (error) {
  139. console.error('获取数据失败:', error);
  140. ElMessage.error('获取数据失败');
  141. }
  142. }
  143. getUnapprovalList();
  144. const tableData1 = reactive([]);
  145. // =========== 按钮 ===========
  146. // 搜索默认为空
  147. const searchInfo = ref('')
  148. const table_Selection = ref(false)
  149. //查询按钮
  150. const onSubmit = async () => {
  151. try {
  152. const UnapprovalListtable = await UnapprovalList({search:searchInfo.value, page:page.value, limit:pageSize.value});
  153. tableData1.splice(0, tableData1.length, ...UnapprovalListtable.data.table);
  154. total.value = UnapprovalListtable.data.total;
  155. } catch (error) {
  156. console.error('搜索失败:', error);
  157. ElMessage.error('搜索失败');
  158. }
  159. };
  160. //表格复选框
  161. const _Uniqid = ref('');
  162. const multipleTable = ref(null);
  163. const handleSelectionChange = (selection) => {
  164. if(selection.length >= 1) {
  165. table_Selection.value = true;
  166. // 提取 Uniqid
  167. const Uniqid_ids = selection.map(item => item.Uniqid).join(',');
  168. _Uniqid.value = Uniqid_ids;
  169. } else {
  170. table_Selection.value = false;
  171. }
  172. };
  173. //核批通过按钮
  174. const hptg_onClick = async () => {
  175. try {
  176. const Approvals = await Approval({Uniqid:_Uniqid.value, sys_id:userStore.userInfo.nickName});
  177. if (Approvals.code === 0) {
  178. searchInfo.value = '';
  179. _Uniqid.value = '';
  180. ElMessage({type: 'success', message: '核批成功'});
  181. if (multipleTable.value) {
  182. multipleTable.value.clearSelection();
  183. }
  184. await onSubmit();
  185. } else {
  186. ElMessage({type: 'error', message: '核批失败'});
  187. }
  188. } catch (error) {
  189. console.error('核批失败:', error);
  190. ElMessage.error('核批失败');
  191. }
  192. };
  193. // 状态更改弹窗
  194. const dialogVisible = ref(false);
  195. const selectedStatus = ref('');
  196. const statusOptions = [
  197. { value: '计划中', label: '计划中' },
  198. { value: '生产中', label: '生产中' },
  199. { value: '已裁剪', label: '已裁剪' },
  200. { value: '已车缝', label: '已车缝' },
  201. { value: '已完工', label: '已完工' }
  202. ];
  203. const handleStatusConfirm = async () => {
  204. if (!selectedStatus.value) {
  205. ElMessage.warning('请选择状态');
  206. return;
  207. }
  208. try {
  209. const res = await Apigdstatus({ Uniqid: _Uniqid.value, gd_statu: selectedStatus.value });
  210. if (res.code === 0) {
  211. ElMessage.success(`已更改为:${selectedStatus.value}`);
  212. dialogVisible.value = false;
  213. await onSubmit();
  214. } else {
  215. ElMessage.error('更改失败');
  216. }
  217. } catch (error) {
  218. console.error('状态更改失败:', error);
  219. ElMessage.error('更改失败');
  220. }
  221. };
  222. //状态更改按钮
  223. const ztgg_onClick = () => {
  224. dialogVisible.value = true;
  225. }
  226. </script>
  227. <style scoped>
  228. :deep(.el-table__body tr.current-row) > td {
  229. background: #ff80ff !important;
  230. }
  231. </style>
  232. <style scoped>
  233. :deep(.el-table td .cell) {
  234. line-height: 20px !important;
  235. }
  236. :deep(.el-tabs__header){
  237. margin-bottom: 0;
  238. margin: 0px !important;
  239. }
  240. .bt{
  241. margin-left: 2px !important;
  242. padding: 3px !important;
  243. font-size: 12px;
  244. }
  245. .gva-table-box{
  246. padding: 0px !important;
  247. }
  248. </style>