fabricsummary.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <template>
  2. <div>
  3. <layout>
  4. <h1 style="margin: 0%;margin-bottom: 6px;">选择日期查询当月面料库存汇总</h1>
  5. <el-row :gutter="24" style="margin-bottom: 6px;">
  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-date-picker
  10. v-model="mlscgdformData['日期']" id="日期" @input="handleInput"
  11. style="height: 50px;margin-left: 20px;"
  12. type="date"/>
  13. <el-button type="primary" @click="add_onSubmit" style="height: 50px;font-size: 20px;">查询</el-button>
  14. <!-- <el-button type="primary" icon="reading" @click="details_onSubmit" style="height: 50px;font-size: 20px;">出库退还记录</el-button> -->
  15. </el-row>
  16. <layout>
  17. <layout-content >
  18. <div class="gva-table-box">
  19. <el-table ref="multipleTable" style="width: 100%;height: 64vh" tooltip-effect="dark"
  20. :row-style="{ height: '40px' }" :header-cell-style="{ padding: '0px' }"
  21. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  22. :data="restableData" border row-key="ID" size="small"
  23. :cell-class-name="tableDataCellClass"
  24. highlight-current-row="true" @row-dblclick="updateCompanyFunc"
  25. @row-click="tableRowClick" :show-overflow-tooltip="true"
  26. @selection-change="handleSelectionChange">
  27. <!-- <el-table-column type="selection" width="80" /> -->
  28. <el-table-column align="left" label="订单编号" prop="订单编号" width="105" />
  29. <el-table-column align="left" label="客户编号" prop="客户编号" width="80"/>
  30. <el-table-column align="left" label="生产款号" prop="生产款号" width="170"/>
  31. <el-table-column align="left" label="款式" prop="款式" width="170"/>
  32. <el-table-column align="left" label="物料名称" prop="物料名称" width="160"/>
  33. <el-table-column align="left" label="库存总量" prop="库存总量" width="100"/>
  34. <el-table-column align="left" label="面料结余" prop="面料结余" width="100"/>
  35. <el-table-column align="left" label="投料单位" prop="投料单位" width="100"/>
  36. </el-table>
  37. <div class="dialog-footer" style="text-align: left;margin-right: 60px;">
  38. </div>
  39. </div>
  40. </layout-content>
  41. </layout>
  42. </layout>
  43. </div>
  44. </template>
  45. <script>
  46. //点击按钮显示下方表格
  47. export default {
  48. data() {
  49. return {
  50. currentTable: '', // 当前展示的表格
  51. activeName: 'first',
  52. _ddhval:'',
  53. add_gddialogFormVisible: true,
  54. };
  55. },
  56. methods: {
  57. }
  58. };
  59. </script>
  60. <script setup>
  61. // 全量引入格式化工具 请按需保留
  62. import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
  63. import {ref, reactive} from 'vue'
  64. import {getSpotList,getSpotTab,orderSearch,outReport,orderBomList,FabricDetail,fabricList} from '@/api/mes/job'
  65. import {ElMessage} from "element-plus";
  66. // import { get } from 'scriptjs';
  67. defineOptions({name: 'Company'})
  68. import { useUserStore } from '@/pinia/modules/user'
  69. //获取用户登录信息
  70. const userStore = useUserStore()
  71. const _username = ref('')
  72. _username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
  73. console.log('获取用户名称',_username.value)
  74. //全局调用获取当前日期
  75. const today = new Date();
  76. const year = today.getFullYear();
  77. const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,需要补零
  78. const day = String(today.getDate()).padStart(2, '0');
  79. const hours = String(today.getHours()).padStart(2, '0');
  80. const minutes = String(today.getMinutes()).padStart(2, '0');
  81. const seconds = String(today.getSeconds()).padStart(2, '0');
  82. const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  83. const currentDates = `${year}-${month}-${day}`;
  84. const currentDatess = `${year}-${month}`;
  85. const mlscgdformData = reactive({
  86. 日期: '',
  87. });
  88. //自动聚焦光标input
  89. const getMachineMacdata = async () => {
  90. mlscgdformData['日期'] = currentDates
  91. restableData.splice(0, restableData.length);//清空表格
  92. setTimeout(() => {
  93. const inputElement = document.getElementById('searchInput');
  94. if (inputElement) {
  95. inputElement.focus();
  96. }
  97. }, 100); // 延迟100毫秒
  98. }
  99. getMachineMacdata();
  100. const fabricListdada = async () => {
  101. //订单信息数据查询【接口】
  102. const fabricListdata = await fabricList({mouth:currentDates});
  103. console.log(fabricListdata)
  104. restableData.splice(0,fabricListdata.length,...fabricListdata.data);
  105. }
  106. fabricListdada()
  107. //全局调用参数
  108. const add_searchInfo = ref('')//搜索
  109. const restableData = reactive([])//表格
  110. const _orderid = ref('')//订单子编号
  111. const handleInput = async ()=>{
  112. add_onSubmit()
  113. }
  114. //查询按钮
  115. const add_onSubmit = async ()=>{
  116. restableData.splice(0, restableData.length);//清空表格
  117. //日期转换
  118. let lhrq_formattedDeliveryDate = '';
  119. if (mlscgdformData['日期']) {
  120. const date = new Date(mlscgdformData['日期']);
  121. lhrq_formattedDeliveryDate = `${date.getFullYear()}-${('0' + (date.getMonth() + 1)).slice(-2)}-${('0' + date.getDate()).slice(-2)}`;
  122. }
  123. //订单信息数据查询【接口】
  124. const fabricListdata = await fabricList({mouth:lhrq_formattedDeliveryDate});
  125. console.log(fabricListdata)
  126. restableData.splice(0,fabricListdata.length,...fabricListdata.data);
  127. };
  128. //表格行点击
  129. const tableRowClick = async (row)=>{
  130. console.log(row)
  131. }
  132. const resbomtableData = ref([]);
  133. // =========== 分页 ===========
  134. // 分页相关的响应式变量
  135. const page = ref(1)
  136. const total = ref(0)
  137. const pageSize = ref(10)
  138. // 分页
  139. const handleCurrentChange = (val) => {
  140. page.value = val;
  141. _getStaffList();
  142. };
  143. // 修改页面容量 点击多少条/页
  144. const handleSizeChange = (val) => {
  145. page.value = 10;//默认显示
  146. pageSize.value = val;
  147. _getStaffList();
  148. };
  149. </script>
  150. <style scoped>
  151. /* 根据出库状态文字颜色 */
  152. :deep(.status-plan-usage-low div) {
  153. color: #8c939d !important;
  154. }
  155. :deep(.statusy-plan-usage-low div) {
  156. color: blue !important;
  157. }
  158. .form-container {
  159. display: flex;
  160. flex-wrap: wrap;
  161. }
  162. .form-column {
  163. /*flex: 1;*/
  164. margin-right: 15px; /* 调整列之间的间距 */
  165. }
  166. /* 左侧输入框宽度调整 */
  167. .form-column .el-form-item .el-input {
  168. width: 150px; /* 调整左侧输入框的宽度 */
  169. }
  170. /* 媒体查询,根据需要调整断点 */
  171. @media screen and (max-width: 768px) {
  172. .form-column {
  173. flex: 1 0 100%; /* 在小屏幕下变成单列布局 */
  174. margin-right: 0;
  175. }
  176. }
  177. .JKWTree-container {
  178. display: flex;
  179. }
  180. .JKWTree-tree {
  181. /*width: 300px;*/
  182. background-color: #fff;
  183. padding: 10px;
  184. margin-right: 20px;
  185. }
  186. .JKWTree-tree h3 {
  187. font-size: 15px;
  188. font-weight: 700;
  189. margin: 10px 0;
  190. }
  191. .JKWTree-content {
  192. flex: 1;
  193. }
  194. /* 表格复选框大小调整 */
  195. :deep(.el-checkbox.el-checkbox--small .el-checkbox__inner) {
  196. width: 45px; /* 复选框宽度 */
  197. height: 23px; /* 复选框高度 */
  198. }
  199. /*bom参数背景*/
  200. :deep(.el-table__body .background-plan-usage-low div div div) {
  201. background: #80FA80 !important;
  202. }
  203. /* 选中某行时的背景色 */
  204. :deep(.el-table__body tr.current-row) > td {
  205. background: #ff80ff !important;
  206. }
  207. :deep(.el-checkbox.el-checkbox--small.is-checked .el-checkbox__inner::after) {
  208. transform: scale(1.2) rotate(45deg); /* 调整选中后的对勾大小 */
  209. top: 5%; /* 调整对勾位置 */
  210. left: 40%; /* 调整对勾位置 */
  211. width: 5px; /* 调整对勾宽度 */
  212. height: 9px; /* 调整对勾高度 */
  213. }
  214. /* 选中某行时的背景色 */
  215. :deep(.el-table__body tr.current-row) > td {
  216. background: #ff80ff !important;
  217. }
  218. </style>
  219. <style scoped>
  220. :deep(.el-table td .cell) {
  221. line-height: 20px !important;
  222. }
  223. :deep(.el-tabs__header){
  224. margin-bottom: 0;
  225. }
  226. .search{
  227. margin-left: 0px !important;
  228. margin-right: 10px !important;
  229. }
  230. .bt{
  231. margin-left: 2px !important;
  232. padding: 3px !important;
  233. font-size: 12px;
  234. }
  235. .el-tabs__header{
  236. margin: 0px !important;
  237. }
  238. .gva-table-box{
  239. padding: 0px !important;
  240. margin-left: 5px !important;
  241. }
  242. .mab{
  243. margin-bottom: 5px;
  244. }
  245. /* 搜索样式 */
  246. ::v-deep .el-input__wrapper #searchInput {
  247. font-size: 16px;
  248. }
  249. ::v-deep(.el-descriptions__table tbody tr .is-bordered-label){
  250. width: 60px;
  251. }
  252. ::v-deep(.el-descriptions__table tbody tr .el-descriptions__content){
  253. width: 120px;
  254. }
  255. </style>