Эх сурвалжийг харах

feature:跟进增加未来计划字段,所有的操作按钮点击之后置灰

liuzl 2 жил өмнө
parent
commit
d855bb5b14

+ 8 - 7
pages/contract/collection.vue

@@ -59,7 +59,7 @@
             maxlength="300"></u-textarea>
         </u-form-item>
       </u-form>
-      <view class="save" @click="save">保存</view>
+      <view class="save" @click="save" :class="!flag ? 'disabledBtn' : ''">保存</view>
     </view>
     <u-calendar :show="show" @confirm="confirmCalendar" @close="show = false"></u-calendar>
     <u-action-sheet :actions="collectionTypeOption" @select="selectClick" :show="showPicker"></u-action-sheet>
@@ -73,6 +73,7 @@
   export default {
     data() {
       return {
+        flag: true,
         height: '',
         paddingTop: '',
         form: {
@@ -143,6 +144,7 @@
         this.showPicker = false
       },
       async save() {
+        if (!this.flag) return
         let params = {
           ...this.form,
         }
@@ -152,7 +154,9 @@
           .validate()
           .then(async (valid) => {
             if (valid) {
+              this.flag = false
               const [err, res] = await to(api.addCollection(params))
+              this.flag = true
               if (err) return
               this.$refs.uToast.show({
                 type: 'success',
@@ -208,7 +212,7 @@
     .main {
       position: absolute;
       width: 100%;
-      height: calc(100vh - 280rpx);
+      height: calc(100vh - 190rpx);
       background: #ffffff;
       border-radius: 31rpx 31rpx 0 0;
       padding: 0 32rpx;
@@ -231,14 +235,11 @@
       }
 
       .save {
-        position: fixed;
-        bottom: 0;
-        left: 0;
         width: 100%;
         height: 92rpx;
         background: #3e7ef8;
-        border-radius: 31rpx 31rpx 0 0;
-        margin: 116rpx auto 0;
+        border-radius: 31rpx;
+        margin: 60rpx auto 0;
         font-size: 32rpx;
         color: #ffffff;
         text-align: center;

+ 2 - 2
pages/contract/index.vue

@@ -88,9 +88,9 @@
       </scroll-view>
     </view>
     <!-- 新增按钮 -->
-    <view class="fixed-btn center" @click="openAdd()">
+    <!-- <view class="fixed-btn center" @click="openAdd()">
       <u-icon name="plus" color="#fff" size="20"></u-icon>
-    </view>
+    </view> -->
     <!-- 消息提示 -->
     <u-toast ref="uToast"></u-toast>
   </view>

+ 65 - 50
pages/contract/invoice.vue

@@ -25,7 +25,7 @@
             <view class="label-tag"></view>
             开票金额
           </view>
-          <u-input v-model.number="form.invoiceAmount" placeholder="请输入开票金额"/>
+          <u-input v-model.number="form.invoiceAmount" placeholder="请输入开票金额" />
         </u-form-item>
         <u-form-item prop="invoiceDate" @click="show = true">
           <view class="form-label flex_l">
@@ -46,11 +46,16 @@
             <view class="label-tag"></view>
             备注
           </view>
-          <u-textarea fontSize="26rpx" v-model="form.remark" placeholder="输入备注" height="180" :count="true"
+          <u-textarea
+            fontSize="26rpx"
+            v-model="form.remark"
+            placeholder="输入备注"
+            height="180"
+            :count="true"
             maxlength="300"></u-textarea>
         </u-form-item>
       </u-form>
-      <view class="save" @click="save">保存</view>
+      <view class="save" @click="save" :class="!flag ? 'disabledBtn' : ''">保存</view>
     </view>
     <u-calendar :show="show" @confirm="confirmCalendar" @close="show = false" minDate="1990-1-1"></u-calendar>
     <u-action-sheet :actions="collectionTypeOption" @select="selectClick" :show="showPicker"></u-action-sheet>
@@ -64,6 +69,7 @@
   export default {
     data() {
       return {
+        flag:true,
         height: '',
         paddingTop: '',
         form: {
@@ -76,31 +82,39 @@
           remark: '', //备注
         },
         rules: {
-          contractCode: [{
-            required: true,
-            trigger: 'blur',
-            message: '请选择合同'
-          }],
-          invoiceAmount: [{
-            type:'number',
-            required: true,
-            trigger: 'blur',
-            message: '请输入开票金额'
-          }],
-          invoiceDate: [{
-            required: true,
-            trigger: 'change',
-            message: '请选择开票日期'
-          }],
-          invoiceType: [{
-            required: true,
-            trigger: 'chgange',
-            message: '请输入开票类型'
-          }],
+          contractCode: [
+            {
+              required: true,
+              trigger: 'blur',
+              message: '请选择合同',
+            },
+          ],
+          invoiceAmount: [
+            {
+              type: 'number',
+              required: true,
+              trigger: 'blur',
+              message: '请输入开票金额',
+            },
+          ],
+          invoiceDate: [
+            {
+              required: true,
+              trigger: 'change',
+              message: '请选择开票日期',
+            },
+          ],
+          invoiceType: [
+            {
+              required: true,
+              trigger: 'chgange',
+              message: '请输入开票类型',
+            },
+          ],
         },
         show: false,
         showPicker: false,
-        collectionTypeOption: []
+        collectionTypeOption: [],
       }
     },
     created() {
@@ -118,13 +132,11 @@
         Promise.all([this.getDicts('invoice_type')])
           .then(([collectionType]) => {
             this.collectionTypeOption = collectionType.data.values || []
-            this.collectionTypeOption.forEach(item => item.name = item.value)
+            this.collectionTypeOption.forEach((item) => (item.name = item.value))
           })
           .catch((err) => console.log(err))
       },
-      closeMoveInModel() {
-
-      },
+      closeMoveInModel() {},
       confirmCalendar(val) {
         this.form.invoiceDate = val[0]
         this.show = false
@@ -135,24 +147,30 @@
         this.showPicker = false
       },
       async save() {
+        if(!this.flag) return 
         let params = {
-          ...this.form
+          ...this.form,
         }
         delete params.invoiceName
         params.invoiceAmount = parseInt(params.invoiceAmount)
-        this.$refs.form.validate().then(async valid => {
-          if (valid) {
-            const [err, res] = await to(api.addInvoice(params))
-            if (err) return
-            this.$refs.uToast.show({
-              type: 'success',
-              message: '创建成功',
-              complete: () => {
-                this.goBack()
-              },
-            })
-          }
-        }).catch(errors => {})
+        this.$refs.form
+          .validate()
+          .then(async (valid) => {
+            if (valid) {
+              this.flag = false
+              const [err, res] = await to(api.addInvoice(params))
+              this.flag = true
+              if (err) return
+              this.$refs.uToast.show({
+                type: 'success',
+                message: '创建成功',
+                complete: () => {
+                  this.goBack()
+                },
+              })
+            }
+          })
+          .catch((errors) => {})
       },
       goBack() {
         uni.navigateBack({
@@ -197,7 +215,7 @@
     .main {
       position: absolute;
       width: 100%;
-      height: calc(100vh - 280rpx);
+      height: calc(100vh - 190rpx);
       background: #ffffff;
       border-radius: 31rpx 31rpx 0 0;
       padding: 0 32rpx;
@@ -213,21 +231,18 @@
         .label-tag {
           width: 15rpx;
           height: 15rpx;
-          background:  #ff4d4f;
+          background: #ff4d4f;
           border-radius: 50%;
           margin-right: 10rpx;
         }
       }
 
       .save {
-        position: fixed;
-        bottom: 0;
-        left: 0;
         width: 100%;
         height: 92rpx;
         background: #3e7ef8;
-        border-radius: 31rpx 31rpx 0 0;
-        margin: 116rpx auto 0;
+        border-radius: 31rpx;
+        margin: 60rpx auto 0;
         font-size: 32rpx;
         color: #ffffff;
         text-align: center;

+ 5 - 1
pages/customer/add.vue

@@ -104,7 +104,7 @@
             customStyle="padding: 0 30rpx 0 12rpx"></u-input>
         </u-form-item>
       </u-form>
-      <view class="save" @click="handleAdd">保存</view>
+      <view class="save" @click="handleAdd" :class="!flag ? 'disabledBtn' : ''">保存</view>
     </view>
     <!-- 选择客户行业 -->
     <u-picker
@@ -154,6 +154,7 @@
     name: 'omsIndex',
     data() {
       return {
+        flag: true,
         height: '',
         paddingTop: '',
         showIndustry: false, //选择行业
@@ -380,6 +381,7 @@
         this.showArea = false
       },
       handleAdd() {
+        if (!this.flag) return
         this.$refs.addForm
           .validate()
           .then(async () => {
@@ -395,7 +397,9 @@
               CustRegion: this.addForm.CustRegion,
               remark: this.addForm.remark,
             }
+            this.flag = false
             const [err, res] = await to(customerApi.createCustomer(params))
+            this.flag = true
             if (err) return
             if (res && res.code == 200) {
               this.$refs.uToast.show({

+ 4 - 0
pages/customer/components/moveInOpenSea.vue

@@ -32,6 +32,7 @@
   export default {
     data() {
       return {
+        flag: true,
         showMoveInModel: false,
         openSeaObj: {
           remark: '',
@@ -46,8 +47,11 @@
       },
       // 移入公海
       async confirmMoveInOpenSea() {
+        if (!this.flag) return
         let params = this.openSeaObj
+        this.flag = false
         const [err, res] = await to(customerApi.moveInOpenSea(params))
+        this.flag = true
         if (err) return this.closeMoveInModel()
         if (res.code == 200) {
           this.$refs.uToast.show({

+ 5 - 1
pages/customer/transfer.vue

@@ -56,7 +56,7 @@
             maxlength="300"></u-textarea>
         </u-form-item>
       </u-form>
-      <view class="save" @click="handleAdd">保存</view>
+      <view class="save" @click="handleAdd" :class="!flag ? 'disabledBtn' : ''">保存</view>
     </view>
     <u-notify ref="uNotify"></u-notify>
     <u-toast ref="uToast"></u-toast>
@@ -72,6 +72,7 @@
     components: { SelectUser },
     data() {
       return {
+        flag:true,
         height: '',
         paddingTop: '',
         transferObj: {
@@ -108,11 +109,14 @@
     onShow() {},
     methods: {
       handleAdd() {
+        if(!this.flag) return
         this.$refs.addForm
           .validate()
           .then(async () => {
             let params = this.transferObj
+            this.flag = false
             const [err, res] = await to(customerApi.transfer(params))
+            this.flag = true
             if (err) return
             if (res && res.code == 200) {
               this.$refs.uToast.show({

+ 11 - 2
pages/distributor/create.vue

@@ -53,7 +53,7 @@
         </u-form-item>
       </u-form>
       <view class="center">
-        <view class="handle-btn" @click="handleAdd">保存</view>
+        <view class="handle-btn" @click="handleAdd" :class="!flag ? 'disabledBtn' : ''">保存</view>
       </view>
     </view>
     <!-- 选择省 -->
@@ -69,6 +69,7 @@
   </view>
 </template>
 <script>
+  import { mapGetters } from 'vuex'
   import to from 'await-to-js'
   import distrApi from '../../api/base/distr'
   import SelectUser from 'components/SelectUser'
@@ -77,6 +78,7 @@
     components: { SelectUser },
     data() {
       return {
+        flag: true,
         height: '',
         paddingTop: '',
         showProvince: false,
@@ -95,7 +97,9 @@
         },
       }
     },
-
+    computed: {
+      ...mapGetters(['userId', 'username']),
+    },
     created() {
       const navData = uni.getMenuButtonBoundingClientRect()
       this.height = navData.height + 'px'
@@ -119,11 +123,16 @@
         this.showProvince = false
       },
       handleAdd() {
+        if (!this.flag) return
         this.$refs.addForm
           .validate()
           .then(async () => {
             let params = this.addForm
+            params.belongSale = this.username
+            params.belongSaleId = this.userId
+            this.flag = false
             const [err, res] = await to(distrApi.doAdd(params))
+            this.flag = true
             if (err) return
             if (res && res.code == 200) {
               this.$refs.uToast.show({

+ 19 - 9
pages/openSeaCustomer/components/collectionCustomer.vue

@@ -1,13 +1,21 @@
 <template>
   <view>
     <!-- 领取客户 -->
-    <u-modal :show="showCollectionModel" :showCancelButton="true" @confirm="confirmCollection()"
-      @cancel="closeMoveInModel()" title="领取客户">
+    <u-modal
+      :show="showCollectionModel"
+      :showCancelButton="true"
+      @confirm="confirmCollection()"
+      @cancel="closeMoveInModel()"
+      title="领取客户">
       <view class="slot-content" style="width: 100%">
         <view class="flex">
           <text>申请说明:</text>
-          <u-textarea v-model="openSeaObj.applyRemark" placeholder="请输入申请说明" height="180" :count="true" maxlength="500">
-          </u-textarea>
+          <u-textarea
+            v-model="openSeaObj.applyRemark"
+            placeholder="请输入申请说明"
+            height="180"
+            :count="true"
+            maxlength="500"></u-textarea>
         </view>
       </view>
     </u-modal>
@@ -16,9 +24,7 @@
 </template>
 
 <script>
-  import {
-    mapGetters
-  } from 'vuex'
+  import { mapGetters } from 'vuex'
   import customerApi from '../../../api/customer'
   import to from 'await-to-js'
   export default {
@@ -26,10 +32,11 @@
       position: {
         default: () => {},
         required: true,
-      }
+      },
     },
     data() {
       return {
+        flag: true,
         showCollectionModel: false,
         openSeaObj: {
           applyRemark: '',
@@ -50,6 +57,7 @@
       async confirmCollection() {
         // this.openSeaObj.salesId = this.userId
         // this.openSeaObj.salesName = this.username
+        if (!this.flag) return
         if (!this.openSeaObj.applyRemark) {
           this.$refs.uNotify.show({
             top: this.position.height + this.position.paddingTop + 10,
@@ -62,9 +70,11 @@
         let params = {
           ...this.openSeaObj,
           salesId: this.userId,
-          salesName: this.username
+          salesName: this.username,
         }
+        this.flag = false
         const [err, res] = await to(customerApi.collection(params))
+        this.flag = true
         if (err) return this.closeMoveInModel()
         if (res.code == 200) {
           this.$refs.uToast.show({

+ 4 - 0
pages/project/components/transferReserve.vue

@@ -29,6 +29,7 @@
   export default {
     data() {
       return {
+        flag: true,
         modelVisible: false,
         addFrom: {
           projConversionReason: '',
@@ -43,8 +44,11 @@
       },
       // 移入公海
       async handleConfirm() {
+        if (!this.flag) return
         let params = this.addFrom
+        this.flag = false
         const [err, res] = await to(projectApi.toReserve(params))
+        this.flag = true
         if (err) return this.close()
         if (res.code == 200) {
           this.$refs.uToast.show({

+ 5 - 1
pages/project/create.vue

@@ -361,7 +361,7 @@
       <view class="center">
         <view class="handle-btn" v-if="step > 1" @click="previousStep">上一步</view>
         <view class="handle-btn" v-if="step < 2" @click="nextStep">下一步</view>
-        <view class="handle-btn" v-if="step == 2" @click="handleAdd">保存</view>
+        <view class="handle-btn" v-if="step == 2" @click="handleAdd" :class="!flag ? 'disabledBtn' : ''">保存</view>
       </view>
     </view>
     <!-- 选择下次时间 -->
@@ -451,6 +451,7 @@
     components: { SelectCustomer, CustomerContact, SelectUser, SelectDealer, SelectProduct },
     data() {
       return {
+        flag: true,
         step: 1,
         height: '',
         paddingTop: '',
@@ -693,9 +694,11 @@
         }
       },
       handleAdd() {
+        if (!this.flag) return
         this.$refs.addForm
           .validate()
           .then(async () => {
+            this.flag = false
             let params = this.addForm
             params.nboBudget = Number(params.nboBudget)
             params.saleName = this.nickName
@@ -710,6 +713,7 @@
             }))
             params.products = products
             const [err, res] = await to(projectApi.create(params))
+            this.flag = true
             if (err) return
             if (res && res.code == 200) {
               this.$refs.uToast.show({

+ 5 - 0
pages/project/downgrade.vue

@@ -102,6 +102,7 @@
     <u-notify ref="uNotify"></u-notify>
     <u-toast ref="uToast"></u-toast>
     <u-modal
+      :asyncClose="true"
       :show="showModal"
       content="确认进行项目降级?"
       :showCancelButton="true"
@@ -116,6 +117,7 @@
     name: 'omsIndex',
     data() {
       return {
+        flag: true,
         height: '',
         paddingTop: '',
         showSupportDate: false, //技术支持时间
@@ -199,8 +201,11 @@
           })
       },
       async handleDownApi() {
+        if (!this.flag) return
         let params = this.addForm
+        this.flag = false
         const [err, res] = await to(projectApi.downgrade(params))
+        this.flag = true
         this.showModal = false
         if (err) return
         if (res && res.code == 200) {

+ 6 - 2
pages/project/transfer.vue

@@ -47,7 +47,7 @@
             maxlength="300"></u-textarea>
         </u-form-item>
       </u-form>
-      <view class="save" @click="handleAdd">保存</view>
+      <view class="save" @click="handleAdd" :class="!flag ? 'disabledBtn' : ''">保存</view>
     </view>
     <u-notify ref="uNotify"></u-notify>
     <u-toast ref="uToast"></u-toast>
@@ -63,6 +63,7 @@
     components: { SelectUser },
     data() {
       return {
+        flag: true,
         height: '',
         paddingTop: '',
         transferObj: {
@@ -98,11 +99,14 @@
     onShow() {},
     methods: {
       handleAdd() {
+        if (!this.flag) return
         this.$refs.addForm
           .validate()
           .then(async () => {
             let params = this.transferObj
+            this.flag = false
             const [err, res] = await to(projectApi.transfer(params))
+            this.flag = true
             if (err) return
             if (res && res.code == 200) {
               this.$refs.uToast.show({
@@ -189,7 +193,7 @@
         .label-tag {
           width: 15rpx;
           height: 15rpx;
-          background:  #ff4d4f;
+          background: #ff4d4f;
           border-radius: 50%;
           margin-right: 10rpx;
         }

+ 7 - 1
pages/project/upgrade.vue

@@ -2,7 +2,7 @@
  * @Author: liuzhenlin 461480418@qq.ocm
  * @Date: 2023-01-12 11:57:48
  * @LastEditors: liuzhenlin
- * @LastEditTime: 2023-05-08 10:24:04
+ * @LastEditTime: 2023-06-07 11:07:33
  * @Description: file content
  * @FilePath: \oms\pages\project\upgrade.vue
 -->
@@ -368,6 +368,7 @@
     <u-notify ref="uNotify"></u-notify>
     <u-toast ref="uToast"></u-toast>
     <u-modal
+      :asyncClose="true"
       :show="showModal"
       content="确认进行项目升级?"
       :showCancelButton="true"
@@ -391,6 +392,7 @@
     components: { SelectDealer, CustomerContact },
     data() {
       return {
+        flag: true,
         height: '',
         paddingTop: '',
         showSupportDate: false, //技术支持时间
@@ -665,6 +667,7 @@
             })
           },
           complete: (ret) => {
+            this.flag = true
             this.showModal = false
           },
         })
@@ -685,12 +688,15 @@
           })
       },
       async handleUpgradeApi() {
+        if (!this.flag) return
         let params = this.addForm
         params.nboBudget = Number(params.nboBudget)
+        this.flag = false
         if (this.addForm.nboType === '10' || this.addForm.nboType === '20') {
           this.upgradeAorB(params)
         } else {
           const [err, res] = await to(projectApi.upgrade(params))
+          this.flag = true
           this.showModal = false
           if (err) return
           if (res && res.code == 200) {

+ 5 - 1
pages/publicPages/concatCreate.vue

@@ -83,7 +83,7 @@
         </u-form-item>
       </u-form>
       <view class="center">
-        <view class="handle-btn" @click="handleAdd">保存</view>
+        <view class="handle-btn" @click="handleAdd" :class="!flag ? 'disabledBtn' : ''">保存</view>
       </view>
     </view>
     <u-notify ref="uNotify"></u-notify>
@@ -97,6 +97,7 @@
     name: 'omsIndex',
     data() {
       return {
+        flag:true,
         height: '',
         paddingTop: '',
         addForm: {
@@ -148,11 +149,14 @@
     mounted() {},
     methods: {
       handleAdd() {
+        if(!this.flag) return 
         this.$refs.addForm
           .validate()
           .then(async () => {
             let params = this.addForm
+            this.flag = false
             const [err, res] = await to(customerApi.createContact(params))
+            this.flag = true
             if (err) return
             if (res && res.code == 200) {
               this.$refs.uToast.show({

+ 28 - 3
pages/publicPages/follow.vue

@@ -23,11 +23,24 @@
         <u-form-item prop="content" customStyle="padding:40rpx 0 34rpx">
           <view class="form-label flex_l">
             <view class="label-tag"></view>
-            跟进内容
+            本次跟进进展
           </view>
           <u-textarea
             v-model="addForm.content"
-            placeholder="请输入跟进内容"
+            placeholder="请输入本次跟进进展"
+            maxlength="800"
+            height="190rpx"
+            count
+            customStyle="border-radius:16rpx"></u-textarea>
+        </u-form-item>
+        <u-form-item prop="furtherPlan" customStyle="padding:40rpx 0 34rpx">
+          <view class="form-label flex_l">
+            <view class="label-tag"></view>
+            下一步跟进计划和目标
+          </view>
+          <u-textarea
+            v-model="addForm.furtherPlan"
+            placeholder="请输入下一步跟进计划和目标"
             maxlength="800"
             height="190rpx"
             count
@@ -87,7 +100,7 @@
           </view>
         </uni-file-picker>
       </view>
-      <view class="save" @click="handleAdd">保存</view>
+      <view class="save" @click="handleAdd" :class="!flag ? 'disabledBtn' : ''">保存</view>
       <!-- 选择跟进方式 -->
       <u-picker
         :show="showMode"
@@ -135,6 +148,7 @@
     },
     data() {
       return {
+        flag: true,
         imageValue: [],
         height: '',
         paddingTop: '',
@@ -161,6 +175,7 @@
           files: [],
           date: this.parseTime(new Date(), '{y}-{m}-{d}'), //时间
           content: '', //客户姓名
+          furtherPlan: '', //下一步跟进计划
           mode: '', //跟进方式
           modeId: 0,
           fileName: '', //附件
@@ -169,6 +184,12 @@
         },
         targetType: 0, //跟进对象类型(10客户,20项目,30合同,40回款,50经销商,50代理商)
         rules: {
+          furtherPlan: {
+            type: 'string',
+            required: true,
+            message: '请填写下一步跟进计划和目标',
+            trigger: ['blur'],
+          },
           content: {
             type: 'string',
             required: true,
@@ -291,6 +312,7 @@
         }
       },
       handleAdd() {
+        if (!this.flag) return
         this.$refs.addForm
           .validate()
           .then(async () => {
@@ -328,11 +350,14 @@
                 followDate: this.addForm.date,
                 followType: this.addForm.modeId,
                 targetType: this.targetType,
+                furtherPlan: this.addForm.furtherPlan,
                 files: this.addForm.files,
               },
               idParams
             )
+            this.flag = false
             const [err, res] = await to(followApi.createFollow(params))
+            this.flag = true
             if (err) return
             if (res && res.code == 200) {
               this.$refs.uToast.show({

+ 4 - 0
style/common.scss

@@ -230,4 +230,8 @@ view {
     border-radius: 50%;
     margin-right: 10rpx;
   }
+}
+
+.disabledBtn {
+  background: #ccc !important;
 }