backlogManageRecycleDetail.vue 7.3 KB

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