backlogManageAirDetail.vue 6.6 KB

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