Browse Source

Merge branch 'develop_yh10' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh11

lilei 2 years ago
parent
commit
94afd1c3ed

+ 148 - 142
src/views/financialManagement/collectionDetailStatic/invoiceModal.vue

@@ -1,22 +1,33 @@
 <template>
-  <a-modal v-model="opened" :title="title" centered :maskClosable="false" :footer="null" @cancel="cancel" width="50%">
+  <a-modal
+    v-model="opened"
+    :title="title"
+    centered
+    :maskClosable="false"
+    :footer="null"
+    @cancel="cancel"
+    width="40%">
     <a-spin :spinning="spinning" tip="Loading...">
-      <a-form-model id="chooseCustom-form" ref="ruleForm" :model="form"
-        :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-        <a-form-model-item label="收款单号:" prop="no"> <span>{{form.no}}</span>
+      <a-form-model
+        id="chooseCustom-form"
+        ref="ruleForm"
+        :model="form"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol">
+        <a-form-model-item label="收款单号:" prop="no"> <span>{{ form.no }}</span>
         </a-form-model-item>
-        <a-form-model-item label="付款方:" prop="payerName"> <span>{{form.payerName}}</span>
+        <a-form-model-item label="付款方:" prop="payerName"> <span>{{ form.payerName }}</span>
         </a-form-model-item>
         <a-form-model-item label="开票日期:" prop="invoiceDate">
-         <a-date-picker
-           show-time
-           id="noticeEdit-releaseDate"
-           format="YYYY-MM-DD HH:mm:ss"
-           placeholder="请选择开票时间"
-           :disabled-date="disabledDate"
-           :disabledTime="disabledDateTime"
-           v-model="form.invoiceDate"/>
-           <div style="color:#999">如果没有开票,则不填写即可</div>
+          <a-date-picker
+            show-time
+            id="noticeEdit-releaseDate"
+            format="YYYY-MM-DD HH:mm:ss"
+            placeholder="请选择开票时间"
+            :disabled-date="disabledDate"
+            :disabledTime="disabledDateTime"
+            v-model="form.invoiceDate"/>
+          <div style="color:#999">如果没有开票,则不填写即可</div>
         </a-form-model-item>
         <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;margin-top: 50px;">
           <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
@@ -29,146 +40,141 @@
 </template>
 
 <script>
-  import moment from 'moment'
-  import {
-    updateDetailInvoiceDate
-  } from '@/api/financeBook.js'
-  export default {
-    name: 'InvoiceModal',
-    props: {
-      show: [Boolean],
-      info: {
-        type: Object,
-        default: () => {
-          return null
+import moment from 'moment'
+import {
+  updateDetailInvoiceDate
+} from '@/api/financeBook.js'
+export default {
+  name: 'InvoiceModal',
+  props: {
+    show: [Boolean],
+    info: {
+      type: Object,
+      default: () => {
+        return null
+      }
+    }
+  },
+  data () {
+    return {
+      opened: this.show,
+      spinning: false,
+      title: '开票日期',
+
+      confirmLoading: false,
+      formItemLayout: {
+        labelCol: {
+          span: 6
+        },
+        wrapperCol: {
+          span: 18
         }
+      },
+      form: {
+        no: undefined,
+        payerName: undefined,
+        invoiceDate: undefined,
+        bookDetailSn: ''
       }
+    }
+  },
+  methods: {
+    disabledDate (current) {
+      return current && current < moment().startOf('day')
     },
-    data() {
+    disabledDateTime (date) {
+      if (!date) {
+        date = moment()
+      }
       return {
-        opened: this.show,
-        spinning: false,
-        title: '开票日期',
-
-        confirmLoading: false,
-        formItemLayout: {
-          labelCol: {
-            span: 6
-          },
-          wrapperCol: {
-            span: 18
-          }
-        },
-        form: {
-          no: undefined,
-          payerName: undefined,
-          invoiceDate:undefined,
-          bookDetailSn:''
+        disabledHours: () => this.getDisabledHours(date.format('YYYY-MM-DD HH:mm:ss')),
+        disabledMinutes: () => this.getDisabledMinutes(date.format('YYYY-MM-DD HH:mm:ss')),
+        disabledSeconds: () => this.getDisabledSeconds(date.format('YYYY-MM-DD HH:mm:ss'))
+      }
+    },
+    // 禁用时间范围  时
+    getDisabledHours (nowTime) {
+      const todayDate = moment().format('YYYY-MM-DD HH:mm:ss')
+      const time = nowTime.split(' ')
+      const times = todayDate.split(' ')
+      const timeArrs = times[1].split(':')
+      const hours = []
+      if (todayDate.split(' ')[0] == time[0]) {
+        for (var i = 0; i < parseInt(timeArrs[0]); i++) {
+          hours.push(i)
         }
       }
+      return hours
     },
-    methods: {
-     disabledDate (current) {
-       return current && current < moment().startOf('day')
-     },
-     disabledDateTime (date) {
-       if (!date) {
-         date = moment()
-       }
-       return {
-         disabledHours: () => this.getDisabledHours(date.format('YYYY-MM-DD HH:mm:ss')),
-         disabledMinutes: () => this.getDisabledMinutes(date.format('YYYY-MM-DD HH:mm:ss')),
-         disabledSeconds: () => this.getDisabledSeconds(date.format('YYYY-MM-DD HH:mm:ss'))
-       }
-     },
-     // 禁用时间范围  时
-     getDisabledHours (nowTime) {
-       const todayDate = moment().format('YYYY-MM-DD HH:mm:ss')
-       const time = nowTime.split(' ')
-       const times = todayDate.split(' ')
-       const timeArrs = times[1].split(':')
-       const hours = []
-       if (todayDate.split(' ')[0] == time[0]) {
-         for (var i = 0; i < parseInt(timeArrs[0]); i++) {
-           hours.push(i)
-         }
-       }
-       return hours
-     },
-     // 禁用时间范围  分
-     getDisabledMinutes (nowTime) {
-       const todayDate = moment().format('YYYY-MM-DD HH:mm:ss')
-       const time = nowTime.split(' ')
-       const times = todayDate.split(' ')
-       const timeArr = time[1].split(':')
-       const timeArrs = times[1].split(':')
-       const minutes = []
-       if (todayDate.split(' ')[0] == time[0] && timeArrs[0] == timeArr[0]) {
-         for (var i = 0; i < parseInt(timeArrs[1]); i++) {
-           minutes.push(i)
-         }
-       }
-       return minutes
-     },
-     // 禁用时间范围  秒
-     getDisabledSeconds (nowTime) {
-       const todayDate = moment().format('YYYY-MM-DD HH:mm:ss')
-       const time = nowTime.split(' ')
-       const times = todayDate.split(' ')
-       const timeArr = time[1].split(':')
-       const timeArrs = times[1].split(':')
-       const second = []
-       if (todayDate.split(' ')[0] == time[0] && timeArrs[0] == timeArr[0] && timeArrs[1] == timeArr[1]) {
-         for (var i = 0; i <= parseInt(timeArrs[2]); i++) {
-           second.push(i)
-         }
-       }
-       return second
-     },
-      //  保存
-      handleSubmit(e) {
-        e.preventDefault()
-        const _this = this
-        this.$refs.ruleForm.validate(valid => {
-          if (valid) {
-            _this.salesSaveFun()
-          } else {
-            return false
-          }
-        })
-      },
-      salesSaveFun() {
-        const _this = this
-        const ajax_form = {
-          "bookDetailSn" :this.form.bookDetailSn,
-          "invoiceDate": this.form.invoiceDate
+    // 禁用时间范围  分
+    getDisabledMinutes (nowTime) {
+      const todayDate = moment().format('YYYY-MM-DD HH:mm:ss')
+      const time = nowTime.split(' ')
+      const times = todayDate.split(' ')
+      const timeArr = time[1].split(':')
+      const timeArrs = times[1].split(':')
+      const minutes = []
+      if (todayDate.split(' ')[0] == time[0] && timeArrs[0] == timeArr[0]) {
+        for (var i = 0; i < parseInt(timeArrs[1]); i++) {
+          minutes.push(i)
         }
-        _this.spinning = true
-        updateDetailInvoiceDate(ajax_form).then(res => {
-          if (res.status == 200) {
-            _this.$message.success(res.message)
-            _this.cancel()
-            _this.spinning = false
-          } else {
-            _this.spinning = false
-          }
-        })
-      },
-      cancel() {
-        this.opened = false
-        this.$emit('cancel')
-        this.$refs.ruleForm.resetFields()
       }
+      return minutes
     },
-    watch: {
-      show(newValue, oldValue) {
-        this.opened = newValue
-        if (!newValue) {
-          this.cancel();
-        }else{
-          this.form = this.info
+    // 禁用时间范围  秒
+    getDisabledSeconds (nowTime) {
+      const todayDate = moment().format('YYYY-MM-DD HH:mm:ss')
+      const time = nowTime.split(' ')
+      const times = todayDate.split(' ')
+      const timeArr = time[1].split(':')
+      const timeArrs = times[1].split(':')
+      const second = []
+      if (todayDate.split(' ')[0] == time[0] && timeArrs[0] == timeArr[0] && timeArrs[1] == timeArr[1]) {
+        for (var i = 0; i <= parseInt(timeArrs[2]); i++) {
+          second.push(i)
         }
       }
+      return second
+    },
+    //  保存
+    handleSubmit (e) {
+      const _this = this
+      const invoiceDate = moment(this.form.invoiceDate).format('YYYY-MM-DD')
+      const ajax_form = {
+        'bookDetailSn': this.form.bookDetailSn,
+        'invoiceDate': invoiceDate
+      }
+      _this.spinning = true
+      updateDetailInvoiceDate(ajax_form).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.cancel()
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    cancel () {
+      this.opened = false
+      this.$emit('cancel')
+      this.$refs.ruleForm.resetFields()
+    }
+  },
+  watch: {
+    show (newValue, oldValue) {
+      this.opened = newValue
+      if (!newValue) {
+        this.cancel()
+      } else {
+        this.form = this.info
+      }
     }
   }
+}
 </script>
+<style lang="less" scoped>
+ .ant-form-item{
+   margin-bottom:0 !important;
+ }
+</style>

+ 68 - 61
src/views/financialManagement/collectionDetailStatic/list.vue

@@ -73,19 +73,19 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="开票状态">
                   <a-select v-model="queryParam.invoiceDateType" style="width: 100%" placeholder="请选择开票状态">
-                        <a-select-option value="1">
-                          已开票
-                        </a-select-option>
-                        <a-select-option value="0">
-                         未开票
-                        </a-select-option>
-                      </a-select>
+                    <a-select-option value="1">
+                      已开票
+                    </a-select-option>
+                    <a-select-option value="0">
+                      未开票
+                    </a-select-option>
+                  </a-select>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-               <a-form-item label="收款日期">
-                 <rangeDate ref="receiptDate" :value="receiptDate" @change="receiptDateChange" />
-               </a-form-item>
+                <a-form-item label="收款日期">
+                  <rangeDate ref="receiptDate" :value="receiptDate" @change="receiptDateChange" />
+                </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="所属区域">
@@ -141,31 +141,30 @@
         bordered>
         <!-- 开票日期 -->
         <template slot="draftDate" slot-scope="text, record">
-          <div  @click="handleInvoice(record)">
-            <span v-if="record.invoiceBeginDate" class="link-bule">{{ record.invoiceBeginDate }}~{{record.invoiceEndDate}}</span>
+          <div @click="handleInvoice(record)">
+            <span v-if="record.invoiceDate" class="link-bule">{{ record.invoiceDate }}</span>
             <span class="link-bule" v-else>--</span>
           </div>
         </template>
         <!-- 收款打印状态 -->
         <template slot="printStatus" slot-scope="text, record">
-          <span v-if="record.printStatus!='NO_PRINT'&&record.printStatus!='PRINT'">{{record.printStatusDictValue}}</span>
-          <span @click="handlePrint(record)" class="link-bule" v-else>{{record.printStatusDictValue}}</span>
+          <span v-if="record.printStatus=='NO_PRINT' || record.printStatus=='PRINT'">{{ record.printStatusDictValue }}</span>
+          <span @click="handlePrint(record)" class="link-bule" v-else>{{ record.printStatusDictValue }}</span>
         </template>
         <!-- 备注 -->
         <template slot="note" slot-scope="text, record">
-          <div  @click="handleNote(record)">
-            <span v-if="record.explainInfo" class="link-bule">备注可修改</span>
-            <span class="link-bule" v-else>--</span>
+          <div @click="handleNote(record)">
+            <span class="link-bule">{{ record.remarks || '--' }}</span>
           </div>
         </template>
       </s-table>
     </a-spin>
     <!-- 开票日期弹窗 -->
-     <invoiceModal v-drag :show="invoiceIsShow" :info="invoiceInfo" @cancel="invoiceIsShow=false"></invoiceModal>
-     <!-- 备注弹窗 -->
-     <noteModal v-drag :show="noteIsShow" :info="noteInfo" @cancel="noteIsShow=false"></noteModal>
-     <!-- 收款打印状态 -->
-     <printModal v-drag :show="printIsShow" :info="printInfo" @cancel="printIsShow=false"></printModal>
+    <invoiceModal v-drag :show="invoiceIsShow" :info="invoiceInfo" @cancel="cancel"></invoiceModal>
+    <!-- 备注弹窗 -->
+    <noteModal ref="remarksModal" v-drag :show="noteIsShow" @cancel="cancel"></noteModal>
+    <!-- 收款打印状态 -->
+    <printModal v-drag :show="printIsShow" :info="printInfo" @cancel="cancel"></printModal>
   </a-card>
 </template>
 
@@ -186,7 +185,7 @@ import { financeBookDetailQueryPage, financeBookDetailExport, financeBookReportD
 export default {
   name: 'CollectionDetailStaticList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, employee, dealerSubareaScopeList, subarea, Area,invoiceModal,noteModal,printModal },
+  components: { STable, VSelect, rangeDate, employee, dealerSubareaScopeList, subarea, Area, invoiceModal, noteModal, printModal },
   data () {
     return {
       spinning: false,
@@ -207,11 +206,11 @@ export default {
         bankName: undefined,
         subareaSn: undefined,
         provinceSn: undefined,
-        invoiceDateType:undefined
+        invoiceDateType: undefined
       },
-      invoiceIsShow:false,
-      noteIsShow:false,
-      printIsShow:false,
+      invoiceIsShow: false,
+      noteIsShow: false,
+      printIsShow: false,
       disabled: false, //  查询、重置按钮是否可操作
       receiptDate: [], //  收款时间
       auditDate: [
@@ -261,9 +260,8 @@ export default {
         }
       ],
       bankNameList: [],
-      invoiceInfo:null,
-      noteInfo:null,
-      printInfo:null
+      invoiceInfo: null,
+      printInfo: null
     }
   },
   // 根据权限显示列表字段
@@ -288,16 +286,23 @@ export default {
         { title: '跨月打款', dataIndex: 'nextMonthAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
         { title: '户名', dataIndex: 'bankAccount', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
         { title: '汇入银行', dataIndex: 'bankName', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
-        { title: '足额打款', dataIndex: 'fullPaymentFlagDictValue', align: 'center', width: '5%',customRender: function (text) { return (text == 0 || text) ? text : '--' }},
+        { title: '足额打款', dataIndex: 'fullPaymentFlagDictValue', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
         { title: '说明', dataIndex: 'explainInfo', align: 'center', width: '8%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '开票日期', scopedSlots: { customRender: 'draftDate' },align: 'center', width: '8%'},
-        { title: '收款打印状态', scopedSlots: { customRender: 'printStatus' },align: 'center', width: '8%'},
-        { title: '备注', scopedSlots: { customRender: 'note' },align: 'center', width: '8%'},
+        { title: '开票日期', scopedSlots: { customRender: 'draftDate' }, align: 'center', width: '8%' },
+        { title: '收款打印状态', scopedSlots: { customRender: 'printStatus' }, align: 'center', width: '8%' },
+        { title: '备注', scopedSlots: { customRender: 'note' }, align: 'center', width: '8%' }
       ]
       return arr
     }
   },
   methods: {
+    // 关闭弹窗刷新表格
+    cancel () {
+      this.invoiceIsShow = false
+      this.noteIsShow = false
+      this.printIsShow = false
+      this.$refs.table.refresh(true)
+    },
     getCount (params) {
       financeBookReportDetailCount(params).then(res => {
         this.countData = res.data
@@ -371,41 +376,43 @@ export default {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 205
     },
-    handleInvoice(con){
-      let obj={
-        no:con.bookNo,
-        payerName:con.dealerName,
-        bookDetailSn:con.bookDetailSn
+    handleInvoice (con) {
+      const obj = {
+        no: con.bookNo,
+        payerName: con.payerName,
+        bookDetailSn: con.bookDetailSn
       }
-      this.invoiceInfo=obj;
-      this.$nextTick(()=>{
-         this.invoiceIsShow = true
+      this.invoiceInfo = obj
+      this.$nextTick(() => {
+        this.invoiceIsShow = true
       })
     },
-    handleNote(info){
-      let obj={
-        no:info.bookNo,
-        payerName:info.dealerName,
-        id:info.id,
-        remarks:info.remarks
+    // 修改备注
+    handleNote (info) {
+      const obj = {
+        no: info.bookNo,
+        payerName: info.payerName,
+        id: info.id,
+        remarks: info.remarks ? info.remarks : ''
       }
-      this.noteInfo=obj;
-      this.$nextTick(()=>{
-         this.noteIsShow = true
+      this.noteIsShow = true
+      const _this = this
+      _this.$nextTick(() => {
+        _this.$refs.remarksModal.setData(JSON.stringify(obj))
       })
     },
-    handlePrint(item){
-      let obj={
-        no:item.bookNo,
-        payerName:item.dealerName,
-        id:item.id,
-        printStatus:item.printStatus  
+    handlePrint (item) {
+      const obj = {
+        no: item.bookNo,
+        payerName: item.payerName,
+        id: item.id,
+        printStatus: item.printStatus
       }
-      this.printInfo=obj;
-      this.$nextTick(()=>{
-         this.printIsShow = true
+      this.printInfo = obj
+      this.$nextTick(() => {
+        this.printIsShow = true
       })
-    },
+    }
   },
   watch: {
     advanced (newValue, oldValue) {

+ 88 - 77
src/views/financialManagement/collectionDetailStatic/noteModal.vue

@@ -1,19 +1,30 @@
 <template>
-  <a-modal v-model="opened" :title="title" centered :maskClosable="false" :footer="null" @cancel="cancel" width="50%">
+  <a-modal
+    v-model="opened"
+    :title="title"
+    centered
+    :maskClosable="false"
+    :footer="null"
+    @cancel="cancel"
+    width="40%">
     <a-spin :spinning="spinning" tip="Loading...">
-      <a-form-model id="chooseCustom-form" ref="ruleForm" :model="form"
-        :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-        <a-form-model-item label="收款单号:" prop="no"> <span>{{form.no}}</span>
+      <a-form-model
+        id="chooseCustom-form"
+        ref="ruleForm"
+        :model="form"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol">
+        <a-form-model-item label="收款单号:" prop="no"> <span>{{ form.no }}</span>
         </a-form-model-item>
-        <a-form-model-item label="付款方:" prop="payerName"> <span>{{form.payerName}}</span>
+        <a-form-model-item label="付款方:" prop="payerName"> <span>{{ form.payerName }}</span>
         </a-form-model-item>
         <a-form-model-item label="备注:" prop="remarks">
-         <a-textarea
-               v-model="form.remarks"
-               placeholder="请输入备注(最多100字符)"
-               :auto-size="{ minRows: 3, maxRows: 5 }"
-               :maxLength="100"
-             />
+          <a-textarea
+            v-model="form.remarks"
+            placeholder="请输入备注(最多100字符)"
+            :auto-size="{ minRows: 3, maxRows: 5 }"
+            :maxLength="100"
+          />
         </a-form-model-item>
         <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;margin-top: 50px;">
           <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
@@ -26,79 +37,79 @@
 </template>
 
 <script>
-  import {
-    updateFinanceBookDetail
-  } from '@/api/financeBook.js'
-  export default {
-    name: 'NoteModal',
-    props: {
-      show: [Boolean],
-      info: {
-        type: Object,
-        default: () => {
-          return null
-        }
-      }
-    },
-    data() {
-      return {
-        opened: this.show,
-        spinning: false,
-        title: '备注',
+import {
+  updateFinanceBookDetail
+} from '@/api/financeBook.js'
+export default {
+  name: 'NoteModal',
+  props: {
+    show: [Boolean]
+  },
+  data () {
+    return {
+      opened: this.show,
+      spinning: false,
+      title: '备注',
 
-        confirmLoading: false,
-        formItemLayout: {
-          labelCol: {
-            span: 6
-          },
-          wrapperCol: {
-            span: 18
-          }
+      confirmLoading: false,
+      formItemLayout: {
+        labelCol: {
+          span: 6
         },
-        form: {
-          no: undefined,
-          payerName: undefined,
-          remarks:'',
-          id:''
+        wrapperCol: {
+          span: 18
         }
-      }
-    },
-    methods: {
-      //  保存
-      handleSubmit() {
-       const _this = this
-       const ajax_form = {
-         id:this.form.id,
-         remarks:this.form.remarks
-       }
-       _this.spinning = true
-       _this.confirmLoading = true
-       updateFinanceBookDetail(ajax_form).then(res => {
-         if (res.status == 200) {
-           _this.$message.success(res.message)
-           _this.cancel()
-           _this.spinning = false
-         } else {
-           _this.spinning = false
-         }
-         _this.confirmLoading = false
-       })
       },
-      cancel() {
-        this.opened = false
-        this.$emit('cancel')
-        this.$refs.ruleForm.resetFields()
+      form: {
+        no: undefined,
+        payerName: undefined,
+        remarks: '',
+        id: ''
       }
-    },
-    watch: {
-      show(newValue, oldValue) {
-        this.opened = newValue
-        if (!newValue) {
-         this.cancel();
-        }else{
-           this.form = this.info
+    }
+  },
+  methods: {
+    //  保存
+    handleSubmit () {
+      const _this = this
+      const ajax_form = {
+        id: this.form.id,
+        remarks: this.form.remarks
+      }
+      _this.spinning = true
+      _this.confirmLoading = true
+      updateFinanceBookDetail(ajax_form).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.cancel()
+          _this.spinning = false
+        } else {
+          _this.spinning = false
         }
+        _this.confirmLoading = false
+      })
+    },
+    cancel () {
+      this.opened = false
+      this.$emit('cancel')
+      this.$refs.ruleForm.resetFields()
+    },
+    setData (data) {
+      this.form = JSON.parse(data)
+    }
+  },
+  watch: {
+    show (newValue, oldValue) {
+      this.opened = newValue
+      if (!newValue) {
+        this.cancel()
       }
     }
   }
+}
 </script>
+<style lang="less" scoped>
+  .ant-form-item{
+    margin-bottom:0 !important;
+  }
+</style>

+ 96 - 79
src/views/financialManagement/collectionDetailStatic/printModal.vue

@@ -1,21 +1,32 @@
 <template>
-  <a-modal v-model="opened" :title="title" centered :maskClosable="false" :footer="null" @cancel="cancel" width="50%">
+  <a-modal
+    v-model="opened"
+    :title="title"
+    centered
+    :maskClosable="false"
+    :footer="null"
+    @cancel="cancel"
+    width="40%">
     <a-spin :spinning="spinning" tip="Loading...">
-      <a-form-model id="chooseCustom-form" ref="ruleForm" :model="form"
-        :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-        <a-form-model-item label="收款单号:" prop="no"> <span>{{form.no}}{{form.printStatus=='UNABLE_PRINT'?'(暂不打印)':form.printStatus=='CANCEL_PRINT'?'(取消打印)':''}}</span>
+      <a-form-model
+        id="chooseCustom-form"
+        ref="ruleForm"
+        :model="form"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol">
+        <a-form-model-item label="收款单号:" prop="no"> <span>{{ form.no }}{{ form.printStatus=='UNABLE_PRINT'?'(暂不打印)':form.printStatus=='CANCEL_PRINT'?'(取消打印)':'' }}</span>
         </a-form-model-item>
-        <a-form-model-item label="付款方:" prop="payerName"> <span>{{form.payerName}}</span>
+        <a-form-model-item label="付款方:" prop="payerName"> <span>{{ form.payerName }}</span>
         </a-form-model-item>
         <a-form-model-item label="收款打印:" prop="printStatus">
-          <a-radio-group  v-model="form.printStatus">
-              <a-radio value="NO_PRINT">
-                允许打印
-              </a-radio>
-              <a-radio value="CANCEL_PRINT">
-                取消打印
-              </a-radio>
-            </a-radio-group>
+          <a-radio-group v-model="printStatus">
+            <a-radio value="NO_PRINT">
+              允许打印
+            </a-radio>
+            <a-radio value="CANCEL_PRINT" v-if="form.printStatus=='UNABLE_PRINT'">
+              取消打印
+            </a-radio>
+          </a-radio-group>
         </a-form-model-item>
         <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;margin-top: 50px;">
           <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
@@ -28,80 +39,86 @@
 </template>
 
 <script>
-  import {
-    updateFinanceBookDetail
-  } from '@/api/financeBook.js'
-  export default {
-    name: 'PrintModal',
-    props: {
-      show: [Boolean],
-      info: {
-        type: Object,
-        default: () => {
-          return null
-        }
+import {
+  updateFinanceBookDetail
+} from '@/api/financeBook.js'
+export default {
+  name: 'PrintModal',
+  props: {
+    show: [Boolean],
+    info: {
+      type: Object,
+      default: () => {
+        return null
       }
-    },
-    data() {
-      return {
-        opened: this.show,
-        spinning: false,
-        title: '备注',
+    }
+  },
+  data () {
+    return {
+      opened: this.show,
+      spinning: false,
+      title: '备注',
 
-        confirmLoading: false,
-        formItemLayout: {
-          labelCol: {
-            span: 6
-          },
-          wrapperCol: {
-            span: 18
-          }
+      confirmLoading: false,
+      formItemLayout: {
+        labelCol: {
+          span: 6
         },
-        form: {
-          no: undefined,
-          payerName: undefined,
-          printStatus:'',
-          id:'',
-          type:undefined
+        wrapperCol: {
+          span: 18
         }
-      }
-    },
-    methods: {
-      //  保存
-      handleSubmit() {
-       const _this = this
-       const ajax_form = {
-         id:this.form.id,
-         printStatus:this.form.printStatus  
-       }
-       _this.spinning = true
-       _this.confirmLoading = true
-       updateFinanceBookDetail(ajax_form).then(res => {
-         if (res.status == 200) {
-           _this.$message.success(res.message)
-           _this.cancel()
-           _this.spinning = false
-         } else {
-           _this.spinning = false
-         }
-         _this.confirmLoading = false
-       })
       },
-      cancel() {
-        this.opened = false
-        this.$emit('cancel')
-        this.$refs.ruleForm.resetFields()
+      form: {
+        no: undefined,
+        payerName: undefined,
+        printStatus: '',
+        id: '',
+        type: undefined
+      },
+      printStatus: ''
+    }
+  },
+  methods: {
+    //  保存
+    handleSubmit () {
+      const _this = this
+      const ajax_form = {
+        id: this.form.id,
+        printStatus: this.printStatus
       }
-    },
-    watch: {
-      show(newValue, oldValue) {
-        this.opened = newValue
-        if (!newValue) {
-         this.cancel();
-        }else{
-           this.form = this.info
+      _this.spinning = true
+      _this.confirmLoading = true
+      updateFinanceBookDetail(ajax_form).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.cancel()
+          _this.spinning = false
+        } else {
+          _this.spinning = false
         }
+        _this.confirmLoading = false
+      })
+    },
+    cancel () {
+      this.opened = false
+      this.$emit('cancel')
+      this.$refs.ruleForm.resetFields()
+    }
+  },
+  watch: {
+    show (newValue, oldValue) {
+      this.opened = newValue
+      if (!newValue) {
+        this.cancel()
+      } else {
+        this.form = this.info
       }
     }
   }
+}
 </script>
+<style lang="less" scoped>
+  .ant-form-item{
+    margin-bottom:0 !important;
+  }
+</style>