Jelajahi Sumber

添加业务 确认修改

lijt 1 tahun lalu
induk
melakukan
a86812fda7
1 mengubah file dengan 23 tambahan dan 14 penghapusan
  1. 23 14
      src/views/modules/cw/invoice/ProgramPageForm.vue

+ 23 - 14
src/views/modules/cw/invoice/ProgramPageForm.vue

@@ -170,11 +170,8 @@
         </el-form>
       </div>
       <span slot="footer" class="dialog-footer">
-      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
-      <el-button size="small" type="primary" v-if="method != 'view'" v-else-if="checkType===1" @click="getProgram()"
-                 icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
-<!--        <el-button size="small" type="primary" v-if="method != 'view'" v-else-if="checkType===2" @click="getProgram2()"
-                   icon="el-icon-circle-check" v-noMoreClick>确定</el-button>-->
+         <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" type="primary" v-if="method != 'view'"  @click="getProgram()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
     </span>
     </el-dialog>
   </div>
@@ -184,7 +181,7 @@
 import ProjectRecordsService from '@/api/cw/projectRecords/ProjectRecordsService'
 
 export default {
-  data() {
+  data () {
     return {
       title: '项目选择',
       method: '',
@@ -231,7 +228,7 @@ export default {
      *      num为空或者true,则允许多选
      *      num为其他任何值,则只可以单选
      */
-    init(isShow, num) {
+    init (isShow, num) {
       if (this.commonJS.isEmpty(isShow)) {
         this.isShow = true
         this.checkType = '1'
@@ -278,6 +275,18 @@ export default {
           }
         }
         rows = this.$refs.projectTable.getCheckboxRecords()
+      } else if (this.checkType === '2') {
+        if (this.commonJS.isEmpty(this.$refs.projectTable1.getCheckboxRecords())) {
+          this.$message.error('请至少选择一条数据')
+          return
+        }
+        if (this.num === false) {
+          if (this.$refs.projectTable1.getCheckboxRecords().length > 1) {
+            this.$message.error('最多选择一条数据')
+            return
+          }
+        }
+        rows = this.$refs.projectTable1.getCheckboxRecords()
       } else {
         if (this.commonJS.isEmpty(this.detail)) {
           this.$message.error('请填写开票详情')
@@ -337,7 +346,7 @@ export default {
       this.close()
       this.$emit('getProgram', rows)
     }, */
-    list() {
+    list () {
       this.loading = true
       this.searchForm.status = '5'
       this.projectRecordsService.list({
@@ -351,7 +360,7 @@ export default {
         this.loading = false
       })
     },
-    list1() {
+    list1 () {
       this.loading = true
       this.searchForm.status = '5'
       this.projectRecordsService.list1({
@@ -366,25 +375,25 @@ export default {
       })
     },
     // 当前页
-    currentChangeHandle({currentPage, pageSize}) {
+    currentChangeHandle ({currentPage, pageSize}) {
       this.tablePage.currentPage = currentPage
       this.tablePage.pageSize = pageSize
       this.list()
     },
-    resetSearch() {
+    resetSearch () {
       this.$refs.searchForm.resetFields()
       this.list()
     },
-    currentChangeHandle1({currentPage, pageSize}) {
+    currentChangeHandle1 ({currentPage, pageSize}) {
       this.tablePage.currentPage = currentPage
       this.tablePage.pageSize = pageSize
       this.list1()
     },
-    resetSearch1() {
+    resetSearch1 () {
       this.$refs.searchForm.resetFields()
       this.list1()
     },
-    close() {
+    close () {
       this.detail = ''
       this.visible = false
     }