warehouse_details.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  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">
  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"></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. this.$api.doRequest('get', '/purchasePrice/purchasePriceLook', {
  181. id: this.id
  182. }).then(res => {
  183. if (res.data.code == 200) {
  184. this.list = res.data.data
  185. this.$api.doRequest('get', '/workflow/query/workflowDefinitions', {
  186. businessCode: 'PROCUREMENT-PRICE-APPROVE',
  187. tmpCompId: uni.getStorageSync('pcUserInfo').compId
  188. }).then(res1 => {
  189. this.$api.doRequest('get', '/commonUser/getHis', {
  190. workflowId: res1.data.data[0].id,
  191. businessKey: this.id
  192. }).then(response => {
  193. uni.hideLoading()
  194. for (let i = 0; i < response.data.data.length; i++) {
  195. this.$set(response.data.data[i],'status','question')
  196. // console.log(response.data.data[i].workflowHistoricTasks,i)
  197. if(response.data.data[i].commonStaffs){
  198. response.data.data[i].showflow=false
  199. response.data.data[i].operatorTitle=response.data.data[i].desc.substring(0,2)
  200. response.data.data[i].operatorName=response.data.data[i].desc
  201. response.data.data[i].staffscontent='共'+response.data.data[i].commonStaffs.length+'人,当前审核'+response.data.data[i].workflowHistoricTasks.length+'人'
  202. if(response.data.data[i].workflowHistoricTasks&&response.data.data[i].workflowHistoricTasks.length>0){
  203. if(response.data.data[i].workflowHistoricTasks.length!=response.data.data[i].commonStaffs.length){
  204. // response.data.data[i].status='question'
  205. this.$set(response.data.data[i],'status','question')
  206. }else{
  207. this.$set(response.data.data[i],'status','success')
  208. // response.data.data[i].status='success'
  209. }
  210. response.data.data[i].workflowlen=response.data.data[i].workflowHistoricTasks.length
  211. var workflowdata=response.data.data[i].workflowHistoricTasks
  212. var staffsdata=response.data.data[i].commonStaffs
  213. for (let q = 0; q < staffsdata.length; q++) {
  214. staffsdata[q].status=false
  215. staffsdata[q].staffTitle=staffsdata[q].staffName
  216. for (let k = 0; k < workflowdata.length; k++) {
  217. if(staffsdata[q].staffId==workflowdata[k].operatorId){
  218. staffsdata[q].status=true
  219. }
  220. }
  221. }
  222. }
  223. response.data.data[i].commonStaffs1=response.data.data[i].commonStaffs
  224. }else{
  225. if(response.data.data[i].workflowHistoricTasks&&response.data.data[i].workflowHistoricTasks.length>0){
  226. var len =response.data.data[i].workflowHistoricTasks.length-1
  227. if(response.data.data[i].workflowHistoricTasks[len].approved){
  228. this.$set(response.data.data[i],'status','success')
  229. }else{
  230. this.$set(response.data.data[i],'status','error')
  231. }
  232. response.data.data[i].operatorTitle=response.data.data[i].workflowHistoricTasks[len].operatorName.substring(response.data.data[i].workflowHistoricTasks[0].operatorName.length - 2)
  233. response.data.data[i].operatorName=response.data.data[i].workflowHistoricTasks[len].operatorName
  234. var time=new Date(response.data.data[i].workflowHistoricTasks[len].claimTime).getTime()
  235. response.data.data[i].updateDate=this.$u.timeFormat(time, 'mm.dd hh:MM')
  236. response.data.data[i].auditMind=response.data.data[i].workflowHistoricTasks[len].auditMind
  237. }else{
  238. this.$set(response.data.data[i],'status','question')
  239. // response.data.data[i].status='question'
  240. if(response.data.data[i].desc=='总经理助理审核'){
  241. response.data.data[i].operatorTitle='总助'
  242. }else if(response.data.data[i].desc=='杜大光审核'){
  243. response.data.data[i].operatorTitle='大光'
  244. }else{
  245. response.data.data[i].operatorTitle=response.data.data[i].desc.substring(0,2)
  246. }
  247. response.data.data[i].operatorName=response.data.data[i].desc
  248. var time1=new Date(response.data.data[i].updateDate).getTime()
  249. response.data.data[i].updateDate=this.$u.timeFormat(time1, 'mm.dd hh:MM')
  250. response.data.data[i].auditMind=''
  251. }
  252. }
  253. }
  254. // console.log(response.data.data)
  255. this.auditList = response.data.data
  256. var time2=new Date(this.auditList[0].createDate).getTime()
  257. var time3=this.$u.timeFormat(time2, 'mm.dd hh:MM')
  258. this.auditList.unshift({
  259. operatorTitle:this.list.creater.substring(0,2),
  260. operatorName:this.list.creater,
  261. updateDate:time3,
  262. auditMind:'',
  263. desc:'发起申请',
  264. showflow:false,
  265. commonStaffs1:null,
  266. commonStaffs:null,
  267. workflowHistoricTasks:[],
  268. status:'success'
  269. })
  270. })
  271. })
  272. }
  273. })
  274. },
  275. confirm(item) {
  276. this.list.contractNo = item[0].value
  277. },
  278. fanHui(){
  279. uni.navigateBack()
  280. }
  281. }
  282. }
  283. </script>
  284. <style scoped lang="scss">
  285. .warp {
  286. margin: 10rpx;
  287. padding: 20rpx 20rpx 330rpx 20rpx;
  288. }
  289. .content1,
  290. .content2 {
  291. border-radius: 20rpx;
  292. background: white;
  293. padding: 20rpx;
  294. .title {
  295. font-size: 28rpx;
  296. font-weight: 600;
  297. color: #333333;
  298. text-align: left;
  299. }
  300. .row {
  301. display: flex;
  302. justify-content: space-between;
  303. border-bottom: 1px solid #EEEEEE;
  304. padding: 21rpx 0;
  305. .right,
  306. input {
  307. font-size: 28rpx;
  308. color: #333333;
  309. }
  310. }
  311. }
  312. .content2 {
  313. margin-top: 20rpx;
  314. }
  315. .bottom-btn {
  316. width: 100%;
  317. position: fixed;
  318. bottom:0;
  319. display: flex;
  320. z-index: 2;
  321. left: 0;
  322. background-color: #f8f8f8;
  323. flex-direction: column;
  324. .btn1,.btn2{
  325. width: 100%;
  326. margin-bottom: 26rpx;
  327. border-radius: 90rpx;
  328. }
  329. .btn1{
  330. background: white;
  331. color: #00C265;
  332. }
  333. }
  334. .submit {
  335. width: 40%;
  336. background: #22C572;
  337. border-radius: 10rpx;
  338. }
  339. .boder{
  340. border:0;
  341. border-bottom: 0!important;
  342. }
  343. .topInfo {
  344. height: 210rpx;
  345. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  346. padding: 30rpx;
  347. .topInfo-item {
  348. height: 150rpx;
  349. background-color: #FFFFFF;
  350. border-radius: 20rpx;
  351. padding: 40rpx;
  352. .logo {
  353. width: 40rpx;
  354. height: 40rpx;
  355. margin-top: 8rpx;
  356. }
  357. .infoText {
  358. font-size: 36rpx;
  359. font-weight: 600;
  360. margin-left: 20rpx;
  361. }
  362. .infoData {
  363. color: #878C9C;
  364. font-size: 26rpx;
  365. margin-top: 10rpx;
  366. }
  367. }
  368. }
  369. .content3 {
  370. background: white;
  371. margin: 20rpx 0;
  372. border-radius: 20rpx;
  373. padding: 20rpx;
  374. .row {
  375. display: flex;
  376. .left {
  377. display: flex;
  378. align-items: center;
  379. .item1{
  380. position:relative;
  381. .item-content{
  382. background:#22C572;
  383. width: 50px;
  384. height: 50px;
  385. border-radius: 10px;
  386. line-height: 50px;
  387. text-align: center;
  388. font-size: 18px;
  389. color: #fff;
  390. }
  391. .status{
  392. position:absolute;
  393. border-radius: 50%;
  394. padding: 0px 2px;
  395. right: -3px;
  396. bottom: -3px;
  397. background:#fff;
  398. }
  399. .status.success{
  400. border:1px solid rgb(60, 156, 255);
  401. }
  402. .status.error{
  403. border:1px solid rgb(245, 108, 108);
  404. }
  405. .status.question{
  406. border:1px solid #f9ae3d;
  407. }
  408. }
  409. }
  410. .right {
  411. width:80%;
  412. // color: #B0B1B5;
  413. margin-top: 10px;
  414. .right-content{
  415. background:#F2F3F7;
  416. margin-left:10px;
  417. margin-top:10px;
  418. padding:10px;
  419. border-radius:5px;
  420. color: #B0B1B5;
  421. }
  422. .right-item{
  423. display: flex;
  424. justify-content: space-between;
  425. .time{
  426. color:#999;
  427. }
  428. .item2 {
  429. margin-left: 20rpx;
  430. .name {
  431. font-size: 28rpx;
  432. font-weight: 800;
  433. }
  434. .status.success {
  435. color: #6CC48C;
  436. }
  437. .status.error {
  438. color: rgb(245, 108, 108);
  439. }
  440. .status.question {
  441. color: #f9ae3d;
  442. }
  443. }
  444. }
  445. }
  446. }
  447. .row2{
  448. display:flex;
  449. .item-content{
  450. background:#22C572;
  451. width: 30px;
  452. height: 30px;
  453. border-radius: 50%;
  454. line-height: 30px;
  455. text-align: center;
  456. font-size: 12px;
  457. color: #fff;
  458. padding:0 2px;
  459. margin:0 auto;
  460. }
  461. .status{
  462. position:absolute;
  463. top:0;right:0;
  464. }
  465. }
  466. .row-line {
  467. width: 1px;
  468. height: 30px;
  469. background: #F2F2F2;
  470. margin: 10rpx 50rpx;
  471. }
  472. .audit {
  473. margin-top: 20rpx;
  474. }
  475. }
  476. </style>