ruku.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  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-button type="primary" @click="Reporting_onSubmit" 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. </el-row>
  12. <layout>
  13. <layout-content >
  14. <div class="gva-table-box">
  15. <el-table ref="multipleTable" style="width: 100%;height: 64vh" tooltip-effect="dark"
  16. :row-style="{ height: '40px' }" :header-cell-style="{ padding: '0px' }"
  17. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  18. :data="restableData" border row-key="ID" size="small"
  19. :cell-class-name="tableDataCellClass"
  20. highlight-current-row="true" @row-dblclick="updateCompanyFunc"
  21. @row-click="tableRowClick" :show-overflow-tooltip="true"
  22. @selection-change="handleSelectionChange">
  23. <!-- <el-table-column type="selection" width="80" /> -->
  24. <el-table-column align="left" label="订单编号" prop="订单编号" width="105" />
  25. <el-table-column align="left" label="客户编号" prop="客户编号" width="80"/>
  26. <el-table-column align="left" label="生产款号" prop="生产款号" width="170"/>
  27. <el-table-column align="left" label="款式" prop="款式" width="170"/>
  28. <el-table-column align="left" label="接单日期" prop="接单日期" width="160"/>
  29. <el-table-column align="left" label="创建人员" prop="创建人员" width="160"/>
  30. <el-table-column align="left" label="创建时间" prop="创建时间" width="160"/>
  31. </el-table>
  32. <div class="dialog-footer" style="text-align: left;margin-right: 60px;">
  33. </div>
  34. </div>
  35. </layout-content>
  36. </layout>
  37. </layout>
  38. </div>
  39. <el-dialog v-model="res_bomdialogFormVisible" :before-close="res_bomcloseDialog" width="100%" style="height: 100%;margin: 0%;padding: 0px 10px 0px 10px;" destroy-on-close>
  40. <div class="dialog-footer" style="margin: 0px;">
  41. <el-input v-model="add_lysearchInfo" placeholder="请扫描订单编号进行操作"
  42. @keyup.enter="add_lyonSubmit" id="ly_searchInput" style="width: 340px;height: 50px;margin-left: 10px;">
  43. </el-input>
  44. <el-button type="primary" @click="res_bomcloseDialog" style="width: 100px;height: 50px;margin-left: 10px;">关 闭</el-button>
  45. <el-button type="primary" @click="print_lingyong" style="width: 100px;height: 50px;">增加至入库页</el-button>
  46. <!-- <el-button type="primary" @click="del_lingyong" style="width: 100px;height: 50px;">删除面料领用</el-button> -->
  47. </div>
  48. <!-- 上面部分 -->
  49. <el-divider style="margin: 10px 0px 20px;" ><span style="font-size: 18px;color:red;font-weight: bold;margin-left: 20px;">绿色部分填写入库数量</span></el-divider>
  50. <el-descriptions class="margin-top" :column="4" :size="size" border>
  51. <el-descriptions-item label="订单编号" class="ddh">{{ ddhformData['ddh'] }}</el-descriptions-item>
  52. <el-descriptions-item label="客户">{{ ddhformData['kh'] }}</el-descriptions-item>
  53. <el-descriptions-item label="生产款号">{{ ddhformData['sckh'] }}</el-descriptions-item>
  54. <el-descriptions-item label="款式">{{ ddhformData['ks'] }}</el-descriptions-item>
  55. </el-descriptions>
  56. <div>
  57. <el-table ref="paichengRef" :show-overflow-tooltip="true" highlight-current-row="true"
  58. :row-style="{ height: '0px' }" :header-cell-style="{ padding: '0px' }"
  59. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
  60. style="width: 100%;height: 22vh" border tooltip-effect="dark"
  61. :data="resbomtableData" row-key="ID" :cell-class-name="scfjfpxsCellClass">
  62. <template v-for="(item, idx) in resbom_tableColumns">
  63. <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width" >
  64. <div v-if="['领用'].includes(item.prop)">
  65. <el-input v-model="row[item.prop]" :clearable="false" style='height: 30px;'
  66. :id="`input${idx}${$index}`" @keyup="resbom_handleKeyDown($event, idx, $index, item.prop)"/>
  67. </div>
  68. <div v-else>{{ row[item.prop] }}</div>
  69. </el-table-column>
  70. </template>
  71. </el-table>
  72. </div>
  73. <!-- 下面部分 -->
  74. <div class="print-container">
  75. <el-button type="primary" @click="res_bomenterDialog" style="width: 100px;height: 50px;">一键入库</el-button>
  76. <el-divider>
  77. <span class="print-title" style="font-size: 18px;">面料入库页</span>
  78. </el-divider>
  79. <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">
  80. <p style="font-size: 18px;margin-right: 20px;">领用单号:
  81. <el-input v-model="danhao" style="width: 200px;" disabled/>
  82. </p>
  83. <p style="font-size: 18px;margin-right: 20px;">领用日期:
  84. <el-input v-model="riqi" style="width: 200px;" disabled/>
  85. </p>
  86. </div>
  87. <div style="margin-top: 5px;">
  88. <el-table ref="paichengRef1" :show-overflow-tooltip="true" highlight-current-row="true"
  89. :row-style="{ height: '30px' }" :header-cell-style="{ padding: '0px' }"
  90. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '10px' }"
  91. style="width: 100%; height: 40vh" border
  92. tooltip-effect="dark" :data="FabriccollartableData"
  93. row-key="ID" :cell-class-name="scfjfpxsCellClass"
  94. @selection-change="FabriccollarhandleSelectionChange">
  95. <!-- <el-table-column type="selection" width="45" /> -->
  96. <template v-for="(item, idx) in Fabriccollar_tableColumns">
  97. <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width">
  98. <div v-if="[''].includes(item.prop)">
  99. <el-input v-model="row[item.prop]" :clearable="false"
  100. :id="`input${idx}${$index}`"
  101. @keyup="resbom_handleKeyDown($event, idx, $index, item.prop)"/>
  102. </div>
  103. <div v-else>{{ row[item.prop] }}</div>
  104. </el-table-column>
  105. </template>
  106. </el-table>
  107. </div>
  108. <br>
  109. <div style="display: flex; justify-content: space-around; align-items: center; margin-bottom: 10px;">
  110. <p style="font-size: 18px;">出库人:
  111. <el-input v-model="chukuren" style="width: 200px;" disabled/>
  112. </p>
  113. <p style="font-size: 18px;">领用人:
  114. <el-input v-model="linguser" style="width: 200px;" />
  115. </p>
  116. </div>
  117. </div>
  118. </el-dialog>
  119. <!--详情记录 -->
  120. <el-dialog v-model="pickingaddvisible" :before-close="()=> pickingaddvisible = false" style="width: 70%; margin: 5% auto; height: 79%;" :title="'出库退还记录'" destroy-on-close>
  121. <div class="dialog-footer" style="bottom: 10px; right: 10px; width: 100%;">
  122. <el-button type="primary" @click="ckth_closeDialog" style="width: 80px;height: 40px;">关 闭</el-button>
  123. </div>
  124. <br>
  125. <div>
  126. <el-tabs v-model="activeName" @tab-click="handleClick">
  127. <el-tab-pane label="出库记录" @click="showTable('出库记录')" name="first">
  128. <el-table ref="multipleTable"
  129. :row-style="{ height: '30px' }"
  130. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  131. :header-cell-style="{ padding: '0px' }"
  132. :show-overflow-tooltip="true"
  133. highlight-current-row="true"
  134. @row-click="tableclick"
  135. @row-dblclick="ysupdateCompanyFunc"
  136. style="width: 100%;height: 36vh" border
  137. :summary-method="getSummaries" tooltip-effect="dark" :data="cktableData" row-key="ID" >
  138. <el-table-column align="left" sortable label="订单编号" prop="订单编号" width="140"/>
  139. <el-table-column align="left" sortable label="款号" prop="款号" width="180"/>
  140. <el-table-column align="left" sortable label="数量" prop="数量" width="105"/>
  141. <el-table-column align="left" sortable label="出库时间" prop="出库时间" width="160"/>
  142. <el-table-column align="left" sortable label="上报机台" prop="上报机台" width="160"/>
  143. </el-table>
  144. </el-tab-pane>
  145. <el-tab-pane label="入库记录" @click="showTable('入库记录')" name="second">
  146. <el-table ref="multipleTable"
  147. :row-style="{ height: '30px' }"
  148. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  149. :header-cell-style="{ padding: '0px' }"
  150. :show-overflow-tooltip="true"
  151. highlight-current-row="true"
  152. @row-click="rukutableclick"
  153. @row-dblclick="rukuupdateCompanyFunc"
  154. style="width: 100%;height: 36vh" border
  155. :summary-method="getSummaries" tooltip-effect="dark" :data="rukutableData" row-key="ID" >
  156. <el-table-column align="left" sortable label="订单编号" prop="订单编号" width="140"/>
  157. <el-table-column align="left" sortable label="款号" prop="款号" width="180"/>
  158. <el-table-column align="left" sortable label="数量" prop="数量" width="105"/>
  159. <el-table-column align="left" sortable label="出库时间" prop="出库时间" width="160"/>
  160. <el-table-column align="left" sortable label="上报机台" prop="上报机台" width="160"/>
  161. </el-table>
  162. </el-tab-pane>
  163. <el-tab-pane label="退还记录" @click="showTable('退还记录')" name="third">
  164. <el-table ref="multipleTable"
  165. :row-style="{ height: '30px' }"
  166. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  167. :header-cell-style="{ padding: '0px' }"
  168. highlight-current-row="true"
  169. :show-overflow-tooltip="true"
  170. :cell-class-name="gysatusCellClass"
  171. @row-dblclick="gdgyupdateCompanyFunc"
  172. @row-click="clickybupdate2"
  173. :row-class-name="rowClassStyle2"
  174. style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="thtableData" row-key="ID">
  175. <el-table-column align="left" sortable label="订单编号" prop="订单编号" width="140"/>
  176. <el-table-column align="left" sortable label="款号" prop="款号" width="180"/>
  177. <el-table-column align="left" sortable label="数量" prop="数量" width="105"/>
  178. <el-table-column align="left" sortable label="出库时间" prop="出库时间" width="160"/>
  179. <el-table-column align="left" sortable label="上报机台" prop="上报机台" width="160"/>
  180. </el-table>
  181. </el-tab-pane>
  182. </el-tabs>
  183. </div>
  184. </el-dialog>
  185. </template>
  186. <script>
  187. //点击按钮显示下方表格
  188. export default {
  189. data() {
  190. return {
  191. currentTable: '', // 当前展示的表格
  192. activeName: 'second',
  193. _ddhval:'',
  194. add_gddialogFormVisible: true,
  195. };
  196. },
  197. methods: {
  198. }
  199. };
  200. </script>
  201. <script setup>
  202. // 全量引入格式化工具 请按需保留
  203. import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
  204. import {ref, reactive} from 'vue'
  205. import {getSpotList,getSpotTab,orderSearch,outReport,orderBomList,FabricDetail,
  206. gitReceiptNumber
  207. } from '@/api/mes/job'
  208. import {ElMessage} from "element-plus";
  209. // import { get } from 'scriptjs';
  210. defineOptions({name: 'Company'})
  211. import { useUserStore } from '@/pinia/modules/user'
  212. //获取用户登录信息
  213. const userStore = useUserStore()
  214. const _username = ref('')
  215. _username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
  216. console.log('获取用户名称',_username.value)
  217. //全局调用获取当前日期
  218. const today = new Date();
  219. const year = today.getFullYear();
  220. const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,需要补零
  221. const day = String(today.getDate()).padStart(2, '0');
  222. const hours = String(today.getHours()).padStart(2, '0');
  223. const minutes = String(today.getMinutes()).padStart(2, '0');
  224. const seconds = String(today.getSeconds()).padStart(2, '0');
  225. const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  226. const currentDates = `${year}-${month}-${day}`;
  227. //自动聚焦光标input
  228. const getMachineMacdata = async () => {
  229. setTimeout(() => {
  230. const inputElement = document.getElementById('searchInput');
  231. if (inputElement) {
  232. inputElement.focus();
  233. }
  234. }, 100); // 延迟100毫秒
  235. }
  236. getMachineMacdata();
  237. //全局调用参数
  238. const danhao = ref('')
  239. const riqi = ref('')
  240. const linguser = ref('')
  241. const chukuren = ref('')
  242. const add_searchInfo = ref('')//搜索
  243. const add_lysearchInfo = ref('')//搜索
  244. const restableData = reactive([])//表格
  245. const _orderid = ref('')//订单子编号
  246. const _kh = ref('')//生产款号
  247. const handleInput = async ()=>{
  248. add_onSubmit()
  249. }
  250. //查询按钮
  251. const add_onSubmit = async ()=>{
  252. restableData.splice(0, restableData.length);//清空表格
  253. //订单信息数据查询【接口】
  254. const orderSearchdata = await orderSearch({search:add_searchInfo.value});
  255. if(orderSearchdata.data.length === 1){
  256. res_bomdialogFormVisible.value = true
  257. _orderid.value = orderSearchdata.data[0]['订单编号']
  258. add_searchInfo.value = orderSearchdata.data[0]['订单编号']
  259. ddhformData.ddh = orderSearchdata.data[0]['订单编号']
  260. ddhformData.kh = orderSearchdata.data[0]['客户编号']
  261. ddhformData.sckh = orderSearchdata.data[0]['生产款号']
  262. ddhformData.ks = orderSearchdata.data[0]['款式']
  263. add_lysearchInfo.value = add_searchInfo.value
  264. const gitReceiptNumberdata = await gitReceiptNumber({number:'RK'});
  265. console.log(gitReceiptNumberdata)
  266. danhao.value = gitReceiptNumberdata.data
  267. chukuren.value = userStore.userInfo.nickName
  268. riqi.value = currentDates
  269. Reporting_onSubmit()
  270. }else{
  271. restableData.splice(0,orderSearchdata.length,...orderSearchdata.data);
  272. }
  273. };
  274. //表格行点击
  275. const tableRowClick = async (row)=>{
  276. console.log(row)
  277. add_searchInfo.value = row.订单编号
  278. _orderid.value = row.订单编号
  279. _kh.value = row.生产款号
  280. ddhformData.ddh = row['订单编号']
  281. ddhformData.kh = row['客户编号']
  282. ddhformData.sckh = row['生产款号']
  283. ddhformData.ks = row['款式']
  284. }
  285. //查询
  286. const add_lyonSubmit = async ()=>{
  287. const orderSearchdata = await orderSearch({search:add_lysearchInfo.value});
  288. if(orderSearchdata.data.length === 1){
  289. add_lysearchInfo.value = orderSearchdata.data[0]['订单编号']
  290. ddhformData.ddh = orderSearchdata.data[0]['订单编号']
  291. ddhformData.kh = orderSearchdata.data[0]['客户编号']
  292. ddhformData.sckh = orderSearchdata.data[0]['生产款号']
  293. ddhformData.ks = orderSearchdata.data[0]['款式']
  294. }
  295. try {
  296. const orderBomListdata = await orderBomList({order:add_lysearchInfo.value});
  297. resbomtableData.value = orderBomListdata.data;
  298. const formattedData = orderBomListdata.data.map(item=>{
  299. item.物料名称 = item.物料名称;
  300. item.计划用料 = item.计划用料;
  301. item.定额用料 = item.定额用料;
  302. item.裁床实际用料 = item.裁床实际用料;
  303. item.裁床领用面料 = item.裁床领用面料;
  304. item.裁床退回仓库面料 = item.裁床退回仓库面料;
  305. item.备注 = item.备注;
  306. item.UNIQID = item.UNIQID;
  307. item.领用 = '';
  308. return item
  309. });
  310. add_lysearchInfo.value = ''
  311. } catch (error) {
  312. console.error(error);
  313. }
  314. };
  315. const res_bomdialogFormVisible = ref(false)
  316. const resbomtableData = ref([]);
  317. const FabriccollartableData = ref([]);
  318. const ddhformData = reactive({
  319. ddh: '',
  320. kh:'',
  321. sckh:'',
  322. ks:'',
  323. });
  324. const resbom_tableColumns = ref(
  325. [
  326. // { label: '订单编号', prop: '订单编号', width: '90' },
  327. // { label: '客户', prop: '客户编号', width: '70' },
  328. // { label: '生产款号', prop: '生产款号', width: '100' },
  329. // { label: '款式', prop: '款式', width: '100' },
  330. { label: '物料名称', prop: '物料名称', width: '160' },
  331. { label: '计划用料', prop: '计划用料', width: '105' },
  332. { label: '定额用料', prop: '定额用料', width: '110' },
  333. { label: '门封', prop: '门封', width: '100' },
  334. { label: '裁床实际用料', prop: '裁床实际用料', width: '115' },
  335. { label: '裁床领用面料', prop: '裁床领用面料', width: '115' },
  336. { label: '裁床退回仓库面料', prop: '裁床退回仓库面料', width: '150' },
  337. { label: '入库总量', prop: '入库总量', width: '90' },
  338. { label: '面料结余', prop: '面料结余', width: '90' },
  339. { label: '入库', prop: '领用', width: '110' },
  340. // { label: '备注', prop: '备注', width: '120' },
  341. { label: '投料单位', prop: '投料单位', width: '90' },
  342. // { label: 'UNIQID', prop: 'UNIQID', width: '80' },
  343. ]
  344. )
  345. const Fabriccollar_tableColumns = ref(
  346. [
  347. { label: '订单编号', prop: '订单编号', width: '90' },
  348. { label: '客户', prop: '客户编号', width: '70' },
  349. { label: '生产款号', prop: '生产款号', width: '100' },
  350. { label: '款式', prop: '款式', width: '100' },
  351. { label: '物料名称', prop: '物料名称', width: '160' },
  352. { label: '计划用料', prop: '计划用料', width: '105' },
  353. { label: '定额用料', prop: '定额用料', width: '110' },
  354. { label: '门封', prop: '门封', width: '100' },
  355. { label: '裁床实际用料', prop: '裁床实际用料', width: '115' },
  356. { label: '裁床领用面料', prop: '裁床领用面料', width: '115' },
  357. { label: '裁床退回仓库面料', prop: '裁床退回仓库面料', width: '150' },
  358. { label: '入库总量', prop: '入库总量', width: '90' },
  359. { label: '面料结余', prop: '面料结余', width: '90' },
  360. { label: '入库', prop: '领用', width: '110'},
  361. // { label: '备注', prop: '备注', width: '120' },
  362. { label: '投料单位', prop: '投料单位', width: '90' },
  363. // { label: 'UNIQID', prop: 'UNIQID', width: '80' },
  364. ]
  365. )
  366. //查询
  367. const Reporting_onSubmit = async ()=>{
  368. if(_orderid.value === '' || _orderid.value === null){
  369. ElMessage({type: 'warning',message: '请扫描订单后,再操作此功能'})
  370. }else{
  371. add_lysearchInfo.value = add_searchInfo.value
  372. res_bomdialogFormVisible.value = true
  373. FabriccollartableData.value = [];
  374. // const orderBomListlsit = await orderBomList({order:_orderid.value});
  375. // console.log(orderBomListlsit)
  376. _TestCoefficient();
  377. }
  378. }
  379. //bom数据获取
  380. const _TestCoefficient = async ()=>{
  381. try {
  382. const orderBomListdata = await orderBomList({order:_orderid.value});
  383. console.log(orderBomListdata)
  384. resbomtableData.value = orderBomListdata.data;
  385. const formattedData = orderBomListdata.data.map(item=>{
  386. item.物料名称 = item.物料名称;
  387. item.计划用料 = item.计划用料;
  388. item.定额用料 = item.定额用料;
  389. item.裁床实际用料 = item.裁床实际用料;
  390. item.裁床领用面料 = item.裁床领用面料;
  391. item.裁床退回仓库面料 = item.裁床退回仓库面料;
  392. item.备注 = item.备注;
  393. item.UNIQID = item.UNIQID;
  394. item.领用 = '';
  395. return item
  396. });
  397. } catch (error) {
  398. console.error(error);
  399. }
  400. }
  401. const resbom_handleKeyDown = (event, x, y, prop) => {
  402. const currentElement = document.getElementById(`input${x}${y}`);
  403. if (currentElement === null && currentElement === undefined) return
  404. let move = 0
  405. switch (event.keyCode) {
  406. case 13: // Enter
  407. case 40: // 向下箭头
  408. if (y < resbomtableData.value.length )
  409. document.getElementById(`input${x}${y + 1}`).focus();
  410. break;
  411. case 38: // 向上箭头
  412. if ( y > 0) {
  413. document.getElementById(`input${x}${y - 1}`).focus();
  414. }
  415. break;
  416. case 39: // 向左箭头
  417. if (x >= 0 && x <=6) {
  418. move = x + 1
  419. }
  420. document.getElementById(`input${move}${y}`).focus();
  421. break;
  422. case 37: // 向右箭头
  423. if (x = 0 && x <=6) {
  424. move = x - 1
  425. }
  426. document.getElementById(`input${move}${y}`).focus();
  427. break;
  428. default:
  429. break;
  430. }
  431. }
  432. const scfjfpxsCellClass = ({row, column, rowIndex, columnIndex}) =>{
  433. if (column.label === '入库') {
  434. return 'background-plan-usage-low';
  435. }
  436. }
  437. // 确定
  438. const res_bomenterDialog = async() => {
  439. if(FabriccollartableData.value.length === 0){
  440. ElMessage({ type: 'warning',message: '请先添加领用信息'})
  441. return
  442. }
  443. const rawValueArray = FabriccollartableData._rawValue;
  444. const formattedData = rawValueArray.map(item => {
  445. return {
  446. order_id: ddhformData.ddh,
  447. 款号: ddhformData.kh,
  448. 物料名称: item.物料名称 !== null ? item.物料名称 : "",
  449. number: item.领用 !== null ? item.领用 : "",
  450. rq: currentDate,
  451. name: "入库",
  452. sys_id: _username.value,
  453. receipt_number: danhao.value,
  454. recipient:linguser.value
  455. }
  456. });
  457. console.log(formattedData);
  458. const add_outReport = await outReport(formattedData);
  459. if (add_outReport.code === 0) {
  460. res_bomdialogFormVisible.value = false;
  461. ElMessage({type: 'success',message: '入库成功'})
  462. } else {
  463. ElMessage({ type: 'error',message: '入库失败'})
  464. }
  465. }
  466. // 取消
  467. const res_bomcloseDialog = () => {
  468. res_bomdialogFormVisible.value = false;
  469. }
  470. // 增加至入库页
  471. const print_lingyong = async () => {
  472. if(add_lysearchInfo.value === ''){
  473. setTimeout(() => {
  474. const inputElement = document.getElementById('ly_searchInput');
  475. if (inputElement) {
  476. inputElement.focus();
  477. }
  478. }, 100);//100毫秒
  479. return;
  480. }
  481. setTimeout(() => {
  482. const inputElement = document.getElementById('ly_searchInput');
  483. if (inputElement) {
  484. inputElement.focus();
  485. }
  486. }, 100);//100毫秒
  487. const filteredData = resbomtableData.value.filter(item => item.领用 && item.领用.trim() !== "");
  488. // 将过滤后的数据添加到 FabriccollartableData
  489. FabriccollartableData.value.push(...filteredData);
  490. add_lyonSubmit()
  491. }
  492. // //删除
  493. // const del_lingyong = async () => {
  494. // if (!lySelection.value) {
  495. // console.log('没有选中任何行');
  496. // return;
  497. // }
  498. // const idsToDelete = lySelection.value.split(',').map(Number); // 确保转换为数字
  499. // console.log('要删除的ID:', idsToDelete);
  500. // console.log('当前数据:', FabriccollartableData.value);
  501. // FabriccollartableData.value = FabriccollartableData.value.filter(
  502. // item => !idsToDelete.includes(item.UNIQID)
  503. // );
  504. // console.log('删除后的数据:', FabriccollartableData.value);
  505. // lySelection.value = '';
  506. // };
  507. // const lySelection = ref('')
  508. // const FabriccollarhandleSelectionChange = (selection) => {
  509. // const ids = selection.map(item => item.UNIQID); // 提取每行的 UniqId
  510. // lySelection.value = ids.join(','); // 将 UniqId 数组转换为逗号分隔的字符串
  511. // console.log(lySelection.value)
  512. // };
  513. //=============出库退还记录==================
  514. const cktableData = reactive([])
  515. const thtableData = reactive([])
  516. const rukutableData = reactive([])
  517. const pickingaddvisible = ref(false)//弹窗
  518. // const detailData = reactive({})
  519. const add_prinkformData = reactive({});
  520. //详情记录
  521. const details_onSubmit = async ()=>{
  522. pickingaddvisible.value = true
  523. const FabricDetaillist = await FabricDetail({order:_orderid.value});
  524. const ruku_FabricDetaillist = await FabricDetail({order:_orderid.value,search:'入库'});
  525. console.log(FabricDetaillist)
  526. console.log(ruku_FabricDetaillist)
  527. rukutableData.splice(0,ruku_FabricDetaillist.length,...ruku_FabricDetaillist.data['入库记录']);
  528. cktableData.splice(0,FabricDetaillist.length,...FabricDetaillist.data['出库记录']);
  529. thtableData.splice(0,FabricDetaillist.length,...FabricDetaillist.data['退还记录']);
  530. }
  531. //领料取消
  532. const ckth_closeDialog = async ()=>{
  533. pickingaddvisible.value = false
  534. //自动聚焦光标input
  535. getMachineMacdata();
  536. }
  537. // =========== 分页 ===========
  538. // 分页相关的响应式变量
  539. const page = ref(1)
  540. const total = ref(0)
  541. const pageSize = ref(10)
  542. // 分页
  543. const handleCurrentChange = (val) => {
  544. page.value = val;
  545. _getStaffList();
  546. };
  547. // 修改页面容量 点击多少条/页
  548. const handleSizeChange = (val) => {
  549. page.value = 10;//默认显示
  550. pageSize.value = val;
  551. _getStaffList();
  552. };
  553. </script>
  554. <style scoped>
  555. /* 根据出库状态文字颜色 */
  556. :deep(.status-plan-usage-low div) {
  557. color: #8c939d !important;
  558. }
  559. :deep(.statusy-plan-usage-low div) {
  560. color: blue !important;
  561. }
  562. .form-container {
  563. display: flex;
  564. flex-wrap: wrap;
  565. }
  566. .form-column {
  567. /*flex: 1;*/
  568. margin-right: 15px; /* 调整列之间的间距 */
  569. }
  570. /* 左侧输入框宽度调整 */
  571. .form-column .el-form-item .el-input {
  572. width: 150px; /* 调整左侧输入框的宽度 */
  573. }
  574. /* 媒体查询,根据需要调整断点 */
  575. @media screen and (max-width: 768px) {
  576. .form-column {
  577. flex: 1 0 100%; /* 在小屏幕下变成单列布局 */
  578. margin-right: 0;
  579. }
  580. }
  581. .JKWTree-container {
  582. display: flex;
  583. }
  584. .JKWTree-tree {
  585. /*width: 300px;*/
  586. background-color: #fff;
  587. padding: 10px;
  588. margin-right: 20px;
  589. }
  590. .JKWTree-tree h3 {
  591. font-size: 15px;
  592. font-weight: 700;
  593. margin: 10px 0;
  594. }
  595. .JKWTree-content {
  596. flex: 1;
  597. }
  598. /* 表格复选框大小调整 */
  599. :deep(.el-checkbox.el-checkbox--small .el-checkbox__inner) {
  600. width: 45px; /* 复选框宽度 */
  601. height: 23px; /* 复选框高度 */
  602. }
  603. /*bom参数背景*/
  604. :deep(.el-table__body .background-plan-usage-low div div div) {
  605. background: #80FA80 !important;
  606. }
  607. /* 选中某行时的背景色 */
  608. :deep(.el-table__body tr.current-row) > td {
  609. background: #ff80ff !important;
  610. }
  611. :deep(.el-checkbox.el-checkbox--small.is-checked .el-checkbox__inner::after) {
  612. transform: scale(1.2) rotate(45deg); /* 调整选中后的对勾大小 */
  613. top: 5%; /* 调整对勾位置 */
  614. left: 40%; /* 调整对勾位置 */
  615. width: 5px; /* 调整对勾宽度 */
  616. height: 9px; /* 调整对勾高度 */
  617. }
  618. /* 选中某行时的背景色 */
  619. :deep(.el-table__body tr.current-row) > td {
  620. background: #ff80ff !important;
  621. }
  622. </style>
  623. <style scoped>
  624. :deep(.el-table td .cell) {
  625. line-height: 20px !important;
  626. }
  627. :deep(.el-tabs__header){
  628. margin-bottom: 0;
  629. }
  630. .search{
  631. margin-left: 0px !important;
  632. margin-right: 10px !important;
  633. }
  634. .bt{
  635. margin-left: 2px !important;
  636. padding: 3px !important;
  637. font-size: 12px;
  638. }
  639. .el-tabs__header{
  640. margin: 0px !important;
  641. }
  642. .gva-table-box{
  643. padding: 0px !important;
  644. margin-left: 5px !important;
  645. }
  646. .mab{
  647. margin-bottom: 5px;
  648. }
  649. /* 搜索样式 */
  650. ::v-deep .el-input__wrapper #searchInput {
  651. font-size: 16px;
  652. }
  653. ::v-deep(.el-descriptions__table tbody tr .is-bordered-label){
  654. width: 60px;
  655. }
  656. ::v-deep(.el-descriptions__table tbody tr .el-descriptions__content){
  657. width: 120px;
  658. }
  659. </style>