popup.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <view>
  3. <!-- 弹窗 -->
  4. <view class="bgbox" @click="getClose" v-if="type"></view>
  5. <!-- 指派 -->
  6. <view v-if="type=='assign'" class="assignbox">
  7. <view class="asstit">报修指派</view>
  8. <picker range-key='text' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  9. <view class="flexc asline">
  10. <view class="flex1 f13" :class="datainfo.iszc?'co27':'coa'">{{datainfo.iszc?'是':'请选择是类型'}}</view>
  11. <view class="rimg"><image :src="rimg"></image></view>
  12. </view>
  13. </picker>
  14. <view class="tabtit">选择维修师傅</view>
  15. <view class="asslists">
  16. <view class="asslist" :class="peoval==ite.val?'act':''" v-for="(ite,idx) in peolist" :key="idx" @click="getChose(ite.val)">
  17. <image :src="headbg" v-if="peoval==ite.val"></image>
  18. <view class="altit">{{ite.name}}</view>
  19. <view class="altxt cof6" v-if="ite.type==0">指派中</view>
  20. <view class="altxt co28" v-if="ite.type==1">空闲中</view>
  21. </view>
  22. </view>
  23. <view class="rhbtn" @click="getSure">确定</view>
  24. <image :src="closeimg" class="closeimg" @click="getClose"></image>
  25. </view>
  26. <!-- 上门打卡 -->
  27. <view v-if="type=='assigncheck'" class="assignbox pra">
  28. <view class="asstit">{{finshtype==2?'完成打卡':'上门打卡'}}</view>
  29. <view class="assadd">
  30. <image :src="addpho"></image>
  31. <view>去拍照</view>
  32. </view>
  33. <view class="assimgs">
  34. <view class="assimg">
  35. <image :src="headbg" class="img"></image>
  36. <image :src="rdelimg" class="delimg" @click="getDelFn"></image>
  37. </view>
  38. <view class="assimg">
  39. <image :src="headbg" class="img"></image>
  40. <image :src="rdelimg" class="delimg" @click="getDelFn"></image>
  41. </view>
  42. <view class="assimg">
  43. <image :src="headbg" class="img"></image>
  44. <image :src="rdelimg" class="delimg" @click="getDelFn"></image>
  45. </view>
  46. </view>
  47. <view class="rhbtn" @click="getSure">确定</view>
  48. <image :src="closeimg" class="closeimg" @click="getClose"></image>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import config from '@/config'
  54. const baseUrl = config.baseUrl
  55. import { getToken } from '@/utils/auth'
  56. import {uploadmore} from '@/utils/common.js'
  57. export default{
  58. components:{},
  59. props:{
  60. type: {
  61. type: String,
  62. default () {
  63. return ''
  64. }
  65. },
  66. finshtype:{
  67. type: [String,Number],
  68. default () {
  69. return ''
  70. }
  71. }
  72. },
  73. data(){
  74. return{
  75. baseUrl:config.baseUrl,
  76. closeimg:require("@/work/static/close.png"),
  77. rimg: require('@/work/static/people/rimg.png'),
  78. headbg: require('@/work/static/service/headbg.png'),
  79. addpho: require('@/work/static/service/addpho.png'),
  80. rdelimg: require('@/work/static/service/rdel.png'),
  81. syqxidx:'',
  82. datainfo:{
  83. iszc:""
  84. },
  85. sexs: [{
  86. text: '男',
  87. value: 0
  88. }, {
  89. text: '女',
  90. value: 1
  91. }],
  92. peoval:0,
  93. peolist:[{name:'王安安',val:"0",type:0},{name:'刘柠溪',val:"1",type:1},{name:'王合一',val:"2",type:0},]
  94. }
  95. },
  96. mounted() {
  97. this.baseUrl=baseUrl
  98. },
  99. watch:{
  100. type(val){
  101. // this.filelist=[];
  102. // this.shtext='';
  103. // this.isty='2';
  104. // this.phofile=[];
  105. }
  106. },
  107. methods:{
  108. bindDateChange(){
  109. var val=e.detail.value;
  110. },
  111. getClose(){
  112. this.$emit('getClose')
  113. },
  114. getSure(){
  115. this.$emit('getSure')
  116. },
  117. getChose(val){
  118. this.peoval=val
  119. },
  120. getPreviewImage(arr,idx){
  121. var newArr=[];
  122. arr.forEach(ite=>{
  123. var ds=this.baseUrl+ite
  124. newArr.push(ds)
  125. })
  126. uni.previewImage({
  127. urls: newArr,
  128. current:idx,
  129. success: function(data) {
  130. },
  131. fail: function(err) {
  132. }
  133. });
  134. },
  135. getDelFn(){
  136. var that=this;
  137. uni.showModal({
  138. title: '确认删除',
  139. content: "是否确认删除",
  140. cancelText: '取消',
  141. confirmText: '确认',
  142. success: function(res) {
  143. if (res.confirm) {
  144. // that.filelist.splice(idx,1)
  145. } else if (res.cancel) {
  146. }
  147. }
  148. });
  149. },
  150. getaddImage(e){
  151. let that = this;
  152. let file =[],count=9
  153. uni.chooseImage({
  154. count: 1,
  155. success:function(res){
  156. let img= res.tempFilePaths;
  157. if(img.length + file.length > count){
  158. uni.showToast({
  159. title: '最多上传'+count+'张图片',
  160. icon: 'none',
  161. duration: 2000
  162. })
  163. }else{
  164. let imglen = res.tempFilePaths.length;
  165. var fuwufile = [];
  166. uploadmore('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
  167. var resurl=rs[0];
  168. // if(e=='front'){
  169. // that.datainfo.front=resurl.fileName;
  170. // }else{
  171. // that.datainfo.back=resurl.fileName;
  172. // }
  173. })
  174. }
  175. }
  176. });
  177. },
  178. }
  179. }
  180. </script>
  181. <style lang="scss" scoped>
  182. // 指派
  183. .assignbox{background: #FFFFFF;border-radius: 20rpx;position: fixed;left:56rpx;right:54rpx;z-index: 10;top: 50%;transform: translateY(-50%);padding: 32rpx 38rpx 36rpx;
  184. .asstit{font-weight: bold;font-size: 30rpx;color: #272727;text-align: center;padding-left: 16rpx;margin-bottom: 28rpx;}
  185. .rimg{width: 16rpx;height: 28rpx;flex: 0 0 auto;margin-left: 20rpx;
  186. image{width: 100%;height: 100%;}
  187. }
  188. .asline{border-bottom: 2rpx solid #E5E5E5;padding: 30rpx 0;margin-bottom: 40rpx;}
  189. .tabtit{font-weight: bold;font-size: 26rpx;color: #272727;line-height: 36rpx;margin-bottom: 24rpx;padding-left: 14rpx;}
  190. .asslists{display: flex;flex-wrap: wrap;
  191. .asslist{width: 252rpx;height: 76rpx;border-radius: 20rpx;border: 2rpx solid #DADADA;position: relative;display: flex;align-items: center;box-sizing: border-box;padding: 0 22rpx;margin: 0 14rpx 24rpx 14rpx;overflow: hidden;
  192. &.act{border-color: #0256FD;
  193. .altit{color: #0256FD;}
  194. }
  195. image{position: absolute;right: -2rpx;bottom: -2rpx;width: 34rpx;height: 32rpx;}
  196. .altit{font-weight: bold;font-size: 26rpx;color: #666666;flex: 1;}
  197. .altxt{font-weight: bold;font-size: 22rpx;flex: 0 0 auto;}
  198. }
  199. }
  200. // 上传图片
  201. &.pra{left: 100rpx;right: 100rpx;}
  202. .assadd{display: flex;flex-direction: column;align-items: center;justify-content: center;border-radius: 10rpx;height: 192rpx;
  203. border: 2rpx dashed #A7A7A7;box-sizing: border-box;margin-bottom: 32rpx;
  204. image{width:48rpx;height: 40rpx;margin-bottom: 16rpx;}
  205. view{font-weight: bold;font-size: 26rpx;color: #272727;}
  206. }
  207. .assimgs{display: flex;align-items: center;flex-wrap: wrap;margin-bottom: 8rpx;
  208. .assimg{width: 140rpx;height: 140rpx;position: relative;overflow: hidden;margin: 0 24rpx 24rpx 0;
  209. &:nth-of-type(3n){margin-right: 0;}
  210. .img{width: 100%;height: 100%;}
  211. .delimg{width: 24rpx;height: 24rpx;position: absolute;right: 0;top: 0;}
  212. }
  213. }
  214. }
  215. .closeimg{width: 32rpx;height: 32rpx;position: absolute;bottom: -62rpx;left: 50%;margin-left: -16rpx;}
  216. </style>