warehouse_details.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. <template>
  2. <view class="warp">
  3. <view class="topInfo">
  4. <view class="topInfo-item">
  5. <view class="flex info">
  6. <view class="logo">
  7. <image src="../../../static/img/reject.png" mode="" v-if="list.status == '已驳回'"
  8. style="height: 40rpx;"></image><!-- 驳回 -->
  9. <image src="../../../static/img/tongguo.png" mode="" v-if="list.status == '已通过'"
  10. style="height: 40rpx;"></image><!-- 通过 -->
  11. <image src="../../../static/img/daishenhe.png" mode="" v-if="list.status == '审核中'"
  12. style="height: 40rpx;"></image><!-- 待审核 -->
  13. </view>
  14. <view class="infoText">{{list.approveStatus?list.approveStatus:list.status}}</view>
  15. </view>
  16. <view class="infoData">{{list.updateDate}}</view>
  17. </view>
  18. </view>
  19. <view class='content1'>
  20. <view class="title">基本信息</view>
  21. <view class='row'>
  22. <view class="left">仓库</view>
  23. <view class="right">{{list.warehouseName}}</view>
  24. </view>
  25. <view class='row'>
  26. <view class="left">货名</view>
  27. <view class="right">{{list.goodsName}}</view>
  28. </view>
  29. <view class='row'>
  30. <view class="left">基准水分(%)</view>
  31. <view class="right">{{list.waterBase}}</view>
  32. </view>
  33. <view class='row'>
  34. <view class="left">干粮水分(%)</view>
  35. <view class="right">{{list.waterMin}}</view>
  36. </view>
  37. <view class='row'>
  38. <view class="left">水分上限(%)</view>
  39. <view class="right">{{list.waterMax}}</view>
  40. </view>
  41. <view v-if="list.paramType == '2'" class='row'>
  42. <view class="left">扣重比</view>
  43. <view class="right">{{list.deductWeight}}</view>
  44. </view>
  45. <view class='row'>
  46. <view class="left">干粮收购价格(元/公斤)</view>
  47. <view class="right">{{list.dryGrainPrice}}</view>
  48. </view>
  49. <view class='row boder'>
  50. <view class="left">销售上限</view>
  51. <view class="right">{{list.saleLimit}}</view>
  52. </view>
  53. </view>
  54. <view class="content2">
  55. <view class="title">粮价设置</view>
  56. <view v-for="(item,index) in list.details" :key="index">
  57. <view class="row">
  58. <view class="left">等级</view>
  59. <view class="right">{{item.level}}</view>
  60. </view>
  61. <view v-if="list.paramType == '2'" class="row">
  62. <view class="left">基准单价(元/公斤)</view>
  63. <view class="right">{{item.basePrice}}</view>
  64. </view>
  65. <view class="row" v-for="(item1,index1) in item.modelList" :key="index1" :class="index1==item.modelList.length-1?'boder':''">
  66. <view v-if="list.paramType == '2'" class="left">{{item1.startWater}}-{{item1.endWater}}降幅(元/0.1%)</view>
  67. <view v-else class="left">{{item1.startWater}}-{{item1.endWater}}扣重比</view>
  68. <view class="right">{{item1.price}}</view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="content3">
  73. <view class="title row">
  74. 流程
  75. </view>
  76. <view v-for="(item,index) in auditList" :key='index' class="audit">
  77. <view class="row" v-if='item.desc!="_PLACEHOLDER_"'>
  78. <view class="left">
  79. <view class="item1">
  80. <view class="item-content">{{item.operatorTitle}}</view>
  81. <view v-if="item.status=='success'" class='status success'>
  82. <u-icon name="checkmark" color="#2979ff" size="24"></u-icon>
  83. </view>
  84. <view v-if="item.status=='error'" class='status error'>
  85. <u-icon name="close" color="rgb(245, 108, 108)" size="24"></u-icon>
  86. </view>
  87. <view v-if="item.status=='question'" class='status question'>
  88. <u-icon name="question" color="#f9ae3d" size="24"></u-icon>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="right">
  93. <view class="right-item">
  94. <view class="item2">
  95. <view class="name">{{item.desc}}
  96. </view>
  97. <!-- <view class='time'>{{item.updateDate}}</view> -->
  98. <view v-if="item.status=='success'" class="status success">{{item.commonStaffs1?item.staffscontent:item.operatorName}}<text v-if='!item.commonStaffs1&&index!=0'>已审核</text></view>
  99. <view v-if="item.status=='error'" class="status error">{{item.commonStaffs1?item.staffscontent:item.operatorName}}<text v-if='!item.commonStaffs1'>{{item.workflowHistoricTasks ? "已驳回":''}}</text></view>
  100. <view v-if="item.status=='question'" class="status question">{{item.commonStaffs1?item.staffscontent:''}}<text v-if='!item.commonStaffs1'>未审核</text></view>
  101. <!-- <view class="status success">吕波(已审核)</view> -->
  102. </view>
  103. <view v-if='index==0||item.workflowHistoricTasks&&item.workflowHistoricTasks.length>0' class='time'>
  104. {{item.updateDate}}
  105. </view>
  106. </view>
  107. <view v-if='item.auditMind' class="right-content">
  108. {{item.auditMind}}
  109. </view>
  110. </view>
  111. <view v-if='item.commonStaffs1' class="right">
  112. <u-icon @click='showcontent(item)' :name="item.showflow?'arrow-up':'arrow-down'" size="28"></u-icon>
  113. </view>
  114. </view>
  115. <view v-if='item.showflow' style='padding:10px 0 0 50px;'>
  116. <view class='row2'>
  117. <view v-for='item1 in item.commonStaffs1' style='margin:5px;text-align:center;'>
  118. <view class="item-content">
  119. <u-icon v-if='item1.status' name="checkmark" color="#fff" size="14"></u-icon>
  120. <u-icon v-if='!item1.status' name="question" color="#f9ae3d" size="14"></u-icon>
  121. </view>
  122. <view class="name">{{item1.staffName}}</view>
  123. </view>
  124. </view>
  125. </view>
  126. <view class="row-line" v-if="index!= auditList.length - 1&&item.desc!='_PLACEHOLDER_'"></view>
  127. </view>
  128. </view>
  129. <u-toast ref="uToast" />
  130. <view style='padding:10px;' class='flex bottom-btn'>
  131. <u-button @click='fanHui' type="success" class="btn2">返回</u-button>
  132. </view>
  133. </view>
  134. </template>
  135. <script>
  136. import {
  137. mapState
  138. } from 'vuex';
  139. export default {
  140. name: "task",
  141. data() {
  142. return {
  143. show: false,
  144. id: 0,
  145. list: {},
  146. form: {
  147. name: '',
  148. intro: '',
  149. sex: ''
  150. },
  151. radio: '',
  152. pcUserInfo: uni.getStorageSync('pcUserInfo'),
  153. switchVal: false,
  154. contractNoList: [],
  155. auditList:[],
  156. };
  157. },
  158. computed: {
  159. ...mapState(['hasLogin', 'userInfo'])
  160. },
  161. onLoad(options) {
  162. this.id = options.id
  163. },
  164. onShow() {
  165. var that = this
  166. this.$nextTick(function() {
  167. that.getData()
  168. })
  169. },
  170. methods: {
  171. showcontent(item){
  172. item.showflow=!item.showflow
  173. },
  174. getData() {
  175. uni.showLoading({
  176. title:'加载中',
  177. mask:true
  178. })
  179. var data = []
  180. var that = this
  181. this.$api.doRequest('get', '/purchasePrice/purchasePriceLook', {
  182. id: this.id
  183. }).then(res => {
  184. if (res.data.code == 200) {
  185. this.list = res.data.data
  186. this.$api.doRequest('get', '/workflow/query/workflowDefinitions', {
  187. businessCode: 'PROCUREMENT-PRICE-APPROVE',
  188. tmpCompId: uni.getStorageSync('pcUserInfo').compId
  189. }).then(res1 => {
  190. this.$api.doRequest('get', '/commonUser/getHis', {
  191. workflowId: res1.data.data[0].id,
  192. businessKey: this.id,
  193. // branch:that.list.jointVentureParties?that.list.jointVentureParties:'zt'
  194. }).then(response => {
  195. uni.hideLoading()
  196. for (let i = 0; i < response.data.data.length; i++) {
  197. this.$set(response.data.data[i],'status','question')
  198. // console.log(response.data.data[i].workflowHistoricTasks,i)
  199. if(response.data.data[i].commonStaffs){
  200. response.data.data[i].showflow=false
  201. response.data.data[i].operatorTitle=response.data.data[i].desc.substring(0,2)
  202. response.data.data[i].operatorName=response.data.data[i].desc
  203. response.data.data[i].staffscontent='共'+response.data.data[i].commonStaffs.length+'人,当前审核'+response.data.data[i].workflowHistoricTasks.length+'人'
  204. if(response.data.data[i].workflowHistoricTasks&&response.data.data[i].workflowHistoricTasks.length>0){
  205. if(response.data.data[i].workflowHistoricTasks.length!=response.data.data[i].commonStaffs.length){
  206. // response.data.data[i].status='question'
  207. this.$set(response.data.data[i],'status','question')
  208. }else{
  209. this.$set(response.data.data[i],'status','success')
  210. // response.data.data[i].status='success'
  211. }
  212. response.data.data[i].workflowlen=response.data.data[i].workflowHistoricTasks.length
  213. var workflowdata=response.data.data[i].workflowHistoricTasks
  214. var staffsdata=response.data.data[i].commonStaffs
  215. for (let q = 0; q < staffsdata.length; q++) {
  216. staffsdata[q].status=false
  217. staffsdata[q].staffTitle=staffsdata[q].staffName
  218. for (let k = 0; k < workflowdata.length; k++) {
  219. if(staffsdata[q].staffId==workflowdata[k].operatorId){
  220. staffsdata[q].status=true
  221. }
  222. }
  223. }
  224. }
  225. response.data.data[i].commonStaffs1=response.data.data[i].commonStaffs
  226. }else{
  227. if(response.data.data[i].workflowHistoricTasks&&response.data.data[i].workflowHistoricTasks.length>0){
  228. var len =response.data.data[i].workflowHistoricTasks.length-1
  229. if(response.data.data[i].workflowHistoricTasks[len].approved){
  230. this.$set(response.data.data[i],'status','success')
  231. }else{
  232. this.$set(response.data.data[i],'status','error')
  233. }
  234. response.data.data[i].operatorTitle=response.data.data[i].workflowHistoricTasks[len].operatorName.substring(response.data.data[i].workflowHistoricTasks[0].operatorName.length - 2)
  235. response.data.data[i].operatorName=response.data.data[i].workflowHistoricTasks[len].operatorName
  236. var time=new Date(response.data.data[i].workflowHistoricTasks[len].claimTime).getTime()
  237. response.data.data[i].updateDate=this.$u.timeFormat(time, 'mm.dd hh:MM')
  238. response.data.data[i].auditMind=response.data.data[i].workflowHistoricTasks[len].auditMind
  239. }else{
  240. this.$set(response.data.data[i],'status','question')
  241. // response.data.data[i].status='question'
  242. if(response.data.data[i].desc=='总经理助理审核'){
  243. response.data.data[i].operatorTitle='总助'
  244. }else if(response.data.data[i].desc=='杜大光审核'){
  245. response.data.data[i].operatorTitle='大光'
  246. }else{
  247. response.data.data[i].operatorTitle=response.data.data[i].desc.substring(0,2)
  248. }
  249. response.data.data[i].operatorName=response.data.data[i].desc
  250. var time1=new Date(response.data.data[i].updateDate).getTime()
  251. response.data.data[i].updateDate=this.$u.timeFormat(time1, 'mm.dd hh:MM')
  252. response.data.data[i].auditMind=''
  253. }
  254. }
  255. }
  256. // console.log(response.data.data)
  257. this.auditList = response.data.data
  258. var time2=new Date(this.list.createDate).getTime()
  259. var time3=this.$u.timeFormat(time2, 'mm.dd hh:MM')
  260. this.auditList.unshift({
  261. operatorTitle:this.list.creater.substring(0,2),
  262. operatorName:this.list.creater,
  263. updateDate:time3,
  264. auditMind:'',
  265. desc:'发起申请',
  266. showflow:false,
  267. commonStaffs1:null,
  268. commonStaffs:null,
  269. workflowHistoricTasks:[],
  270. status:'success'
  271. })
  272. })
  273. })
  274. }
  275. })
  276. },
  277. confirm(item) {
  278. this.list.contractNo = item[0].value
  279. },
  280. fanHui(){
  281. uni.navigateBack()
  282. }
  283. }
  284. }
  285. </script>
  286. <style scoped lang="scss">
  287. .warp {
  288. margin: 10rpx;
  289. padding: 20rpx 20rpx 330rpx 20rpx;
  290. }
  291. .content1,
  292. .content2 {
  293. border-radius: 20rpx;
  294. background: white;
  295. padding: 20rpx;
  296. .title {
  297. font-size: 28rpx;
  298. font-weight: 600;
  299. color: #333333;
  300. text-align: left;
  301. }
  302. .row {
  303. display: flex;
  304. justify-content: space-between;
  305. border-bottom: 1px solid #EEEEEE;
  306. padding: 21rpx 0;
  307. .right,
  308. input {
  309. font-size: 28rpx;
  310. color: #333333;
  311. }
  312. }
  313. }
  314. .content2 {
  315. margin-top: 20rpx;
  316. }
  317. .bottom-btn {
  318. width: 100%;
  319. position: fixed;
  320. bottom:0;
  321. display: flex;
  322. z-index: 2;
  323. left: 0;
  324. background-color: #f8f8f8;
  325. flex-direction: column;
  326. .btn1,.btn2{
  327. width: 100%;
  328. margin-bottom: 26rpx;
  329. border-radius: 90rpx;
  330. }
  331. .btn1{
  332. background: white;
  333. color: #00C265;
  334. }
  335. }
  336. .submit {
  337. width: 40%;
  338. background: #22C572;
  339. border-radius: 10rpx;
  340. }
  341. .boder{
  342. border:0;
  343. border-bottom: 0!important;
  344. }
  345. .topInfo {
  346. height: 210rpx;
  347. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  348. padding: 30rpx;
  349. .topInfo-item {
  350. height: 150rpx;
  351. background-color: #FFFFFF;
  352. border-radius: 20rpx;
  353. padding: 40rpx;
  354. .logo {
  355. width: 40rpx;
  356. height: 40rpx;
  357. margin-top: 8rpx;
  358. }
  359. .infoText {
  360. font-size: 36rpx;
  361. font-weight: 600;
  362. margin-left: 20rpx;
  363. }
  364. .infoData {
  365. color: #878C9C;
  366. font-size: 26rpx;
  367. margin-top: 10rpx;
  368. }
  369. }
  370. }
  371. .content3 {
  372. background: white;
  373. margin: 20rpx 0;
  374. border-radius: 20rpx;
  375. padding: 20rpx;
  376. .row {
  377. display: flex;
  378. .left {
  379. display: flex;
  380. align-items: center;
  381. .item1 {
  382. position: relative;
  383. .item-content {
  384. background: #617AE0;
  385. width: 44px;
  386. height: 44px;
  387. border-radius: 22px;
  388. line-height: 44px;
  389. text-align: center;
  390. font-size: 15px;
  391. color: #fff;
  392. }
  393. .status {
  394. position: absolute;
  395. border-radius: 50%;
  396. padding: 0px 2px;
  397. right: -3px;
  398. bottom: -3px;
  399. background: #fff;
  400. }
  401. .status.success {
  402. border: 1px solid rgb(60, 156, 255);
  403. }
  404. .status.error {
  405. border: 1px solid rgb(245, 108, 108);
  406. }
  407. .status.question {
  408. border: 1px solid #f9ae3d;
  409. }
  410. }
  411. }
  412. .right {
  413. width: 80%;
  414. // color: #B0B1B5;
  415. margin-top: 10px;
  416. .right-content {
  417. background: #F2F3F7;
  418. margin-left: 10px;
  419. margin-top: 10px;
  420. padding: 10px;
  421. border-radius: 5px;
  422. color: #B0B1B5;
  423. }
  424. .right-item {
  425. display: flex;
  426. justify-content: space-between;
  427. .time {
  428. color: #999;
  429. }
  430. .item2 {
  431. margin-left: 20rpx;
  432. margin-top: -7px;
  433. .name {
  434. font-size: 28rpx;
  435. font-weight: 800;
  436. margin-bottom: 4px;
  437. }
  438. .status.success {
  439. color: #6CC48C;
  440. }
  441. .status.error {
  442. color: rgb(245, 108, 108);
  443. }
  444. .status.question {
  445. color: #f9ae3d;
  446. }
  447. }
  448. }
  449. }
  450. }
  451. .row2 {
  452. display: flex;
  453. .item-content {
  454. background: #22C572;
  455. width: 30px;
  456. height: 30px;
  457. border-radius: 50%;
  458. line-height: 30px;
  459. text-align: center;
  460. font-size: 12px;
  461. color: #fff;
  462. padding: 0 2px;
  463. margin: 0 auto;
  464. }
  465. .status {
  466. position: absolute;
  467. top: 0;
  468. right: 0;
  469. }
  470. }
  471. .row-line {
  472. width: 1px;
  473. height: 30px;
  474. background: #F2F2F2;
  475. margin: 10rpx 50rpx;
  476. }
  477. .audit {
  478. margin-top: 20rpx;
  479. }
  480. }
  481. </style>