|
|
@ -132,6 +132,27 @@ |
|
|
|
<repairbillAdd v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="getList"/> |
|
|
|
<!-- 详情 --> |
|
|
|
<repairbillInfo v-show="viewState == 4" ref="divInfo" @doback="resetState" /> |
|
|
|
<!-- 结算 --> |
|
|
|
<settleAccountsAdd v-show="viewState == 3" ref="divSettle" @doback="resetState" /> |
|
|
|
<!-- 打印结算单(保内) --> |
|
|
|
<el-dialog title="打印类型" :visible.sync="dialogVisible" width="25%" :show-close="false"> |
|
|
|
<el-form :model="temp" class="formaddcopy02"> |
|
|
|
<el-row style="border-top: 1px solid #E0E3EB"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item> |
|
|
|
<el-radio-group v-model="temp.type"> |
|
|
|
<el-radio label="0">财务打印</el-radio> |
|
|
|
<el-radio label="1">客户打印</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<div style="text-align:center;margin-top: 20px;"> |
|
|
|
<el-button type="primary" size="mini" @click="handleConfirm">确 定</el-button> |
|
|
|
<el-button type="info " size="mini" @click="dialogVisible = false">取 消</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
@ -140,10 +161,11 @@ import Pagination from '@/components/pagination' |
|
|
|
import pageye from '@/components/pagination/pageye' |
|
|
|
import ButtonBar from '@/components/ButtonBar' |
|
|
|
import req from '@/api/operation/repairbill' |
|
|
|
import arrearsleavefactory from '@/api/operation/arrearsleavefactory' |
|
|
|
import { typeValues } from '@/api/Common/dictcommons' |
|
|
|
import { typeValues, getOrgSidByPath } from '@/api/Common/dictcommons' |
|
|
|
import { getStorage } from '@/utils/auth' |
|
|
|
import repairbillAdd from './repairbillAdd' |
|
|
|
import repairbillInfo from './repairbillInfo' |
|
|
|
import settleAccountsAdd from '@/views/operation/settleAccounts/settleAccountsAdd' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'RepairBillBySettleAccounts', |
|
|
@ -152,11 +174,25 @@ export default { |
|
|
|
pageye, |
|
|
|
ButtonBar, |
|
|
|
repairbillAdd, |
|
|
|
repairbillInfo |
|
|
|
repairbillInfo, |
|
|
|
settleAccountsAdd |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
btndisabled: false, |
|
|
|
dialogVisible: false, // 打印结算单 |
|
|
|
temp: { |
|
|
|
sid: '', |
|
|
|
type: '', |
|
|
|
createOrgSid: '', |
|
|
|
useOrgSid: '', |
|
|
|
userSid: '' |
|
|
|
}, |
|
|
|
updateAction: process.env.VUE_APP_BASE_API + '/portal/file/upload', |
|
|
|
fileList: [], |
|
|
|
headers: { |
|
|
|
token: window.sessionStorage.getItem('token') |
|
|
|
}, |
|
|
|
btnList: [ |
|
|
|
{ |
|
|
|
type: 'primary', |
|
|
@ -165,6 +201,13 @@ export default { |
|
|
|
btnKey: 'toEdit', |
|
|
|
btnLabel: '编辑' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'primary', |
|
|
|
size: 'small', |
|
|
|
icon: 'toSettle', |
|
|
|
btnKey: 'toEdit', |
|
|
|
btnLabel: '结算' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'info', |
|
|
|
size: 'small', |
|
|
@ -179,6 +222,7 @@ export default { |
|
|
|
tableKey: 0, |
|
|
|
list: [], |
|
|
|
sids: [], // 用于导出的时候保存已选择的SIDs |
|
|
|
multipleSelection: [], |
|
|
|
billType_list: [], |
|
|
|
state_list: [ |
|
|
|
{ |
|
|
@ -258,6 +302,9 @@ export default { |
|
|
|
case 'toEdit': |
|
|
|
this.toEdit() |
|
|
|
break |
|
|
|
case 'toSettle': |
|
|
|
this.toSettle() |
|
|
|
break |
|
|
|
case 'doClose': |
|
|
|
this.doClose() |
|
|
|
break |
|
|
@ -267,6 +314,7 @@ export default { |
|
|
|
}, |
|
|
|
// 信息条数 获取点击时当前的sid |
|
|
|
handleSelectionChange(row) { |
|
|
|
this.multipleSelection = row |
|
|
|
const aa = [] |
|
|
|
row.forEach(element => { |
|
|
|
aa.push(element.sid) |
|
|
@ -346,6 +394,75 @@ export default { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行操作' }) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 打印结算单 |
|
|
|
toPrintSettle() { |
|
|
|
if (this.sids.length === 1) { |
|
|
|
if (this.multipleSelection[0].subject === '保内') { |
|
|
|
this.dialogVisible = true |
|
|
|
} else { |
|
|
|
this.printSettle() |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行操作' }) |
|
|
|
} |
|
|
|
}, |
|
|
|
printSettle() { |
|
|
|
getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.temp.createOrgSid = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
this.temp.sid = this.sids[0] |
|
|
|
this.temp.useOrgSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1) |
|
|
|
this.temp.userSid = window.sessionStorage.getItem('userSid') |
|
|
|
req.printSettlement(this.temp).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
var xhr = new XMLHttpRequest() |
|
|
|
xhr.open('GET', process.env.VUE_APP_BASE_API + '/base/file/download?filePath=' + res.data + '&outFileName=' + '结算单', true) |
|
|
|
xhr.setRequestHeader('token', getStorage()) |
|
|
|
xhr.responseType = 'blob' |
|
|
|
xhr.onload = function(e) { |
|
|
|
// 如果请求执行成功 |
|
|
|
var blob = this.response |
|
|
|
var filename = '结算单.pdf' |
|
|
|
var a = document.createElement('a') |
|
|
|
// blob.type="application/octet-stream"; |
|
|
|
// 创键临时url对象 |
|
|
|
var url = URL.createObjectURL(blob) |
|
|
|
a.href = url |
|
|
|
a.download = filename |
|
|
|
a.click() |
|
|
|
// 释放之前创建的URL对象 |
|
|
|
window.URL.revokeObjectURL(url) |
|
|
|
} |
|
|
|
// 发送请求 |
|
|
|
xhr.send() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleConfirm() { |
|
|
|
if (this.temp.type !== '') { |
|
|
|
this.dialogVisible = false |
|
|
|
this.printSettle() |
|
|
|
} else { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '打印类型不能为空' }) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 结算 |
|
|
|
toSettle() { |
|
|
|
if (this.sids.length === 1) { |
|
|
|
req.settle(this.sids[0]).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.viewState = 3 |
|
|
|
this.$refs['divSettle'].showAdd({ sid: this.sids[0] }) |
|
|
|
} else { |
|
|
|
this.$message({ showClose: true, type: 'error', message: res.msg }) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行操作' }) |
|
|
|
} |
|
|
|
}, |
|
|
|
toInfo(row) { |
|
|
|
this.viewState = 4 |
|
|
|
this.$refs['divInfo'].showInfo(row) |
|
|
|