product-aftersale-1.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <html>
  2. <head>
  3. <meta charset="utf-8"/>
  4. <title>售后换新1</title>
  5. <meta name="keywords" content="售后换新1"/>
  6. <meta name="description" content="售后换新1"/>
  7. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover"/>
  8. <meta name="apple-mobile-web-app-capable" content="yes"/>
  9. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
  10. <meta content="telephone=no" name="format-detection"/>
  11. <meta content="email=no" name="format-detection"/>
  12. <meta name="apple-mobile-web-app-title" content="售后换新1"/>
  13. <meta http-equiv="Cache-Control" content="no-siteapp"/>
  14. <link rel="stylesheet" href="./static/css/main.css"/>
  15. <link rel="stylesheet" href="./static/css/crop.css"/>
  16. <style>
  17. .test .van-field__right-icon i{
  18. transform:rotate(90deg);
  19. }
  20. </style>
  21. </head>
  22. <body class="pt0 pb0" style="padding-top:0;">
  23. <div class="afterSale1 merchant-verification" id="app" v-cloak="v-cloak">
  24. <van-nav-bar :title="title" @click-left="back" v-if="toptitleisshow">
  25. <template #left="">
  26. <van-icon name="arrow-left" color="#333" size=".5333rem"></van-icon>
  27. </template>
  28. <template #right="">
  29. <div class="c666 f12" @click="toDetail">换新记录</div>
  30. </template>
  31. </van-nav-bar>
  32. <div class="tips">
  33. <div class="f14">请仔细核对机具损坏信息后申请,申请通过后请将损坏机具回寄至该分仓。</div>
  34. </div>
  35. <van-form class="formWarp test" validate-first="validate-first" @failed="onFailed" validate-trigger="onSubmit" @submit="onSubmit" :show-error-message="false" :show-error="false">
  36. <div class="label">
  37. <div class="f14 c333">换机原因</div>
  38. <van-field v-model="formInfo.reson" readonly="readonly" name="reson" placeholder="请输入换机原因" @click="errorType = true" :rules="[{ required: true, message: '请选择换机原因' }]" right-icon="play"></van-field>
  39. </div>
  40. <div class="label">
  41. <div class="f14 c333">机具类型</div>
  42. <van-field v-model="showtype" readonly="readonly" name="type" placeholder="请选择机具类型" @click="choseType = true" right-icon="play" :rules="[{ required: true, message: '请选择机具类型' }]"></van-field>
  43. </div>
  44. <div class="label">
  45. <div class="f14 c333">机具SN号</div>
  46. <van-field v-model="formInfo.SN" name="SN" placeholder="请输入该机具SN" :rules="[{ required: true, message: '请填写机具SN' }]"></van-field>
  47. </div>
  48. <div class="label">
  49. <div class="f14 c333">备注</div>
  50. <van-field v-model="formInfo.remaker" name="remaker" placeholder="如有需要,请备注详细原因"></van-field>
  51. </div>
  52. <div class="label">
  53. <div class="f14 c333">上传机具照片1~3张</div>
  54. <van-uploader readonly="true" v-model="showpic" multiple="multiple" :max-count="3" @delete="deleteimg" @click-upload="uploadimg"></van-uploader>
  55. </div>
  56. <van-button class="btn" round="round" block="block" type="info" color="#FDD500" native-type="submit">下一步</van-button>
  57. </van-form>
  58. <input type="file" accept="image/*" id="upload" style="display:none;"/>
  59. <van-popup v-model="choseType" position="bottom">
  60. <van-picker title="机具类型" show-toolbar="show-toolbar" :columns="typecolumns" @confirm="choseTypeonConfirm" @cancel="choseType = false"></van-picker>
  61. </van-popup>
  62. <van-popup v-model="errorType" position="bottom">
  63. <van-picker title="换新原因" show-toolbar="show-toolbar" :columns="errortypecolumns" @confirm="errorTypeonConfirm" @cancel="errorType = false"></van-picker>
  64. </van-popup>
  65. </div>
  66. </body>
  67. <script src="./static/js/clipboard.min.js"></script>
  68. <script src="./static/js/klm-vv.min.js"></script>
  69. <script src="./static/js/appfunc.min.js"></script>
  70. <script src="./static/js/klm-axios-config.js"></script>
  71. <script src="./static/js/publicfn.js"></script>
  72. <script src="./static/js/exif.js"></script>
  73. <script src="./static/js/transformation-matrix.js"></script>
  74. <script src="./static/js/prefix-umd.js"></script>
  75. <script src="./static/js/index.js"></script>
  76. <script>
  77. function AppUpload(imgpath) {
  78. setTimeout(function () {
  79. PublicLib.WapCropForApp(300, 300, 'upload', imgpath, 1);
  80. }, 300);
  81. };
  82. //裁切结束后回调方法
  83. function ShowPhoto(url) {
  84. //获取最终的图片地址
  85. app.uploadheadhpotofn(url);
  86. };
  87. //初始化crop
  88. if (isWeb) {
  89. PublicLib.WapCrop(1000, 1000, 'upload', 1);
  90. };
  91. Vue.use(vant.Lazyload)
  92. let app = new Vue({
  93. el:'#app',
  94. name:'possDetail',
  95. data(){
  96. return {
  97. //- 类型选择器
  98. choseType:false,
  99. errorType:false,
  100. toptitleisshow,
  101. title:'售后换新',
  102. imgtype:'',
  103. formInfo:{
  104. reson:'',
  105. SN:'',
  106. photoList:[
  107. ],
  108. SNtype:'',
  109. },
  110. showpic:[],
  111. errortypecolumns:[
  112. '充电问题',
  113. '存储已满问题',
  114. '硬件问题',
  115. '不能签字问题',
  116. ],
  117. typecolumns:[
  118. ],
  119. showtype:'',
  120. }
  121. },
  122. created(){
  123. this.getproducttypelist();
  124. },
  125. methods:{
  126. errorTypeonConfirm(data){
  127. this.formInfo.reson = data;
  128. this.errorType = false;
  129. },
  130. choseTypeonConfirm(date){
  131. this.formInfo.SNtype = date.Id;
  132. this.showtype = date.text;
  133. this.choseType = false;
  134. },
  135. back(){
  136. PublicLib.GoBack({Leval:1});
  137. },
  138. toDetail(){
  139. PublicLib.Goto({Url:'product-aftersale-list'});
  140. },
  141. uploadimg(){
  142. PublicLib.UploadPhoto({
  143. Quality:1,
  144. PhotoCount:1,
  145. Width:300,
  146. Height:300,
  147. });
  148. },
  149. async getproducttypelist(){
  150. const res = await getRequest('api/v1/pos/kqproducts/list?t='+Math.random(6),JSON.stringify({PageSize:10,PageNum:1}));
  151. if(res.status !== '1')return tips('产品列表获取失败!');
  152. //- res.data.push({Name: "金控大机", Id: 3},{Name: "开店宝大机", Id: 4});
  153. this.typecolumns = res.data.map(item=> {return {Id:item.Id,text:item.Name}});
  154. },
  155. async uploadheadhpotofn(HeadPhoto){
  156. this.formInfo.photoList.push({url: HeadPhoto});
  157. this.showpic.push({url:showHost + HeadPhoto});
  158. },
  159. deleteimg(a,b){
  160. this.formInfo.photoList.splice(b.index,1);
  161. },
  162. onFailed(errorInfo) {
  163. tips(errorInfo.errors[0].message);
  164. },
  165. async onSubmit() {
  166. const UserId = PublicLib.getCookieInfo('userId');
  167. const res = await getRequest('api/v1/pos/machinechange/check?t='+Math.random(6),JSON.stringify({UserId,PosSn:this.formInfo.SN,BrandId:this.formInfo.SNtype}));
  168. if(res.status !== '1') return tips(res.info);
  169. //- 清除仓库Id
  170. PublicLib.putCookieInfo('warehouseId', '');
  171. //- 清除收货地址Id
  172. PublicLib.putCookieInfo('addressId', '');
  173. PublicLib.putCookieInfo('afterSaleInfo', JSON.stringify(this.formInfo));
  174. PublicLib.Goto({Url:'product-aftersale-2'});
  175. },
  176. },
  177. })
  178. </script>
  179. </html>