approve_enter.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. <template>
  2. <!-- 入库审批 -->
  3. <view class="plan-approval-container">
  4. <uni-nav-bar
  5. fixed="true"
  6. statusBar="true"
  7. left-icon="back"
  8. title="入库单审批详情"
  9. @clickLeft="back"
  10. ></uni-nav-bar>
  11. <template>
  12. <view class="tab-title">
  13. <view
  14. class="tab-item"
  15. :class="0 === pickTabIndex ? 'active' : ''"
  16. @click="changeChartsTab(0)"
  17. >基本信息
  18. </view>
  19. <view
  20. class="tab-item"
  21. :class="1 === pickTabIndex ? 'active' : ''"
  22. @click="changeChartsTab(1)"
  23. >
  24. 入库明细
  25. </view>
  26. </view>
  27. </template>
  28. <view class="content">
  29. <!-- 基本信息 -->
  30. <view class="baseinfo" v-if="pickTabIndex === 0">
  31. <view class="col">
  32. <text class="label">入库单号</text>
  33. <text class="desc">{{ baseInfo.bizNum }}</text>
  34. </view>
  35. <!-- <view class="col">
  36. <text class="label">来源类型</text>
  37. <text class="desc">{{ baseInfo.planName }}</text>
  38. </view> -->
  39. <view class="col">
  40. <text class="label">来源单号</text>
  41. <text class="desc">{{ baseInfo.documentSource }}</text>
  42. </view>
  43. <view class="col">
  44. <text class="label">入库场景</text>
  45. <text class="desc">{{ dictOpt.bizScene[baseInfo.bizScene] }}</text>
  46. </view>
  47. <view class="col">
  48. <text class="label">入库登记人</text>
  49. <text class="desc">{{ baseInfo.createUserName }}</text>
  50. </view>
  51. <view class="col">
  52. <text class="label">供应商</text>
  53. <text class="desc">{{ baseInfo.supplierName }}</text>
  54. </view>
  55. <view class="col">
  56. <text class="label">送货人</text>
  57. <text class="desc">{{ baseInfo.deliveryName }}</text>
  58. </view>
  59. <view class="col">
  60. <text class="label">送货人电话</text>
  61. <text class="desc">{{ baseInfo.deliveryPhone }}</text>
  62. </view>
  63. <view class="col">
  64. <text class="label">紧急状态</text>
  65. <text class="desc">{{ dictOpt.urgent[baseInfo.urgent] }}</text>
  66. </view>
  67. <view class="col">
  68. <text class="label">入库时间</text>
  69. <text class="desc">{{ baseInfo.verifyTime }}</text>
  70. </view>
  71. <view class="col">
  72. <text class="label">备注</text>
  73. <text class="desc">{{ baseInfo.remark }}</text>
  74. </view>
  75. </view>
  76. <view class="equipment" v-if="pickTabIndex === 1">
  77. <uni-collapse accordion v-model="accordionVal">
  78. <uni-collapse-item
  79. v-for="(item, index) in planEquiList"
  80. :show-animation="true"
  81. :key="index"
  82. :open="false"
  83. :typeOpen="1"
  84. >
  85. <template v-slot:title>
  86. <view class="collapse-title">
  87. {{ item.assetName }}({{ item.assetCode }})
  88. <text>
  89. {{ item.warehouseLedgerDetails.length }}{{ item.minPackUnit }}
  90. </text>
  91. </view>
  92. </template>
  93. <view class="collapse-item-wrapper">
  94. <view class="info-container">
  95. <view class="col">
  96. <text class="label">类型</text>
  97. <text class="desc">{{
  98. getDictValue('物品类型', item.assetType)
  99. }}</text>
  100. </view>
  101. <view class="col">
  102. <text class="more">入库数量</text>
  103. <text class="desc">
  104. {{ item.outInNum }}{{ item.minPackUnit }}
  105. <span style="margin-left: 15rpx"
  106. >{{ item.outInNum * item.measurementUnit
  107. }}{{ item.unit }}</span
  108. >
  109. </text>
  110. </view>
  111. <view class="col">
  112. <text class="label">批次号</text>
  113. <text class="desc">{{ item.batchNum }}</text>
  114. </view>
  115. <view class="col">
  116. <text class="more">计量单位</text>
  117. <text class="desc"
  118. >{{ item.measurementUnit }}{{ item.unit }}/{{
  119. item.minPackUnit
  120. }}</text
  121. >
  122. </view>
  123. <view
  124. class="col"
  125. v-for="(itm, index) in tableHeader"
  126. :key="index"
  127. >
  128. <text class="label">{{ itm.label }}</text>
  129. <text class="desc">{{ item[itm.prop] }}</text>
  130. </view>
  131. <view class="col row">
  132. <text class="label">货位</text>
  133. <text class="desc"
  134. >{{ item.warehouseName }}-{{ item.areaName }}-{{
  135. item.shelfCode
  136. }}-{{ item.cargoSpaceCode }}</text
  137. >
  138. </view>
  139. <view class="col row" v-if="baseInfo.assetType == 3">
  140. <text class="label">质检单</text>
  141. <text
  142. class="desc text-primary"
  143. @tap.stop.prevent="viewFile(item.contentImage)"
  144. >查看</text
  145. >
  146. </view>
  147. </view>
  148. <uni-table
  149. border
  150. stripe
  151. emptyText="暂无更多数据"
  152. style="margin-top: 30rpx"
  153. >
  154. <!-- 表头行 -->
  155. <uni-tr>
  156. <uni-th align="left" width="240rpx">批次号</uni-th>
  157. <uni-th align="left" width="170rpx"
  158. >{{ getDictValue('物品类型', item.assetType) }}编号</uni-th
  159. >
  160. <uni-th align="left" width="170rpx">{{
  161. dateHeader(item.warehouseLedgerDetails)
  162. }}</uni-th>
  163. <uni-th align="left" width="170rpx">包装编码</uni-th>
  164. </uni-tr>
  165. <!-- 表格数据行 -->
  166. <uni-tr
  167. v-for="(el, index) in item.warehouseLedgerDetails"
  168. :key="index"
  169. >
  170. <uni-td>
  171. {{ el.batchNum }}
  172. </uni-td>
  173. <uni-td>{{ el.onlyCode }}</uni-td>
  174. <uni-td>{{
  175. el.manufactureTime || el.procurementTime
  176. }}</uni-td>
  177. <uni-td>{{ el.num }}</uni-td>
  178. </uni-tr>
  179. </uni-table>
  180. </view>
  181. </uni-collapse-item>
  182. </uni-collapse>
  183. </view>
  184. </view>
  185. <!-- <Approval v-if="isApproval" :devOpsType="0"
  186. :planType="options.planType" :myHandleId="options.id" :id="options.workOrderId" /> -->
  187. <view
  188. class="approval-container"
  189. v-if="isApproval && baseInfo.verifyStatus === 1"
  190. >
  191. <view class="approval_btn-wrapper">
  192. <text class="approval-btn refuse" @click="handleRefuse">驳回</text>
  193. <text class="approval-btn primary" @click="handlePass(true)">通过</text>
  194. </view>
  195. <uni-popup ref="inputDialog" type="dialog">
  196. <uni-popup-dialog
  197. ref="inputClose"
  198. mode="input"
  199. title="驳回原因"
  200. placeholder="请输入内容"
  201. :before-close="true"
  202. @close="handleClose"
  203. @confirm="timeoutCauseConfirm"
  204. ></uni-popup-dialog>
  205. </uni-popup>
  206. </view>
  207. <u-overlay :show="show" @click="show = false">
  208. <view class="warp">
  209. <image v-if="imgs" :src="imgs"></image>
  210. <div v-else class="warp-tips">暂无数据显示</div>
  211. </view>
  212. </u-overlay>
  213. </view>
  214. </template>
  215. <script>
  216. import { post, get, postJ } from '@/utils/api.js'
  217. import Approval from '@/components/Approval.vue'
  218. import Info from './components/Info'
  219. import { tableHeader } from '@/pages/warehouse/common.js'
  220. import Content from './components/Content'
  221. import dictMixin from '@/mixins/dictMixins'
  222. export default {
  223. components: {
  224. Approval,
  225. Content,
  226. Info
  227. },
  228. mixins: [dictMixin],
  229. data () {
  230. return {
  231. pickTabIndex: 0,
  232. accordionVal: '',
  233. options: {
  234. id: '',
  235. workOrderId: '',
  236. planType: '',
  237. devOpsType: ''
  238. },
  239. baseInfo: {},
  240. planEquiList: [],
  241. isApproval: false,
  242. dictOpt: {
  243. bizScene: {
  244. 1: '生产入库',
  245. 2: '采购入库',
  246. 3: '赠送入库',
  247. 4: '借用入库',
  248. 5: '退还入库',
  249. 6: '其他入库'
  250. },
  251. urgent: {
  252. 1: '普通',
  253. 2: '重要',
  254. 3: '紧急'
  255. }
  256. },
  257. show: false,
  258. imgs: ''
  259. }
  260. },
  261. computed: {
  262. tableHeader () {
  263. return tableHeader(this.baseInfo.assetType)
  264. }
  265. },
  266. onLoad (options) {
  267. this.options = options
  268. this.isApproval = options.type === 'approval'
  269. // this.requestDict('物品类型')
  270. },
  271. onShow () {
  272. this.getInfo()
  273. },
  274. methods: {
  275. dateHeader (warehouseLedgerDetails) {
  276. return warehouseLedgerDetails.some(item => !!item.manufactureTime)
  277. ? '生产日期'
  278. : '采购日期'
  279. },
  280. viewFile (list) {
  281. this.show = true
  282. this.imgs = this.apiUrl + list[0]?.accessUrl || ''
  283. },
  284. //切换选项卡
  285. changeChartsTab (index) {
  286. this.pickTabIndex = index
  287. },
  288. getInfo () {
  289. get(
  290. this.apiUrl +
  291. `/outInWarehouse/select/detail/${this.options.workOrderId}`
  292. ).then(res => {
  293. if (res?.success) {
  294. this.baseInfo = res.data.outInWarehouse
  295. this.planEquiList = res.data.warehouseLedgerInfos
  296. }
  297. })
  298. },
  299. // 审批
  300. handleRefuse () {
  301. this.$refs.inputDialog.open()
  302. },
  303. handleClose () {
  304. this.$refs.inputDialog.close()
  305. },
  306. handlePass (checked, cause) {
  307. const params = {
  308. approlId: this.options.id,
  309. handleResult: checked ? 2 : 0,
  310. bizId: this.options.workOrderId,
  311. handleCause: cause,
  312. handleStatus: 1
  313. }
  314. postJ(this.apiUrl + '/outInWarehouse/changeStatus', params).then(res => {
  315. if (res?.success) {
  316. uni.navigateTo({
  317. url: `/pages/home/backlog/result?type=${
  318. checked ? 'approve' : 'refuse'
  319. }&status=${this.devOpsType}`
  320. })
  321. }
  322. })
  323. },
  324. timeoutCauseConfirm (value) {
  325. if (!value) {
  326. uni.showToast({
  327. title: '请输入驳回原因',
  328. icon: 'none'
  329. })
  330. return
  331. }
  332. this.handlePass(false, value)
  333. this.$refs.inputDialog.close()
  334. }
  335. // 审批end
  336. }
  337. }
  338. </script>
  339. <style lang="scss" scoped>
  340. .warp {
  341. display: flex;
  342. justify-content: center;
  343. align-items: center;
  344. width: 100%;
  345. height: 100%;
  346. .warp-tips {
  347. font-size: 28rpx;
  348. color: #ffffff;
  349. }
  350. }
  351. .tab-title {
  352. width: 100%;
  353. padding: 0 30rpx;
  354. margin-bottom: 12rpx;
  355. display: flex;
  356. height: $tab-height;
  357. line-height: $tab-height;
  358. background-color: #ffffff;
  359. border-bottom: 1px solid #f2f2f2;
  360. box-sizing: border-box;
  361. .tab-item {
  362. width: 30%;
  363. text-align: center;
  364. font-size: 32rpx;
  365. color: $uni-text-color-grey;
  366. }
  367. .tab-item.active {
  368. color: $j-primary-border-green;
  369. border-bottom: 1px solid $j-primary-border-green;
  370. }
  371. }
  372. .plan-approval-container {
  373. display: flex;
  374. flex-direction: column;
  375. padding-bottom: 80rpx;
  376. /deep/.uni-collapse-item {
  377. background-color: rgba(21, 122, 44, 0.372549019607843);
  378. }
  379. .content {
  380. flex: 1;
  381. overflow: auto;
  382. .baseinfo {
  383. padding: 0 22rpx;
  384. font-size: 28rpx;
  385. .col {
  386. display: flex;
  387. padding: 10rpx 0;
  388. border-bottom: 1rpx dashed #d7d7d7;
  389. .label {
  390. display: inline-block;
  391. width: 160rpx;
  392. text-align: right;
  393. margin-right: 20rpx;
  394. font-weight: bold;
  395. }
  396. .desc {
  397. flex: 1;
  398. word-break: break-all;
  399. }
  400. }
  401. }
  402. }
  403. .collapse-title {
  404. display: flex;
  405. justify-content: space-between;
  406. align-items: center;
  407. font-size: 28rpx;
  408. height: 80rpx;
  409. padding: 8rpx;
  410. box-sizing: border-box;
  411. }
  412. .collapse-item-wrapper {
  413. padding: 12rpx;
  414. .info-container {
  415. margin-bottom: 20rpx;
  416. display: flex;
  417. flex-wrap: wrap;
  418. .col {
  419. width: 50%;
  420. &.row {
  421. width: 100%;
  422. }
  423. }
  424. }
  425. }
  426. }
  427. .pd-list-item {
  428. padding: 10rpx;
  429. border-bottom: 1px solid #d7d7d7;
  430. .item {
  431. display: flex;
  432. font-size: 28rpx;
  433. justify-content: space-between;
  434. padding: 10rpx;
  435. }
  436. }
  437. .info-container {
  438. padding: 0 20rpx;
  439. .col {
  440. border-bottom: 1rpx dashed #7d7d7d;
  441. padding: 10rpx 0;
  442. display: flex;
  443. .label {
  444. width: 100rpx;
  445. text-align: right;
  446. margin-right: 28rpx;
  447. color: #333;
  448. font-weight: bold;
  449. }
  450. .more {
  451. width: 130rpx;
  452. text-align: right;
  453. margin-right: 28rpx;
  454. color: #333;
  455. font-weight: bold;
  456. }
  457. .desc {
  458. flex: 1;
  459. }
  460. }
  461. }
  462. .approval-container {
  463. width: 100vw;
  464. height: 80rpx;
  465. .approval_btn-wrapper {
  466. display: flex;
  467. position: fixed;
  468. bottom: 0;
  469. width: 100vw;
  470. height: 80rpx;
  471. background-color: #fff;
  472. }
  473. .approval-btn {
  474. flex: 1;
  475. line-height: 78rpx;
  476. text-align: center;
  477. border: 1rpx solid $j-primary-border-green;
  478. &.refuse {
  479. color: red;
  480. }
  481. &.primary {
  482. background-color: $j-primary-border-green;
  483. color: #fff;
  484. }
  485. }
  486. }
  487. </style>