chukubaogong.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <div>
  3. <layout>
  4. <layout-header>
  5. <div class="">
  6. <h1 style="margin: 0%;margin-bottom: 10px;">出库报工</h1>
  7. <el-input v-model="add_searchInfo" placeholder="扫描订单二维码获取订单信息"
  8. @keyup.enter="add_onSubmit"
  9. id="searchInput"
  10. style="width: 270px;margin: 5px;height: 50px;">
  11. </el-input>
  12. <el-button type="primary" icon="search" @click="add_onSubmit" style="margin: 5px;height: 50px;">查询</el-button>
  13. <!-- <el-date-picker v-model="add_riqiformData['日期']" type="date" style="width: 150px;height: 40px;"/> -->
  14. <el-button type="primary" @click="add_Dialog" style="margin: 5px;height: 50px;">确认出库</el-button>
  15. </div>
  16. </layout-header>
  17. <layout>
  18. <layout-content >
  19. <el-main>
  20. <div class="gva-table-box">
  21. <el-table ref="multipleTable" style="width: 100%;height: 65vh" tooltip-effect="dark"
  22. :row-style="{ height: '20px' }" :header-cell-style="{ padding: '0px' }"
  23. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  24. :data="add_tableData" border row-key="ID"
  25. size="small"
  26. highlight-current-row="true" @row-dblclick="add_updateCompanyFunc"
  27. @row-click="add_tableRowClick" :show-overflow-tooltip="true"
  28. @selection-change="handleSelectionChange">
  29. <el-table-column type="selection" width="80" />
  30. <el-table-column sortable align="left" label="订单编号" prop="订单编号" width="300" />
  31. <el-table-column sortable align="left" label="订单子编号" prop="子订单编号" width="300"/>
  32. <el-table-column sortable align="left" label="生产款号" prop="生产款号" width="300" />
  33. <el-table-column sortable align="left" label="款式" prop="款式" width="300" />
  34. <el-table-column sortable align="left" label="颜色" prop="颜色" width="300" />
  35. <!-- <el-table-column sortable align="left" label="工序" prop="工序" width="150" />
  36. <el-table-column sortable align="left" label="面料出库人" prop="面料出库人" width="150" />
  37. <el-table-column sortable align="left" label="日期" prop="日期" width="160" /> -->
  38. </el-table>
  39. </div>
  40. </el-main>
  41. </layout-content>
  42. </layout>
  43. </layout>
  44. </div>
  45. </template>
  46. <script setup>
  47. // 全量引入格式化工具 请按需保留
  48. import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
  49. import {ref, reactive} from 'vue'
  50. import {getSpotList,getSpotTab} from '@/api/mes/job'
  51. import {ElMessage} from "element-plus";
  52. defineOptions({name: 'Company'})
  53. //全局调用获取当前日期
  54. const today = new Date();
  55. const year = today.getFullYear();
  56. const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,需要补零
  57. const day = String(today.getDate()).padStart(2, '0');
  58. const hours = String(today.getHours()).padStart(2, '0');
  59. const minutes = String(today.getMinutes()).padStart(2, '0');
  60. const seconds = String(today.getSeconds()).padStart(2, '0');
  61. const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  62. const currentDates = `${year}-${month}-${day}`;
  63. const add_searchInfo = ref('')
  64. const add_tableData = reactive([])
  65. //点击【查询】按钮
  66. const add_onSubmit = async ()=>{
  67. if(add_searchInfo.value === '' || add_searchInfo.value === undefined){
  68. const WorkListdata = [];
  69. add_tableData.splice(0,add_tableData.length,...WorkListdata);
  70. ElMessage({type: 'warning',message: '搜索内容不能为空' })
  71. }else{
  72. const order =add_searchInfo.value;
  73. const getSpotLists = await getSpotList({order:order,code:'出库'});
  74. console.log(getSpotLists)
  75. add_tableData.splice(0,add_tableData.length,...getSpotLists.data.data);//表格数据
  76. // add_searchInfo.value = '';
  77. setTimeout(() => {
  78. const inputElement = document.querySelector('#searchInput');
  79. if (inputElement) {
  80. inputElement.focus();
  81. }
  82. }, 100); // 延迟100毫秒
  83. }
  84. };
  85. //复选框选择
  86. const ckSelection = ref('')
  87. const handleSelectionChange = (selection, type) => {
  88. const ids = selection.map(item => {
  89. return item.子订单编号
  90. })
  91. ckSelection.value = ids.join(',')
  92. console.log(ckSelection.value)
  93. }
  94. //确认出库按钮
  95. const add_Dialog = async ()=>{
  96. if(ckSelection.value === ''){
  97. ElMessage({type: 'warning',message: '请勾选具体的出库订单后,再操作此功能'})
  98. }else{
  99. //复选框中子订单编号去重
  100. let params = {}
  101. params.order_id = ckSelection.value;
  102. params.code_ck_rq = currentDates;
  103. console.log(params)
  104. const ck_gettab = await getSpotTab(params);
  105. if (ck_gettab.code === 0) {
  106. ElMessage({type: 'success',message: '出库成功'});
  107. // const getSpotToLists = await getSpotToList();
  108. // add_tableData.splice(0,add_tableData.length,...getSpotToLists.data.data);//表格数据
  109. add_searchInfo.value = ''
  110. } else {
  111. ElMessage({ type: 'error',message: '出库失败'})
  112. }
  113. }
  114. }
  115. // =========== 分页 ===========
  116. // 分页相关的响应式变量
  117. const page = ref(1)
  118. const total = ref(0)
  119. const pageSize = ref(10)
  120. // 分页
  121. const handleCurrentChange = (val) => {
  122. page.value = val;
  123. _getStaffList();
  124. };
  125. // 修改页面容量 点击多少条/页
  126. const handleSizeChange = (val) => {
  127. page.value = 10;//默认显示
  128. pageSize.value = val;
  129. _getStaffList();
  130. };
  131. </script>
  132. <style scoped>
  133. .form-container {
  134. display: flex;
  135. flex-wrap: wrap;
  136. }
  137. .form-column {
  138. /*flex: 1;*/
  139. margin-right: 15px; /* 调整列之间的间距 */
  140. }
  141. /* 左侧输入框宽度调整 */
  142. .form-column .el-form-item .el-input {
  143. width: 150px; /* 调整左侧输入框的宽度 */
  144. }
  145. /* 媒体查询,根据需要调整断点 */
  146. @media screen and (max-width: 768px) {
  147. .form-column {
  148. flex: 1 0 100%; /* 在小屏幕下变成单列布局 */
  149. margin-right: 0;
  150. }
  151. }
  152. /*:deep(.el-table td .cell) {*/
  153. /* line-height: 30px !important;*/
  154. /*}*/
  155. .JKWTree-container {
  156. display: flex;
  157. }
  158. .JKWTree-tree {
  159. /*width: 300px;*/
  160. background-color: #fff;
  161. padding: 10px;
  162. margin-right: 20px;
  163. }
  164. .JKWTree-tree h3 {
  165. font-size: 15px;
  166. font-weight: 700;
  167. margin: 10px 0;
  168. }
  169. .JKWTree-content {
  170. flex: 1;
  171. }
  172. /* 图片上传 */
  173. .upload-box {
  174. width: 200px;
  175. height: 200px;
  176. border: 2px dashed #e2e2e2;
  177. display: flex;
  178. justify-content: center;
  179. align-items: center;
  180. position: relative;
  181. cursor: pointer;
  182. }
  183. .uploaded-image {
  184. width: 100%;
  185. height: 100%;
  186. object-fit: cover;
  187. }
  188. .upload-icon {
  189. font-size: 40px;
  190. color: #c0c4cc;
  191. }
  192. .file-input {
  193. display: none;
  194. }
  195. .el-table .warning-row {
  196. background: oldlace;
  197. }
  198. /* 表格复选框大小调整 */
  199. :deep(.el-checkbox.el-checkbox--small .el-checkbox__inner) {
  200. width: 45px; /* 复选框宽度 */
  201. height: 23px; /* 复选框高度 */
  202. }
  203. :deep(.el-checkbox.el-checkbox--small.is-checked .el-checkbox__inner::after) {
  204. transform: scale(1.2) rotate(45deg); /* 调整选中后的对勾大小 */
  205. top: 5%; /* 调整对勾位置 */
  206. left: 40%; /* 调整对勾位置 */
  207. width: 5px; /* 调整对勾宽度 */
  208. height: 9px; /* 调整对勾高度 */
  209. }
  210. /* 选中某行时的背景色 */
  211. :deep(.el-table__body tr.current-row) > td {
  212. background: #ff80ff !important;
  213. }
  214. </style>
  215. <style scoped>
  216. :deep(.el-table td .cell) {
  217. line-height: 20px !important;
  218. }
  219. :deep(.el-tabs__header){
  220. margin-bottom: 0;
  221. }
  222. .search{
  223. margin-left: 0px !important;
  224. margin-right: 10px !important;
  225. }
  226. .bt{
  227. margin-left: 2px !important;
  228. padding: 3px !important;
  229. font-size: 12px;
  230. }
  231. .el-tabs__header{
  232. margin: 0px !important;
  233. }
  234. .gva-table-box{
  235. padding: 0px !important;
  236. }
  237. .mab{
  238. margin-bottom: 5px;
  239. }
  240. </style>