Sfoglia il codice sorgente

发票管理修改

LiFei 3 anni fa
parent
commit
7d1d76637c

+ 4 - 1
src/views/hlwinvoice/HlwInvoiceManageList.vue

@@ -58,6 +58,7 @@
         bordered
         bordered
         rowKey="id"
         rowKey="id"
         :columns="columns"
         :columns="columns"
+        :scroll="{x:true}"
         :dataSource="dataSource"
         :dataSource="dataSource"
         :pagination="ipagination"
         :pagination="ipagination"
         :loading="loading"
         :loading="loading"
@@ -166,7 +167,7 @@
             title: '操作',
             title: '操作',
             dataIndex: 'action',
             dataIndex: 'action',
             align:"center",
             align:"center",
-            // fixed:"right",
+            fixed:"right",
             scopedSlots: { customRender: 'action' }
             scopedSlots: { customRender: 'action' }
           }
           }
         ],
         ],
@@ -187,6 +188,8 @@
       },
       },
       viewInvoice(record){
       viewInvoice(record){
         record.totalPayment=record.amount
         record.totalPayment=record.amount
+        //type=1是编辑
+        record.type=1
         this.$refs.modalFormInvoice.edit(record);
         this.$refs.modalFormInvoice.edit(record);
         this.$refs.modalFormInvoice.title = '查看发票'
         this.$refs.modalFormInvoice.title = '查看发票'
         this.$refs.modalFormInvoice.disableSubmit = false
         this.$refs.modalFormInvoice.disableSubmit = false

+ 46 - 5
src/views/hlwinvoice/modules/HlwInvoiceModal.vue

@@ -7,7 +7,8 @@
     switchFullscreen
     switchFullscreen
     @ok="handleOk"
     @ok="handleOk"
     @cancel="handleCancel"
     @cancel="handleCancel"
-    cancelText="关闭">
+    cancelText="关闭"
+    :footer="null">
     <a-spin :spinning="confirmLoading">
     <a-spin :spinning="confirmLoading">
       <a-form :form="form">
       <a-form :form="form">
 
 
@@ -39,7 +40,12 @@
               :beforeUpload="beforeUpload1"
               :beforeUpload="beforeUpload1"
               @change="handleChange1"
               @change="handleChange1"
             >
             >
-              <div>
+              <div  style="display: flex;flex-direction: row;justify-content: center" v-if="hlwImgList1.length>0"  >
+                <div style="padding-left: 10px"  v-for="(item, index) in hlwImgList1" :key="index">
+                  <img :src="getAvatarView(hlwImgList1[index])" alt="头像" style="height:104px;max-width:300px"/>
+                </div>
+              </div>
+              <div v-else>
                 <a-icon :type="'plus'" />
                 <a-icon :type="'plus'" />
                 <div class="ant-upload-text">上传</div>
                 <div class="ant-upload-text">上传</div>
               </div>
               </div>
@@ -57,7 +63,7 @@
           <a-input v-decorator="['invoiceNumber', validatorRules.invoiceNumber]" placeholder="请输入发票号码"></a-input>
           <a-input v-decorator="['invoiceNumber', validatorRules.invoiceNumber]" placeholder="请输入发票号码"></a-input>
         </a-form-item>
         </a-form-item>
 
 
-        <a-form-item label="发票照片" :labelCol="labelCol" :wrapperCol="wrapperCol" :required="true">
+        <a-form-item  label="发票照片" :labelCol="labelCol" :wrapperCol="wrapperCol" :required="true">
           <a-upload
           <a-upload
             listType="picture-card"
             listType="picture-card"
             class="avatar-uploader"
             class="avatar-uploader"
@@ -68,7 +74,12 @@
             :beforeUpload="beforeUpload"
             :beforeUpload="beforeUpload"
             @change="handleChange"
             @change="handleChange"
           >
           >
-            <div>
+            <div  style="display: flex;flex-direction: row;justify-content: center" v-if="hlwImgList.length>0"  >
+              <div style="padding-left: 10px"  v-for="(item, index) in hlwImgList" :key="index">
+              <img :src="getAvatarView(hlwImgList[index])" alt="头像" style="height:104px;max-width:300px"/>
+              </div>
+            </div>
+            <div v-else>
               <a-icon :type="'plus'" />
               <a-icon :type="'plus'" />
               <div class="ant-upload-text">上传</div>
               <div class="ant-upload-text">上传</div>
             </div>
             </div>
@@ -81,6 +92,10 @@
 
 
       </a-form>
       </a-form>
     </a-spin>
     </a-spin>
+    <div v-if="model.type!=1" class="drawer-bootom-button">
+      <a-button class="ant-btn"  @click="handleCancel">取消</a-button>
+      <a-button class="ant-btn ant-btn-primary" style="margin-left: 8px"  @click="handleOk">确定</a-button>
+    </div>
   </j-modal>
   </j-modal>
 </template>
 </template>
 
 
@@ -102,6 +117,8 @@
     },
     },
     data () {
     data () {
       return {
       return {
+        hlwImgList:[],
+        hlwImgList1:[],
         canClick:true,
         canClick:true,
         headers:{},
         headers:{},
         fileList: [],
         fileList: [],
@@ -162,13 +179,24 @@
       this.canClick=true
       this.canClick=true
         this.fileList=[]
         this.fileList=[]
         this.fileList1=[]
         this.fileList1=[]
+        this.hlwImgList=[]
+        this.hlwImgList1=[]
         this.form.resetFields();
         this.form.resetFields();
         this.model = Object.assign({}, record);
         this.model = Object.assign({}, record);
+        if(this.model.invoice!=null){
+          this.hlwImgList=this.model.invoice.split(',')
+        }
+       if(this.model.serviceInvoice!=null){
+         this.hlwImgList1=this.model.serviceInvoice.split(',')
+       }
         this.visible = true;
         this.visible = true;
         this.$nextTick(() => {
         this.$nextTick(() => {
           this.form.setFieldsValue(pick(this.model,'amount','invoiceNumber','serviceInvoiceNumber','invoice','sysOrgCode','uploadTime','uploadBy'))
           this.form.setFieldsValue(pick(this.model,'amount','invoiceNumber','serviceInvoiceNumber','invoice','sysOrgCode','uploadTime','uploadBy'))
         })
         })
       },
       },
+      getAvatarView(img){
+        return this.url.imgerver + img;
+      },
       close () {
       close () {
         this.$emit('close');
         this.$emit('close');
         this.visible = false;
         this.visible = false;
@@ -364,4 +392,17 @@
       
       
     }
     }
   }
   }
-</script>
+</script>
+<style lang="less" scoped>
+  .drawer-bootom-button {
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>