Commit f65a8f7a authored by 朱彩云's avatar 朱彩云

Merge branch 'func_eccs_2801' into 'master'

ECCs-2801:账单列表增加是否已回款查询条件

See merge request !88
parents a476fbc4 c54ee8e6
This diff is collapsed.
import Vue from "vue"; import Vue from 'vue'
import { import {
Row, Row,
Col, Col,
...@@ -12,6 +12,7 @@ import { ...@@ -12,6 +12,7 @@ import {
DatePicker, DatePicker,
Input, Input,
InputNumber, InputNumber,
Checkbox,
Radio, Radio,
upload, upload,
Button, Button,
...@@ -25,7 +26,7 @@ import { ...@@ -25,7 +26,7 @@ import {
Tooltip, Tooltip,
Popover, Popover,
Empty Empty
} from "ant-design-vue"; } from 'ant-design-vue'
export default () => { export default () => {
let els = [ let els = [
...@@ -41,6 +42,7 @@ export default () => { ...@@ -41,6 +42,7 @@ export default () => {
DatePicker, DatePicker,
Input, Input,
InputNumber, InputNumber,
Checkbox,
Radio, Radio,
upload, upload,
Button, Button,
...@@ -54,13 +56,13 @@ export default () => { ...@@ -54,13 +56,13 @@ export default () => {
Tooltip, Tooltip,
Popover, Popover,
Empty Empty
]; ]
// 注册 // 注册
els.forEach((item) => { els.forEach((item) => {
Vue.use(item); Vue.use(item)
}); })
// 全局提示 // 全局提示
Vue.prototype.$msg = notification; Vue.prototype.$msg = notification
Vue.prototype.$message = message; Vue.prototype.$message = message
Vue.prototype.$modal = Modal; Vue.prototype.$modal = Modal
}; }
...@@ -4,62 +4,67 @@ ...@@ -4,62 +4,67 @@
export function arrToObj(arr) { export function arrToObj(arr) {
// 参数必须是一个数组 // 参数必须是一个数组
if (!Array.isArray(arr)) { if (!Array.isArray(arr)) {
throw new Error("type err: arr 必须是一个数组"); throw new Error('type err: arr 必须是一个数组')
} }
// 存放返回结果 // 存放返回结果
const obj = {}; const obj = {}
arr.map((item) => { arr.map((item) => {
obj[Object.keys(item)[0]] = item[Object.keys(item)[0]]; obj[Object.keys(item)[0]] = item[Object.keys(item)[0]]
}); })
return obj; return obj
} }
/* /*
* 文件流转换为url * 文件流转换为url
* @params file 文件流 * @params file 文件流
* @return url * @return url
*/ */
export function getObjectURL(file) { export function getObjectURL(file) {
console.log(file) console.log(file)
let url = null; let url = null
if (window.createObjectURL != undefined) { // basic if (window.createObjectURL != undefined) {
url = window.createObjectURL(file); // basic
} else if (window.webkitURL != undefined) { // webkit or chrome url = window.createObjectURL(file)
url = window.webkitURL.createObjectURL(file); } else if (window.webkitURL != undefined) {
} else if (window.URL != undefined) { // mozilla(firefox) // webkit or chrome
url = window.URL.createObjectURL(file); url = window.webkitURL.createObjectURL(file)
} } else if (window.URL != undefined) {
return url; // mozilla(firefox)
url = window.URL.createObjectURL(file)
}
return url
} }
/** /**
* @description 文件下载(兼容IE) * @description 文件下载(兼容IE)
* @param {Object} response options 接口响应的数据 包括文件流及保文信息 * @param {Object} response options 接口响应的数据 包括文件流及保文信息
* @param {String} file_name 文件名称 * @param {String} file_name 文件名称
* @returns {undefined} undefined * @returns {undefined} undefined
*/ */
export function downloadFile(response, file_name = "ExportFile") { export function downloadFile(response, file_name = 'ExportFile') {
const fileType = response.headers["content-type"] || "application/pdf"; const fileType = response.headers['content-type'] || 'application/pdf'
const disposition = response.headers["content-disposition"] const disposition = response.headers['content-disposition']
if (disposition) { if (disposition) {
file_name = disposition.split("filename=")[1] file_name = disposition.split('filename=')[1]
} }
const blob = new Blob([response.data], { type: `${fileType};charset=utf-8` }); const blob = new Blob([response.data], { type: `${fileType};charset=utf-8` })
const ie = navigator.userAgent.match(/MSIE\s([\d.]+)/), const ie = navigator.userAgent.match(/MSIE\s([\d.]+)/),
ie11 = navigator.userAgent.match(/Trident\/7.0/) && navigator.userAgent.match(/rv:11/), ie11 =
navigator.userAgent.match(/Trident\/7.0/) &&
navigator.userAgent.match(/rv:11/),
ieEDGE = navigator.userAgent.match(/Edge/g), ieEDGE = navigator.userAgent.match(/Edge/g),
ieVer = ie ? ie[1] : ie11 ? 11 : ieEDGE ? 12 : -1; ieVer = ie ? ie[1] : ie11 ? 11 : ieEDGE ? 12 : -1
if (ie && ieVer < 10) { if (ie && ieVer < 10) {
this.message.error('No blobs on IE<10'); this.message.error('No blobs on IE<10')
return; return
} }
if (ieVer > -1) { if (ieVer > -1) {
window.navigator.msSaveBlob(blob, file_name); window.navigator.msSaveBlob(blob, file_name)
return {} return {}
} else { } else {
const url = window.URL.createObjectURL(blob); const url = window.URL.createObjectURL(blob)
return { return {
url, url,
file_name file_name
...@@ -70,17 +75,17 @@ export function downloadFile(response, file_name = "ExportFile") { ...@@ -70,17 +75,17 @@ export function downloadFile(response, file_name = "ExportFile") {
//导出excel //导出excel
export function exportFile(res, file_name) { export function exportFile(res, file_name) {
let blob = new Blob([res.data], { let blob = new Blob([res.data], {
type:"application/vnd.ms-excel;charset=utf-8" type: 'application/vnd.ms-excel;charset=utf-8'
}); })
let url=window.URL.createObjectURL(blob); let url = window.URL.createObjectURL(blob)
let aLink=document.createElement("a"); let aLink = document.createElement('a')
aLink.style.display="none"; aLink.style.display = 'none'
aLink.href=url; aLink.href = url
aLink.setAttribute("download", file_name); aLink.setAttribute('download', file_name)
document.body.appendChild(aLink); document.body.appendChild(aLink)
aLink.click(); aLink.click()
document.body.removeChild(aLink); document.body.removeChild(aLink)
window.URL.revokeObjectURL(url); window.URL.revokeObjectURL(url)
} }
export const numValid = /^([1-9][0-9]*|0)([.][0-9]+)?$/ export const numValid = /^([1-9][0-9]*|0)([.][0-9]+)?$/
...@@ -88,13 +93,13 @@ export const numValid = /^([1-9][0-9]*|0)([.][0-9]+)?$/ ...@@ -88,13 +93,13 @@ export const numValid = /^([1-9][0-9]*|0)([.][0-9]+)?$/
// 对象转换成query字符串 // 对象转换成query字符串
export const toQuery = (params) => { export const toQuery = (params) => {
if (!params) { if (!params) {
return ""; return ''
} }
let query = []; let query = []
for (let i in params) { for (let i in params) {
query.push(`${i}=${params[i]}`); query.push(`${i}=${encodeURIComponent(params[i])}`)
} }
return query.join("&"); return query.join('&')
} }
// 数值计算 // 数值计算
export const accuracy = { export const accuracy = {
...@@ -103,104 +108,107 @@ export const accuracy = { ...@@ -103,104 +108,107 @@ export const accuracy = {
var t1 = 0, var t1 = 0,
t2 = 0, t2 = 0,
r1, r1,
r2; r2
try { try {
t1 = arg1.toString().split('.')[1].length; t1 = arg1.toString().split('.')[1].length
} catch(e) { } catch (e) {
console.log(e); console.log(e)
} }
try { try {
t2 = arg2.toString().split('.')[1].length; t2 = arg2.toString().split('.')[1].length
} catch(e) { } catch (e) {
console.log(e); console.log(e)
} }
if(Math) { if (Math) {
r1 = Number(arg1.toString().replace('.', '')); r1 = Number(arg1.toString().replace('.', ''))
r2 = Number(arg2.toString().replace('.', '')); r2 = Number(arg2.toString().replace('.', ''))
return this.multiply(r1 / r2, Math.pow(10, t2 - t1)); return this.multiply(r1 / r2, Math.pow(10, t2 - t1))
} }
}, },
multiply(arg1, arg2) { multiply(arg1, arg2) {
//乘法 //乘法
var m = 0, var m = 0,
s1 = arg1.toString(), s1 = arg1.toString(),
s2 = arg2.toString(); s2 = arg2.toString()
try { try {
m += s1.split('.')[1].length; m += s1.split('.')[1].length
} catch(e) { } catch (e) {
console.log(e) console.log(e)
} }
try { try {
m += s2.split('.')[1].length; m += s2.split('.')[1].length
} catch(e) { } catch (e) {
console.log(e) console.log(e)
} }
return Number(s1.replace('.', '')) * Number(s2.replace('.', '')) / Math.pow(10, m); return (
(Number(s1.replace('.', '')) * Number(s2.replace('.', ''))) /
Math.pow(10, m)
)
}, },
add(arg1, arg2) { add(arg1, arg2) {
//加法 //加法
var r1, r2, m; var r1, r2, m
try { try {
r1 = arg1.toString().split('.')[1].length; r1 = arg1.toString().split('.')[1].length
} catch(e) { } catch (e) {
r1 = 0; r1 = 0
} }
try { try {
r2 = arg2.toString().split('.')[1].length; r2 = arg2.toString().split('.')[1].length
} catch(e) { } catch (e) {
r2 = 0; r2 = 0
} }
m = Math.pow(10, Math.max(r1, r2)); m = Math.pow(10, Math.max(r1, r2))
console.log(this.multiply(arg1, m), this.multiply(arg2, m)) console.log(this.multiply(arg1, m), this.multiply(arg2, m))
return(this.multiply(arg1, m) + this.multiply(arg2, m)) / m; return (this.multiply(arg1, m) + this.multiply(arg2, m)) / m
}, },
subtract(arg1, arg2) { subtract(arg1, arg2) {
//减法 //减法
var r1, r2, m, n; var r1, r2, m, n
try { try {
r1 = arg1.toString().split('.')[1].length; r1 = arg1.toString().split('.')[1].length
} catch(e) { } catch (e) {
r1 = 0; r1 = 0
} }
try { try {
r2 = arg2.toString().split('.')[1].length; r2 = arg2.toString().split('.')[1].length
} catch(e) { } catch (e) {
r2 = 0; r2 = 0
} }
m = Math.pow(10, Math.max(r1, r2)); m = Math.pow(10, Math.max(r1, r2))
n = r1 >= r2 ? r1 : r2; n = r1 >= r2 ? r1 : r2
return((arg1 * m - arg2 * m) / m).toFixed(n); return ((arg1 * m - arg2 * m) / m).toFixed(n)
}, },
// 计算一个数组的总和 // 计算一个数组的总和
sum(arr) { sum(arr) {
let result = 0; let result = 0
arr.forEach(item => { arr.forEach((item) => {
result = this.add(result, item); result = this.add(result, item)
}) })
return result; return result
}, },
// 计算一个数组的总和 fn是对每项数据的处理方式 // 计算一个数组的总和 fn是对每项数据的处理方式
sumBy(arr, fn) { sumBy(arr, fn) {
let result = 0; let result = 0
arr.forEach(item => { arr.forEach((item) => {
let val = item; let val = item
if(fn) { if (fn) {
val = fn(item) val = fn(item)
} }
result = this.add(result, val); result = this.add(result, val)
}) })
return result; return result
}, },
toCeil(num, p = 4) { toCeil(num, p = 4) {
num = isNaN(num) ? 0 : num; num = isNaN(num) ? 0 : num
p = isNaN(p) ? 0 : p; p = isNaN(p) ? 0 : p
let precision = Math.pow(10, p); let precision = Math.pow(10, p)
return Math.ceil((num * precision).toFixed(1)) / precision; return Math.ceil((num * precision).toFixed(1)) / precision
}, },
toFloor(num, p = 4) { toFloor(num, p = 4) {
num = isNaN(num) ? 0 : num; num = isNaN(num) ? 0 : num
p = isNaN(p) ? 0 : p; p = isNaN(p) ? 0 : p
let precision = Math.pow(10, p); let precision = Math.pow(10, p)
return Math.floor((num * precision).toFixed(1)) / precision; return Math.floor((num * precision).toFixed(1)) / precision
} }
}; }
\ No newline at end of file
...@@ -222,7 +222,7 @@ ...@@ -222,7 +222,7 @@
:model="searchForm" :model="searchForm"
> >
<a-row> <a-row>
<a-col :lg="4" :sm="12"> <a-col :lg="6" :sm="12">
<a-form-model-item label="账单日期"> <a-form-model-item label="账单日期">
<a-range-picker <a-range-picker
format="YYYY-MM-DD" format="YYYY-MM-DD"
...@@ -232,7 +232,7 @@ ...@@ -232,7 +232,7 @@
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :lg="4" :sm="12"> <a-col :lg="6" :sm="12">
<a-form-model-item label="病历号"> <a-form-model-item label="病历号">
<a-input <a-input
v-model="searchForm.mrnNo" v-model="searchForm.mrnNo"
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :lg="4" :sm="12"> <a-col :lg="6" :sm="12">
<a-form-model-item label="客户名称"> <a-form-model-item label="客户名称">
<a-input <a-input
v-model="searchForm.patientName" v-model="searchForm.patientName"
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :lg="4" :sm="12"> <a-col :lg="6" :sm="12">
<a-form-model-item <a-form-model-item
label="状态" label="状态"
:labelCol="{ span: 7 }" :labelCol="{ span: 7 }"
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :lg="4" :sm="12"> <a-col :lg="6" :sm="12">
<a-form-model-item label="账单编号"> <a-form-model-item label="账单编号">
<a-input <a-input
v-model="searchForm.receiptNo" v-model="searchForm.receiptNo"
...@@ -283,6 +283,15 @@ ...@@ -283,6 +283,15 @@
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :lg="6" :sm="12" v-if="activeKey1 === '1'">
<a-form-model-item label="" class="mar_l40">
<a-checkbox
:checked="searchForm.hasBack == 'Y'"
@change="($event) => changeHasBack($event)"
/>
<span class="lable">是否已回款</span>
</a-form-model-item>
</a-col>
<a-col class="flex-col" :lg="4" :sm="12"> <a-col class="flex-col" :lg="4" :sm="12">
<div> <div>
<a-button type="primary" @click="searchData"> <a-button type="primary" @click="searchData">
...@@ -463,7 +472,8 @@ export default { ...@@ -463,7 +472,8 @@ export default {
searchForm: { searchForm: {
billDate: [], billDate: [],
mrnNo: '', // 病历号 mrnNo: '', // 病历号
patientName: '' // 客户名字 patientName: '', // 客户名字
hasBack: 'N'
}, },
savedStatus: false, //是否已保存 savedStatus: false, //是否已保存
relatedList: [], relatedList: [],
...@@ -592,24 +602,6 @@ export default { ...@@ -592,24 +602,6 @@ export default {
const base = JSON.parse(JSON.stringify(this.columns)) const base = JSON.parse(JSON.stringify(this.columns))
const changeAmount = this.changeAmount const changeAmount = this.changeAmount
const delRecord = this.delRecord const delRecord = this.delRecord
// base[1] = {
// title: '账单状态',
// dataIndex: 'status',
// ellipsis: true,
// width: 100,
// fixed: 'left',
// customRender: (val, row) => {
// return (
// <span
// style={{
// color: row.staus == 2 ? 'red' : ''
// }}
// >
// {row.staus == 1 ? '有效' : row.staus == 2 ? '无效' : ''}
// </span>
// )
// }
// }
base[7] = { base[7] = {
title: '回款金额', title: '回款金额',
dataIndex: 'backAmount', dataIndex: 'backAmount',
...@@ -746,7 +738,8 @@ export default { ...@@ -746,7 +738,8 @@ export default {
this.searchForm = { this.searchForm = {
billDate: [], billDate: [],
mrnNo: '', // 病历号 mrnNo: '', // 病历号
patientName: '' // 客户名字 patientName: '', // 客户名字
hasBack: 'N'
} }
} }
}, },
...@@ -786,6 +779,11 @@ export default { ...@@ -786,6 +779,11 @@ export default {
}, },
methods: { methods: {
moment, moment,
// 切换是否已回款
changeHasBack(e) {
let val = e.target.checked
this.searchForm.hasBack = val ? 'Y' : 'N'
},
// 获取未清余额合计 // 获取未清余额合计
getBackMoneyReportCount(params) { getBackMoneyReportCount(params) {
this.$apis this.$apis
...@@ -1217,6 +1215,14 @@ export default { ...@@ -1217,6 +1215,14 @@ export default {
opacity: 0; opacity: 0;
} }
} }
.lable {
margin-left: 10px;
font-weight: bold;
color: rgba(0, 0, 0, 0.85);
}
.mar_l40 {
margin-left: 60px;
}
.all-list_box { .all-list_box {
height: calc(100vh - 400px); height: calc(100vh - 400px);
overflow-y: auto; overflow-y: auto;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment