|
|
@@ -0,0 +1,204 @@
|
|
|
+<template>
|
|
|
+ <div class="app-content">
|
|
|
+ <form @submit="formSubmit">
|
|
|
+ <view class="module-com">
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" >
|
|
|
+ <div class="tui-title">客户1</div>
|
|
|
+ <input v-model="form.name1" type="text" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="name1" placeholder="请输入名称" />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <div class="tui-title required">手机号</div>
|
|
|
+ <input v-model="form.mobile1" type="number" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="mobile1" placeholder="客户手机号" />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <div class="tui-title required">确认手机号</div>
|
|
|
+ <input v-model="form.confirmMobile1" type="number" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="confirmMobile1" placeholder="客户手机号" />
|
|
|
+ </tui-list-cell>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="module-com">
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" >
|
|
|
+ <div class="tui-title">客户2</div>
|
|
|
+ <input v-model="form.name2" type="text" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="name2" placeholder="请输入名称" />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <div class="tui-title required">手机号</div>
|
|
|
+ <input v-model="form.mobile2" type="number" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="mobile2" placeholder="客户手机号" />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <div class="tui-title required">确认手机号</div>
|
|
|
+ <input v-model="form.confirmMobile2" type="number" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="confirmMobile2" placeholder="客户手机号" />
|
|
|
+ </tui-list-cell>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="module-com">
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" >
|
|
|
+ <div class="tui-title">客户3</div>
|
|
|
+ <input v-model="form.name3" type="text" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="name3" placeholder="请输入名称" />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <div class="tui-title required">手机号</div>
|
|
|
+ <input v-model="form.mobile3" type="number" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="mobile3" placeholder="客户手机号" />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <div class="tui-title required">确认手机号</div>
|
|
|
+ <input v-model="form.confirmMobile3" type="number" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="confirmMobile3" placeholder="客户手机号" />
|
|
|
+ </tui-list-cell>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="module-com">
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" >
|
|
|
+ <div class="tui-title">客户4</div>
|
|
|
+ <input v-model="form.name4" type="text" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="name4" placeholder="请输入名称" />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <div class="tui-title required">手机号</div>
|
|
|
+ <input v-model="form.mobile4" type="number" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="mobile4" placeholder="客户手机号" />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <div class="tui-title required">确认手机号</div>
|
|
|
+ <input v-model="form.confirmMobile4" type="number" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="confirmMobile4" placeholder="客户手机号" />
|
|
|
+ </tui-list-cell>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="module-com">
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" >
|
|
|
+ <div class="tui-title">客户5</div>
|
|
|
+ <input v-model="form.name5" type="text" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="name5" placeholder="请输入名称" />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <div class="tui-title required">手机号</div>
|
|
|
+ <input v-model="form.mobile5" type="number" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="mobile5" placeholder="客户手机号" />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <div class="tui-title required">确认手机号</div>
|
|
|
+ <input v-model="form.confirmMobile5" type="number" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="confirmMobile5" placeholder="客户手机号" />
|
|
|
+ </tui-list-cell>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="app-footer">
|
|
|
+ <div class="btn-wrap">
|
|
|
+ <button class="admin-button-com blue big" formType="submit">确认</button>
|
|
|
+ </div>
|
|
|
+ </view>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import TuiListCell from "@/components/plugin/list-cell";
|
|
|
+const form = require("@/utils/formValidation.js");
|
|
|
+import { batchAddCumtom } from '@/api/custom'
|
|
|
+export default {
|
|
|
+ name: "addCustom",
|
|
|
+ components: {
|
|
|
+ TuiListCell
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ merchantData: {},
|
|
|
+ form: {
|
|
|
+ name1: "",
|
|
|
+ mobile1: "",
|
|
|
+ confirmMobile1: "",
|
|
|
+
|
|
|
+ name2: "",
|
|
|
+ mobile2: "",
|
|
|
+ confirmMobile2: "",
|
|
|
+
|
|
|
+ name3: "",
|
|
|
+ mobile3: "",
|
|
|
+ confirmMobile3: "",
|
|
|
+
|
|
|
+ name4: "",
|
|
|
+ mobile4: "",
|
|
|
+ confirmMobile4: "",
|
|
|
+
|
|
|
+ name5: "",
|
|
|
+ mobile5: "",
|
|
|
+ confirmMobile5: "",
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ formSubmit (e) {
|
|
|
+ let rules = [
|
|
|
+ { name: "name1", rule: ["required"], msg: ["请填写客户1的名称"] },
|
|
|
+ { name: "mobile1", rule: ["isMobile"], msg: ["请填写客户1的手机号"] },
|
|
|
+ { name: "confirmMobile1", rule: ["isSame:mobile1"], msg: ["客户1的确认手机号有误"] },
|
|
|
+ { name: "confirmMobile2", rule: ["isSame:mobile2"], msg: ["客户2的确认手机号有误"] },
|
|
|
+ { name: "confirmMobile3", rule: ["isSame:mobile3"], msg: ["客户3的确认手机号有误"] },
|
|
|
+ { name: "confirmMobile4", rule: ["isSame:mobile4"], msg: ["请客户4的确认手机号有误"] },
|
|
|
+ { name: "confirmMobile5", rule: ["isSame:mobile5"], msg: ["客户5的确认手机号有误"] },
|
|
|
+ ];
|
|
|
+ let formData = this.form;
|
|
|
+ let checkRes = form.validation(formData, rules);
|
|
|
+ if (!checkRes) {
|
|
|
+ uni.showLoading({mask:true})
|
|
|
+ setTimeout(() => {
|
|
|
+ this.confirmFn()
|
|
|
+ })
|
|
|
+ uni.hideLoading()
|
|
|
+ } else {
|
|
|
+ this.$msg(checkRes);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ confirmFn () {
|
|
|
+ uni.showLoading({mask:true})
|
|
|
+ batchAddCumtom({
|
|
|
+ ...this.form
|
|
|
+ }).then(res => {
|
|
|
+ this.$msg(res.msg);
|
|
|
+ if(res.code == 1){
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.navigateBack();
|
|
|
+ }, 2000)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.app-content {
|
|
|
+ margin-bottom: 170upx;
|
|
|
+}
|
|
|
+.module-com {
|
|
|
+ margin-bottom: 20upx;
|
|
|
+ background-color:#fff;
|
|
|
+ .module-tit {
|
|
|
+ padding: 20upx 18upx;
|
|
|
+ font-size: 28upx;
|
|
|
+ font-weight: 600;
|
|
|
+ border-bottom: 1upx solid $borderColor;
|
|
|
+ }
|
|
|
+ .module-det {
|
|
|
+ padding: 0 30upx;
|
|
|
+ }
|
|
|
+}
|
|
|
+// 公共
|
|
|
+.line-cell {
|
|
|
+ .tui-title {
|
|
|
+ width: 210upx;
|
|
|
+ color: $fontColor2;
|
|
|
+ }
|
|
|
+ .tui-input {
|
|
|
+ width: calc(100% - 210upx);
|
|
|
+ font-size: 28upx;
|
|
|
+ }
|
|
|
+ .tui-placeholder {
|
|
|
+ color: #ccc;
|
|
|
+ }
|
|
|
+ .phcolor {
|
|
|
+ color: #ccc;
|
|
|
+ }
|
|
|
+}
|
|
|
+.btn-wrap {
|
|
|
+ width: 90%;
|
|
|
+ margin: 60upx auto;
|
|
|
+ .admin-button-com {
|
|
|
+ width: 100%;
|
|
|
+ margin: 0 auto;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|