approve_allot.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  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.dialNumber }}</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.dialType }}</text>
  42. </view>
  43. <view class="col">
  44. <text class="label">调出库</text>
  45. <text class="desc">{{ baseInfo.warehouseName }}</text>
  46. </view>
  47. <view class="col">
  48. <text class="label">调入库</text>
  49. <text class="desc">{{ baseInfo.inWarehouseName }}</text>
  50. </view>
  51. <view class="col">
  52. <text class="label">调拨数量</text>
  53. <text class="desc">{{ planEquiList.length }}</text>
  54. </view>
  55. <view class="col">
  56. <text class="label">申请人</text>
  57. <text class="desc">{{ baseInfo.createUserName }}</text>
  58. </view>
  59. <view class="col">
  60. <text class="label">创建时间</text>
  61. <text class="desc">{{ baseInfo.createTime }}</text>
  62. </view>
  63. <view class="col">
  64. <text class="label">提交时间</text>
  65. <text class="desc">{{ baseInfo.submissionTime }}</text>
  66. </view>
  67. <view class="col">
  68. <text class="label">审核时间</text>
  69. <text class="desc">{{ baseInfo.auditorTime }}</text>
  70. </view>
  71. <view class="col">
  72. <text class="label">审核说明</text>
  73. <text class="desc">{{ baseInfo.auditCause }}</text>
  74. </view>
  75. </view>
  76. <view class="equipment" v-if="pickTabIndex === 1">
  77. <AssetsCard
  78. v-for="(item, index) in planEquiList"
  79. class="kd-row"
  80. type="detail"
  81. :isApproval="true"
  82. :key="index"
  83. :item="item"
  84. />
  85. <!-- <view class="info-container" v-for="(item,index) in planEquiList" :key="index">
  86. <view class="title">
  87. {{item.assetName}}({{item.assetCode}})
  88. </view>
  89. <view class="main-wrap">
  90. <view class="col">
  91. <text class="label">批次</text>
  92. <text class="desc">{{item.batchNo}}</text>
  93. </view>
  94. <view class="col">
  95. <text class="label">牌号/型号</text>
  96. <text class="desc">{{item.brandNum}}</text>
  97. </view>
  98. <view class="col">
  99. <text class="label">单位</text>
  100. <text class="desc">{{item.measurementUnit}}{{item.unit}}/{{item.minPackUnit}}</text>
  101. </view>
  102. <view class="col">
  103. <text class="label">桶号</text>
  104. <text class="desc">{{item.num}}</text>
  105. </view>
  106. <view class="col">
  107. <text class="label">调出:</text>
  108. <text class="desc">{{ `${item.outWarehouseAreaName}-${item.outWarehouseAreaGoodsCode}-${item.outGoodsAllocationCode}` }}</text>
  109. </view>
  110. <view class="col">
  111. <text class="label">调入:</text>
  112. <text class="desc">{{ `${item.inWarehouseAreaName}-${item.inWarehouseAreaGoodsCode}-${item.inGoodsAllocationCode}` }}</text>
  113. </view>
  114. </view>
  115. </view> -->
  116. </view>
  117. </view>
  118. <view
  119. class="approval-container"
  120. v-if="isApproval && baseInfo.auditStatus == 1"
  121. >
  122. <view class="approval_btn-wrapper">
  123. <text class="approval-btn refuse" @click="handleRefuse">驳回</text>
  124. <text class="approval-btn primary" @click="handlePass(true)">通过</text>
  125. </view>
  126. <uni-popup ref="inputDialog" type="dialog">
  127. <uni-popup-dialog
  128. ref="inputClose"
  129. mode="input"
  130. title="驳回原因"
  131. placeholder="请输入内容"
  132. :before-close="true"
  133. @close="handleClose"
  134. @confirm="timeoutCauseConfirm"
  135. ></uni-popup-dialog>
  136. </uni-popup>
  137. </view>
  138. </view>
  139. </template>
  140. <script>
  141. import { post, get, postJ } from '@/utils/api.js'
  142. import Approval from '@/components/Approval.vue'
  143. import AssetsCard from '@/pages/warehouse/inventoryAllocation/components/AssetsCard.vue'
  144. import Info from './components/Info'
  145. import Content from './components/Content'
  146. export default {
  147. components: {
  148. AssetsCard,
  149. Approval,
  150. Content,
  151. Info
  152. },
  153. data () {
  154. return {
  155. pickTabIndex: 0,
  156. accordionVal: '',
  157. options: {
  158. id: '',
  159. workOrderId: '',
  160. planType: '',
  161. devOpsType: ''
  162. },
  163. baseInfo: '',
  164. planEquiList: [],
  165. isApproval: false,
  166. dict: {
  167. bizScene: {
  168. 1: '生产调拨',
  169. 2: '采购调拨',
  170. 3: '赠送调拨',
  171. 4: '借用调拨',
  172. 5: '退还调拨',
  173. 6: '其他调拨'
  174. },
  175. urgent: {
  176. 1: '普通',
  177. 2: '重要',
  178. 3: '紧急'
  179. }
  180. }
  181. }
  182. },
  183. onLoad (options) {
  184. this.options = options
  185. this.isApproval = options.type === 'approval'
  186. },
  187. onShow () {
  188. this.getInfo()
  189. },
  190. methods: {
  191. //切换选项卡
  192. changeChartsTab (index) {
  193. this.pickTabIndex = index
  194. },
  195. getInfo () {
  196. get(
  197. this.apiUrl +
  198. `/conventionalStockTransfer/details/conventionalStockTransfer/${this.options.workOrderId}`
  199. ).then(res => {
  200. if (res?.success) {
  201. this.baseInfo = res.data.conventionalStockTransfer || {}
  202. this.planEquiList = res.data.stockTransferInfoList
  203. }
  204. })
  205. },
  206. // 审批
  207. handleRefuse () {
  208. this.$refs.inputDialog.open()
  209. },
  210. handleClose () {
  211. this.$refs.inputDialog.close()
  212. },
  213. handlePass (checked, cause) {
  214. const params = {
  215. approlId: this.options.id,
  216. handleResult: checked ? 2 : 0,
  217. bizId: this.options.workOrderId,
  218. handleCause: cause,
  219. handleStatus: 1
  220. }
  221. postJ(
  222. this.apiUrl + '/conventionalStockTransfer/changeStatus',
  223. params
  224. ).then(res => {
  225. if (res?.success) {
  226. uni.navigateTo({
  227. url: `/pages/home/backlog/result?type=${
  228. checked ? 'approve' : 'refuse'
  229. }&status=${this.devOpsType}`
  230. })
  231. }
  232. })
  233. },
  234. timeoutCauseConfirm (value) {
  235. if (!value) {
  236. uni.showToast({
  237. title: '请输入驳回原因',
  238. icon: 'none'
  239. })
  240. return
  241. }
  242. this.handlePass(false, value)
  243. this.$refs.inputDialog.close()
  244. }
  245. // 审批end
  246. }
  247. }
  248. </script>
  249. <style lang="scss" scoped>
  250. .tab-title {
  251. width: 100%;
  252. padding: 0 30rpx;
  253. margin-bottom: 12rpx;
  254. display: flex;
  255. height: $tab-height;
  256. line-height: $tab-height;
  257. background-color: #ffffff;
  258. border-bottom: 1px solid #f2f2f2;
  259. box-sizing: border-box;
  260. .tab-item {
  261. width: 30%;
  262. text-align: center;
  263. font-size: 32rpx;
  264. color: $uni-text-color-grey;
  265. }
  266. .tab-item.active {
  267. color: $j-primary-border-green;
  268. border-bottom: 1px solid $j-primary-border-green;
  269. }
  270. }
  271. .plan-approval-container {
  272. display: flex;
  273. flex-direction: column;
  274. padding-bottom: 80rpx;
  275. /deep/.uni-collapse-item {
  276. background-color: rgba(21, 122, 44, 0.372549019607843);
  277. }
  278. .content {
  279. flex: 1;
  280. overflow: auto;
  281. .baseinfo {
  282. padding: 0 22rpx;
  283. font-size: 28rpx;
  284. .col {
  285. display: flex;
  286. padding: 10rpx 0;
  287. border-bottom: 1rpx dashed #d7d7d7;
  288. .label {
  289. display: inline-block;
  290. width: 200rpx;
  291. text-align: right;
  292. margin-right: 20rpx;
  293. font-weight: bold;
  294. }
  295. .desc {
  296. flex: 1;
  297. word-break: break-all;
  298. }
  299. }
  300. }
  301. }
  302. .collapse-title {
  303. display: flex;
  304. justify-content: space-between;
  305. align-items: center;
  306. font-size: 28rpx;
  307. height: 80rpx;
  308. padding: 8rpx;
  309. box-sizing: border-box;
  310. }
  311. .collapse-item-wrapper {
  312. padding: 12rpx;
  313. .info-container {
  314. margin-bottom: 20rpx;
  315. display: flex;
  316. flex-wrap: wrap;
  317. .col {
  318. width: 50%;
  319. &.row {
  320. width: 100%;
  321. }
  322. }
  323. }
  324. }
  325. }
  326. .pd-list-item {
  327. padding: 10rpx;
  328. border-bottom: 1px solid #d7d7d7;
  329. .item {
  330. display: flex;
  331. font-size: 28rpx;
  332. justify-content: space-between;
  333. padding: 10rpx;
  334. }
  335. }
  336. .info-container {
  337. padding: 20rpx;
  338. border-bottom: 1px solid #f2f2f2;
  339. .title {
  340. font-size: 32rpx;
  341. color: #555;
  342. }
  343. .main-wrap {
  344. display: flex;
  345. flex-wrap: wrap;
  346. .col {
  347. color: #555;
  348. font-size: 28rpx;
  349. width: 50%;
  350. display: flex;
  351. padding: 20rpx 0;
  352. .label {
  353. margin-right: 10rpx;
  354. }
  355. }
  356. }
  357. }
  358. .approval-container {
  359. width: 100vw;
  360. height: 80rpx;
  361. .approval_btn-wrapper {
  362. display: flex;
  363. position: fixed;
  364. bottom: 0;
  365. width: 100vw;
  366. height: 80rpx;
  367. background-color: #fff;
  368. }
  369. .approval-btn {
  370. flex: 1;
  371. line-height: 78rpx;
  372. text-align: center;
  373. border: 1rpx solid $j-primary-border-green;
  374. &.refuse {
  375. color: red;
  376. }
  377. &.primary {
  378. background-color: $j-primary-border-green;
  379. color: #fff;
  380. }
  381. }
  382. }
  383. </style>