| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- <template>
- <div class="app-content">
- <div>
- <form @submit="formSubmit">
- <div class="module-com input-line-wrap">
- <tui-list-cell class="line-cell" :arrow="false">
- <div class="tui-title">采购模式:</div>
- <radio-group class="tui-input" @change="cgModelChange">
- <label class="list" for="cModeJy">
- <radio id="cModeJy" value="1" :checked="cgModel == 1" />
- <span class="checkbox-text">简约</span>
- </label>
- <label class="list" for="cModelBz">
- <radio id="cModelBz" value="0" :checked="cgModel == 0" />
- <span class="checkbox-text">标准</span>
- </label>
- </radio-group>
- </tui-list-cell>
- <tui-list-cell class="line-cell" :arrow="false" v-if="cgModel == 1">
- <div class="tui-title">每公斤运费:</div>
- <input v-model="form.cgPerCost" type="digit" placeholder-class="phcolor" class="tui-input" @focus="form.cgPerCost=''" name="cgPerCost" placeholder="" />
- </tui-list-cell>
- </div>
- <div class="confirm-btn">
- <button class="admin-button-com big blue" formType="submit">保存</button>
- </div>
- </form>
- </div>
- </div>
- </template>
- <script>
- import TuiListCell from "@/components/plugin/list-cell";
- import { currentShop,updateCgModel } from "@/api/shop";
- export default {
- name: "cgSet",
- components: {TuiListCell},
- data() {
- return {
- form:{
- cgPerCost:'',
- },
- hasLoad:false,
- cgModel:0
- };
- },
- onLoad() {
- },
- onShow() {
- },
- methods: {
- cgModelChange(e){
- let value = e.detail.value
- this.cgModel = value
- },
- init(){
- if(this.hasLoad){
- return false
- }
- currentShop().then(res=>{
- if(res.code == 1){
- this.hasLoad = true
- this.form.cgPerCost = res.data.cgPerCost
- this.cgModel = res.data.cgModel
- this.$forceUpdate()
- }
- })
- },
- formSubmit() {
- let that = this
- if(that.cgModel == 1){
- if(that.$util.isMoney(that.form.cgPerCost) == false){
- that.$msg('请输入运费成本')
- return false
- }
- }
- updateCgModel({cgPerCost:that.form.cgPerCost,cgModel:that.cgModel}).then(res=>{
- if(res.code == 1){
- that.$msg(res.msg)
- setTimeout(function(){
- //这个切换得更彻底
- that.$store.commit("setLoginInfo", {})
- that.$util.pageTo({url: "/admin/home/workbench",type: 3})
- },1000);
- }
- })
- }
- },
- };
- </script>
- <style lang="scss" scoped>
- .app-content {
- min-height: calc(100vh - 20upx);
- padding-top: 20upx;
- }
- .prompt-text {
- color: $fontColor3;
- padding-left: 30upx;
- margin-bottom: 30upx;
- }
- .module-com {
- margin-bottom: 20upx;
- .member-wrap {
- .member-det {
- font-size: 24upx;
- margin-left: 20upx;
- }
- }
- .remark-wrap {
- align-items: flex-start;
- .remark {
- height: 240upx;
- }
- }
- }
- // 按钮
- .confirm-btn {
- width: calc(100% - 60upx);
- margin: 60upx 30upx 20upx;
- .admin-button-com {
- width: 100%;
- }
- }
- </style>
|