Issueandreceipt_task_approval.vue 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237
  1. <template>
  2. <view class="warp">
  3. <view class="topInfo" v-if='retreatList.inOutType!="退库"'>
  4. <view class="topInfo-item">
  5. <view class="flex info">
  6. <view class="logo">
  7. <image src="../../../static/img/reject.png" mode=""
  8. v-if="OutList.taskStatus == '已驳回'||EnterList.taskStatus == '已驳回'" style="height: 40rpx;">
  9. </image><!-- 驳回 -->
  10. <image src="../../../static/img/tongguo.png" mode=""
  11. v-else-if="OutList.taskStatus == '已通过'||EnterList.taskStatus == '已通过'||OutList.taskStatus == '执行中'"
  12. style="height: 40rpx;"></image><!-- 通过 -->
  13. <image src="../../../static/img/daishenhe.png" mode=""
  14. v-else-if="OutList.taskStatus == '审核中'||OutList.taskStatus == '待审核'||EnterList.taskStatus == '待审核'"
  15. style="height: 40rpx;"></image><!-- 待审核 -->
  16. </view>
  17. <view class="infoText" v-if="OutList.taskStatus">{{OutList.taskStatus}}</view>
  18. <view class="infoText" v-else>{{EnterList.taskStatus}}</view>
  19. </view>
  20. <view class="infoData" v-if="OutList.updateDate">{{OutList.updateDate}}</view>
  21. <view class="infoData" v-else>{{EnterList.updateDate}}</view>
  22. </view>
  23. </view>
  24. <view class="content1">
  25. <u-form :model="OutList" ref="uForm">
  26. <u-form-item label="任务类型" prop="inOutType" label-width="140" class="uForm_item">
  27. <u-input v-model="OutList.inOutType" input-align="right" disabled v-if="OutList.inOutType" />
  28. <u-input v-model="EnterList.inOutType" input-align="right" disabled v-else />
  29. </u-form-item>
  30. <view v-if="retreatList.judge == 3">
  31. <!-- 退库 -->
  32. <view class="uForm_item">
  33. <view class="title part2">{{retreatList.inOutType}}</view>
  34. <view class='row'>
  35. <view class="left">编号</view>
  36. <view class="right">退库({{retreatList.inOutTaskNo}}}</view>
  37. </view>
  38. <view class='row'>
  39. <view class="left">仓库</view>
  40. <view class="right">{{retreatList.warehouseName}}</view>
  41. </view>
  42. <view class='row'>
  43. <view class="left">出库类型</view>
  44. <view class="right">{{retreatList.inOutType}}</view>
  45. </view>
  46. <view class='row' v-if="retreatList.inOutType == '移库出库'">
  47. <view class="left" style="width: 180rpx;">移库任务编号</view>
  48. <view class="right">{{retreatList.moveTaskNo}}</view>
  49. </view>
  50. <view class='row' v-if="retreatList.inOutType != '移库出库'">
  51. <view class="left">合同编号</view>
  52. <view class="right">{{retreatList.contractNo}}</view>
  53. </view>
  54. <view class='row'>
  55. <view class="left">货名</view>
  56. <view class="right">{{retreatList.goodsName}}</view>
  57. </view>
  58. <view class='row'>
  59. <view class="left">重量(吨)</view>
  60. <view class="right">{{retreatList.weight}}</view>
  61. </view>
  62. <view class='row'>
  63. <view class="left">预计出库日期</view>
  64. <view class="right">{{retreatList.predictDate}}</view>
  65. </view>
  66. <!-- <view class='row'>
  67. <view class="left">预估运费(元/吨)</view>
  68. <view class="right">{{retreatList.estimatedFreight}}</view>
  69. </view> -->
  70. <view class='row'>
  71. <view class="left">收货人</view>
  72. <view class="right">{{retreatList.agent}}</view>
  73. </view>
  74. </view>
  75. <view class="uForm_item">
  76. <u-form-item label="品级" prop="grade" label-width="150">
  77. <u-input v-model="retreatList.grade" input-align="right" placeholder="" @click='show=true'
  78. disabled />
  79. <u-picker :range="pjList" range-key="type" @confirm='pjPicker($event)' v-model="show"
  80. mode="selector">
  81. </u-picker>
  82. </u-form-item>
  83. <u-form-item label="容重(克/升)>=" prop="bulkDensity" label-width="190">
  84. <u-input v-model="retreatList.bulkDensity" input-align="right" placeholder="" />
  85. </u-form-item>
  86. <u-form-item label="水分(%)<=" prop="waterContent" label-width="160">
  87. <u-input v-model="retreatList.waterContent" input-align="right" placeholder="" />
  88. </u-form-item>
  89. <u-form-item v-if='!retreatList.status' label="单价(元/吨)" prop="unitPrice" label-width="160">
  90. <u-input v-model="retreatList.unitPrice" input-align="right" placeholder="" />
  91. </u-form-item>
  92. </view>
  93. </view>
  94. <view v-if="OutList.judge == 1">
  95. <view class="uForm_item">
  96. <!-- 出库 -->
  97. <view class="title part2">{{OutList.inOutType}}</view>
  98. <view class='row'>
  99. <view class="left">编号</view>
  100. <view class="right">出库({{OutList.inOutTaskNo}})</view>
  101. </view>
  102. <view class='row'>
  103. <view class="left">仓库</view>
  104. <view class="right">{{OutList.warehouseName}}</view>
  105. </view>
  106. <view class='row'>
  107. <view class="left">出库类型</view>
  108. <view class="right">{{OutList.inOutType}}</view>
  109. </view>
  110. <view class='row' v-if="OutList.inOutType == '移库出库'">
  111. <view class="left" style="width: 180rpx;">移库任务编号</view>
  112. <view class="right">{{OutList.moveTaskNo}}</view>
  113. </view>
  114. <view class='row' v-if="OutList.inOutType != '移库出库'">
  115. <view class="left">合同编号</view>
  116. <view class="right">{{OutList.contractNo}}</view>
  117. </view>
  118. <view class='row'>
  119. <view class="left">货名</view>
  120. <view class="right">{{OutList.goodsName}}</view>
  121. </view>
  122. <view class='row'>
  123. <view class="left">重量(吨)</view>
  124. <view class="right">{{OutList.weight}}</view>
  125. </view>
  126. <view class='row'>
  127. <view class="left">预计出库日期</view>
  128. <view class="right">{{OutList.predictDate}}</view>
  129. </view>
  130. <!-- <view class='row'>
  131. <view class="left">预估运费(元/吨)</view>
  132. <view class="right">{{OutList.estimatedFreight}}</view>
  133. </view> -->
  134. <view class='row'>
  135. <view class="left">发货人</view>
  136. <view class="right">{{OutList.agent}}</view>
  137. </view>
  138. </view>
  139. <view class="uForm_item">
  140. <u-form-item label="品级" prop="grade" label-width="150" v-if="retreatList.inOutType != '退库'">
  141. <u-input v-model="OutList.grade" input-align="right" placeholder="" @click='show=true'
  142. disabled />
  143. <u-picker :range="pjList" range-key="type" @confirm='pjPicker($event)' v-model="show"
  144. mode="selector"></u-picker>
  145. </u-form-item>
  146. <u-form-item label="容重(克/升)>=" prop="bulkDensity" label-width="190"
  147. v-if="retreatList.inOutType != '退库'">
  148. <u-input v-model="OutList.bulkDensity" input-align="right" placeholder="" />
  149. </u-form-item>
  150. <u-form-item label="水分(%)<=" prop="waterContent" label-width="160"
  151. v-if="retreatList.inOutType != '退库'">
  152. <u-input v-model="OutList.waterContent" input-align="right" placeholder="" />
  153. </u-form-item>
  154. <u-form-item v-if='!retreatList.status&&retreatList.inOutType != "退库"' label="单价(元/吨)" prop="unitPrice" label-width="160">
  155. <u-input v-model="OutList.unitPrice" input-align="right" placeholder="" />
  156. </u-form-item>
  157. <u-form-item label="业务描述" prop="businessDescribe" label-width="160" label-position="top"
  158. v-if="OutList.inOutType != '移库出库'">
  159. <u-input v-model="OutList.businessDescribe" input-align="left" placeholder="请输入业务描述"
  160. type="textarea" class="textarea" maxlength="150" />
  161. </u-form-item>
  162. <u-form-item v-if="retreatList.inOutType!='退库'" label="仓位号(选填)" prop="binNumber"
  163. label-width="170">
  164. <u-input v-model="OutList.binNumber" input-align="right" placeholder="未指定" />
  165. </u-form-item>
  166. </view>
  167. </view>
  168. <view v-if="EnterList.judge == 2">
  169. <view class="uForm_item">
  170. <!-- 入库 -->
  171. <view class="title part2">{{EnterList.inOutType}}</view>
  172. <view class='row'>
  173. <view class="left">编号</view>
  174. <view class="right">入库({{EnterList.inOutTaskNo}})</view>
  175. </view>
  176. <view class='row'>
  177. <view class="left">仓库</view>
  178. <view class="right">{{EnterList.warehouseName}}</view>
  179. </view>
  180. <view class='row'>
  181. <view class="left">入库类型</view>
  182. <view class="right">{{EnterList.inOutType}}</view>
  183. </view>
  184. <view class='row' v-if="EnterList.inOutType == '移库入库'">
  185. <view class="left" style="width: 180rpx;">移库任务编号</view>
  186. <view class="right">{{EnterList.moveTaskNo}}</view>
  187. </view>
  188. <view class='row' v-if="EnterList.inOutType != '移库入库'">
  189. <view class="left">合同编号</view>
  190. <view class="right">{{EnterList.contractNo}}</view>
  191. </view>
  192. <view class='row'>
  193. <view class="left">货名</view>
  194. <view class="right">{{EnterList.goodsName}}</view>
  195. </view>
  196. <view class='row'>
  197. <view class="left">重量(吨)</view>
  198. <view class="right">{{EnterList.weight}}</view>
  199. </view>
  200. <view class='row'>
  201. <view class="left">预计入库日期</view>
  202. <view class="right">{{EnterList.predictDate}}</view>
  203. </view>
  204. <!-- <view class='row'>
  205. <view class="left">预估运费(元/吨)</view>
  206. <view class="right">{{EnterList.estimatedFreight}}</view>
  207. </view> -->
  208. <view class='row'>
  209. <view class="left">收货人</view>
  210. <view class="right">{{EnterList.agent}}</view>
  211. </view>
  212. </view>
  213. <view class="uForm_item">
  214. <u-form-item label="品级" prop="grade" label-width="150" v-if="EnterList.inOutType != '移库入库' ">
  215. <u-input v-model="EnterList.grade" input-align="right" placeholder="请选择品级"
  216. @click='show=true' disabled />
  217. <u-picker :range="pjList" range-key="type" @confirm='pjPicker1($event)' v-model="show"
  218. mode="selector">
  219. </u-picker>
  220. </u-form-item>
  221. <u-form-item label="容重(克/升)>=" prop="bulkDensity" label-width="190"
  222. v-if="EnterList.inOutType != '移库入库'">
  223. <u-input v-model="EnterList.bulkDensity" input-align="right" placeholder="请输入容重占比" />
  224. </u-form-item>
  225. <u-form-item label="水分(%)<=" prop="waterContent" label-width="160"
  226. v-if="EnterList.inOutType != '移库入库'">
  227. <u-input v-model="EnterList.waterContent" input-align="right" placeholder="请输入水分占比" />
  228. </u-form-item>
  229. <u-form-item v-if='!EnterList.status&&EnterList.inOutType != "移库入库"' label="单价(元/吨)" prop="unitPrice" label-width="160">
  230. <u-input v-model="EnterList.unitPrice" input-align="right" placeholder="请输入单价" />
  231. </u-form-item>
  232. <u-form-item label="业务描述" prop="businessDescribe" label-width="160" label-position="top">
  233. <u-input v-model="EnterList.businessDescribe" input-align="left" placeholder="请输入业务描述"
  234. type="textarea" class="textarea" maxlength="150" />
  235. </u-form-item>
  236. <u-form-item v-if="OutList.inOutType!='退库'" label="仓位号(选填)" prop="binNumber" label-width="170">
  237. <u-input v-model="EnterList.binNumber" input-align="right" placeholder="未指定" />
  238. </u-form-item>
  239. </view>
  240. </view>
  241. <view class="content2">
  242. <view class="title row">
  243. 流程
  244. </view>
  245. <view v-for="(item,index) in auditList" :key='index' class="audit">
  246. <view class="row">
  247. <view class="left">
  248. <view class="item1">
  249. <view class="item-content">{{item.operatorTitle}}</view>
  250. <view v-if="item.status=='success'" class='status success'>
  251. <u-icon name="checkmark" color="#2979ff" size="28"></u-icon>
  252. </view>
  253. <view v-if="item.status=='error'" class='status error'>
  254. <u-icon name="close" color="rgb(245, 108, 108)" size="28"></u-icon>
  255. </view>
  256. <view v-if="item.status=='question'" class='status question'>
  257. <u-icon name="question" color="#f9ae3d" size="28"></u-icon>
  258. </view>
  259. </view>
  260. <view class="item2">
  261. <view class="name">{{item.desc}}
  262. </view>
  263. <view class='time'>{{item.updateDate}}</view>
  264. <view v-if="item.status=='success'" class="status success">{{item.commonStaffs1?item.staffscontent:item.operatorName}}<text v-if='!item.commonStaffs1'>已审核</text></view>
  265. <!-- <view v-if="item.status='error'" class="status error">{{item.commonStaffs1?item.staffscontent:item.operatorName}}<text v-if='!item.commonStaffs1'>{{item.workflowHistoricTasks ? "已审核":'未审核'}}</text></view> -->
  266. <view v-if="item.status=='question'" class="status question">{{item.commonStaffs1?item.staffscontent:''}}<text v-if='!item.commonStaffs1'>未审核</text></view>
  267. <!-- <view class="status success">吕波(已审核)</view> -->
  268. </view>
  269. </view>
  270. <view v-if='item.commonStaffs1&&item.commonStaffs1.length>0' class="right">
  271. <u-icon @click='showcontent(item)' :name="item.showflow?'arrow-up':'arrow-down'" size="28"></u-icon>
  272. </view>
  273. </view>
  274. <view v-if='item.showflow' style='padding:10px 0 0 50px;'>
  275. <view class='row2'>
  276. <view v-for='item1 in item.commonStaffs1' style='margin:5px;text-align:center;'>
  277. <view class="item-content">
  278. <u-icon v-if='item1.status' name="checkmark" color="#fff" size="14"></u-icon>
  279. <u-icon v-if='!item1.status' name="question" color="#f9ae3d" size="14"></u-icon>
  280. </view>
  281. <view class="name">{{item1.staffName}}</view>
  282. </view>
  283. </view>
  284. </view>
  285. <view class="row-line" v-if="index!= auditList.length - 1"></view>
  286. </view>
  287. </view>
  288. </u-form>
  289. </view>
  290. <view v-if='show1' class="shade">
  291. <view class="wrap">
  292. <view class="alert-top">
  293. <view class="title">
  294. {{title}}
  295. </view>
  296. <u-icon name="close" class="close" color="#8890B1" @click="close()"></u-icon>
  297. </view>
  298. <view class="u-textarea-style">
  299. <view class="right-bottom">
  300. {{auditMind.length}}/100个字
  301. </view>
  302. <u-input class="" v-model='auditMind' placeholder="请在此输入审核意见" type="textarea" height="414"
  303. maxlength="100" />
  304. </view>
  305. <view @click='close()' class="cancel">取消</view>
  306. <view @click='passSubmit()' class="confirm">确定</view>
  307. </view>
  308. </view>
  309. <u-toast ref="uToast" />
  310. <view style='padding:10px;' class='flex bottom-btn'>
  311. <u-button @click='reject' type="error" class="btn1" hover-class='none'>驳回</u-button>
  312. <u-button @click='pass' type="success" class="btn2">通过</u-button>
  313. </view>
  314. </view>
  315. </template>
  316. <script>
  317. import helper from '@/common/helper.js';
  318. import {
  319. mapState
  320. } from 'vuex';
  321. export default {
  322. data() {
  323. return {
  324. everyCheck: '',
  325. height: 200,
  326. autoHeight: true,
  327. border: false,
  328. id: "",
  329. OutList: {}, //出
  330. EnterList: {}, //入
  331. retreatList: {}, //退
  332. type: '移库',
  333. show: false,
  334. show1: false,
  335. auditList:[],
  336. auditMind: '',
  337. pjList: [{
  338. type: '一等品'
  339. },
  340. {
  341. type: '二等品'
  342. },
  343. {
  344. type: '三等品'
  345. },
  346. {
  347. type: '等外'
  348. }
  349. ],
  350. count:0,
  351. }
  352. },
  353. // onReady() {
  354. // this.$refs.uForm.setRules(this.rules);
  355. // },
  356. onBackPress(e) {
  357. if(this.everyCheck){
  358. uni.navigateTo({
  359. url: "/pages/task/my_task"
  360. })
  361. return true;
  362. }
  363. },
  364. onLoad(options) {
  365. this.id = options.id
  366. this.everyCheck = uni.getStorageSync("everyTask")
  367. this.count=0
  368. this.getList()
  369. },
  370. computed: {
  371. ...mapState(['hasLogin', 'userInfo']),
  372. },
  373. methods: {
  374. showcontent(item){
  375. item.showflow=!item.showflow
  376. },
  377. getList() {
  378. this.$api.doRequest('get', '/inOutWarehouseTask/getTask', {
  379. id: this.id
  380. }).then(res => {
  381. if (res.data.code == 200) {
  382. this.$api.doRequest('get', '/inOutWarehouseTask/getInOutWarehouseTask', {
  383. relevanceId: res.data.data.relevanceId
  384. }).then(res => {
  385. if (res.data.code == 200) {
  386. this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
  387. compId:uni.getStorageSync('pcUserInfo').compId
  388. }).then(res1 => {
  389. for (let i = 0; i < res.data.data.length; i++) {
  390. if (res.data.data[i].inOutType == "移库出库" || res.data.data[i]
  391. .inOutType == "贸易服务出库" || res.data.data[i].inOutType == "销售出库" ||
  392. res.data.data[i].inOutType == "暂存出库") {
  393. this.OutList = res.data.data[i]
  394. this.OutList.judge = 1
  395. } else if (res.data.data[i].inOutType == "移库入库" || res.data.data[i]
  396. .inOutType == "暂存入库" || res.data.data[i]
  397. .inOutType == "收购入库"|| res
  398. .data.data[i].inOutType == "采购入库" || res.data.data[i].inOutType ==
  399. "贸易服务入库") {
  400. this.EnterList = res.data.data[i]
  401. this.EnterList.judge = 2
  402. } else if (res.data.data[i].inOutType == "退库") {
  403. this.retreatList = res.data.data[i]
  404. this.retreatList.judge = 3
  405. }
  406. }
  407. for(let i = 0; i < res1.data.data.length; i++) {
  408. if(res1.data.data[i].contractNo==this.EnterList.contractNo){
  409. if(res1.data.data[i].priceType=='随行就市'){
  410. this.EnterList.status=true
  411. }else{
  412. this.EnterList.status=false
  413. }
  414. }
  415. if(res1.data.data[i].contractNo==this.retreatList.contractNo){
  416. if(res1.data.data[i].priceType=='随行就市'){
  417. this.retreatList.status=true
  418. }else{
  419. this.retreatList.status=false
  420. }
  421. }
  422. }
  423. })
  424. }
  425. })
  426. }
  427. })
  428. this.$api.doRequest('get', '/workflow/query/workflowDefinitions', {
  429. businessCode: 'INOUTTASK-TASK-APPROVE',
  430. tmpCompId: uni.getStorageSync('pcUserInfo').compId
  431. }).then(res1 => {
  432. this.$api.doRequest('get', '/commonUser/getHis', {
  433. workflowId: res1.data.data[0].id,
  434. businessKey: this.id
  435. }).then(response => {
  436. // uni.hideLoading()
  437. for (let i = 0; i < response.data.data.length; i++) {
  438. this.$set(response.data.data[i],'status','question')
  439. console.log(response.data.data[i].workflowHistoricTasks,i)
  440. if(response.data.data[i].commonStaffs&&response.data.data[i].commonStaffs.length>0){
  441. response.data.data[i].showflow=false
  442. response.data.data[i].operatorTitle=response.data.data[i].desc[0]
  443. response.data.data[i].operatorName=response.data.data[i].desc
  444. response.data.data[i].staffscontent='共'+response.data.data[i].commonStaffs.length+'人,当前审核'+response.data.data[i].workflowHistoricTasks.length+'人'
  445. if(response.data.data[i].workflowHistoricTasks&&response.data.data[i].workflowHistoricTasks.length>0){
  446. if(response.data.data[i].workflowHistoricTasks.length!=response.data.data[i].commonStaffs.length){
  447. // response.data.data[i].status='question'
  448. this.$set(response.data.data[i],'status','question')
  449. }else{
  450. this.$set(response.data.data[i],'status','success')
  451. // response.data.data[i].status='success'
  452. }
  453. response.data.data[i].workflowlen=response.data.data[i].workflowHistoricTasks.length
  454. var workflowdata=response.data.data[i].workflowHistoricTasks
  455. var staffsdata=response.data.data[i].commonStaffs
  456. for (let q = 0; q < staffsdata.length; q++) {
  457. staffsdata[q].status=false
  458. staffsdata[q].staffTitle=staffsdata[q].staffName
  459. for (let k = 0; k < workflowdata.length; k++) {
  460. if(staffsdata[q].staffId==workflowdata[k].operatorId){
  461. staffsdata[q].status=true
  462. }
  463. }
  464. }
  465. }
  466. response.data.data[i].commonStaffs1=response.data.data[i].commonStaffs
  467. }else{
  468. if(response.data.data[i].workflowHistoricTasks&&response.data.data[i].workflowHistoricTasks.length>0){
  469. this.$set(response.data.data[i],'status','success')
  470. response.data.data[i].operatorTitle=response.data.data[i].workflowHistoricTasks[0].operatorName[0]
  471. response.data.data[i].operatorName=response.data.data[i].workflowHistoricTasks[0].operatorName
  472. }else{
  473. this.$set(response.data.data[i],'status','question')
  474. // response.data.data[i].status='question'
  475. response.data.data[i].operatorTitle=response.data.data[i].desc[0]
  476. response.data.data[i].operatorName=response.data.data[i].desc
  477. }
  478. }
  479. }
  480. console.log(response.data.data)
  481. this.auditList = response.data.data
  482. })
  483. })
  484. },
  485. pjPicker(e) {
  486. this.OutList.grade = this.pjList[e[0]].type
  487. this.OutList.gradeKey = e[0] + 1
  488. },
  489. pjPicker1(e) {
  490. this.EnterList.grade = this.pjList[e[0]].type
  491. this.EnterList.gradeKey = e[0] + 1
  492. },
  493. close() {
  494. this.show1 = false
  495. },
  496. pass() {
  497. this.show1 = true
  498. this.title = '审核意见(通过)'
  499. },
  500. reject() {
  501. this.show1 = true
  502. this.title = '驳回原因(驳回)'
  503. },
  504. passSubmit() {
  505. var that = this
  506. if (this.title == '驳回原因(驳回)') {
  507. this.rejectSubmit()
  508. } else {
  509. let that = this
  510. that.show = false
  511. uni.showModal({
  512. content: "是否确定通过?",
  513. showCancel: true,
  514. confirmText: '确定',
  515. success: function(res) {
  516. if (res.confirm) {
  517. that.OutList.inOutFlag = 1
  518. that.EnterList.inOutFlag = 2
  519. if (that.OutList.taskTypeKey == 1) {
  520. that.requestadd(that.OutList)
  521. } else if (that.EnterList.taskTypeKey == 2) {
  522. that.requestadd(that.EnterList)
  523. } else if (
  524. that.OutList.taskTypeKey == 3 ||
  525. that.OutList.taskTypeKey == 4
  526. ) {
  527. that.requestadd(that.OutList, 'repetition')
  528. if (!that.deletetask) {
  529. that.requestadd(that.EnterList, 'repetition')
  530. }
  531. }
  532. if (that.retreatList.taskTypeKey == 1 || that.retreatList.taskTypeKey == 2) {
  533. that.requestadd(that.retreatList)
  534. } else if (that.retreatList.taskTypeKey == 3 || that.retreatList.taskTypeKey ==
  535. 4) {
  536. that.requestadd(that.retreatList, 'repetition')
  537. }
  538. }
  539. }
  540. })
  541. }
  542. },
  543. rejectSubmit() {
  544. // (1出库2入库3移库4退库并出库)
  545. if (!this.auditMind) {
  546. this.$api.msg('驳回原因不能为空!')
  547. } else {
  548. this.show = false
  549. let that = this
  550. uni.showModal({
  551. content: "是否确定驳回?",
  552. showCancel: true,
  553. confirmText: '确定',
  554. success: function(res) {
  555. if (res.confirm) {
  556. if (that.OutList.taskTypeKey == 1) {
  557. that.requestaudit(that.OutList)
  558. } else if (that.OutList.taskTypeKey == 2) {
  559. that.requestaudit(that.OutList)
  560. } else if (
  561. that.OutList.taskTypeKey == 3 ||
  562. that.OutList.taskTypeKey == 4
  563. ) {
  564. that.requestaudit(that.OutList, 'repetition')
  565. if (!that.deletetask) {
  566. that.requestaudit(that.OutList, 'repetition')
  567. }
  568. }
  569. if (that.EnterList.taskTypeKey) {
  570. if (that.EnterList.taskTypeKey == 1 || that.EnterList.taskTypeKey == 2) {
  571. that.requestaudit(that.EnterList)
  572. } else if (that.EnterList.taskTypeKey == 3 || that.EnterList.taskTypeKey ==
  573. 4) {
  574. that.requestaudit(that.EnterList, 'repetition')
  575. }
  576. }
  577. if (that.retreatList.taskTypeKey) {
  578. if (that.retreatList.taskTypeKey == 1 || that.retreatList.taskTypeKey ==
  579. 2) {
  580. that.requestaudit(that.retreatList)
  581. } else if (that.retreatList.taskTypeKey == 3 || that.retreatList
  582. .taskTypeKey == 4) {
  583. that.requestaudit(that.retreatList, 'repetition')
  584. }
  585. }
  586. }
  587. }
  588. })
  589. }
  590. },
  591. requestadd(list, status) {
  592. let that = this
  593. uni.getStorage({
  594. key: 'pcUserInfo',
  595. success(e) {
  596. list.compId = e.data.compId //这就是你想要取的token
  597. uni.showLoading({
  598. title: "审核中"
  599. })
  600. that.$api.doRequest('post', '/inOutWarehouseTask/api/checkOrUpdateInOutTask', list).then(
  601. res => {
  602. if (res.data.code == 200) {
  603. that.$api.doRequest('post', '/workflow/api/handle', {
  604. taskId: list.taskId,
  605. approved: true,
  606. auditMind: that.auditMind,
  607. needReapply: false
  608. }).then(res => {
  609. if (res.data.code == 200) {
  610. that.$api.msg('审核成功!')
  611. that.count++
  612. if (that.everyCheck) {
  613. helper.setAudit(that.list)
  614. }
  615. } else {
  616. that.$api.msg('审核失败!')
  617. }
  618. if(list.taskTypeKey == '3' || list.taskTypeKey == '4'){
  619. if(that.count == 2){
  620. setTimeout(function() {
  621. uni.hideLoading()
  622. uni.navigateBack()
  623. }, 1000);
  624. }
  625. }else{
  626. setTimeout(function() {
  627. uni.hideLoading()
  628. uni.navigateBack()
  629. }, 1000);
  630. }
  631. }).catch(res => {
  632. uni.hideLoading()
  633. if (res.message) {
  634. uni.showToast({
  635. title: res.message,
  636. icon: 'none',
  637. duration: 2000
  638. })
  639. } else {
  640. uni.showToast({
  641. title: "系统异常,请联系管理员",
  642. icon: 'none',
  643. duration: 2000
  644. })
  645. }
  646. })
  647. } else {
  648. that.$api.msg('审核失败!')
  649. }
  650. }).catch(res => {
  651. uni.hideLoading()
  652. if (res.message) {
  653. uni.showToast({
  654. title: res.message,
  655. icon: 'none',
  656. duration: 2000
  657. })
  658. } else {
  659. uni.showToast({
  660. title: "系统异常,请联系管理员",
  661. icon: 'none',
  662. duration: 2000
  663. })
  664. }
  665. })
  666. }
  667. })
  668. // list.publisher = this.userInfo.userName
  669. },
  670. requestaudit(list, status) {
  671. uni.showLoading({
  672. title: "审核中"
  673. })
  674. list.compId = '2710b21efc1e4393930c5dc800010dc4'
  675. // list.publisher = this.userInfo.userName
  676. this.$api.doRequest('post', '/inOutWarehouseTask/api/checkOrUpdateInOutTask', list).then(res => {
  677. if (res.data.code == 200) {
  678. this.$api.doRequest('post', '/workflow/api/handle', {
  679. taskId: list.taskId,
  680. approved: false,
  681. auditMind: this.auditMind,
  682. needReapply: true
  683. }).then(res => {
  684. if (res.data.code == 200) {
  685. this.$api.msg('驳回成功!')
  686. this.count++
  687. if (this.everyCheck) {
  688. helper.setAudit(this.list)
  689. }
  690. uni.hideLoading()
  691. if(list.taskTypeKey == '3' || list.taskTypeKey == '4'){
  692. if(this.count == 2){
  693. setTimeout(function() {
  694. uni.hideLoading()
  695. uni.navigateBack()
  696. }, 1000);
  697. }
  698. }else{
  699. setTimeout(function() {
  700. uni.hideLoading()
  701. uni.navigateBack()
  702. }, 1000);
  703. }
  704. }else{
  705. this.$api.msg('驳回失败!')
  706. }
  707. })
  708. }
  709. })
  710. },
  711. check() {
  712. // (1出库2入库3移库4退库并出库)taskTypeKey
  713. if (this.OutList.taskTypeKey == 1 || this.OutList.taskTypeKey == 3) {
  714. if (!this.OutList.grade) {
  715. this.$api.msg('品级不能为空')
  716. return
  717. }
  718. if (!this.OutList.bulkDensity) {
  719. this.$api.msg('容重不能为空')
  720. return
  721. }
  722. if (this.OutList.bulkDensity < 500 || this.OutList.bulkDensity > 1000) {
  723. this.$api.msg('容重输入错误')
  724. return
  725. }
  726. if (String(this.OutList.bulkDensity).indexOf('.') != -1 && String(this.OutList.bulkDensity).length - (
  727. String(this.OutList.bulkDensity).indexOf('.') + 1) > 0) {
  728. this.$api.msg('容重输入错误')
  729. return
  730. }
  731. if (!this.OutList.waterContent) {
  732. this.$api.msg('水分不能为空')
  733. return
  734. }
  735. if (isNaN(this.OutList.waterContent) ||
  736. (String(this.OutList.waterContent).indexOf('.') != -1 &&
  737. String(this.OutList.waterContent).length -
  738. (String(this.OutList.waterContent).indexOf('.') + 1) >
  739. 2) ||
  740. this.OutList.waterContent < 1 ||
  741. this.OutList.waterContent > 40
  742. ) {
  743. this.$api.msg('水分输入错误!')
  744. return
  745. }
  746. if (!this.OutList.unitPrice) {
  747. this.$api.msg('单价不能为空')
  748. return
  749. }
  750. if (isNaN(this.OutList.unitPrice) ||
  751. (String(this.OutList.unitPrice).indexOf('.') != -1 &&
  752. String(this.OutList.unitPrice).length -
  753. (String(this.OutList.unitPrice).indexOf('.') + 1) >
  754. 2) ||
  755. this.OutList.unitPrice < 1 ||
  756. this.OutList.unitPrice > 10000
  757. ) {
  758. this.$api.msg('单价输入错误!')
  759. return
  760. }
  761. }
  762. if (this.OutList.taskTypeKey == 1) {
  763. if (!this.OutList.businessDescribe) {
  764. this.$api.msg('业务描述不能为空')
  765. return
  766. }
  767. if (this.OutList.businessDescribe.length > 150) {
  768. this.$api.msg('业务描述长度错误')
  769. return
  770. }
  771. }
  772. if (this.EnterList.taskTypeKey == 2 && this.EnterList.judge) {
  773. if (!this.EnterList.grade) {
  774. this.$api.msg('品级不能为空')
  775. return
  776. }
  777. if (!this.EnterList.bulkDensity) {
  778. this.$api.msg('容重不能为空')
  779. return
  780. }
  781. if (this.EnterList.bulkDensity < 500 || this.EnterList.bulkDensity > 1000) {
  782. this.$api.msg('容重输入错误')
  783. return
  784. }
  785. if (String(this.EnterList.bulkDensity).indexOf('.') != -1 && String(this.EnterList.bulkDensity)
  786. .length - (
  787. String(this.EnterList.bulkDensity).indexOf('.') + 1) > 0) {
  788. this.$api.msg('容重输入错误')
  789. return
  790. }
  791. if (!this.EnterList.waterContent) {
  792. this.$api.msg('水分不能为空')
  793. return
  794. }
  795. if (isNaN(this.EnterList.waterContent) ||
  796. (String(this.EnterList.waterContent).indexOf('.') != -1 &&
  797. String(this.EnterList.waterContent).length -
  798. (String(this.EnterList.waterContent).indexOf('.') + 1) >
  799. 2) ||
  800. this.EnterList.waterContent < 1 ||
  801. this.EnterList.waterContent > 40
  802. ) {
  803. this.$api.msg('水分输入错误!')
  804. return
  805. }
  806. if (!this.EnterList.unitPrice) {
  807. this.$api.msg('单价不能为空')
  808. return
  809. }
  810. if (isNaN(this.EnterList.unitPrice) ||
  811. (String(this.EnterList.unitPrice).indexOf('.') != -1 &&
  812. String(this.EnterList.unitPrice).length -
  813. (String(this.EnterList.unitPrice).indexOf('.') + 1) >
  814. 2) ||
  815. this.EnterList.unitPrice < 1 ||
  816. this.EnterList.unitPrice > 10000
  817. ) {
  818. this.$api.msg('单价输入错误!')
  819. return
  820. }
  821. if (!this.EnterList.businessDescribe) {
  822. this.$api.msg('业务描述不能为空')
  823. return
  824. }
  825. if (this.EnterList.businessDescribe.length > 150) {
  826. this.$api.msg('业务描述长度错误')
  827. return
  828. }
  829. }
  830. if (this.OutList.taskTypeKey == 3) {
  831. if (!this.EnterList.businessDescribe) {
  832. this.$api.msg('业务描述不能为空')
  833. return
  834. }
  835. if (this.EnterList.businessDescribe.length > 150) {
  836. this.$api.msg('业务描述长度错误')
  837. return
  838. }
  839. }
  840. if (this.retreatList.taskTypeKey == 4 && this.retreatList.judge) {
  841. if (!this.retreatList.grade) {
  842. this.$api.msg('品级不能为空')
  843. return
  844. }
  845. if (!this.retreatList.bulkDensity) {
  846. this.$api.msg('容重不能为空')
  847. return
  848. }
  849. if (this.retreatList.bulkDensity < 500 || this.retreatList.bulkDensity > 1000) {
  850. this.$api.msg('容重输入错误')
  851. return
  852. }
  853. if (String(this.retreatList.bulkDensity).indexOf('.') != -1 && String(this.retreatList.bulkDensity)
  854. .length - (
  855. String(this.retreatList.bulkDensity).indexOf('.') + 1) > 0) {
  856. this.$api.msg('容重输入错误')
  857. return
  858. }
  859. if (!this.retreatList.waterContent) {
  860. this.$api.msg('水分不能为空')
  861. return
  862. }
  863. if (isNaN(this.retreatList.waterContent) ||
  864. (String(this.retreatList.waterContent).indexOf('.') != -1 &&
  865. String(this.retreatList.waterContent).length -
  866. (String(this.retreatList.waterContent).indexOf('.') + 1) >
  867. 2) ||
  868. this.retreatList.waterContent < 1 ||
  869. this.retreatList.waterContent > 40
  870. ) {
  871. this.$api.msg('水分输入错误!')
  872. return
  873. }
  874. if (!this.retreatList.unitPrice) {
  875. this.$api.msg('单价不能为空')
  876. return
  877. }
  878. if (isNaN(this.retreatList.unitPrice) ||
  879. (String(this.retreatList.unitPrice).indexOf('.') != -1 &&
  880. String(this.retreatList.unitPrice).length -
  881. (String(this.retreatList.unitPrice).indexOf('.') + 1) >
  882. 2) ||
  883. this.retreatList.unitPrice < 1 ||
  884. this.retreatList.unitPrice > 10000
  885. ) {
  886. this.$api.msg('单价输入错误!')
  887. return
  888. }
  889. if (!this.EnterList.businessDescribe) {
  890. this.$api.msg('业务描述不能为空')
  891. return
  892. }
  893. if (this.EnterList.businessDescribe.length > 150) {
  894. this.$api.msg('业务描述长度错误')
  895. return
  896. }
  897. }
  898. }
  899. }
  900. }
  901. </script>
  902. <style scoped lang="scss">
  903. .content1 {
  904. margin: 10rpx;
  905. padding-bottom: 224rpx;
  906. .title {
  907. height: 70rpx;
  908. line-height: 60rpx;
  909. font-size: 32rpx;
  910. font-weight: 600;
  911. color: #333333;
  912. border-bottom: 2rpx solid #EEEEEE;
  913. }
  914. }
  915. .uForm {
  916. padding: 0 40rpx;
  917. }
  918. .u-form-item {
  919. padding: 0;
  920. }
  921. .bottom-btn {
  922. width: 100%;
  923. position: fixed;
  924. bottom: 0;
  925. display: flex;
  926. z-index: 2;
  927. left: 0;
  928. background-color: #f8f8f8;
  929. flex-direction: column;
  930. .btn1,
  931. .btn2 {
  932. width: 100%;
  933. margin-bottom: 26rpx;
  934. border-radius: 90rpx;
  935. }
  936. .btn1 {
  937. background: white;
  938. color: #00C265;
  939. }
  940. }
  941. .submit {
  942. width: 50%;
  943. background: #22C572;
  944. border-radius: 10rpx;
  945. }
  946. .part2 {
  947. margin-top: 20rpx;
  948. }
  949. .textarea {
  950. border: 1px solid #ccc;
  951. border-radius: 10rpx;
  952. background-color: #F9F9FA;
  953. height: 100px;
  954. }
  955. .row {
  956. display: flex;
  957. justify-content: space-between;
  958. // border-bottom: 1px solid #EEEEEE;
  959. padding: 21rpx 0;
  960. .right,
  961. input {
  962. font-size: 28rpx;
  963. color: #333333;
  964. }
  965. }
  966. //弹出框
  967. // .popup {
  968. // padding: 30rpx;
  969. // border-radius: 20rpx;
  970. // }
  971. // .rejectInfoCss {
  972. // border: 1px solid #ccc;
  973. // border-radius: 10rpx;
  974. // background-color: #F9F9FA;
  975. // margin: 30rpx;
  976. // overflow-y: auto;
  977. // // height: 300rpx;
  978. // background: red;
  979. // }
  980. .uForm_item {
  981. padding: 20rpx;
  982. background-color: #FFFFFF;
  983. margin: 20rpx;
  984. border-radius: 20rpx;
  985. }
  986. .rejectText {
  987. text-align: center;
  988. }
  989. .topInfo {
  990. height: 210rpx;
  991. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  992. padding: 30rpx;
  993. .topInfo-item {
  994. height: 150rpx;
  995. background-color: #FFFFFF;
  996. border-radius: 20rpx;
  997. padding: 40rpx;
  998. .logo {
  999. width: 40rpx;
  1000. height: 40rpx;
  1001. margin-top: 8rpx;
  1002. }
  1003. .infoText {
  1004. font-size: 36rpx;
  1005. font-weight: 600;
  1006. margin-left: 20rpx;
  1007. }
  1008. .infoData {
  1009. color: #878C9C;
  1010. font-size: 26rpx;
  1011. margin-top: 10rpx;
  1012. }
  1013. }
  1014. }
  1015. .shade {
  1016. position: fixed;
  1017. top: 0;
  1018. left: 0;
  1019. height: 100%;
  1020. width: 100%;
  1021. background: rgba(0, 0, 0, 0.4);
  1022. z-index: 3;
  1023. .wrap {
  1024. position: absolute;
  1025. left: 0;
  1026. top: 0;
  1027. right: 0;
  1028. bottom: 0;
  1029. margin: auto;
  1030. background: #fff;
  1031. width: calc(100% - 198rpx);
  1032. height: 700rpx;
  1033. border-radius: 20rpx;
  1034. .alert-top {
  1035. padding: 33rpx;
  1036. display: flex;
  1037. justify-content: center;
  1038. align-items: center;
  1039. position: relative;
  1040. }
  1041. .title {
  1042. font-size: 32rpx;
  1043. font-weight: 600;
  1044. color: #333333;
  1045. }
  1046. .close {
  1047. position: absolute;
  1048. right: 33rpx;
  1049. }
  1050. }
  1051. }
  1052. .cancel,
  1053. .confirm {
  1054. position: absolute;
  1055. display: inline-block;
  1056. width: 50%;
  1057. text-align: center;
  1058. bottom: 0;
  1059. padding: 10px;
  1060. border-top: 1px solid #eee;
  1061. font-size: 34rpx;
  1062. }
  1063. .cancel {
  1064. left: 0;
  1065. border-right: 1px solid #eee;
  1066. color: #AFB3BF;
  1067. }
  1068. .confirm {
  1069. right: 0;
  1070. color: #22C572;
  1071. }
  1072. .u-textarea-style {
  1073. margin: 20rpx;
  1074. background: #F9F9FA;
  1075. border-radius: 10px;
  1076. border: 1px solid #EEEEEE;
  1077. padding: 10rpx 20rpx;
  1078. position: relative;
  1079. .right-bottom {
  1080. position: absolute;
  1081. right: 20rpx;
  1082. bottom: 20rpx;
  1083. color: #AFB3BF;
  1084. }
  1085. }
  1086. /deep/.u-input__textarea {
  1087. height: 300rpx !important;
  1088. }
  1089. .content2 {
  1090. background: white;
  1091. margin: 20rpx 0;
  1092. border-radius: 20rpx;
  1093. padding: 20rpx;
  1094. .row {
  1095. display: flex;
  1096. justify-content: space-between;
  1097. .left {
  1098. display: flex;
  1099. align-items: center;
  1100. .item1{
  1101. position:relative;
  1102. .item-content{
  1103. background:#22C572;
  1104. width: 50px;
  1105. height: 50px;
  1106. border-radius: 50%;
  1107. line-height: 50px;
  1108. text-align: center;
  1109. font-size: 20px;
  1110. color: #fff;
  1111. }
  1112. .status{
  1113. position:absolute;
  1114. border-radius: 50%;
  1115. padding: 1px 2px;
  1116. right: 0;
  1117. bottom: 0;
  1118. background:#fff;
  1119. }
  1120. .status.success{
  1121. border:1px solid rgb(60, 156, 255);
  1122. }
  1123. .status.error{
  1124. border:1px solid rgb(245, 108, 108);
  1125. }
  1126. .status.question{
  1127. border:1px solid #f9ae3d;
  1128. }
  1129. }
  1130. .item2 {
  1131. margin-left: 20rpx;
  1132. .name {
  1133. font-size: 32rpx;
  1134. font-weight: 800;
  1135. }
  1136. .status.success {
  1137. color: #6CC48C;
  1138. }
  1139. .status.error {
  1140. color: rgb(245, 108, 108);
  1141. }
  1142. .status.question {
  1143. color: #f9ae3d;
  1144. }
  1145. .time{
  1146. color:#999;
  1147. }
  1148. }
  1149. }
  1150. .right {
  1151. color: #B0B1B5;
  1152. margin-top: 10px;
  1153. }
  1154. }
  1155. .row2{
  1156. display:flex;
  1157. .item-content{
  1158. background:#22C572;
  1159. width: 30px;
  1160. height: 30px;
  1161. border-radius: 50%;
  1162. line-height: 30px;
  1163. text-align: center;
  1164. font-size: 12px;
  1165. color: #fff;
  1166. padding:0 2px;
  1167. margin:0 auto;
  1168. }
  1169. .status{
  1170. position:absolute;
  1171. top:0;right:0;
  1172. }
  1173. }
  1174. .row-line {
  1175. width: 1px;
  1176. height: 30px;
  1177. background: #F2F2F2;
  1178. margin: 10rpx 50rpx;
  1179. }
  1180. .audit {
  1181. margin-top: 20rpx;
  1182. }
  1183. }
  1184. </style>