fabricsummary.vue 8.6 KB

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