123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680 |
- <!DOCTYPE html>
- <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">
- <style>
- .mall-bottom{padding:0 .3733rem;height:54px;}
- .mall-bottom button{border-radius:999px !important; height:80% !important;}
- .machine-list .van-cell__value{
- flex:.2;
- text-align:center;
- }
- .van-radio__icon--checked .van-icon,
- .van-checkbox__icon--checked .van-icon-success{
- color:#333 !important;
- }
- .apply .checkbox{
- color :#333;
- }
- .dialog .scroll {
- overflow-y: scroll;
- overflow-x:hidden;
- }
- .scroll .machine-list {
- width:96%;
- }
- .ismeng{font-size:4px;border:.5px solid #FFD6D6;color:#FF7D7D;padding:0 2px;margin-right:5px;}
- </style>
- </head>
- <body class="h100p ovh apply pb0 pt0" style="padding-top:0;">
- <div id="app" v-cloak>
- <van-nav-bar class="user_rank_explan_title user_title_normal rightc333" left-arrow :title="'机具申请-'+title" v-if="toptitleisshow" @click-left="goback" @click-right="applyrecord" right-text="申请记录">
- <template #left><img src="./static/images/icon-comback@2x.png" alt=""></template>
- </van-nav-bar>
- <div class="pt16 pb16 pl16 pr16 bgcfff bb8f7f7f7" v-cloak>
- <div class="f14 c333">尊敬的创客:</div>
- <div class="f14 c333" style="text-indent:2em">您已满足参加循环送活动资质。已经领取过循环送机器的除外,到目前为止您已经激活{{ActCount}}台,除去{{ExpiredCount}}台过期不可循环机,您本次最多领取{{ActCount - ExpiredCount}}台,最少领取{{MinCount}}台。循环送的机器不支持划拨他人。</div>
- </div>
- <div class="bgcfff">
- <div class="pt16 pb16 pl16 pr16"><span class="f14 c333 vm pr16">请在下方选择需要兑换的机器</span>
- <van-popover v-model="tipsisshow" overlay trigger="click" placement="bottom-end">
- <template #reference><img class="vm" src="./static/images/icon-help@2x.png" alt="" width="26" height="26"></template>
- <template #default>
- <div class="tc f14 c333">每个SN后面的标签代表可兑换的机具类型:</div>
- <div class="mt12"><span class="dib vm tag tag-1">金</span><span>: 创业帮-金控</span><span v-if="productId === '1' || productId === '2' || productId === '4' || productId === '6' || productId === '7' || productId === '8'">电签</span><span v-else>大POS</span></div>
- <div class="mt6" v-if="productId === '1' || productId === '2' || productId === '4' || productId === '6' || productId === '7' || productId === '8'"><span class="dib vm tag tag-2">开</span><span>: 创业帮-开店宝</span><span>电签</span></div>
- <div class="mt6"><span class="dib vm tag tag-3">乐</span><span>: 创业帮-乐刷</span><span v-if="productId === '1' || productId === '2' || productId === '4' || productId === '6' || productId === '7' || productId === '8'">电签</span><span v-else>大POS</span></div>
- <div class="mt6" v-if="productId === '1' || productId === '2' || productId === '4' || productId === '6' || productId === '7' || productId === '8'"><span class="dib vm tag tag-1">立</span><span>: 创业帮-立刷</span><span>云电签</span></div>
- <div class="mt6" v-if="productId === '1' || productId === '2' || productId === '4' || productId === '6' || productId === '7' || productId === '8'"><span class="dib vm tag tag-2">盛</span><span>: 创业帮-盛付通</span><span>电签</span></div>
- <div class="mt6"><span class="dib vm tag tag-3">海</span><span>: 创业帮-海科</span><span v-if="productId === '1' || productId === '2' || productId === '4' || productId === '6' || productId === '7' || productId === '8'">电签</span><span v-else>大POS</span></div>
- </template>
- </van-popover>
- </div>
- <van-tabs v-model="active" swipeable animated @change="changetab">
- <van-tab title="SN循环">
- <div class="ovh-x" ref="wrapper2" v-if="active === 0">
- <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="transactions.length === 0"></van-empty>
- <van-checkbox-group v-model="result">
- <van-cell-group>
- <van-cell class="machine-list" v-for="item,index in transactions" clickable :key="item.SnId" :value="item.MachineType" value-class="f14 c333" @click="toggle(index)" center>
- <template #title>
- <div class="f14 c333 warp"><span class="ismeng" v-if="item.IsLeader === 1">盟</span><span class="vm">SN:</span><span class="vm pr16" :id="'sn'+index">{{item.SnNo}}</span></div>
- </template>
- <template #icon>
- <van-checkbox class="mr16" :name="item" ref="checkboxes" checked-color="#FFD500"></van-checkbox>
- </template>
- <template #label>
- <div class="f12 more" v-if="item.last !== ''">循环剩余{{item.RecycDays}}天(截止{{item.EndDate}})</div>
- <div><span class="dib vm tag tag-1" v-if="item.king">金</span><span class="dib vm tag tag-2" v-if="item.open">开</span><span class="dib vm tag tag-3" v-if="item.leshua">乐</span><span class="dib vm tag tag-1" v-if="item.bigking">金</span><span class="dib vm tag tag-3" v-if="item.leshuabig">乐</span><span class="dib vm tag tag-1" v-if="item.lishua">立</span><span class="dib vm tag tag-2" v-if="item.sheng">盛</span><span class="dib vm tag tag-3" v-if="item.haikes">海</span><span class="dib vm tag tag-3" v-if="item.haikeb">海</span></div>
- </template>
- </van-cell>
- </van-cell-group>
- </van-checkbox-group>
- </div>
- </van-tab>
- <van-tab title="电签兑换券" v-if="is200">
- <div class="ovh-x" ref="wrapper2" v-if="active === 1">
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" :class="transactions.length === 0 ? 'isnodata':''" style="height: 100%;min-height:20vh;">
- <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
- <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="transactions.length === 0"></van-empty>
- <van-checkbox-group v-model="result">
- <van-cell-group>
- <van-cell class="machine-list" v-for="item,index in transactions" clickable :key="item.Id" :value="item.Kind === 1 ? '电签兑换券' : '大机兑换券'" value-class="f14 c333" @click="toggle(index)" center>
- <template #title>
- <div class="f14 c333 warp"><span class="ismeng" v-if="item.IsLeader === 1">盟</span><span class="vm">兑换码:</span><span class="vm pr16" :id="'sn'+index">{{item.ExchangeCode}}</span></div>
- </template>
- <template #icon>
- <van-checkbox class="mr16" :name="item" ref="checkboxes" checked-color="#FFD500"></van-checkbox>
- </template>
- <template #label>
- <div><span class="dib vm tag tag-1" v-if="item.king">金</span><span class="dib vm tag tag-2" v-if="item.open">开</span><span class="dib vm tag tag-3" v-if="item.leshua">乐</span><span class="dib vm tag tag-1" v-if="item.lishua">立</span><span class="dib vm tag tag-2" v-if="item.sheng">盛</span><span class="dib vm tag tag-3" v-if="item.haikes">海</span></div>
- </template>
- </van-cell>
- </van-cell-group>
- </van-checkbox-group>
- </van-list>
- </van-pull-refresh>
- </div>
- </van-tab>
- <van-tab title="大机兑换券" v-if="!is200">
- <div class="ovh-x" ref="wrapper2" v-if="active === 1">
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" :class="transactions.length === 0 ? 'isnodata':''" style="height: 100%;min-height:20vh;">
- <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
- <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="transactions.length === 0"></van-empty>
- <van-checkbox-group v-model="result">
- <van-cell-group>
- <van-cell class="machine-list" v-for="item,index in transactions" clickable :key="item.Id" :value="item.Kind === 1 ? '电签兑换券' : '大机兑换券'" value-class="f14 c333" @click="toggle(index)" center>
- <template #title>
- <div class="f14 c333 warp"><span class="ismeng" v-if="item.IsLeader === 1">盟</span><span class="vm">兑换码:</span><span class="vm pr16" :id="'sn'+index">{{item.ExchangeCode}}</span>
- <div><span class="dib vm tag tag-1" v-if="item.bigking">金</span><span class="dib vm tag tag-3" v-if="item.leshuabig">乐</span><span class="dib vm tag tag-3" v-if="item.haikeb">海</span></div>
- </div>
- </template>
- <template #icon>
- <van-checkbox class="mr16" :name="item" ref="checkboxes" checked-color="#FFD500"></van-checkbox>
- </template>
- <template #label></template>
- </van-cell>
- </van-cell-group>
- </van-checkbox-group>
- </van-list>
- </van-pull-refresh>
- </div>
- </van-tab>
- </van-tabs>
- </div>
- <div class="machine_appli_checkall fixed">
- <van-cell title="全选" :value="'已选'+ result.length + '台'" clickable @click="toggleSelectAll">
- <template #icon>
- <van-checkbox class="mr16" name="selectedNum" v-model="SelectedAll" checked-color="#FFD500"></van-checkbox>
- </template>
- </van-cell>
- </div>
- <van-goods-action class="mall-bottom">
- <van-goods-action-button class="kxs-btn" type="default" color="#FFD500" style="color:#333;" text="确认申请" :disabled="result.length === 0" @click="onClickButton"></van-goods-action-button>
- </van-goods-action>
- <van-dialog class="dialog selectProductType" v-model="showSuccess" show-cancel-button confirm-button-text="确认兑换" @confirm="surebtn" :before-close="isclose" @close="closedialog">
- <div class="pt16 pl16 pr16 tc mb8">
- <div class="f14 c333 b">请选择需要兑换的产品类型</div>
- <div class="pt16 f12 c999 tl">
- <p>1、选择的产品类型一旦申请兑换成功,不可更改;</p>
- <p>2、若某产品类型不可选择,则表示申请的机具中含不满足条件机具,请重新选择。</p>
- </div>
- <van-radio-group v-model="typeResult">
- <van-cell-group class="scroll" :border="false" style="height:40vh;">
- <van-cell class="machine-list" v-for="item,index in productTypes" clickable :key="index" value-class="f14" @click="typeToggle(item,index)" center>
- <template #title>
- <div class="f14 c333 tl"><span class="vm pr16 disable" :class="typeResult.Id === item.Id ? 'checkbox':''">{{item.Name}}</span></div>
- </template>
- <template #icon>
- <van-radio class="mr16" :name="item" ref="radios" :disabled="!item.status" checked-color="#FFD500"></van-radio>
- </template>
- </van-cell>
- </van-cell-group>
- </van-radio-group>
- </div>
- </van-dialog>
- </div>
- <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>
- function OnStart(){
- if(PublicLib.getCookieInfo('isApplyBack') === 'true'){
- app.changetab();
- PublicLib.putCookieInfo('isApplyBack','');
- }
- };
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
- PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- active:0,
- loading: false,
- finished: false,
- refreshing:false,
- productId:0,
- toptitleisshow:false,
- title:'ad',
- ExpiredCount:0,
- MinCount:0,
- ActCount:0,
- showSuccess: false,
- tipsisshow:false,
- result: [],
- typeResult: [
- ],
- pageinfo:{
- PageSize:30,
- PageNum:1
- },
- productTypes: [
- ],
- transactions: [
- ],
- value: '',
- SelectedAll: false,
- ischeck:true,
- king:{
- Id:[],
- status:true
- },
- bigking:{
- Id:[],
- status:true
- },
- open:{
- Id:[],
- status:true
- },
- leshua:{
- Id:[],
- status:true
- },
- leshuabig:{
- Id:[],
- status:true
- },
- lishua:{
- Id:[],
- status:true
- },
- sheng:{
- Id:[],
- status:true
- },
- haikes:{
- Id:[],
- status:true
- },
- haikeb:{
- Id:[],
- status:true
- },
- is200:true,
- };
- },
- async created() {
- this.toptitleisshow = toptitleisshow;
- this.getproductlist();
- this.getproducttypelist();
- this.title = PublicLib.getCookieInfo('productMachineType');
- this.productId = PublicLib.getCookieInfo('productMachineId');
- if(this.productId === '1' || this.productId === '2' || this.productId === '4' || this.productId === '6' || this.productId === '7' || this.productId === '8'){
- this.is200 = true;
- }else{
- this.is200 = false;
- };
- PublicLib.SetTitle({Title:'机具申请-'+ PublicLib.getCookieInfo('productMachineType')});
- },
- beforeUpdate(){
- this.$nextTick(() => {
- this.$refs.wrapper2.style.height = `${document.documentElement.clientHeight - 314}px`;
- });
- },
- methods: {
- changetab(){
- this.transactions = [];
- this.getnewinfo();
- },
- getnewinfo:undebounce(async function(){
- this.pageinfo.PageNum = 1;
- this.finished = false;
- this.result = [];
- if(this.active === 0){
- this.getproductlist('refresh');
- }else{
- this.getexchangelist('refresh');
- };
- },500),
- onRefresh() {
- // 清空列表数据
- this.finished = false;
- this.loading = true;
- // 重新加载数据
- // 将 loading 设置为 true,表示处于加载状态
- this.pageinfo.PageNum = 1;
- if(this.active === 0){
- this.getproductlist('refresh');
- }else{
- this.getexchangelist('refresh');
- };
- },
- onLoad() {
- if(this.refreshing){
- this.refreshing = false;
- };
- this.pageinfo.PageNum++;
- if(this.active !== 0){
- this.getexchangelist();
- };
- },
- giveToast(str){
- vant.Toast(str);
- },
- typeToggle(item,index) {
- const that = this;
- if(item.status){
- that.typeResult = item;
- };
- },
- toggle(index) {
- const that = this;
- this.$refs.checkboxes[index].toggle();
- //- 选择逻辑
- setTimeout(() => {
- this.choose();
- if(!this.ischeck){
- this.$refs.checkboxes[index].toggle();
- this.ischeck = true;
- return;
- };
- if(that.result.length == that.transactions.length){
- that.SelectedAll = true;
- }else{
- that.SelectedAll = false;
- };
- }, 10);
- },
- //- 选择逻辑
- choose(){
- this.king.status = true;
- this.open.status = true;
- this.bigking.status = true;
- this.leshua.status = true;
- this.leshuabig.status = true;
- this.lishua.status = true;
- this.sheng.status = true;
- this.haikes.status = true;
- this.haikeb.status = true;
- let king = true;
- let bigking = true;
- let open = true;
- let leshua = true;
- let leshuabig = true;
- let lishua = true;
- let sheng = true;
- let haikes = true;
- let haikeb = true;
- this.result.forEach(item=>{
- open = item.open;
- bigking = item.bigking;
- king = item.king;
- leshua = item.leshua;
- leshuabig = item.leshuabig;
- lishua = item.lishua;
- sheng = item.sheng;
- haikes = item.haikes;
- haikeb = item.haikeb;
- });
- if(this.result.length !== 0) {
- this.result.forEach(item=>{
- if(!(king === item.king || bigking === item.bigking || open === item.open || leshuabig === item.leshuabig || leshua === item.leshua || lishua === item.lishua || sheng === item.sheng)) {
- this.ischeck = false;
- };
- if(this.king.status) {
- this.king.status = item.king;
- };
- if(this.open.status) {
- this.open.status = item.open;
- };
- if(this.bigking.status) {
- this.bigking.status = item.bigking ;
- };
- if(this.leshuabig.status) {
- this.leshuabig.status = item.leshuabig ;
- };
- if(this.lishua.status) {
- this.lishua.status = item.lishua ;
- };
- if(this.sheng.status) {
- this.sheng.status = item.sheng ;
- };
- if(this.haikes.status) {
- this.haikes.status = item.haikes ;
- };
- if(this.haikeb.status) {
- this.haikeb.status = item.haikeb ;
- };
- if(this.leshua.status) {
- this.leshua.status = item.leshua ;
- };
- });
- };
- },
- toggleSelectAll(){
- const that = this;
- that.SelectedAll = !that.SelectedAll;
- if(that.SelectedAll){
- that.result = that.transactions;
- }else{
- that.result = [];
- };
- },
- onClickButton:undebounce(function(){
- if(PublicLib.getCookieInfo('userId') === '124473'){
- return tips('账号异常,请联系客服');
- };
- this.choose();
- this.chosefn();
- this.showSuccess = true;
- }),
- goback(){
- PublicLib.GoBack({Level:1});
- },
- //- 获取循环SN列表
- async getproductlist(){
- const ProductType = PublicLib.getCookieInfo('productMachineId');
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/pos/orders/exchangemachines2?t='+Math.random(6),JSON.stringify({...this.pageinfo,ProductType,UserId}));
- if(res.status !== '1')return tips('机具列表获取失败!');
- res.data.forEach((obj,index)=>{
- //- TODO:删除赋值start
- //- if(index === 0) {
- //- obj.ProductType = [1,2,4,6];
- //- } else if(index === 1){
- //- obj.ProductType = [1];
- //- } else if(index === 2){
- //- obj.ProductType = [4];
- //- } else {
- //- obj.ProductType = [1,2,3];
- //- };
- // end
- obj.king = false;
- obj.open = false;
- obj.bigking = false;
- obj.leshua = false;
- obj.leshuabig = false;
- obj.lishua = false;
- obj.sheng = false;
- obj.haikes = false;
- obj.haikeb = false;
- const typearray = obj.ProductType;
- typearray.forEach(i=>{
- if(i === 1) {
- this.king.Id.push(i);
- obj.king = true;
- };
- if(i === 2) {
- this.open.Id.push(i);
- obj.open = true;
- };
- if(i === 3) {
- this.bigking.Id.push(i);
- obj.bigking = true;
- };
- if(i === 4) {
- this.leshua.Id.push(i);
- obj.leshua = true;
- };
- if(i === 5) {
- this.leshuabig.Id.push(i);
- obj.leshuabig = true;
- };
- if(i === 6) {
- this.lishua.Id.push(i);
- obj.lishua = true;
- };
- if(i === 7) {
- this.sheng.Id.push(i);
- obj.sheng = true;
- };
- if(i === 8) {
- this.haikes.Id.push(i);
- obj.haikes = true;
- };
- if(i === 9) {
- this.haikeb.Id.push(i);
- obj.haikeb = true;
- };
- });
- });
- if(res.data.length < 10){
- this.finished = true;
- };
- //- this.transactions.push(...res.data);
- this.transactions = res.data;
- this.ActCount = res.other.ActCount;
- this.ExpiredCount = res.other.ExpiredCount;
- this.MinCount = res.other.MinCount;
- this.loading = false;
- },
- //- 获取兑换码列表
- async getexchangelist(type = 'onload'){
- const Kind = this.is200 ? 1 : 2;
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/pos/poscoupons/exchangecoupons?t='+Math.random(6),JSON.stringify({...this.pageinfo,UserId,Kind}));
- if(res.status !== '1')return tips('机具列表获取失败!');
- res.data.forEach((obj,index)=>{
- //- TODO:删除赋值start
- //- if(index === 0) {
- //- obj.ProductType = [1,2,4,6,7];
- //- } else if(index === 1){
- //- obj.ProductType = [1,2,4,6];
- //- } else if(index === 2){
- //- obj.ProductType = [1,2,4,6];
- //- } else {
- //- obj.ProductType = [1,2,7];
- //- };
- // end
- obj.king = false;
- obj.open = false;
- obj.bigking = false;
- obj.leshua = false;
- obj.leshuabig = false;
- obj.lishua = false;
- obj.sheng = false;
- obj.haikes = false;
- obj.haikeb = false;
- const typearray = obj.ProductType;
- typearray.forEach(i=>{
- if(i === 1) {
- this.king.Id.push(i);
- obj.king = true;
- };
- if(i === 2) {
- this.open.Id.push(i);
- obj.open = true;
- };
- if(i === 3) {
- this.bigking.Id.push(i);
- obj.bigking = true;
- };
- if(i === 4) {
- this.leshua.Id.push(i);
- obj.leshua = true;
- };
- if(i === 5) {
- this.leshuabig.Id.push(i);
- obj.leshuabig = true;
- };
- if(i === 6) {
- this.lishua.Id.push(i);
- obj.lishua = true;
- };
- if(i === 7) {
- this.sheng.Id.push(i);
- obj.sheng = true;
- };
- if(i === 8) {
- this.haikes.Id.push(i);
- obj.haikes = true;
- };
- if(i === 9) {
- this.haikeb.Id.push(i);
- obj.haikeb = true;
- };
- });
- });
- if(res.data.length < 10){
- this.finished = true;
- };
- if(type === 'refresh'){
- this.transactions = res.data
- this.refreshing = false;
- }else{
- this.transactions.push(...res.data);
- }
- this.loading = false;
- //- this.ActCount = res.other.ActCount;
- //- this.ExpiredCount = res.other.ExpiredCount;
- //- this.MinCount = res.other.MinCount;
- },
- async getproducttypelist(type = 'onload'){
- 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: 7});
- if(type === 'refresh'){
- this.productTypes = res.data
- this.refreshing = false;
- }else{
- this.productTypes.push(...res.data);
- }
- },
- chosefn(){
- this.productTypes.forEach(item=>{
- if(this.typefn(item.Id,this.king.Id)){
- item.status = this.king.status;
- }else if(this.typefn(item.Id,this.open.Id)){
- item.status = this.open.status;
- }else if(this.typefn(item.Id,this.bigking.Id)){
- item.status = this.bigking.status;
- }else if(this.typefn(item.Id,this.leshua.Id)){
- item.status = this.leshua.status;
- }else if(this.typefn(item.Id,this.leshuabig.Id)){
- item.status = this.leshuabig.status;
- }else if(this.typefn(item.Id,this.lishua.Id)){
- item.status = this.lishua.status;
- }else if(this.typefn(item.Id,this.sheng.Id)){
- item.status = this.sheng.status;
- }else if(this.typefn(item.Id,this.haikes.Id)){
- item.status = this.haikes.status;
- }else if(this.typefn(item.Id,this.haikeb.Id)){
- item.status = this.haikeb.status;
- }else {
- item.status = false;
- };
- });
- },
- typefn(Id,arr){
- const result = arr.find(item=>{
- return item === Id
- })
- return result;
- },
- isclose(action, done){
- if(action === 'confirm'){
- return done(false);
- }else{
- return done();
- };
- },
- surebtn(){
- let isRepeat = false;
- if(this.active === 0){
- this.result.forEach((obj,i)=>{
- this.result.forEach((item,index)=>{
- if(obj.SnNo === item.SnNo && i !== index){
- isRepeat = true;
- };
- });
- });
- if(isRepeat){
- return tips('请勿选择相同SN号!')
- };
- }else{
- this.result.forEach((obj,i)=>{
- this.result.forEach((item,index)=>{
- if(obj.ExchangeCode === item.ExchangeCode && i !== index){
- isRepeat = true;
- };
- });
- });
- if(isRepeat){
- return tips('请勿选择相同兑换码!')
- };
- };
- if(this.typeResult.length === 0){
- return tips('请选择循环机具类型!');
- };
- PublicLib.putCookieInfo('SNIDinfo', JSON.stringify(this.result));
- PublicLib.putCookieInfo('chooseProductId', JSON.stringify(this.typeResult));
- PublicLib.putCookieInfo('sendKind', JSON.stringify(this.active));
- this.result = [];
- this.SelectedAll = false;
- //- 清除仓库Id
- PublicLib.putCookieInfo('warehouseId', '');
- //- 清除收货地址Id
- PublicLib.putCookieInfo('addressId', '');
- this.showSuccess = false;
- setTimeout(()=>{
- PublicLib.Goto({Url:'product-machine-apply-2'});
- },50)
- },
- closedialog(){
- this.typeResult = [];
- },
- applyrecord(){
- PublicLib.Goto({Url:'product-machine-apply-record'});
- }
- }
- });
- </script>
- </body>
- </html>
|