zuozhengqing
2023-11-22 72f6f5abb7d6a90c9edfb69db63907ef3e17ef03
src/views/other/payment/collectionPlan/AddCollectionPlan.vue
@@ -106,7 +106,13 @@
                  "
                ></el-input>
                <div v-else-if="item.date">
                  <el-date-picker v-model="scope.row[item.prop]" type="date" size="mini" style="width: 130px">
                  <el-date-picker
                    v-model="scope.row[item.prop]"
                    type="date"
                    value-format="yyyy-MM-dd"
                    size="mini"
                    style="width: 130px"
                  >
                  </el-date-picker>
                </div>
                <div v-else @click="delClick(scope.row)"><i class="el-icon-delete"></i></div>
@@ -142,7 +148,7 @@
        </div>
        <div class="btn-view">
          <el-button type="primary" size="small" @click="saveClick">保存</el-button>
          <el-button size="small" @click="editConfig.visible = false">取消</el-button>
          <el-button size="small" @click="droppedClick">取消</el-button>
        </div>
      </div>
    </el-dialog>
@@ -229,9 +235,12 @@
    // 保存
    saveClick() {
      this.sumTotalAmount()
      console.log(this.amount)
      if (this.editConfig.title === "新建") {
        if (this.principalId === 0) {
          this.$message.error("请选择收款计划负责人")
        } else if (this.amount === 0) {
          this.$message.error("收款金额不能为0")
        } else if (this.amount !== this.planAmount) {
          this.$message.error("收款计划和未计划金额不一致,请重算")
        } else {
@@ -246,6 +255,10 @@
          })
        }
      }
    },
    droppedClick() {
      this.editConfig.visible = false
      this.$parent.getData()
    },
    // 计算计划总额
    sumTotalAmount() {
@@ -432,9 +445,15 @@
    setDate(str, monthNumber) {
      console.log(str.split("-"))
      let dateArr = str.split("-")
      let year = parseInt(dateArr[0])
      let month = parseInt(dateArr[1]) + monthNumber
      // 月份和
      let monthCount = parseInt(dateArr[1]) + monthNumber
      // 年
      let year = monthCount > 12 ? parseInt(dateArr[0]) + 1 : parseInt(dateArr[0])
      // 月
      let month = monthCount > 12 ? monthCount - 12 : monthCount
      // 日
      let day = parseInt(dateArr[2])
      return year + "-" + month + "-" + day
    },
    principalClick(val) {