pickinglist.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. <template>
  2. <div>
  3. <layout>
  4. <layout-header>
  5. <!-- <div class="">
  6. <el-input v-model="add_searchInfo" placeholder="请输入入库或出库单号模糊查询" @input="handleInput"
  7. @keyup.enter="add_onSubmit" id="searchInput" style="width: 340px;height: 50px;margin-left: 10px;">
  8. </el-input>
  9. <el-button type="primary" @click="Reporting_onSubmit" icon="view" style="height: 50px;font-size: 20px;">查看记录</el-button>
  10. <el-button type="primary" icon="reading" @click="details_onSubmit" style="height: 50px;font-size: 20px;">出库退还记录</el-button>
  11. </div> -->
  12. </layout-header>
  13. <layout>
  14. <!-- 左侧树形结构 -->
  15. <layout-sider :resize-directions="['right']" :width="190" style="margin: 0px;">
  16. <div class="JKWTree-tree" style="height: 200px">
  17. <h3>领用单记录</h3>
  18. <el-tree :data="treeData" class="treecolor" @node-click="handleNodeClick"></el-tree>
  19. </div>
  20. </layout-sider>
  21. <layout-content >
  22. <el-main>
  23. <div class="gva-table-box">
  24. <el-table ref="multipleTable" style="width: 100%;height: 36vh" tooltip-effect="dark"
  25. :row-style="{ height: '20px' }"
  26. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  27. :header-cell-style="{ padding: '0px' }"
  28. :data="restableData" border row-key="ID" size="small"
  29. :cell-class-name="tableDataCellClass"
  30. highlight-current-row="true" @row-dblclick="updateCompanyFunc"
  31. @row-click="tableRowClick" :show-overflow-tooltip="true"
  32. @selection-change="handleSelectionChange">
  33. <!-- <el-table-column type="selection" width="80" /> -->
  34. <el-table-column align="left" label="订单编号" prop="订单编号" width="160" />
  35. <el-table-column align="left" label="出库单" prop="出库单" width="160"/>
  36. <el-table-column align="left" label="款号" prop="款号" width="100"/>
  37. <el-table-column align="left" label="物料名称" prop="物料名称" width="160"/>
  38. <el-table-column align="left" label="领料人员" prop="领料人员" width="160"/>
  39. <el-table-column align="left" label="操作机台" prop="操作机台" width="160"/>
  40. <el-table-column align="left" label="日期" prop="日期:" width="160"/>
  41. </el-table>
  42. </div>
  43. <el-tabs v-model="activeName" @tab-click="handleClick">
  44. <el-tab-pane label="出库单详情" @click="showTable('出库单详情')" name="first">
  45. <el-table ref="multipleTable"
  46. :row-style="{ height: '20px' }"
  47. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  48. :header-cell-style="{ padding: '0px' }"
  49. :show-overflow-tooltip="true"
  50. highlight-current-row="true"
  51. @row-click="listtableclick"
  52. @row-dblclick="ysupdateCompanyFunc"
  53. @selection-change="selectionChange($event, '出库单详情')"
  54. style="width: 100%;height: 40vh" border show-summary
  55. :summary-method="getSummaries" tooltip-effect="dark" :data="listtableData" row-key="ID" >
  56. <!-- <el-table-column type="selection" width="30" /> -->
  57. <el-table-column align="left" label="订单编号" prop="订单编号" width="160" />
  58. <el-table-column align="left" label="款号" prop="款号" width="100"/>
  59. <el-table-column align="left" label="出库单" prop="出库单" width="160"/>
  60. <el-table-column align="left" label="物料名称" prop="物料名称" width="160"/>
  61. <el-table-column align="left" label="数量" prop="数量" width="160"/>
  62. <el-table-column align="left" label="领料人员" prop="领料人员" width="160"/>
  63. <el-table-column align="left" label="操作机台" prop="操作机台" width="160"/>
  64. <el-table-column align="left" label="日期" prop="日期:" width="160"/>
  65. </el-table>
  66. </el-tab-pane>
  67. </el-tabs>
  68. </el-main>
  69. </layout-content>
  70. </layout>
  71. </layout>
  72. </div>
  73. </template>
  74. <script>
  75. //点击按钮显示下方表格
  76. export default {
  77. data() {
  78. return {
  79. currentTable: '', // 当前展示的表格
  80. activeName: 'first',
  81. _ddhval:'',
  82. add_gddialogFormVisible: true,
  83. };
  84. },
  85. methods: {
  86. }
  87. };
  88. </script>
  89. <script setup>
  90. // 全量引入格式化工具 请按需保留
  91. import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
  92. import {ref, reactive} from 'vue'
  93. import {getSpotList,getSpotTab,orderSearch,outReport,orderBomList,FabricDetail,getReceiptTab,
  94. ReceiptList,
  95. ReceiptDetail
  96. } from '@/api/mes/job'
  97. import {ElMessage} from "element-plus";
  98. // import { get } from 'scriptjs';
  99. defineOptions({name: 'Company'})
  100. import { useUserStore } from '@/pinia/modules/user'
  101. //获取用户登录信息
  102. const userStore = useUserStore()
  103. const _username = ref('')
  104. _username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
  105. console.log('获取用户名称',_username.value)
  106. //全局调用获取当前日期
  107. const today = new Date();
  108. const year = today.getFullYear();
  109. const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,需要补零
  110. const day = String(today.getDate()).padStart(2, '0');
  111. const hours = String(today.getHours()).padStart(2, '0');
  112. const minutes = String(today.getMinutes()).padStart(2, '0');
  113. const seconds = String(today.getSeconds()).padStart(2, '0');
  114. const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  115. const currentDates = `${year}-${month}-${day}`;
  116. //自动聚焦光标input
  117. const getMachineMacdata = async () => {
  118. setTimeout(() => {
  119. const inputElement = document.getElementById('searchInput');
  120. if (inputElement) {
  121. inputElement.focus();
  122. }
  123. }, 100); // 延迟100毫秒
  124. }
  125. getMachineMacdata();
  126. // =========== 左侧树侧形结构 ===========
  127. const treeData = ref([]);
  128. const defaultProps = {
  129. children: 'children',
  130. label: 'label'
  131. };
  132. const getReceiptTabs = async () => {
  133. try {
  134. // 调用接口获取数据
  135. const response = await getReceiptTab();
  136. console.log(response); // 查看接口返回的数据
  137. // 将接口返回的数据格式化为树形结构
  138. const formattedData = response.data.map(item => ({
  139. label: item.month, // 显示月份
  140. children: [] // 如果需要,可以添加子节点,或者根据需求添加
  141. }));
  142. // 将格式化后的数据赋值给treeData
  143. treeData.value = formattedData;
  144. } catch (error) {
  145. console.error(error);
  146. }
  147. };
  148. getReceiptTabs();
  149. const restableData = reactive([])
  150. //点击左侧树形获取编号
  151. const handleNodeClick = async (node) => {
  152. restableData.splice(0, restableData.length);//清空表格
  153. // 获取点击的节点的月份
  154. const month = node.label;
  155. const response = await ReceiptList({mouth:month});
  156. console.log(response)
  157. restableData.splice(0,response.length,...response.data);
  158. }
  159. const listtableData = reactive([])
  160. //表格行点击
  161. const tableRowClick = async (row)=>{
  162. console.log(row['出库单'])
  163. const response = await ReceiptDetail({receipt:row['出库单']});
  164. console.log(response)
  165. listtableData.splice(0,response.length,...response.data);
  166. }
  167. const getSummaries = (param) => {
  168. const { columns, data } = param;
  169. const sums = {};
  170. //选择你希望合计的列
  171. const summableLabels = ["数量"];
  172. columns.forEach((column, index) => {
  173. if (index === 0) {
  174. sums[index] = '总数量合计';
  175. return;
  176. }
  177. if (summableLabels.includes(column.label)) {
  178. const values = data.map(item => Number(item[column.property]));
  179. if (!values.every(value => isNaN(value))) {
  180. sums[index] = values.reduce((prev, curr) => {
  181. const value = Number(curr);
  182. if (!isNaN(value)) {
  183. return prev + value;
  184. }
  185. return prev;
  186. }, 0);
  187. } else {
  188. sums[index] = 'N/A';
  189. }
  190. }
  191. });
  192. return sums;
  193. };
  194. // =========== 分页 ===========
  195. // 分页相关的响应式变量
  196. const page = ref(1)
  197. const total = ref(0)
  198. const pageSize = ref(10)
  199. // 分页
  200. const handleCurrentChange = (val) => {
  201. page.value = val;
  202. _getStaffList();
  203. };
  204. // 修改页面容量 点击多少条/页
  205. const handleSizeChange = (val) => {
  206. page.value = 10;//默认显示
  207. pageSize.value = val;
  208. _getStaffList();
  209. };
  210. </script>
  211. <style scoped>
  212. /* 根据出库状态文字颜色 */
  213. :deep(.status-plan-usage-low div) {
  214. color: #8c939d !important;
  215. }
  216. :deep(.statusy-plan-usage-low div) {
  217. color: blue !important;
  218. }
  219. .form-container {
  220. display: flex;
  221. flex-wrap: wrap;
  222. }
  223. .form-column {
  224. /*flex: 1;*/
  225. margin-right: 15px; /* 调整列之间的间距 */
  226. }
  227. /* 左侧输入框宽度调整 */
  228. .form-column .el-form-item .el-input {
  229. width: 150px; /* 调整左侧输入框的宽度 */
  230. }
  231. /* 媒体查询,根据需要调整断点 */
  232. @media screen and (max-width: 768px) {
  233. .form-column {
  234. flex: 1 0 100%; /* 在小屏幕下变成单列布局 */
  235. margin-right: 0;
  236. }
  237. }
  238. .JKWTree-container {
  239. display: flex;
  240. }
  241. .JKWTree-tree {
  242. /*width: 300px;*/
  243. background-color: #fff;
  244. padding: 10px;
  245. margin-right: 20px;
  246. }
  247. .JKWTree-tree h3 {
  248. font-size: 15px;
  249. font-weight: 700;
  250. margin: 10px 0;
  251. }
  252. .JKWTree-content {
  253. flex: 1;
  254. }
  255. /* 表格复选框大小调整 */
  256. :deep(.el-checkbox.el-checkbox--small .el-checkbox__inner) {
  257. width: 45px; /* 复选框宽度 */
  258. height: 23px; /* 复选框高度 */
  259. }
  260. /*bom参数背景*/
  261. :deep(.el-table__body .background-plan-usage-low div div div) {
  262. background: #80FA80 !important;
  263. }
  264. /* 选中某行时的背景色 */
  265. :deep(.el-table__body tr.current-row) > td {
  266. background: #ff80ff !important;
  267. }
  268. :deep(.el-checkbox.el-checkbox--small.is-checked .el-checkbox__inner::after) {
  269. transform: scale(1.2) rotate(45deg); /* 调整选中后的对勾大小 */
  270. top: 5%; /* 调整对勾位置 */
  271. left: 40%; /* 调整对勾位置 */
  272. width: 5px; /* 调整对勾宽度 */
  273. height: 9px; /* 调整对勾高度 */
  274. }
  275. /* 选中某行时的背景色 */
  276. :deep(.el-table__body tr.current-row) > td {
  277. background: #ff80ff !important;
  278. }
  279. </style>
  280. <style scoped>
  281. :deep(.el-table td .cell) {
  282. line-height: 20px !important;
  283. }
  284. :deep(.el-tabs__header){
  285. margin-bottom: 0;
  286. }
  287. .search{
  288. margin-left: 0px !important;
  289. margin-right: 10px !important;
  290. }
  291. .bt{
  292. margin-left: 2px !important;
  293. padding: 3px !important;
  294. font-size: 12px;
  295. }
  296. .el-tabs__header{
  297. margin: 0px !important;
  298. }
  299. .gva-table-box{
  300. padding: 0px !important;
  301. margin-left: 5px !important;
  302. }
  303. .mab{
  304. margin-bottom: 5px;
  305. }
  306. /* 搜索样式 */
  307. ::v-deep .el-input__wrapper #searchInput {
  308. font-size: 16px;
  309. }
  310. ::v-deep(.el-descriptions__table tbody tr .is-bordered-label){
  311. width: 60px;
  312. }
  313. ::v-deep(.el-descriptions__table tbody tr .el-descriptions__content){
  314. width: 120px;
  315. }
  316. </style>