gasRecycleRecycleDetail.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <!-- 回收申请-->
  2. <template>
  3. <view id="register">
  4. <view class="register_li">
  5. <view class="register_li_min">
  6. <view></view>
  7. <view>实验地点:</view>
  8. <input v-model="form.qpTask.location" disabled type="text" >
  9. </view>
  10. <view class="register_li_min">
  11. <view></view>
  12. <view>联系人:</view>
  13. <input v-model="form.qpTask.userName" disabled type="text" >
  14. </view>
  15. <view class="register_li_min">
  16. <view></view>
  17. <view>联系方式:</view>
  18. <input v-model="form.qpTask.phone" disabled type="text" >
  19. </view>
  20. <view v-if="pageType==1 || form.bottleStorageOut.outStatus==1" class="register_li_min">
  21. <view></view>
  22. <view>运输人员:</view>
  23. <input v-model="form.bottleStorageOut.transportName" disabled type="text" >
  24. </view>
  25. <view v-if="pageType==1 || form.bottleStorageOut.outStatus==1" class="register_li_min">
  26. <view></view>
  27. <view>运输车辆:</view>
  28. <input v-model="form.bottleStorageOut.carNumber" disabled type="text" >
  29. </view>
  30. <view class="register_li_min">
  31. <view></view>
  32. <view>申请回收时间:</view>
  33. <input v-model="form.bottleStorageOut.createTime" disabled type="text" >
  34. </view>
  35. <view v-if="pageType==1 || form.bottleStorageOut.outStatus==1" class="register_li_min" style="border: none;">
  36. <view></view>
  37. <view>确认回收时间:</view>
  38. <input v-model="form.bottleStorageOut.disposeTime" disabled type="text" >
  39. </view>
  40. </view>
  41. <view class="register_li">
  42. <view class="register_li_min">
  43. <view></view>
  44. <view>{{specificationName.airName}}-{{specificationName.gasLevel}}:</view>
  45. <input v-model="'数量:'+form.taskDetail.bottleNumber" disabled type="text" >
  46. </view>
  47. </view>
  48. <view v-if="pageType==0 || form.bottleStorageOut.outStatus==0" class="register_li">
  49. <picker @change="bindPickerPerson" :value="pickerIndex" :range="personList">
  50. <view class="register_li_min">
  51. <view>*</view>
  52. <view>运输人员:</view>
  53. <input v-model="form.userName" disabled type="text" placeholder="请选择运输人员">
  54. </view>
  55. </picker>
  56. <picker @change="bindPickerCar" :value="pickerIndex" :range="carList">
  57. <view class="register_li_min">
  58. <view>*</view>
  59. <view>运输车辆:</view>
  60. <input v-model="form.carCode" disabled type="text" placeholder="请选择运输车辆">
  61. </view>
  62. </picker>
  63. </view>
  64. <view v-if="form.bottleStorageOut.outStatus==0" class="sub_btn" @click="submitForm(1)">确认回收</view>
  65. <view v-if="form.bottleStorageOut.outStatus==1" class="sub_btn" @click="submitForm(2)">已回收</view>
  66. </view>
  67. </template>
  68. <script>
  69. import {supplierBacklogDetail,
  70. supplierBacklogRecycleDetail,
  71. supplierBacklogIssueDetail,
  72. supplierBacklogPersonCar,
  73. supplierBacklogStorageOut,
  74. } from '@/api/apiDemo/index.js'
  75. import { config } from '@/api/request/config.js'
  76. export default {
  77. data() {
  78. return {
  79. pageType:0,//0待处理1已处理
  80. form:{},
  81. id:'',
  82. status:'',//gq hs wt
  83. personList:[],
  84. personListArr:[],
  85. carList:[],
  86. carListArr:[],
  87. editForm:{
  88. id:'',
  89. transportId:'',
  90. transportName:'',
  91. carId:'',
  92. carNumber:'',
  93. remark:'1',//确认回收1,已回收2
  94. outStatus:'1',//确认回收1,已回收2
  95. },//配送
  96. specificationName:{},//回收
  97. }
  98. },
  99. onLoad(option) {
  100. this.id=JSON.parse(decodeURIComponent(option.item)).id;
  101. this.pageType=option.status;
  102. },
  103. onShow(){
  104. },
  105. mounted() {
  106. this.getInfo();
  107. this.getPersonCarList();
  108. },
  109. methods: {
  110. //供气人员点击
  111. bindPickerPerson(e){
  112. let _this=this;
  113. let index=e.target.value
  114. _this.form.userName=this.personList[index]
  115. _this.editForm.transportName=this.personList[index]
  116. _this.personListArr.forEach(function(item){
  117. if(item.userName==_this.personList[index]){
  118. _this.editForm.transportId=item.id
  119. }
  120. })
  121. },
  122. //供气车辆点击
  123. bindPickerCar(e){
  124. let _this=this;
  125. let index=e.target.value
  126. _this.form.carCode=this.carList[index]
  127. _this.editForm.carNumber=this.carList[index]
  128. _this.carListArr.forEach(function(item){
  129. if(item.carCode==_this.carList[index]){
  130. _this.editForm.carId=item.id
  131. }
  132. })
  133. },
  134. async getPersonCarList(){
  135. let _this = this;
  136. const {data} = await supplierBacklogPersonCar()
  137. if(data.code==200){
  138. let res=data.data
  139. //车辆
  140. _this.carListArr=res.carlist;
  141. if(res.carlist){
  142. res.carlist.forEach(function(item){
  143. _this.carList.push(item.carCode)
  144. })
  145. }
  146. //人员
  147. _this.personListArr=res.userlist;
  148. if(res.userlist){
  149. res.userlist.forEach(function(item){
  150. _this.personList.push(item.userName)
  151. })
  152. }
  153. }
  154. },
  155. //获取详情
  156. async getInfo(){
  157. let _this = this;
  158. const {data} = await supplierBacklogRecycleDetail({id:this.id})
  159. if(data.code==200){
  160. let res=data.data
  161. _this.form=res;
  162. _this.specificationName=JSON.parse(res.taskDetail.applyDescribe)
  163. }
  164. },
  165. //确认回收
  166. async submitForm(type){
  167. let _this = this;
  168. if(type==1){
  169. if(!this.form.userName){
  170. uni.showToast({
  171. title: '请选择运输人员',
  172. icon:"none",
  173. mask:true,
  174. duration: 2000
  175. });
  176. return
  177. }
  178. if(!this.form.carCode){
  179. uni.showToast({
  180. title: '请选择运输车辆',
  181. icon:"none",
  182. mask:true,
  183. duration: 2000
  184. });
  185. return
  186. }
  187. this.editForm.remark=1
  188. this.editForm.outStatus=1
  189. }else{
  190. this.editForm.remark=2
  191. this.editForm.outStatus=2
  192. this.editForm.carId=null
  193. this.editForm.carNumber=null
  194. this.editForm.transportId=null
  195. this.editForm.transportName=null
  196. }
  197. _this.editForm.id=_this.id;
  198. const {data} = await supplierBacklogStorageOut(_this.editForm);
  199. if(data.code == 200){
  200. uni.showToast({
  201. title: '提交成功',
  202. icon:"none",
  203. mask:true,
  204. duration: 2000
  205. });
  206. setTimeout(function(){
  207. uni.redirectTo({
  208. url: '/pages_supplier/gasRecycle/gasRecycle'
  209. });
  210. },2000);
  211. }
  212. },
  213. }
  214. }
  215. </script>
  216. <style lang="stylus" scoped>
  217. #register{
  218. height:auto;
  219. width:100%;
  220. display flex;
  221. flex-direction column;
  222. padding-bottom: 220rpx;
  223. .register_li{
  224. background #fff;
  225. border-radius:20rpx;
  226. margin:20rpx 20rpx 0;
  227. padding:20rpx 0;
  228. box-sizing: border-box;
  229. .register_li_min{
  230. margin:0 26rpx;
  231. display flex;
  232. align-items center;
  233. border-bottom: 1px solid #F5F5F5;
  234. view{
  235. line-height:100rpx;
  236. font-size:28rpx;
  237. }
  238. view:nth-child(1){
  239. color:red;
  240. line-height:28rpx;
  241. margin-right: 12rpx;
  242. }
  243. view:nth-child(2){
  244. //width:140rpx;
  245. font-size: 28rpx;
  246. font-family: PingFang SC;
  247. font-weight: 500;
  248. color: #999999;
  249. }
  250. >input{
  251. flex:1;
  252. text-align: right;
  253. font-size: 24rpx;
  254. font-family: PingFang SC;
  255. font-weight: 500;
  256. color: #333333;
  257. }
  258. }
  259. .issue_li{
  260. margin:34rpx 26rpx 0;
  261. display flex;
  262. border-bottom: 1px solid #F5F5F5;
  263. view:nth-child(1){
  264. color:red;
  265. line-height:28rpx;
  266. margin-right: 12rpx;
  267. }
  268. view:nth-child(2){
  269. //width:140rpx;
  270. font-size: 28rpx;
  271. font-family: PingFang SC;
  272. font-weight: 500;
  273. color: #999999;
  274. }
  275. .issue_img{
  276. width: 210rpx;
  277. height: 210rpx;
  278. border-radius: 10rpx;
  279. margin-left:250rpx;
  280. }
  281. }
  282. }
  283. /* 按钮 */
  284. .sub_btn{
  285. width: 650rpx;
  286. height: 100rpx;
  287. background: #0183FA;
  288. border-radius: 20rpx;
  289. font-size: 28rpx;
  290. font-family: PingFang SC;
  291. font-weight: 500;
  292. color: #FFFFFF;
  293. line-height: 100rpx;
  294. text-align: center;
  295. margin-left: 50rpx;
  296. position: fixed;
  297. bottom:30rpx;
  298. z-index: 1000;
  299. }
  300. }
  301. /deep/.input-value-border{
  302. display :none !important;
  303. }
  304. </style>