123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <template>
- <view class="page">
- <view class="form">
- <u-form :model="form" ref="uForm">
- <u-form-item label-width="150" label="备注信息" prop="record_remark" required label-position="top">
- <u-input :placeholder="remarkTips" v-model="form.record_remark" type="textarea"></u-input>
- </u-form-item>
- </u-form>
- <u-gap height="60"></u-gap>
- <u-button type="primary" @click="submitHandle">提交</u-button>
- </view>
- <!-- 列表选择 -->
- <u-select mode="single-column" :list="propertySelectList" v-model="propertySelectShow"
- @confirm="propertySelectConfirm"></u-select>
- <!-- modal -->
- <!-- utoast -->
- <u-toast ref="uToast" />
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- form: {
- record_remark: null,
- },
- customer_id: null,
- rules: {
- record_remark: [{
- required: true,
- message: '备注不能为空',
- trigger: ['change']
- }, ]
- },
- remarkTips: '请输入:购房预算(总价/均价/面积段)~现居住区域~现居住产品/面积段~工作类型~购房需求/关注点~已经看过的房源情况',
-
- propertySelectShow: false,
- propertySelectList: [],
- };
- },
- onLoad(data) {
- this.customer_id = data.id
- },
- created() {},
- // 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
- onReady() {
- this.$refs.uForm.setRules(this.rules);
- },
- methods: {
- // // 选择所属项目回调
- // propertySelectConfirm(e) {
- // e.map((val, index) => {
- // this.form.estate_id = val.value;
- // this.form.estate_name = val.label;
- // });
- // },
- submitHandle() {
- const that = this
- this.$refs.uForm.validate(valid => {
- if (valid) {
- // 验证成功
- let apiStr = 'apiprivaterecordadd'
- let params = {
- record_remark: that.form.record_remark,
- customer_id: this.customer_id
- }
- if (that.isEdit) {
- apiStr = 'apiprivaterecordedit'
- params.id = that.form.id
- }
- uni.api.cust[apiStr](params).then(res => {
- if (that.isEdit) {
- uni.$msgConfirm('编辑成功', () => {
- uni.reLaunch({
- url: '/pages/cust/my'
- })
- }, () => {
- uni.reLaunch({
- url: '/pages/cust/my'
- })
- })
- } else {
- uni.$msgConfirm('添加跟进记录成功,是否前往列表?', () => {
- uni.navigateBack()
- }, () => {
- this.form = {
- record_remark: null,
- }
- })
- }
- })
- } else {
- console.log('验证失败');
- }
- });
- },
- }
- };
- </script>
- <style lang="scss">
- .page {
- padding: 20rpx;
- background-color: #ffffff;
- }
- .form {
- border-radius: 10rpx;
- padding: 0 40rpx;
- }
- .popup-body {
- .tips-title {
- font-size: $u-p;
- margin-bottom: 20rpx;
- }
- .tips-content {
- font-size: $u-p2;
- color: $u-tips-color;
- margin-bottom: 60rpx;
- }
- }
- .id_card {
- color: #606266;
- width: 100%;
- height: 350rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- background-color: #f4f5f6;
- font-size: $u-p2;
- }
- .footer {
- position: absolute;
- text-align: center;
- bottom: 40rpx;
- font-size: $u-p2;
- .agreement {
- color: $u-type-error;
- }
- }
- .slot-content {
- font-size: 28rpx;
- color: $u-content-color;
- padding: 20rpx;
- }
- </style>
|