|
|
@@ -0,0 +1,136 @@
|
|
|
+<template>
|
|
|
+ <view class="app-content">
|
|
|
+ <view>
|
|
|
+ <view class="module-com input-line-wrap">
|
|
|
+ <tui-list-cell class="line-cell" :arrow="false">
|
|
|
+ <view class="tui-title">入库选项</view>
|
|
|
+ <view class="tui-right">
|
|
|
+ <switch :checked="form.cgIn == '0' ? false : true" @change="switchChangeFn('cgIn', $event)" />
|
|
|
+ {{ form.cgIn == '0' ? '不要入库' : '需要入库' }}
|
|
|
+ </view>
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :arrow="false">
|
|
|
+ <view class="tui-title">成本选项</view>
|
|
|
+ <view class="tui-right">
|
|
|
+ <switch :checked="form.cgIsCost == '0' ? false : true" @change="switchChangeFn('cgIsCost', $event)" />
|
|
|
+ {{ form.cgIsCost == '0' ? '不算成本' : '算成本' }}
|
|
|
+ </view>
|
|
|
+ </tui-list-cell>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="tips">以上请勿随意修改,了解清楚再修改,否则出问题自行承担</view>
|
|
|
+ <view class="confirm-btn">
|
|
|
+ <button class="admin-button-com big blue" @click="formSubmit">提交</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import TuiListCell from '@/components/plugin/list-cell';
|
|
|
+import { getExtInfo, modifyCgSetting } from '@/api/shop/ext.js';
|
|
|
+export default {
|
|
|
+ name: 'set',
|
|
|
+ components: { TuiListCell },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ form: {
|
|
|
+ cgIn: '0',
|
|
|
+ cgIsCost: '0'
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init() {
|
|
|
+ getExtInfo({fields:'cgIn,cgIsCost'}).then((res) => {
|
|
|
+ if (res.code === 1) {
|
|
|
+ this.form = res.data.ext;
|
|
|
+ console.log(this.form);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ formSubmit() {
|
|
|
+ modifyCgSetting(this.form).then((res) => {
|
|
|
+ if (res.code === 1) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '操作成功',
|
|
|
+ icon: 'success',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ // setTimeout(() => {
|
|
|
+ // uni.navigateBack({});
|
|
|
+ // }, 2000);
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ switchChangeFn(key, e) {
|
|
|
+ this.form[key] = e.detail.value ? '1' : '0';
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.app-content {
|
|
|
+ min-height: calc(100vh - 40rpx);
|
|
|
+ padding-top: 2rpx;
|
|
|
+}
|
|
|
+.tui-right {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #333;
|
|
|
+
|
|
|
+ ::v-deep switch {
|
|
|
+ margin-left: 20rpx;
|
|
|
+ }
|
|
|
+}
|
|
|
+.tips {
|
|
|
+ padding: 0 30rpx;
|
|
|
+ color: red;
|
|
|
+ font-size: 28rpx;
|
|
|
+ margin-bottom: 40rpx;
|
|
|
+}
|
|
|
+.prompt-text {
|
|
|
+ color: $fontColor3;
|
|
|
+ padding-left: 30rpx;
|
|
|
+ margin-bottom: 30rpx;
|
|
|
+}
|
|
|
+.module-com {
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ ::v-deep .tui-list-cell {
|
|
|
+ padding: 20rpx 30rpx;
|
|
|
+ &:first-child {
|
|
|
+ border-bottom: 1rpx solid #eee;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .member-wrap {
|
|
|
+ .member-det {
|
|
|
+ font-size: 24rpx;
|
|
|
+ margin-left: 20rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .remark-wrap {
|
|
|
+ align-items: flex-start;
|
|
|
+ .remark {
|
|
|
+ height: 240rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+// 按钮
|
|
|
+.confirm-btn {
|
|
|
+ width: calc(100% - 60rpx);
|
|
|
+ margin: 60rpx 30rpx;
|
|
|
+ .admin-button-com {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+}
|
|
|
+.switch-blo {
|
|
|
+ padding: 30rpx 30rpx;
|
|
|
+}
|
|
|
+</style>
|