gasRecycleAirDetail.vue 7.3 KB

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