123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- <html>
- <head>
- <meta charset="utf-8"/>
- <title>售后换新1</title>
- <meta name="keywords" content="售后换新1"/>
- <meta name="description" content="售后换新1"/>
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover"/>
- <meta name="apple-mobile-web-app-capable" content="yes"/>
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
- <meta content="telephone=no" name="format-detection"/>
- <meta content="email=no" name="format-detection"/>
- <meta name="apple-mobile-web-app-title" content="售后换新1"/>
- <meta http-equiv="Cache-Control" content="no-siteapp"/>
- <link rel="stylesheet" href="./static/css/main.css"/>
- <link rel="stylesheet" href="./static/css/crop.css"/>
- <style>
- .test .van-field__right-icon i{
- transform:rotate(90deg);
- }
- </style>
- </head>
- <body class="pt0 pb0" style="padding-top:0;">
- <div class="afterSale1 merchant-verification" id="app" v-cloak="v-cloak">
- <van-nav-bar :title="title" @click-left="back" v-if="toptitleisshow">
- <template #left="">
- <van-icon name="arrow-left" color="#333" size=".5333rem"></van-icon>
- </template>
- <template #right="">
- <div class="c666 f12" @click="toDetail">换新记录</div>
- </template>
- </van-nav-bar>
- <div class="tips">
- <div class="f14">请仔细核对机具损坏信息后申请,申请通过后请将损坏机具回寄至该分仓。</div>
- </div>
- <van-form class="formWarp test" validate-first="validate-first" @failed="onFailed" validate-trigger="onSubmit" @submit="onSubmit" :show-error-message="false" :show-error="false">
- <div class="label">
- <div class="f14 c333">换机原因</div>
- <van-field v-model="formInfo.reson" readonly="readonly" name="reson" placeholder="请输入换机原因" @click="errorType = true" :rules="[{ required: true, message: '请选择换机原因' }]" right-icon="play"></van-field>
- </div>
- <div class="label">
- <div class="f14 c333">机具类型</div>
- <van-field v-model="showtype" readonly="readonly" name="type" placeholder="请选择机具类型" @click="choseType = true" right-icon="play" :rules="[{ required: true, message: '请选择机具类型' }]"></van-field>
- </div>
- <div class="label">
- <div class="f14 c333">机具SN号</div>
- <van-field v-model="formInfo.SN" name="SN" placeholder="请输入该机具SN" :rules="[{ required: true, message: '请填写机具SN' }]"></van-field>
- </div>
- <div class="label">
- <div class="f14 c333">备注</div>
- <van-field v-model="formInfo.remaker" name="remaker" placeholder="如有需要,请备注详细原因"></van-field>
- </div>
- <div class="label">
- <div class="f14 c333">上传机具照片1~3张</div>
- <van-uploader readonly="true" v-model="showpic" multiple="multiple" :max-count="3" @delete="deleteimg" @click-upload="uploadimg"></van-uploader>
- </div>
- <van-button class="btn" round="round" block="block" type="info" color="#FDD500" native-type="submit">下一步</van-button>
- </van-form>
- <input type="file" accept="image/*" id="upload" style="display:none;"/>
- <van-popup v-model="choseType" position="bottom">
- <van-picker title="机具类型" show-toolbar="show-toolbar" :columns="typecolumns" @confirm="choseTypeonConfirm" @cancel="choseType = false"></van-picker>
- </van-popup>
- <van-popup v-model="errorType" position="bottom">
- <van-picker title="换新原因" show-toolbar="show-toolbar" :columns="errortypecolumns" @confirm="errorTypeonConfirm" @cancel="errorType = false"></van-picker>
- </van-popup>
- </div>
- </body>
- <script src="./static/js/clipboard.min.js"></script>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/appfunc.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/publicfn.js"></script>
- <script src="./static/js/exif.js"></script>
- <script src="./static/js/transformation-matrix.js"></script>
- <script src="./static/js/prefix-umd.js"></script>
- <script src="./static/js/index.js"></script>
- <script>
- function AppUpload(imgpath) {
- setTimeout(function () {
- PublicLib.WapCropForApp(300, 300, 'upload', imgpath, 1);
- }, 300);
- };
- //裁切结束后回调方法
- function ShowPhoto(url) {
- //获取最终的图片地址
- app.uploadheadhpotofn(url);
- };
- //初始化crop
- if (isWeb) {
- PublicLib.WapCrop(1000, 1000, 'upload', 1);
- };
- Vue.use(vant.Lazyload)
- let app = new Vue({
- el:'#app',
- name:'possDetail',
- data(){
- return {
- //- 类型选择器
- choseType:false,
- errorType:false,
- toptitleisshow,
- title:'售后换新',
- imgtype:'',
- formInfo:{
- reson:'',
- SN:'',
- photoList:[
- ],
- SNtype:'',
- },
- showpic:[],
- errortypecolumns:[
- '充电问题',
- '存储已满问题',
- '硬件问题',
- '不能签字问题',
- ],
- typecolumns:[
- ],
- showtype:'',
- }
- },
- created(){
- this.getproducttypelist();
- },
- methods:{
- errorTypeonConfirm(data){
- this.formInfo.reson = data;
- this.errorType = false;
- },
- choseTypeonConfirm(date){
- this.formInfo.SNtype = date.Id;
- this.showtype = date.text;
- this.choseType = false;
- },
- back(){
- PublicLib.GoBack({Leval:1});
- },
- toDetail(){
- PublicLib.Goto({Url:'product-aftersale-list'});
- },
- uploadimg(){
- PublicLib.UploadPhoto({
- Quality:1,
- PhotoCount:1,
- Width:300,
- Height:300,
- });
- },
- async getproducttypelist(){
- const res = await getRequest('api/v1/pos/kqproducts/list?t='+Math.random(6),JSON.stringify({PageSize:10,PageNum:1}));
- if(res.status !== '1')return tips('产品列表获取失败!');
- //- res.data.push({Name: "金控大机", Id: 3},{Name: "开店宝大机", Id: 4});
- this.typecolumns = res.data.map(item=> {return {Id:item.Id,text:item.Name}});
- },
- async uploadheadhpotofn(HeadPhoto){
- this.formInfo.photoList.push({url: HeadPhoto});
- this.showpic.push({url:showHost + HeadPhoto});
- },
- deleteimg(a,b){
- this.formInfo.photoList.splice(b.index,1);
- },
- onFailed(errorInfo) {
- tips(errorInfo.errors[0].message);
- },
- async onSubmit() {
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/pos/machinechange/check?t='+Math.random(6),JSON.stringify({UserId,PosSn:this.formInfo.SN,BrandId:this.formInfo.SNtype}));
- if(res.status !== '1') return tips(res.info);
- //- 清除仓库Id
- PublicLib.putCookieInfo('warehouseId', '');
- //- 清除收货地址Id
- PublicLib.putCookieInfo('addressId', '');
- PublicLib.putCookieInfo('afterSaleInfo', JSON.stringify(this.formInfo));
- PublicLib.Goto({Url:'product-aftersale-2'});
- },
- },
- })
- </script>
- </html>
|