chukubaogong.vue 27 KB

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