|
|
@@ -0,0 +1,178 @@
|
|
|
+<template>
|
|
|
+ <view class="app-content">
|
|
|
+ <form @submit="toSubmit">
|
|
|
+ <view class="module-com input-line-wrap">
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <view class="tui-title">客户可看库存</view>
|
|
|
+ <view>
|
|
|
+ <switch style="transform:scale(0.7,0.7)" :checked="form.showStock == 0 ? false : true" @change="showStockChange" /> {{form.showStock==1 ? '可以' : '不要'}}
|
|
|
+ </view>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <view class="tui-title">默认新客享受</view>
|
|
|
+ <view>
|
|
|
+ <switch style="transform:scale(0.7,0.7)" :checked="form.isHd == 1 ? false : true" @change="isHdChange" /> {{form.isHd == 1 ? '批发价' : '零售价'}}
|
|
|
+ </view>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <view class="tui-title">默认允许欠款</view>
|
|
|
+ <view>
|
|
|
+ <switch style="transform:scale(0.7,0.7)" :checked="form.allowDebt == 0 ? false : true" @change="allowDebtChange" /> {{form.allowDebt==0 ? '不能' : '允许'}}
|
|
|
+ </view>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" v-if="form.allowDebt == 1">
|
|
|
+ <view class="tui-title ">默认欠款额度</view>
|
|
|
+ <input type="number" v-model="form.allowDebtAmount" @focus="form.allowDebtAmount=''" placeholder-class="phcolor" class="tui-input" name="allowDebtAmount" placeholder="请填写金额" />
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <view class="tui-title">默认新客要审</view>
|
|
|
+ <view>
|
|
|
+ <switch style="transform:scale(0.7,0.7)" :checked="form.needCheck == 0 ? false : true" @change="needCheckChange" /> {{form.needCheck==0 ? '不要' : '需要'}}
|
|
|
+ </view>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <view class="tui-title">客户可看销量</view>
|
|
|
+ <view>
|
|
|
+ <switch style="transform:scale(0.7,0.7)" :checked="form.showSold == 0 ? false : true" @change="showSoldChange" /> {{form.showSold==1 ? '可以' : '不要'}}
|
|
|
+ </view>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <view class="tui-title">线下开单超欠</view>
|
|
|
+ <view>
|
|
|
+ <switch style="transform:scale(0.7,0.7)" :checked="form.overAllowDebt == 0 ? false : true" @change="overAllowDebtChange" /> {{form.overAllowDebt==1 ? '可以' : '不要'}}
|
|
|
+ </view>
|
|
|
+ </tui-list-cell>
|
|
|
+ </view>
|
|
|
+ <view class="confirm-btn">
|
|
|
+ <button class="admin-button-com big blue" formType="submit">提交</button>
|
|
|
+ </view>
|
|
|
+ </form>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import TuiListCell from '@/components/plugin/list-cell'
|
|
|
+import AppAvatarModule from '@/components/module/app-avatar'
|
|
|
+import AppAreaSel from '@/components/app-area-sel'
|
|
|
+import AppUploader from "@/components/app-uploader";
|
|
|
+import { updateShop } from '@/api/shop'
|
|
|
+import {mapActions} from "vuex";
|
|
|
+import { getDetail } from "@/api/shop"
|
|
|
+export default {
|
|
|
+ name: 'set',
|
|
|
+ components: {
|
|
|
+ TuiListCell,
|
|
|
+ AppAvatarModule,
|
|
|
+ AppAreaSel,
|
|
|
+ AppUploader
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ form: {
|
|
|
+ allowDebt:0,
|
|
|
+ needCheck:0,
|
|
|
+ allowDebtAmount:5000,
|
|
|
+ showStock:1,
|
|
|
+ showSold:0,
|
|
|
+ overAllowDebt:1,
|
|
|
+ isHd:1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init() {
|
|
|
+ this.getSetDetail()
|
|
|
+ },
|
|
|
+ getSetDetail() {
|
|
|
+ let id = 0
|
|
|
+ getDetail({shopId:id}).then(res=>{
|
|
|
+ let data = res.data.info
|
|
|
+ if (this.$util.isEmpty(data)){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ Object.keys(this.form).forEach((i, index) => {
|
|
|
+ this.form[i] = data[i]
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ isHdChange(e){
|
|
|
+ this.form.isHd = e.target.value ? 0 : 1
|
|
|
+ },
|
|
|
+ showStockChange(e){
|
|
|
+ this.form.showStock = e.target.value ? 1 : 0
|
|
|
+ },
|
|
|
+ overAllowDebtChange(e){
|
|
|
+ this.form.overAllowDebt = e.target.value ? 1 : 0
|
|
|
+ },
|
|
|
+ showSoldChange(e){
|
|
|
+ this.form.showSold = e.target.value ? 1 : 0
|
|
|
+ },
|
|
|
+ allowDebtChange(e){
|
|
|
+ this.form.allowDebt = e.target.value ? 1 : 0
|
|
|
+ },
|
|
|
+ needCheckChange(e){
|
|
|
+ this.form.needCheck = e.target.value ? 1 : 0
|
|
|
+ },
|
|
|
+ toSubmit() {
|
|
|
+ this.$msg('开发中')
|
|
|
+ return false
|
|
|
+ uni.showLoading({mask:true})
|
|
|
+ updateShop(this.form).then(res => {
|
|
|
+ uni.hideLoading()
|
|
|
+ this.$msg('修改成功')
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$util.pageTo(1)
|
|
|
+ }, 1000)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .app-content {
|
|
|
+ min-height: calc(100vh - 20upx);
|
|
|
+ padding-top:10upx;
|
|
|
+ padding-bottom:150upx;
|
|
|
+ }
|
|
|
+ .prompt-text {
|
|
|
+ color: $fontColor3;
|
|
|
+ padding-left: 30upx;
|
|
|
+ margin-bottom: 30upx;
|
|
|
+ }
|
|
|
+ .module-com {
|
|
|
+ .member-wrap {
|
|
|
+ .member-det {
|
|
|
+ font-size: 24upx;
|
|
|
+ margin-left: 20upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .remark-wrap {
|
|
|
+ align-items: flex-start;
|
|
|
+ .remark {
|
|
|
+ height: 180upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 按钮
|
|
|
+ .confirm-btn {
|
|
|
+ position: fixed;
|
|
|
+ bottom: 0upx;
|
|
|
+ width: calc(100% - 60upx);
|
|
|
+ margin: 60upx 30upx 20upx;
|
|
|
+ background-color: white;
|
|
|
+ z-index: 999;
|
|
|
+ .admin-button-com {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|