Out.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012
  1. <script setup lang="tsx">
  2. import { reactive, ref, unref,onMounted } from 'vue'
  3. import { useTable } from '@/hooks/web/useTable'
  4. import { useI18n } from '@/hooks/web/useI18n'
  5. import { Table, TableColumn } from '@/components/Table'
  6. import { Search } from '@/components/Search'
  7. import { FormSchema } from '@/components/Form'
  8. import { ContentWrap } from '@/components/ContentWrap'
  9. import { Dialog } from '@/components/Dialog'
  10. import { BaseButton } from '@/components/Button'
  11. import { UpImgButtom } from '@/components/UpFile'
  12. import {
  13. ElDivider,
  14. ElMessage,
  15. ElMessageBox,
  16. ElTag,
  17. ElText,
  18. ElSelect,
  19. ElOption,
  20. ElForm,
  21. ElFormItem,
  22. ElRadioGroup,
  23. ElRadio,
  24. ElTable,
  25. ElTableColumn,
  26. ElInput,
  27. ElDatePicker
  28. } from 'element-plus'
  29. import {
  30. getStoreUser,
  31. endPur,
  32. upCompute,
  33. authComput,
  34. getOut,
  35. outAuth,
  36. outOut,
  37. delOut,
  38. getStoreList
  39. } from '@/api/erp'
  40. import { useRouter } from 'vue-router'
  41. import { formatTime } from '@/utils'
  42. import { endPuritem } from '@/api/erp/types'
  43. // import Write from './components/Write.vue'
  44. const { t } = useI18n()
  45. const { push } = useRouter()
  46. const { tableRegister, tableState, tableMethods } = useTable({
  47. fetchDataApi: async () => {
  48. const res = await getOut({
  49. page: unref(currentPage) || 1,
  50. limit: unref(pageSize) || 10,
  51. ...unref(searchParams)
  52. })
  53. return { list: res.data.data, total: res.data.count || 0 }
  54. }
  55. })
  56. const { dataList, loading, total, currentPage, pageSize } = tableState
  57. const { getList } = tableMethods
  58. const tableColumns = reactive<TableColumn[]>([
  59. { field: 'id', label: 'ID', align: 'center', width: 70 },
  60. { field: 'out_order_id', label: '出库单号', minWidth: 230 },
  61. { field: 'total_price', label: '总价格', minWidth: 150 },
  62. {
  63. field: 'in',
  64. label: '调出单位',
  65. minWidth: 150,
  66. slots: {
  67. default: ({ row }: any) => {
  68. return <>{row.up_store_id ? row.tstore?.name : row.up_wid ? row.tware?.name : ''}</>
  69. }
  70. }
  71. },
  72. {
  73. field: 'out',
  74. label: '调入单位',
  75. minWidth: 150,
  76. slots: {
  77. default: ({ row }: any) => {
  78. return <>{row.wid ? row.ware?.name : row.store?.name}</>
  79. }
  80. }
  81. },
  82. {
  83. field: 'info',
  84. label: '出库商品',
  85. minWidth: 200,
  86. slots: {
  87. default: ({ row }: any) => {
  88. return (
  89. <>
  90. {row.info.map((item) => {
  91. return (
  92. <>
  93. <div>
  94. {item.product_name}
  95. <ElText class="mx-1" type="primary">
  96. {item.is_weigh == 1 ? item.net_weight : item.product_num * 1}
  97. </ElText>
  98. {item.suk}
  99. </div>
  100. </>
  101. )
  102. })}
  103. </>
  104. )
  105. }
  106. }
  107. },
  108. {
  109. field: 'create_admin_id',
  110. label: '创建人员',
  111. width: 200,
  112. slots: {
  113. default: ({ row }: any) => {
  114. return (
  115. <>
  116. <div>{row.cuser?.real_name || '-'}</div>
  117. <div>{row.create_time ? formatTime(row.create_time * 1000, 'yyyy-MM-dd') : ''}</div>
  118. </>
  119. )
  120. }
  121. }
  122. },
  123. {
  124. field: 'auth_admin_id',
  125. label: '审核人员',
  126. width: 200,
  127. slots: {
  128. default: ({ row }: any) => {
  129. return (
  130. <>
  131. <div>{row.auser?.real_name || '-'}</div>
  132. <div>{row.auth_time ? formatTime(row.auth_time * 1000, 'yyyy-MM-dd') : ''}</div>
  133. </>
  134. )
  135. }
  136. }
  137. },
  138. {
  139. field: 'status',
  140. label: '状态',
  141. width: 190,
  142. slots: {
  143. default: ({ row }: any) => {
  144. if (row.status == 3) {
  145. return (
  146. <>
  147. <ElTag>完成</ElTag>
  148. </>
  149. )
  150. } else if (row.status == 2 && row.auth_status == -2) {
  151. return (
  152. <>
  153. <ElTag type="danger">收货拒绝</ElTag>
  154. </>
  155. )
  156. } else {
  157. return (
  158. <>
  159. <ElTag
  160. class="mr-5px"
  161. type={
  162. row.status == -1
  163. ? 'danger'
  164. : row.status == 0
  165. ? 'warning'
  166. : row.status == 1
  167. ? 'success'
  168. : row.status == 2
  169. ? 'info'
  170. : 'success'
  171. }
  172. >
  173. {row.status == -1
  174. ? '审核拒绝'
  175. : row.status == 0
  176. ? '待审核'
  177. : row.status == 1
  178. ? '通过'
  179. : row.status == 2
  180. ? '完成'
  181. : '完成'}
  182. </ElTag>
  183. </>
  184. )
  185. }
  186. }
  187. }
  188. },
  189. {
  190. field: 'action',
  191. label: t('userDemo.action'),
  192. width: 200,
  193. fixed: 'right',
  194. align: 'center',
  195. headerAlign: 'center',
  196. slots: {
  197. default: ({ row }: any) => {
  198. if (row.status == 0) {
  199. return (
  200. <>
  201. <BaseButton link size="small" type="primary" onClick={() => action('auth', row)}>
  202. 审核
  203. </BaseButton>
  204. <ElDivider direction="vertical" />
  205. <BaseButton link size="small" type="danger" onClick={() => delAction(row)}>
  206. 删除
  207. </BaseButton>
  208. <ElDivider direction="vertical" />
  209. <BaseButton link size="small" type="primary" onClick={() => action('print', row)}>
  210. 打印
  211. </BaseButton>
  212. </>
  213. )
  214. } else if (row.status == 1) {
  215. return (
  216. <>
  217. <BaseButton link size="small" type="primary" onClick={() => action('out', row)}>
  218. 出库
  219. </BaseButton>
  220. <ElDivider direction="vertical" />
  221. <BaseButton link size="small" type="primary" onClick={() => action('print', row)}>
  222. 打印
  223. </BaseButton>
  224. </>
  225. )
  226. } else {
  227. return (
  228. <>
  229. <BaseButton link size="small" type="primary" onClick={() => action('print', row)}>
  230. 打印
  231. </BaseButton>
  232. </>
  233. )
  234. }
  235. }
  236. }
  237. }
  238. ])
  239. const storeLoading = ref(false)
  240. const wareLoading = ref(false)
  241. const storeOptions = ref<any[]>([])
  242. const wareOptions = ref<any[]>([])
  243. const getStore = async (query = '', id = '') => {
  244. try {
  245. storeLoading.value = true
  246. const res = await getStoreList({ page: 1, limit: 1000, name: query, id, store: 1 })
  247. if (res) {
  248. storeOptions.value = res.data.data.map((item) => {
  249. return {
  250. value: item.id,
  251. label: item.name
  252. }
  253. })
  254. } else {
  255. return []
  256. }
  257. } catch (error) {
  258. console.log(error)
  259. } finally {
  260. storeLoading.value = false
  261. }
  262. }
  263. const getWare = async (query = '', id = '') => {
  264. try {
  265. wareLoading.value = true
  266. const res = await getStoreList({ page: 1, limit: 1000, name: query, id, type: 3 })
  267. if (res) {
  268. wareOptions.value = res.data.data.map((item) => {
  269. return {
  270. value: item.id,
  271. label: item.name
  272. }
  273. })
  274. } else {
  275. return []
  276. }
  277. } catch (error) {
  278. console.log(error)
  279. } finally {
  280. wareLoading.value = false
  281. }
  282. }
  283. const searchSchema = reactive<FormSchema[]>([
  284. {
  285. field: 'out_order_id',
  286. label: '出库单号',
  287. component: 'Input',
  288. value: '',
  289. componentProps: {
  290. placeholder: '请输入出库单号'
  291. }
  292. },
  293. {
  294. field: 'store_id',
  295. label: '门店',
  296. component: 'Select',
  297. value: '',
  298. componentProps: {
  299. placeholder: '请选择',
  300. options: storeOptions
  301. }
  302. },
  303. {
  304. field: 'wid',
  305. label: '仓库',
  306. component: 'Select',
  307. value: '',
  308. componentProps: {
  309. placeholder: '请选择',
  310. options: wareOptions
  311. }
  312. },
  313. {
  314. field: 'status',
  315. label: '状态',
  316. component: 'Select',
  317. value: '',
  318. componentProps: {
  319. placeholder: '全部',
  320. options: [
  321. { label: '待审核', value: '0' },
  322. { label: '出库审核', value: '1' }
  323. ]
  324. }
  325. },
  326. ])
  327. const searchParams = ref<{ status?: string }>({
  328. // status: '3'
  329. })
  330. const setSearchParams = (data: any) => {
  331. searchParams.value = data
  332. getList()
  333. }
  334. const dialogVisible = ref(false)
  335. const currentRow = ref()
  336. const dialogTitle = ref('')
  337. const actionType = ref('')
  338. // const writeRef = useTemplateRef('writeRef')
  339. // function arrayToObject(array) {
  340. // var obj = {};
  341. // for (var i = 0; i < array.length; i++) {
  342. // obj[i] = array[i];
  343. // }
  344. // return obj;
  345. // }
  346. const authId = ref(0)
  347. const storeId = ref(0)
  348. const wid = ref(0)
  349. const dialogVisibles = ref(false)
  350. const dialogVisibless = ref(false)
  351. const dialogVisiblesss = ref(false)
  352. const dialogVisiblessss = ref(false)
  353. const prDialogVisible = ref(false)
  354. const prItem = ref<any>({})
  355. const endItem = ref<endPuritem>({ purchasing_person_admin_id: 0, id: 0, info: [] })
  356. const action = async (type: string, row?: any) => {
  357. actionType.value = type
  358. if (type == 'print') {
  359. console.log(row)
  360. prDialogVisible.value = true
  361. prItem.value = row
  362. }
  363. if (type == 'out') {
  364. ElMessageBox.confirm('是否立即出库?', {
  365. confirmButtonText: '确认',
  366. cancelButtonText: '取消',
  367. type: 'warning'
  368. })
  369. .then(async () => {
  370. const re = await outOut(row.id)
  371. if (re) {
  372. ElMessage({ showClose: true, message: '出库成功', type: 'success' })
  373. }
  374. await getList()
  375. })
  376. .catch(() => {})
  377. }
  378. if (type == 'authCompute') {
  379. endItem.value = row
  380. dialogVisiblessss.value = true
  381. }
  382. if (type == 'compute') {
  383. endItem.value = row
  384. dialogVisiblesss.value = true
  385. }
  386. if (type == 'end') {
  387. endItem.value = row
  388. endItem.value.info = row.info.map((item) => {
  389. item.tare_weight_one = ''
  390. return item
  391. })
  392. dialogTitle.value = '完成采购'
  393. dialogVisibless.value = true
  394. storeId.value = row.store_id || 0
  395. wid.value = row.wid || 0
  396. getAdmin()
  397. }
  398. if (type == 'auth') {
  399. dialogTitle.value = '审核'
  400. authId.value = row.id * 1
  401. storeId.value = row.up_store_id || 0
  402. wid.value = row.up_wid || 0
  403. dialogVisibles.value = true
  404. }
  405. if (type == 'add') {
  406. // dialogTitle.value = t('exampleDemo.add')
  407. // currentRow.value = undefined
  408. push(`/erp/out_edit/${type}/${row?.id || 0}`)
  409. }
  410. if (type == 'edit') {
  411. dialogTitle.value = t('exampleDemo.edit')
  412. currentRow.value = {
  413. // roles: row.roles,
  414. wid: row.wid,
  415. type: row.type,
  416. id: row.id,
  417. name: row.name,
  418. is_show: row.is_show == 1 ? true : false,
  419. introduction: row.introduction,
  420. address: row.address,
  421. area: row.area,
  422. city: row.city,
  423. province: row.province,
  424. detailed_address: row.detailed_address,
  425. latitude: row.latitude,
  426. logo: [row.logo],
  427. longitude: row.longitude,
  428. manager_name: row.manager_name,
  429. phone: row.phone,
  430. product_verify_status: row.product_verify_status == 1 ? true : false,
  431. product_status: row.product_status == 1 ? true : false,
  432. valid_range: row.valid_range,
  433. slide_images: row.slide_images_chs,
  434. auth_code: row.auth_code,
  435. auth_code_end_time: row.auth_code_end_time,
  436. ppid: row.appid,
  437. loss_sale: row.loss_sale == 1,
  438. receiver_uid: row.receiver_uid,
  439. huifu_id: row.huifu_id,
  440. appsecret: row.appsecret,
  441. cost: row.cost,
  442. roles: row.roles * 1
  443. }
  444. console.log(currentRow, 'currentRow')
  445. }
  446. dialogVisible.value = true
  447. }
  448. const delAction = (row: any) => {
  449. ElMessageBox.confirm('删除后无法恢复,是否删除?', {
  450. confirmButtonText: '删除',
  451. cancelButtonText: '取消',
  452. type: 'warning'
  453. })
  454. .then(async () => {
  455. const re = await delOut(row.id)
  456. if (re) {
  457. ElMessage({ showClose: true, message: '删除成功', type: 'success' })
  458. }
  459. await getList()
  460. })
  461. .catch(() => {})
  462. }
  463. const formData = ref({ auth_admin_id: '', auth_status: 1 })
  464. const adminOptions = ref<any[]>([])
  465. const adminLoading = ref(false)
  466. const rules = reactive({
  467. auth_admin_id: [{ required: true, message: '请选择审核员', trigger: 'change' }]
  468. })
  469. const getAdmin = async () => {
  470. const res = await getStoreUser({
  471. page: 1,
  472. limit: 20,
  473. relation_id: storeId.value ? storeId.value : wid.value
  474. })
  475. adminLoading.value = true
  476. try {
  477. if (res) {
  478. adminOptions.value = res.data.map((item) => {
  479. return { value: item.id, label: item.real_name }
  480. })
  481. console.log(adminOptions.value, 'adminOptions.value')
  482. } else {
  483. return []
  484. }
  485. } catch (err) {
  486. console.log(err)
  487. }
  488. }
  489. const cancelClick = () => {
  490. dialogVisibles.value = false
  491. authId.value = 0
  492. storeId.value = 0
  493. formData.value.auth_admin_id = ''
  494. formData.value.auth_status = 1
  495. }
  496. const cancelClicks = () => {
  497. dialogVisibless.value = false
  498. authId.value = 0
  499. storeId.value = 0
  500. endItem.value = { id: 0, purchasing_person_admin_id: 0, info: [] }
  501. }
  502. const confirmClick = async () => {
  503. if (!formData.value.auth_admin_id) {
  504. return ElMessage.error('请选择审核人员')
  505. }
  506. // if (formData.value.status == 1 && !formData.value.purchasing_person_admin_id) {
  507. // return ElMessage.error('请选择采购人员')
  508. // }
  509. const res = await outAuth(authId.value, formData.value)
  510. if (res.status == 200) {
  511. ElMessage.success('审核完成')
  512. getList()
  513. cancelClick()
  514. }
  515. }
  516. const confirmClicks = async () => {
  517. console.log('zhe')
  518. let qdata: endPuritem = {
  519. id: endItem.value.id,
  520. purchasing_person_admin_id: endItem.value.purchasing_person_admin_id,
  521. info: []
  522. }
  523. qdata.info = endItem.value.info.map((item) => {
  524. if (item.is_weigh == 1) {
  525. item.tare_weight = item.tare_weight_one * 1 * item.pur_num * 1
  526. item.net_weight = item.weight * 1 - item.tare_weight
  527. }
  528. return item
  529. })
  530. const res = await endPur(qdata)
  531. if (res.status == 200) {
  532. ElMessage.success('采购完成')
  533. getList()
  534. cancelClicks()
  535. }
  536. }
  537. const confirmClickss = async () => {
  538. const res = await upCompute(endItem.value.id, {
  539. prove: compteData.value.image[0],
  540. pay_time: new Date(compteData.value.pay_time).getTime() / 1000
  541. })
  542. if (res.status == 200) {
  543. ElMessage.success('提交完成')
  544. getList()
  545. cancelClickss()
  546. }
  547. }
  548. const cancelClickss = () => {
  549. dialogVisiblesss.value = false
  550. endItem.value = { id: 0, purchasing_person_admin_id: 0, info: [] }
  551. compteData.value = { image: [], pay_time: '' }
  552. }
  553. const compteData = ref({ image: [], pay_time: '' })
  554. const authCompteData = ref({ pay_status: 2 })
  555. const confirmClicksss = async () => {
  556. const res = await authComput(endItem.value.id, authCompteData.value)
  557. if (res.status == 200) {
  558. ElMessage.success('审核完成')
  559. getList()
  560. cancelClicksss()
  561. }
  562. }
  563. const cancelClicksss = () => {
  564. dialogVisiblessss.value = false
  565. endItem.value = { id: 0, purchasing_person_admin_id: 0, info: [] }
  566. authCompteData.value = { pay_status: 2 }
  567. }
  568. const printobj = ref({
  569. id: 'dc',
  570. popTitle: '好的打印标题',
  571. extraCss:
  572. 'https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css',
  573. extraHead: '<meta http-equiv="content-language" content="zh-cn" />',
  574. beforeOpenCallback(vue) {
  575. vue.printLoading = true
  576. console.log(window.document.body.style, 'window.document.body.innerHTML')
  577. console.log('打开之前')
  578. },
  579. openCallback(vue) {
  580. vue.printLoading = false
  581. console.log('执行了打印')
  582. }
  583. })
  584. const printing = () => {
  585. // const splitDoms = document.getElementsByClassName('pri')
  586. // console.log(splitDoms)
  587. // let startY = 0 // 占用A4纸的高度,从每页第一个poetry div的top值开始累加
  588. // for (let i = 0; i < splitDoms.length; i++) {
  589. // const splitDom = splitDoms[i]
  590. // const splitValue = splitDom.getBoundingClientRect()
  591. // console.log(splitDom.getBoundingClientRect())
  592. // if (startY === 0) {
  593. // startY = splitValue.top
  594. // }
  595. // const pageHeight = splitValue.bottom - startY
  596. // // 当加上当前div的高度大于A4纸高度时,给前一个div加上分页标识
  597. // if (pageHeight > PAGE_HEIGHT) {
  598. // console.log(i)
  599. // startY = 0
  600. // if (i > 0) {
  601. // splitDoms[i - 1].style.pageBreakBefore = 'always'; // 给前一个元素添加分页符
  602. // }
  603. // }
  604. // }
  605. }
  606. const getTime = () => {
  607. let time = new Date().getTime()
  608. return formatTime(time, 'yyyy-MM-dd HH:mm:ss')
  609. }
  610. const getLen = () => {
  611. let sum = 0
  612. prItem.value.info.forEach((item) => {
  613. console.log(item.product_num)
  614. if (item.is_weigh == 1) {
  615. sum += item.net_weight * 1
  616. } else {
  617. sum += item.product_num * 1
  618. }
  619. })
  620. return sum
  621. }
  622. onMounted(() => {
  623. getStore()
  624. getWare()
  625. })
  626. </script>
  627. <template>
  628. <ContentWrap>
  629. <Search :schema="searchSchema" @reset="setSearchParams" @search="setSearchParams" />
  630. <div class="mb-10px">
  631. <BaseButton type="primary" @click="action('add')">{{ t('exampleDemo.add') }}</BaseButton>
  632. </div>
  633. <Table
  634. v-model:current-page="currentPage"
  635. v-model:page-size="pageSize"
  636. :columns="tableColumns"
  637. default-expand-all
  638. node-key="id"
  639. stripe
  640. :data="dataList"
  641. :loading="loading"
  642. @register="tableRegister"
  643. :pagination="{ total }"
  644. />
  645. </ContentWrap>
  646. <Dialog v-model="dialogVisibles" :title="dialogTitle" width="500px" maxHeight="160px">
  647. <!-- <Record :cid="cid"></Record> -->
  648. <ElForm ref="formRef" :model="formData" :rules="rules" label-width="100px">
  649. <ElFormItem label="审核人员" prop="auth_admin_id">
  650. <ElSelect
  651. filterable
  652. remote
  653. reserve-keyword
  654. v-model="formData.auth_admin_id"
  655. :remote-method="getAdmin"
  656. remote-show-suffix
  657. placeholder="请选择审核人员"
  658. >
  659. <ElOption
  660. v-for="item in adminOptions"
  661. :key="item.value"
  662. :label="item.label"
  663. :value="item.value"
  664. />
  665. </ElSelect>
  666. </ElFormItem>
  667. <ElFormItem label="审核状态" prop="status">
  668. <ElRadioGroup v-model="formData.auth_status" class="ml-4">
  669. <ElRadio :label="1" size="large">通过</ElRadio>
  670. <ElRadio :label="-1" size="large">拒绝</ElRadio>
  671. </ElRadioGroup>
  672. </ElFormItem>
  673. </ElForm>
  674. <template #footer>
  675. <div style="flex: auto">
  676. <BaseButton @click="cancelClick">取消</BaseButton>
  677. <BaseButton type="primary" @click="confirmClick">确认</BaseButton>
  678. </div>
  679. </template>
  680. </Dialog>
  681. <Dialog v-model="dialogVisibless" :title="dialogTitle" width="1000px" maxHeight="800px">
  682. <!-- <Record :cid="cid"></Record> -->
  683. <ElForm ref="formRefs" :model="endItem" :rules="rules" label-width="100px">
  684. <ElFormItem label="采购人员" prop="purchasing_person_admin_id">
  685. <ElSelect
  686. filterable
  687. remote
  688. reserve-keyword
  689. v-model="endItem.purchasing_person_admin_id"
  690. :remote-method="getAdmin"
  691. remote-show-suffix
  692. placeholder="请选择采购人员"
  693. >
  694. <ElOption
  695. v-for="item in adminOptions"
  696. :key="item.value"
  697. :label="item.label"
  698. :value="item.value"
  699. />
  700. </ElSelect>
  701. </ElFormItem>
  702. <ElFormItem label="采购商品">
  703. <!-- <BaseButton type="primary" style="margin-bottom: 20px" @click="getPurgoods(1)">
  704. 加载商品
  705. </BaseButton> -->
  706. <ElTable
  707. header-cell-class-name="bg-gray-100!"
  708. :data="endItem.info"
  709. class="w-100%"
  710. :border="true"
  711. stripe
  712. >
  713. <ElTableColumn prop="product_name" label="名称"> </ElTableColumn>
  714. <ElTableColumn prop="suk" label="单位"></ElTableColumn>
  715. <ElTableColumn prop="product_num" label="采购数量"> </ElTableColumn>
  716. <ElTableColumn prop="pur_num" label="采购数量">
  717. <template #default="{ row }">
  718. <ElInput type="number" v-model="row.pur_num" />
  719. </template>
  720. </ElTableColumn>
  721. <ElTableColumn prop="total_price" label="总价格">
  722. <template #default="{ row }">
  723. <ElInput type="number" v-model="row.total_price" />
  724. </template>
  725. </ElTableColumn>
  726. <ElTableColumn prop="tare_weight_one" label="单个皮重">
  727. <template #default="{ row }">
  728. <ElInput type="number" :disable="!row.is_weigh" v-model="row.tare_weight_one" />
  729. </template>
  730. </ElTableColumn>
  731. <ElTableColumn prop="weight" label="总重量">
  732. <template #default="{ row }">
  733. <ElInput type="number" :disable="!row.is_weigh" v-model="row.weight" />
  734. </template>
  735. </ElTableColumn>
  736. </ElTable>
  737. </ElFormItem>
  738. </ElForm>
  739. <template #footer>
  740. <div style="flex: auto">
  741. <BaseButton @click="cancelClicks">取消</BaseButton>
  742. <BaseButton type="primary" @click="confirmClicks">确认</BaseButton>
  743. </div>
  744. </template>
  745. </Dialog>
  746. <Dialog v-model="dialogVisiblesss" :title="dialogTitle" width="500px" maxHeight="160px">
  747. <ElForm ref="formRefss" :model="compteData" :rules="rules" label-width="100px">
  748. <ElFormItem label="凭证" prop="image">
  749. <UpImgButtom v-model="compteData.image"></UpImgButtom>
  750. </ElFormItem>
  751. <ElFormItem label="支付时间" prop="status">
  752. <ElDatePicker v-model="compteData.pay_time" type="date" placeholder="请选择支付时间" />
  753. </ElFormItem>
  754. </ElForm>
  755. <template #footer>
  756. <div style="flex: auto">
  757. <BaseButton @click="cancelClickss">取消</BaseButton>
  758. <BaseButton type="primary" @click="confirmClickss">确认</BaseButton>
  759. </div>
  760. </template>
  761. </Dialog>
  762. <Dialog v-model="dialogVisiblessss" :title="dialogTitle" width="500px" maxHeight="100px">
  763. <ElForm ref="formRefss" :model="authCompteData" :rules="rules" label-width="100px">
  764. <ElFormItem label="审核状态" prop="status">
  765. <ElRadioGroup v-model="authCompteData.pay_status" class="ml-4">
  766. <ElRadio :label="2" size="large">通过</ElRadio>
  767. <ElRadio :label="-1" size="large">拒绝</ElRadio>
  768. </ElRadioGroup>
  769. </ElFormItem>
  770. </ElForm>
  771. <template #footer>
  772. <div style="flex: auto">
  773. <BaseButton @click="cancelClicksss">取消</BaseButton>
  774. <BaseButton type="primary" @click="confirmClicksss">确认</BaseButton>
  775. </div>
  776. </template>
  777. </Dialog>
  778. <Dialog v-model="prDialogVisible" title="打印">
  779. <div id="dc">
  780. <div class="section">
  781. <div class="text-center title">调出单</div>
  782. <div class="top-tit">
  783. <div class="item mb10">
  784. <div class=""
  785. ><span class="name">出库单号:</span><span>{{ prItem.out_order_id }}</span></div
  786. >
  787. <div class="val"></div>
  788. </div>
  789. <div class="item mb10" v-if="prItem?.tware && prItem.tware.name">
  790. <div class=""
  791. ><span class="name">调出单位:</span><span>{{ prItem.tware.name || '' }}</span></div
  792. >
  793. </div>
  794. <div class="item mb10" v-if="prItem?.tstore && prItem.tstore.name">
  795. <div class=""
  796. ><span class="name">调入单位:</span><span>{{ prItem?.store.name || '' }}</span></div
  797. >
  798. </div>
  799. <div class="item mb10" v-if="prItem?.tstore">
  800. <div class=""
  801. ><span class="name">联系电话:</span><span>{{ prItem.tstore.phone }}</span></div
  802. >
  803. <div class="val"></div>
  804. </div>
  805. <div class="item mb10" v-if="prItem?.tware">
  806. <div class=""
  807. ><span class="name">联系电话:</span><span>{{ prItem.tware.phone }}</span></div
  808. >
  809. <div class="val"></div>
  810. </div>
  811. <div class="item mb10" v-if="prItem?.ware">
  812. <div class=""
  813. ><span class="name">收货单位:</span><span>{{ prItem.ware.name }}</span></div
  814. >
  815. <div class="val"></div>
  816. </div>
  817. <div class="item mb10" v-if="prItem?.store">
  818. <div class=""
  819. ><span class="name">收货单位:</span><span>{{ prItem.store.name }}</span></div
  820. >
  821. <div class="val"></div>
  822. </div>
  823. <div class="item items mb10" v-if="prItem?.store">
  824. <div class=""
  825. ><span class="name">收货地址:</span><span>{{ prItem.store.address }}</span></div
  826. >
  827. </div>
  828. <div class="item items mb10" v-if="prItem?.ware">
  829. <div class=""
  830. ><span class="name">收货地址:</span><span>{{ prItem.ware.address }}</span></div
  831. >
  832. </div>
  833. </div>
  834. <div class="table">
  835. <div class="tr">
  836. <div class="item w10">序号</div>
  837. <div class="item w20">编号</div>
  838. <div class="item w30">商品</div>
  839. <div class="item w20">数量</div>
  840. <div class="item w20">单位</div>
  841. </div>
  842. <div class="tr" v-for="(item, index) in prItem.info" >
  843. <div class="item w10">{{ index + 1 }}</div>
  844. <div class="item w20">{{ item.bar_code }}</div>
  845. <div class="item w30"
  846. >{{ item.product_name }}</div
  847. >
  848. <div class="item w20">{{
  849. item.is_weigh == 1 ? item.net_weight : item.product_num
  850. }}</div>
  851. <div class="item w20">{{ item.suk }}</div>
  852. </div>
  853. </div>
  854. <div class="btm-tip">
  855. <div class="itemt">
  856. <span class="name">货品数:</span>
  857. <span>{{ prItem.info.length }}</span>
  858. </div>
  859. <div class="itemt">
  860. <span class="name">数量:</span>
  861. <span>{{ getLen() }}</span>
  862. </div>
  863. <div class="itemt">
  864. <span class="name">审核人:</span>
  865. <span>{{ prItem.auth_admin_id ? prItem.auser.real_name : '' }}</span>
  866. </div>
  867. <div class="itemt">
  868. <span class="name">仓管员签字:</span>
  869. <span></span>
  870. </div>
  871. <div class="itemt">
  872. <span class="name">财务员签字:</span>
  873. <span></span>
  874. </div>
  875. <div class="itemt">
  876. <span>打印时间:</span>
  877. <span>{{ getTime() }}</span>
  878. </div>
  879. </div>
  880. </div>
  881. </div>
  882. <template #footer>
  883. <div style="flex: auto">
  884. <BaseButton type="primary" @click="printing" v-print="printobj">打印</BaseButton>
  885. </div>
  886. </template>
  887. </Dialog>
  888. </template>
  889. <style>
  890. @media print {
  891. .section {
  892. page-break-before: always;
  893. margin-top: 0;
  894. }
  895. }
  896. .bold {
  897. font-weight: bold;
  898. }
  899. #dc {
  900. font-size: 14px;
  901. page-break-before: always;
  902. padding: 10px;
  903. position: relative;
  904. padding-bottom: 100px;
  905. }
  906. .title {
  907. font-size: 18px;
  908. font-weight: bold;
  909. color: #000000;
  910. }
  911. .top-tit {
  912. display: flex;
  913. flex-wrap: wrap;
  914. justify-content: flex-start;
  915. padding: 20px 0 10px;
  916. }
  917. .item {
  918. width: 50%;
  919. /* margin-bottom: 10px; */
  920. }
  921. .mb10 {
  922. margin-bottom: 10px;
  923. }
  924. .items {
  925. width: 100% !important;
  926. }
  927. .name {
  928. font-weight: bold;
  929. color: #000000;
  930. }
  931. .table {
  932. width: 98%;
  933. text-align: center;
  934. border-top: 1px solid #000;
  935. /* border-left: 1px solid #000; */
  936. }
  937. .table > .tr {
  938. display: flex;
  939. flex-wrap: wrap;
  940. }
  941. .table .tr > .item {
  942. padding: 5px 10px;
  943. /* border-right: 1px solid #000; */
  944. border-bottom: 1px solid #000;
  945. display: flex;
  946. justify-content: center;
  947. align-items: center;
  948. }
  949. .w30 {
  950. width: 30%;
  951. }
  952. .w20 {
  953. width: 20%;
  954. }
  955. .w10 {
  956. width: 10%;
  957. }
  958. .table .th {
  959. color: #000000;
  960. padding: 10px 0;
  961. border-left: 1px solid #000000;
  962. border-top: 1px solid #000000;
  963. min-width: 60px;
  964. }
  965. .table .td {
  966. padding: 5px 3px;
  967. border-left: 1px solid #000000;
  968. border-top: 1px solid #000000;
  969. }
  970. @media print {
  971. body,
  972. html,
  973. .previewPageBox {
  974. height: auto !important;
  975. overflow: visible !important;
  976. }
  977. .previewPageBox {
  978. position: relative !important;
  979. }
  980. }
  981. .btm-tip {
  982. display: flex;
  983. width: 100%;
  984. flex-wrap: wrap;
  985. padding-top: 150px;
  986. }
  987. .btm-tip .itemt {
  988. width: 33.3%;
  989. margin-bottom: 10px;
  990. }
  991. </style>