warehouse_details.vue 16 KB

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