
16 changed files with 2793 additions and 328 deletions
@ -0,0 +1,259 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div> |
|||
<button-bar view-title="选择采购单" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/> |
|||
<div class="main-content"> |
|||
<div class="searchcon"> |
|||
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button> |
|||
<div v-show="isSearchShow" class="search"> |
|||
<el-form ref="listQueryform" :inline="true" :model="listQuery" class="tab-header" label-width="100px"> |
|||
<el-form-item label="分公司"> |
|||
<el-input v-model="listQuery.params.createOrgName" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="申请部门"> |
|||
<el-input v-model="listQuery.params.deptName" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="申请人"> |
|||
<el-input v-model="listQuery.params.createByName" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="单据编号"> |
|||
<el-input v-model="listQuery.params.billNo" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="申请日期"> |
|||
<el-date-picker v-model="listQuery.params.createStartTime" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker> |
|||
<span style="padding: 0 8px">至</span> |
|||
<el-date-picker v-model="listQuery.params.createEndTime" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="办结日期"> |
|||
<el-date-picker v-model="listQuery.params.finishStartTime" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker> |
|||
<span style="padding: 0 8px">至</span> |
|||
<el-date-picker v-model="listQuery.params.finishEndTime" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="采购类型"> |
|||
<el-select v-model="listQuery.params.purchaseTypeValue" placeholder="请选择" clearable filterable> |
|||
<el-option v-for="item in procurementType_list" :key="item.sid" :label="item.supplierName" :value="item.sid"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="采购原因"> |
|||
<el-select v-model="listQuery.params.purchaseReasonValue" placeholder="请选择" clearable filterable> |
|||
<el-option v-for="item in procurementReason_list" :key="item.sid" :label="item.supplierName" :value="item.sid"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="付款方式"> |
|||
<el-select v-model="listQuery.params.payTypeValue" placeholder="请选择" clearable filterable> |
|||
<el-option v-for="item in paymentMethod_list" :key="item.sid" :label="item.supplierName" :value="item.sid"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="供应商"> |
|||
<el-input v-model="listQuery.params.supplierName" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="是否开票"> |
|||
<el-select v-model="listQuery.params.isInvoicing" placeholder="请选择" clearable filterable> |
|||
<el-option v-for="item in state_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="btn" style="text-align: center"> |
|||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button> |
|||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handresetting">重置</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class=""> |
|||
<el-table :key="tableKey" ref="multipleTable" v-loading="listLoading" :data="list" border style="width: 100%"> |
|||
<el-table-column width="60" fixed label="编号" type="index" :index="indexMethod" align="center"/> |
|||
<el-table-column label="操作" fixed width="80" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="primary" size="small" @click="handleConfirm(scope.row)">确认</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="billNo" label="单据编号" align="center" width="160" /> |
|||
<el-table-column prop="createOrgName" label="分公司" align="center" width="120" /> |
|||
<el-table-column prop="deptName" label="申请部门" align="center" width="120" /> |
|||
<el-table-column prop="createTime" label="申请日期" align="center" width="120" /> |
|||
<el-table-column prop="finishTime" label="办结日期" align="center" width="120" /> |
|||
<el-table-column prop="purchaseTypeValue" label="采购类型" align="center" width="100" /> |
|||
<el-table-column prop="purchaseReasonValue" label="采购原因" align="center" width="100" /> |
|||
<el-table-column prop="payTypeValue" label="付款方式" align="center" width="100" /> |
|||
<el-table-column prop="supplierName" label="供应商" align="center" min-width="150" /> |
|||
<el-table-column prop="isInvoicing" label="是否开票" align="center" width="100" /> |
|||
<el-table-column prop="amountCount" label="采购金额合计" align="center" width="140" /> |
|||
<el-table-column prop="payableAmount" label="应付金额合计" align="center" width="140" /> |
|||
</el-table> |
|||
</div> |
|||
<div class="pages"> |
|||
<div class="tit"/> |
|||
<!-- 翻页 --> |
|||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from '@/components/pagination' |
|||
import ButtonBar from '@/components/ButtonBar' |
|||
import req from '@/api/purchase/purchasereturn' |
|||
import { typeValues } from '@/api/Common/dictcommons' |
|||
|
|||
export default { |
|||
name: 'OriginalOrder', |
|||
components: { |
|||
Pagination, |
|||
ButtonBar |
|||
}, |
|||
data() { |
|||
return { |
|||
btndisabled: false, |
|||
btnList: [ |
|||
{ |
|||
type: 'info', |
|||
size: 'small', |
|||
icon: 'cross', |
|||
btnKey: 'doClose', |
|||
btnLabel: '关闭' |
|||
} |
|||
], |
|||
isSearchShow: false, |
|||
searchxianshitit: '隐藏查询条件', |
|||
tableKey: 0, |
|||
sids: [], |
|||
list: [], |
|||
procurementType_list: [], |
|||
procurementReason_list: [], |
|||
paymentMethod_list: [], |
|||
state_list: [ |
|||
{ |
|||
dictKey: '1', |
|||
dictValue: '是' |
|||
}, |
|||
{ |
|||
dictKey: '0', |
|||
dictValue: '否' |
|||
} |
|||
], |
|||
listLoading: false, |
|||
listQuery: { |
|||
current: 1, |
|||
size: 5, |
|||
params: { |
|||
createOrgName: '', |
|||
createOrgSid: '', |
|||
deptName: '', |
|||
createByName: '', |
|||
billNo: '', |
|||
createStartTime: '', |
|||
createEndTime: '', |
|||
finishStartTime: '', |
|||
finishEndTime: '', |
|||
purchaseTypeValue: '', |
|||
purchaseReasonValue: '', |
|||
payTypeValue: '', |
|||
supplierName: '', |
|||
isInvoicing: '' |
|||
}, |
|||
total: 1 |
|||
} |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$refs['btnbar'].setButtonList(this.btnList) |
|||
}, |
|||
methods: { |
|||
init() { |
|||
typeValues({ type: 'procurementType' }).then((res) => { |
|||
if (res.success) { |
|||
this.procurementType_list = res.data |
|||
} |
|||
}) |
|||
typeValues({ type: 'procurementReason' }).then((res) => { |
|||
if (res.success) { |
|||
this.procurementReason_list = res.data |
|||
} |
|||
}) |
|||
typeValues({ type: 'paymentMethod' }).then((res) => { |
|||
if (res.success) { |
|||
this.paymentMethod_list = res.data |
|||
} |
|||
}) |
|||
}, |
|||
// 搜索条件效果 |
|||
clicksearchShow() { |
|||
this.isSearchShow = !this.isSearchShow |
|||
if (this.isSearchShow) { |
|||
this.searchxianshitit = '隐藏查询条件' |
|||
} else { |
|||
this.searchxianshitit = '显示查询条件' |
|||
} |
|||
}, |
|||
btnHandle(btnKey) { |
|||
console.log('XXXXXXXXXXXXXXX ' + btnKey) |
|||
switch (btnKey) { |
|||
case 'doClose': |
|||
this.doClose() |
|||
break |
|||
default: |
|||
break |
|||
} |
|||
}, |
|||
indexMethod(index) { |
|||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
// 查询列表信息 |
|||
getList() { |
|||
this.listLoading = true |
|||
req.choiceBillListPage(this.listQuery).then((response) => { |
|||
this.listLoading = false |
|||
if (response.success) { |
|||
this.listQuery.total = response.data.total |
|||
this.list = response.data.records |
|||
} |
|||
}) |
|||
}, |
|||
// 查询按钮 |
|||
handleFilter() { |
|||
this.listQuery.current = 1 |
|||
this.getList() |
|||
}, |
|||
// 重置按钮 |
|||
handresetting() { |
|||
this.listQuery.current = 1 |
|||
this.listQuery.total = 0 |
|||
this.listQuery.size = 5 |
|||
this.listQuery.params.createOrgName = '' |
|||
this.listQuery.params.deptName = '' |
|||
this.listQuery.params.createByName = '' |
|||
this.listQuery.params.billNo = '' |
|||
this.listQuery.params.createStartTime = '' |
|||
this.listQuery.params.createEndTime = '' |
|||
this.listQuery.params.finishStartTime = '' |
|||
this.listQuery.params.finishEndTime = '' |
|||
this.listQuery.params.purchaseTypeValue = '' |
|||
this.listQuery.params.purchaseReasonValue = '' |
|||
this.listQuery.params.payTypeValue = '' |
|||
this.listQuery.params.supplierName = '' |
|||
this.listQuery.params.isInvoicing = '' |
|||
this.getList() |
|||
}, |
|||
showData(createOrgSid) { |
|||
this.listQuery.current = 1 |
|||
this.listQuery.total = 0 |
|||
this.listQuery.size = 5 |
|||
this.listQuery.params.createOrgSid = createOrgSid |
|||
this.getList() |
|||
}, |
|||
handleConfirm(row) { |
|||
this.$emit('backData', row) |
|||
}, |
|||
// 返回 |
|||
doClose() { |
|||
this.$emit('doback') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
</style> |
@ -0,0 +1,558 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="viewState == 1"> |
|||
<div class="tab-header webtop"> |
|||
<div>{{ viewTitle }}</div> |
|||
<div> |
|||
<el-button type="primary" size="small" @click="openCountersign('加签')">加 签</el-button> |
|||
<el-button type="primary" size="small" @click="openAgree('同意')">同 意</el-button> |
|||
<el-button type="danger" size="small" @click="openReject('驳回')">驳 回</el-button> |
|||
<el-button type="danger" size="small" @click="openStop('终止')">终 止</el-button> |
|||
</div> |
|||
</div> |
|||
<div class=""> |
|||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02"> |
|||
<el-row style="border-top: 1px solid #e0e3eb"> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">申请部门</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">申请人</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">申请日期</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">备注</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title">原单信息</div> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">单据编号</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.sourceBillNo }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">单据日期</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.createTime }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">采购人</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.purchaserName }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">采购类型</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.purchaseTypeValue }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">采购原因</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.purchaseReasonValue }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">付款方式</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.payTypeValue }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">供应商</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.supplierName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">是否开发票</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.isInvoicing }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div v-show="originalmessage.isInvoicing == '1'"> |
|||
<div class="span-sty">发票类型(税率)</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.billType }}({{ originalmessage.taxRate }})</span></el-form-item> |
|||
</div> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">备注</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.remarks }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title">款项情况</div> |
|||
<el-row> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">采购金额</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.amountCount }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">运费</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.freight }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">优惠金额</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.discountAmount }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">误差调整</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.errorAmount }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">应付金额</div> |
|||
<el-form-item><span class="addinputInfo">{{ yfTotal }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty"><span class="icon">*</span>已付金额</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.paidAmount }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<div class="span-sty">欠款</div> |
|||
<el-form-item><span class="addinputInfo">{{ qkTotal }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title">商品列表 |
|||
</div> |
|||
<el-table :key="tableKey" :data="formobj.pmsPurchasebackDetailList" :index="index" border style="width: 100%"> |
|||
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/> |
|||
<el-table-column prop="goodsSpuName" label="商品名称" align="center" width="300" /> |
|||
<el-table-column prop="goodsSkuCode" label="图号" align="center" width="100" /> |
|||
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" width="100" /> |
|||
<el-table-column prop="unit" label="单位" align="center" width="100" /> |
|||
<el-table-column prop="count" label="采购数量" align="center" width="100" /> |
|||
<el-table-column prop="taxPrice" v-if="originalmessage.isInvoicing == '1'" label="含税单价" align="center" min-width="150" /> |
|||
<el-table-column prop="taxPrice" v-else label="不含税单价" align="center" min-width="150" /> |
|||
<el-table-column prop="amount" label="采购金额" align="center" width="140" /> |
|||
<el-table-column prop="returnedCount" label="已退数量" align="center" width="140" /> |
|||
<el-table-column prop="backCount" label="退货数量" align="center" min-width="100" /> |
|||
<el-table-column prop="backAmount" label="退货金额" align="center" width="140" /> |
|||
</el-table> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">数量</div> |
|||
<el-form-item><span class="addinputInfo">{{ slTotal }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">应收金额</div> |
|||
<el-form-item><span class="addinputInfo">{{ ysTotal }} = 退货金额:{{ thTotal }} - 运费:{{ formobj.backFreight }} - 退优惠:{{ formobj.backDiscountAmount }} - 抵扣欠款:{{ formobj.deductDebts }} + 误差调整:{{ formobj.backErrorAmount }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
<!-- 选择待办人 的弹出框--> |
|||
<el-dialog title="填写审批意见" :visible.sync="nodeDialogVisible" width="80%"> |
|||
<el-form class="formadd" > |
|||
<el-row v-show="countersignLink" style="border-top: 1px solid #e0e3eb"> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span class="icon">*</span>加签人员: |
|||
</el-col> |
|||
<el-col :span="20"> |
|||
<el-form-item> |
|||
<el-select v-model="countersign.assignee" placeholder="请选择" filterable> |
|||
<el-option v-for="item in options" :key="item.userSid" :label="item.staffName" :value="item.userSid"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row v-show="currentLink" style="border-top: 1px solid #e0e3eb"> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>当前环节:</span> |
|||
</el-col> |
|||
<el-col :span="20"> |
|||
<el-form-item><span>{{ current.taskName }}->{{ nextNode.name }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row :class="{rowClass:!currentLink}"> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>意见:</span> |
|||
</el-col> |
|||
<el-col :span="20"> |
|||
<el-form-item><el-input size="small" v-model="dialogList.comment" placeholder="审批意见" class="addinputw" type="textarea" :autosize="{ minRows: 1, maxRows: 10}" clearable ></el-input></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div style="text-align:center;margin-top: 20px;"> |
|||
<el-button type="primary" size="mini" @click="reject">确 定</el-button> |
|||
<el-button type="info " size="mini" @click="nodeDialogVisible = false">取 消</el-button> |
|||
</div> |
|||
</el-form> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/purchase/purchasereturn' |
|||
|
|||
export default { |
|||
name: 'PurchaseReturnDaiBan', |
|||
data() { |
|||
return { |
|||
viewTitle: '', |
|||
viewState: 1, |
|||
tableKey: 1, |
|||
index: 0, |
|||
formobj: { |
|||
sid: '', |
|||
remarks: '', |
|||
createBySid: '', |
|||
createByName: '', |
|||
sourceBillSid: '', |
|||
sourceBillNo: '', |
|||
billNo: '', |
|||
backErrorAmount: '', |
|||
backFreight: '', |
|||
backDiscountAmount: '', |
|||
deductDebts: '', |
|||
deductBillNo: '', |
|||
toPrepayment: '', |
|||
payableAmount: '', |
|||
paidAmount: '', |
|||
receivableAmount: '', |
|||
deptSid: '', |
|||
deptName: '', |
|||
procDefId: '', |
|||
nodeId: '', |
|||
procInstId: '', |
|||
nodeState: '', |
|||
taskId: '', |
|||
finishTime: '', |
|||
useOrgSid: '', |
|||
useOrgName: '', |
|||
createOrgSid: '', |
|||
createOrgName: '', |
|||
pmsPurchasebackDetailList: [] |
|||
}, |
|||
originalmessage: { |
|||
createTime: '', |
|||
purchaserName: '', |
|||
purchaseTypeValue: '', |
|||
purchaseReasonValue: '', |
|||
payTypeValue: '', |
|||
supplierName: '', |
|||
isInvoicing: '', |
|||
billType: '', |
|||
taxRate: '', |
|||
remarks: '', |
|||
amountCount: '', |
|||
freight: '', |
|||
discountAmount: '', |
|||
errorAmount: '' |
|||
}, |
|||
rules: {}, |
|||
options: [], |
|||
operation: '', // 点击操作按钮 |
|||
dialogList: { |
|||
comment: '' |
|||
}, |
|||
startTask: true, |
|||
current: { |
|||
taskDefKey: '', |
|||
taskName: '' // 当前环节名称 |
|||
}, |
|||
nextNode: {}, // 下一环节 |
|||
nodeDialogVisible: false, |
|||
currentLink: true, |
|||
countersignLink: false, |
|||
// 环节所需参数 |
|||
linkByParameter: { |
|||
businessSid: '', |
|||
comment: '', |
|||
instanceId: '', |
|||
taskId: '', |
|||
orgSidPath: '', |
|||
taskDefKey: '', |
|||
userSid: '' |
|||
}, |
|||
// 加签按钮所需参数 |
|||
countersign: { |
|||
taskId: '', |
|||
assignee: '', |
|||
userSid: '', |
|||
instanceId: '', |
|||
views: '' |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
console.log('url:' + window.location.href) |
|||
var one = window.location.href.indexOf('&data') + 6 |
|||
const data = window.location.href.substr(one) // url解码unescape()已从web中移除,尽量不使用 |
|||
const obj = JSON.parse(decodeURIComponent(data)) |
|||
console.log('iframe页面获取的obj:', obj) |
|||
// 点击(同意、终止、驳回、驳回)操作时所需的参数 |
|||
this.linkByParameter.businessSid = obj.businessSid |
|||
this.linkByParameter.instanceId = obj.instanceId |
|||
this.linkByParameter.taskId = obj.taskId |
|||
this.linkByParameter.taskDefKey = obj.taskDefKey |
|||
// this.linkByParameter.orgSidPath = window.sessionStorage.getItem('orgSidPath') |
|||
this.linkByParameter.userSid = window.sessionStorage.getItem('userSid') |
|||
this.current.taskDefKey = obj.taskDefKey |
|||
this.current.taskName = obj.taskName |
|||
// 加签参数 |
|||
this.countersign.taskId = obj.taskId |
|||
this.countersign.userSid = window.sessionStorage.getItem('userSid') |
|||
this.countersign.instanceId = obj.instanceId |
|||
// 加载表单数据 |
|||
this.showInfo(obj.businessSid) |
|||
}, |
|||
mounted() { |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 告诉父级页面,子页面的弹框高度。 |
|||
code: 2, |
|||
data: 500 + 'px' |
|||
} |
|||
}, '*') |
|||
}, |
|||
computed: { |
|||
// 数量 |
|||
slTotal() { |
|||
let sl = '0' |
|||
if (this.formobj.pmsPurchasebackDetailList.length > 0) { |
|||
this.formobj.pmsPurchasebackDetailList.forEach((e) => { |
|||
if (e.goodsSpuName !== '') { |
|||
sl = Math.round((parseFloat(sl) + parseFloat(e.backCount !== '' ? e.backCount : '0')) * 100) / 100 |
|||
} |
|||
}) |
|||
} |
|||
return sl |
|||
}, |
|||
// 退货金额 |
|||
thTotal() { |
|||
let th = '0' |
|||
if (this.formobj.pmsPurchasebackDetailList.length > 0) { |
|||
this.formobj.pmsPurchasebackDetailList.forEach((e) => { |
|||
if (e.goodsSpuName !== '') { |
|||
th = Math.round((parseFloat(th) + parseFloat(e.backAmount !== '' ? e.backAmount : '0')) * 100) / 100 |
|||
} |
|||
}) |
|||
} |
|||
return th |
|||
}, |
|||
ysTotal() { |
|||
let ys = '0' |
|||
ys = Math.round((parseFloat(ys) + parseFloat(this.thTotal) - parseFloat(this.formobj.backFreight !== '' ? this.formobj.backFreight : '0') - parseFloat(this.formobj.backDiscountAmount !== '' ? this.formobj.backDiscountAmount : '0') - parseFloat(this.formobj.deductDebts !== '' ? this.formobj.deductDebts : '0') + parseFloat(this.formobj.backErrorAmount !== '' ? this.formobj.backErrorAmount : '0')) * 100) / 100 |
|||
return ys |
|||
}, |
|||
// 应付金额 = 应付金额 - 退货单合计(退货金额 - 优惠 + 误差调整) - 运费 - 抵扣欠款 |
|||
yfTotal() { |
|||
let yf = '0' |
|||
yf = Math.round((parseFloat(yf) + parseFloat(this.formobj.payableAmount === '' ? '0' : this.formobj.payableAmount) - (parseFloat(this.thTotal) - parseFloat(this.formobj.backDiscountAmount !== '' ? this.formobj.backDiscountAmount : '0') + parseFloat(this.formobj.backErrorAmount !== '' ? this.formobj.backErrorAmount : '0')) - parseFloat(this.formobj.backFreight !== '' ? this.formobj.backFreight : '0') - parseFloat(this.formobj.deductDebts !== '' ? this.formobj.deductDebts : '0')) * 100) / 100 |
|||
return yf |
|||
}, |
|||
// 欠款 = 应付金额 - 已付金额 |
|||
qkTotal() { |
|||
let qk = '0' |
|||
qk = Math.round((parseFloat(this.yfTotal) - parseFloat(this.formobj.paidAmount === '' ? '0' : this.formobj.paidAmount)) * 100) / 100 |
|||
return qk |
|||
} |
|||
}, |
|||
methods: { |
|||
showInfo(sid) { |
|||
this.viewTitle = '采购退货单详情' |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
req.fetchDetailsBySid(sid).then((res) => { |
|||
if (res.success) { |
|||
this.formobj = res.data |
|||
this.originalmessage = this.formobj.pmsPurchaseChoiceBillDetailsVo |
|||
} |
|||
}) |
|||
}, |
|||
// 加签 |
|||
openCountersign(val) { |
|||
this.operation = val |
|||
this.currentLink = true |
|||
this.countersignLink = true |
|||
this.dialogList.comment = '' |
|||
req.getNextNodesForSubmit({ taskDefKey: this.current.taskDefKey, businessSid: this.linkByParameter.businessSid }).then((resp) => { |
|||
if (resp.success) { |
|||
var arr = resp.data |
|||
this.nextNode = arr[0] |
|||
this.nodeDialogVisible = true |
|||
} |
|||
this.submitdisabled = false |
|||
}) |
|||
}, |
|||
// 同意 |
|||
openAgree(val) { |
|||
this.operation = val |
|||
this.currentLink = true |
|||
this.countersignLink = false |
|||
this.dialogList.comment = '同意' |
|||
req.getNextNodesForSubmit({ taskDefKey: this.current.taskDefKey, businessSid: this.linkByParameter.businessSid }).then((resp) => { |
|||
if (resp.success) { |
|||
var arr = resp.data |
|||
this.nextNode = arr[0] |
|||
this.nodeDialogVisible = true |
|||
} |
|||
this.submitdisabled = false |
|||
}) |
|||
}, |
|||
// 驳回 |
|||
openReject(val) { |
|||
this.operation = val |
|||
this.currentLink = true |
|||
this.countersignLink = false |
|||
this.dialogList.comment = '' |
|||
req.getPreviousNodesForReject({ taskDefKey: this.current.taskDefKey, businessSid: this.linkByParameter.businessSid }).then((resp) => { |
|||
if (resp.success) { |
|||
var arr = resp.data |
|||
this.nextNode = arr[0] |
|||
this.nodeDialogVisible = true |
|||
} |
|||
this.submitdisabled = false |
|||
}) |
|||
}, |
|||
// 终止 |
|||
openStop(val) { |
|||
this.operation = val |
|||
this.currentLink = false |
|||
this.countersignLink = false |
|||
this.dialogList.comment = '' |
|||
this.nodeDialogVisible = true |
|||
}, |
|||
reject() { |
|||
if (this.operation === '同意') { |
|||
this.handleAgree() |
|||
} else if (this.operation === '驳回') { |
|||
if (this.dialogList.comment === '') { |
|||
this.$message({ showClose: true, type: 'error', message: '请填写审批意见' }) |
|||
} else { |
|||
this.handleReject() |
|||
} |
|||
} else if (this.operation === '终止') { |
|||
if (this.dialogList.comment === '') { |
|||
this.$message({ showClose: true, type: 'error', message: '请填写审批意见' }) |
|||
} else { |
|||
this.handleStop() |
|||
} |
|||
} else if (this.operation === '加签') { |
|||
this.handleCountersign() |
|||
} |
|||
}, |
|||
/** 加签 */ |
|||
handleCountersign() { |
|||
if (this.countersign.assignee === '') { |
|||
this.$message({ showClose: true, type: 'error', message: '请选择加签人员' }) |
|||
return |
|||
} |
|||
if (this.dialogList.comment === '') { |
|||
this.$message({ showClose: true, type: 'error', message: '请填写审批意见' }) |
|||
return |
|||
} |
|||
this.countersign.views = this.dialogList.comment |
|||
req.delegate(this.countersign).then((response) => { |
|||
if (response.success) { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '执行成功', |
|||
type: 'success', |
|||
duration: 2000 |
|||
}) |
|||
this.nodeDialogVisible = false |
|||
// 子页面向父级页面传递值 |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 操作成功,告诉父级页面关闭弹框 |
|||
code: 1 |
|||
} |
|||
}, '*') |
|||
} |
|||
}) |
|||
}, |
|||
/** 同意任务 */ |
|||
handleAgree() { |
|||
this.linkByParameter.comment = this.dialogList.comment |
|||
req.complete(this.linkByParameter).then((response) => { |
|||
if (response.success) { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '执行成功', |
|||
type: 'success', |
|||
duration: 2000 |
|||
}) |
|||
this.nodeDialogVisible = false |
|||
// 子页面向父级页面传递值 |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 操作成功,告诉父级页面关闭弹框 |
|||
code: 1 |
|||
} |
|||
}, '*') |
|||
} |
|||
}) |
|||
}, |
|||
/** 驳回任务 */ |
|||
handleReject() { |
|||
this.linkByParameter.comment = this.dialogList.comment |
|||
req.reject(this.linkByParameter).then((response) => { |
|||
if (response.success) { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '执行成功', |
|||
type: 'success', |
|||
duration: 2000 |
|||
}) |
|||
this.nodeDialogVisible = false |
|||
// 子页面向父级页面传递值 |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 操作成功,告诉父级页面关闭弹框 |
|||
code: 1 |
|||
} |
|||
}, '*') |
|||
} |
|||
}) |
|||
}, |
|||
/** 终止任务 */ |
|||
handleStop() { |
|||
this.linkByParameter.comment = this.dialogList.comment |
|||
req.breakProcess(this.linkByParameter).then((response) => { |
|||
if (response.success) { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '执行成功', |
|||
type: 'success', |
|||
duration: 2000 |
|||
}) |
|||
this.nodeDialogVisible = false |
|||
// 子页面向父级页面传递值 |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 操作成功,告诉父级页面关闭弹框 |
|||
code: 1 |
|||
} |
|||
}, '*') |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.span-sty { |
|||
width: 130px !important; |
|||
} |
|||
.addinputInfo { |
|||
margin-left: 120px !important; |
|||
} |
|||
.rowClass{ |
|||
border-top: 1px solid #E0E3EB; |
|||
} |
|||
</style> |
@ -0,0 +1,460 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="viewState == 1"> |
|||
<div class="tab-header webtop"> |
|||
<div>{{ viewTitle }}</div> |
|||
<div> |
|||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="selectionList()">选择原单</el-button> |
|||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存</el-button> |
|||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="submit()">提交</el-button> |
|||
</div> |
|||
</div> |
|||
<div class=""> |
|||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02"> |
|||
<el-row style="border-top: 1px solid #e0e3eb"> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">申请部门</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">申请人</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">申请日期</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">备注</div> |
|||
<el-form-item><el-input class="addinputInfo" style="width: 80%" v-model="formobj.remarks" clearable placeholder="" /></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title">原单信息</div> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">单据编号</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.sourceBillNo }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">单据日期</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.createTime }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">采购人</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.purchaserName }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">采购类型</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.purchaseTypeValue }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">采购原因</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.purchaseReasonValue }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">付款方式</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.payTypeValue }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">供应商</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.supplierName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">是否开发票</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.isInvoicing }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div v-show="originalmessage.isInvoicing == '1'"> |
|||
<div class="span-sty">发票类型(税率)</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.billType }}({{ originalmessage.taxRate }})</span></el-form-item> |
|||
</div> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">备注</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.remarks }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title">款项情况</div> |
|||
<el-row> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">采购金额</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.amountCount }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">运费</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.freight }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">优惠金额</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.discountAmount }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">误差调整</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.errorAmount }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">应付金额</div> |
|||
<el-form-item><span class="addinputInfo">{{ yfTotal }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty"><span class="icon">*</span>已付金额</div> |
|||
<el-form-item><el-input class="addinputInfo" style="width: 40%" v-model="formobj.paidAmount" @keyup.native="formobj.paidAmount = getNumber(formobj.paidAmount, 2)" clearable placeholder="" /></el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<div class="span-sty">欠款</div> |
|||
<el-form-item><span class="addinputInfo">{{ qkTotal }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title titleOne"> |
|||
<div>商品列表</div> |
|||
<el-button type="primary" size="mini" class="btntopblueline" @click="fullyWithdraw">整单全退</el-button> |
|||
</div> |
|||
<el-table :key="tableKey" :data="formobj.pmsPurchasebackDetailList" :index="index" border style="width: 100%"> |
|||
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/> |
|||
<el-table-column prop="goodsSpuName" label="商品名称" align="center" width="300" /> |
|||
<el-table-column prop="goodsSkuCode" label="图号" align="center" width="100" /> |
|||
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" width="100" /> |
|||
<el-table-column prop="unit" label="单位" align="center" width="100" /> |
|||
<el-table-column prop="count" label="采购数量" align="center" width="100" /> |
|||
<el-table-column prop="taxPrice" v-if="originalmessage.isInvoicing == '1'" label="含税单价" align="center" min-width="150" /> |
|||
<el-table-column prop="taxPrice" v-else label="不含税单价" align="center" min-width="150" /> |
|||
<el-table-column prop="amount" label="采购金额" align="center" width="140" /> |
|||
<el-table-column prop="returnedCount" label="已退数量" align="center" width="140" /> |
|||
<el-table-column label="退货数量" align="center" min-width="100"> |
|||
<template slot-scope="scope"> |
|||
<el-input @input="backAmountInput(scope.row)" @keyup.native="scope.row.backCount = getNumber(scope.row.backCount, 2)" v-model="scope.row.backCount" clearable placeholder="" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="backAmount" label="退货金额" align="center" width="140" /> |
|||
</el-table> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">数量</div> |
|||
<el-form-item><span class="addinputInfo">{{ slTotal }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">应收金额</div> |
|||
<el-form-item><span class="addinputInfo">{{ ysTotal }} = 退货金额:{{ thTotal }} - 运费:<el-input @keyup.native="formobj.backFreight = getNumber(formobj.backFreight, 2)" v-model="formobj.backFreight" style="width: 160px" clearable placeholder="" /> - 退优惠:<el-input @keyup.native="formobj.backDiscountAmount = getNumber(formobj.backDiscountAmount, 2)" v-model="formobj.backDiscountAmount" style="width: 160px" clearable placeholder="" /> - 抵扣欠款:<el-input @keyup.native="formobj.deductDebts = getNumber(formobj.deductDebts, 2)" v-model="formobj.deductDebts" style="width: 160px" clearable placeholder="" /> + 误差调整:<el-input @keyup.native="formobj.backErrorAmount = getNumber(formobj.backErrorAmount, 2)" v-model="formobj.backErrorAmount" style="width: 160px" clearable placeholder="" /></span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
<!-- 选择商品 --> |
|||
<originalorder v-show="viewState == 2" ref="divYd" @backData="backData" @doback="resetState" /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/purchase/purchasereturn' |
|||
import originalorder from './relation/originalorder' |
|||
|
|||
export default { |
|||
name: 'PurchaseReturnEdit', |
|||
components: { |
|||
originalorder |
|||
}, |
|||
data() { |
|||
return { |
|||
viewTitle: '', |
|||
viewState: 1, |
|||
submitdisabled: false, |
|||
tableKey: 1, |
|||
index: 0, |
|||
formobj: { |
|||
sid: '', |
|||
remarks: '', |
|||
createBySid: '', |
|||
createByName: '', |
|||
sourceBillSid: '', |
|||
sourceBillNo: '', |
|||
billNo: '', |
|||
backErrorAmount: '', |
|||
backFreight: '', |
|||
backDiscountAmount: '', |
|||
deductDebts: '', |
|||
deductBillNo: '', |
|||
toPrepayment: '', |
|||
payableAmount: '', |
|||
paidAmount: '', |
|||
receivableAmount: '', |
|||
deptSid: '', |
|||
deptName: '', |
|||
procDefId: '', |
|||
nodeId: '', |
|||
procInstId: '', |
|||
nodeState: '', |
|||
taskId: '', |
|||
finishTime: '', |
|||
useOrgSid: '', |
|||
useOrgName: '', |
|||
createOrgSid: '', |
|||
createOrgName: '', |
|||
pmsPurchasebackDetailList: [] |
|||
}, |
|||
originalmessage: { |
|||
createTime: '', |
|||
purchaserName: '', |
|||
purchaseTypeValue: '', |
|||
purchaseReasonValue: '', |
|||
payTypeValue: '', |
|||
supplierName: '', |
|||
isInvoicing: '', |
|||
billType: '', |
|||
taxRate: '', |
|||
remarks: '', |
|||
freight: '', |
|||
amountCount: '', |
|||
discountAmount: '', |
|||
errorAmount: '' |
|||
}, |
|||
rules: {} |
|||
} |
|||
}, |
|||
created() { |
|||
console.log('url:' + window.location.href) |
|||
var one = window.location.href.indexOf('&data') + 6 |
|||
const data = window.location.href.substr(one) // url解码unescape()已从web中移除,尽量不使用 |
|||
const obj = JSON.parse(decodeURIComponent(data)) |
|||
this.showInfo(obj.businessSid) |
|||
}, |
|||
mounted() { |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 告诉父级页面,子页面的弹框高度。 |
|||
code: 2, |
|||
data: 500 + 'px' |
|||
} |
|||
}, '*') |
|||
}, |
|||
computed: { |
|||
// 数量 |
|||
slTotal() { |
|||
let sl = '0' |
|||
if (this.formobj.pmsPurchasebackDetailList.length > 0) { |
|||
this.formobj.pmsPurchasebackDetailList.forEach((e) => { |
|||
if (e.goodsSpuName !== '') { |
|||
sl = Math.round((parseFloat(sl) + parseFloat(e.backCount !== '' ? e.backCount : '0')) * 100) / 100 |
|||
} |
|||
}) |
|||
} |
|||
return sl |
|||
}, |
|||
// 退货金额 |
|||
thTotal() { |
|||
let th = '0' |
|||
if (this.formobj.pmsPurchasebackDetailList.length > 0) { |
|||
this.formobj.pmsPurchasebackDetailList.forEach((e) => { |
|||
if (e.goodsSpuName !== '') { |
|||
th = Math.round((parseFloat(th) + parseFloat(e.backAmount !== '' ? e.backAmount : '0')) * 100) / 100 |
|||
} |
|||
}) |
|||
} |
|||
return th |
|||
}, |
|||
ysTotal() { |
|||
let ys = '0' |
|||
ys = Math.round((parseFloat(ys) + parseFloat(this.thTotal) - parseFloat(this.formobj.backFreight !== '' ? this.formobj.backFreight : '0') - parseFloat(this.formobj.backDiscountAmount !== '' ? this.formobj.backDiscountAmount : '0') - parseFloat(this.formobj.deductDebts !== '' ? this.formobj.deductDebts : '0') + parseFloat(this.formobj.backErrorAmount !== '' ? this.formobj.backErrorAmount : '0')) * 100) / 100 |
|||
return ys |
|||
}, |
|||
// 应付金额 = 应付金额 - 退货单合计(退货金额 - 优惠 + 误差调整) - 运费 - 抵扣欠款 |
|||
yfTotal() { |
|||
let yf = '0' |
|||
yf = Math.round((parseFloat(yf) + parseFloat(this.formobj.payableAmount === '' ? '0' : this.formobj.payableAmount) - (parseFloat(this.thTotal) - parseFloat(this.formobj.backDiscountAmount !== '' ? this.formobj.backDiscountAmount : '0') + parseFloat(this.formobj.backErrorAmount !== '' ? this.formobj.backErrorAmount : '0')) - parseFloat(this.formobj.backFreight !== '' ? this.formobj.backFreight : '0') - parseFloat(this.formobj.deductDebts !== '' ? this.formobj.deductDebts : '0')) * 100) / 100 |
|||
return yf |
|||
}, |
|||
// 欠款 = 应付金额 - 已付金额 |
|||
qkTotal() { |
|||
let qk = '0' |
|||
qk = Math.round((parseFloat(this.yfTotal) - parseFloat(this.formobj.paidAmount === '' ? '0' : this.formobj.paidAmount)) * 100) / 100 |
|||
return qk |
|||
} |
|||
}, |
|||
methods: { |
|||
showInfo(sid) { |
|||
this.viewTitle = '【编辑】采购退货单' |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
req.fetchDetailsBySid(sid).then((res) => { |
|||
if (res.success) { |
|||
this.formobj = res.data |
|||
this.formobj.instanceId = res.data.procInstId |
|||
this.originalmessage = this.formobj.pmsPurchaseChoiceBillDetailsVo |
|||
} |
|||
}) |
|||
}, |
|||
getNumber(val, limit) { |
|||
val = val.replace(/[^0-9.]/g, '') // 保留数字 |
|||
val = val.replace(/^00/, '0.') // 开头不能有两个0 |
|||
val = val.replace(/^\./g, '0.') // 开头为小数点转换为0. |
|||
val = val.replace(/\.{2,}/g, '.') // 两个以上的小数点转换成一个 |
|||
val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); // 只保留一个小数点 |
|||
/^0\d+/.test(val) ? val = val.slice(1) : '' // 两位以上数字开头不能为0 |
|||
const str = '^(\\d+)\\.(\\d{' + limit + '}).*$' |
|||
const reg = new RegExp(str) |
|||
if (limit === 0) { |
|||
// 不需要小数点 |
|||
val = val.replace(reg, '$1') |
|||
} else { |
|||
// 通过正则保留小数点后指定的位数 |
|||
val = val.replace(reg, '$1.$2') |
|||
} |
|||
return val |
|||
}, |
|||
selectionList() { |
|||
this.viewState = 2 |
|||
this.$refs['divYd'].showData(this.formobj.createOrgSid) |
|||
}, |
|||
backData(value) { |
|||
this.viewState = 1 |
|||
this.formobj.sourceBillNo = value.billNo |
|||
this.formobj.sourceBillSid = value.sid |
|||
this.formobj.payableAmount = value.payableAmount |
|||
const aa = [] |
|||
if (value.pmsPurchaseBillDetailList.length > 0) { |
|||
value.pmsPurchaseBillDetailList.forEach((e) => { |
|||
aa.push({ |
|||
sid: '', |
|||
billSid: '', |
|||
goodsSpuSid: e.goodsSpuSid, |
|||
goodsSpuName: e.goodsSpuName, |
|||
goodsSkuSid: e.goodsSkuSid, |
|||
goodsSkuTitle: e.goodsSkuTitle, |
|||
goodsSkuCode: e.goodsSkuCode, |
|||
goodsSkuOwnSpec: e.goodsSkuOwnSpec, |
|||
count: e.count, |
|||
amount: e.amount, |
|||
unit: e.unit, |
|||
warehouseSid: '', |
|||
warehouseName: '', |
|||
returnedCount: e.returnedCount, |
|||
backCount: '', |
|||
taxAmount: '', |
|||
taxPrice: e.taxPrice, |
|||
backAmount: '' |
|||
}) |
|||
}) |
|||
} |
|||
this.formobj.pmsPurchasebackDetailList = aa |
|||
this.originalmessage.createTime = value.createTime |
|||
this.originalmessage.purchaserName = value.purchaserName |
|||
this.originalmessage.purchaseTypeValue = value.purchaseTypeValue |
|||
this.originalmessage.purchaseReasonValue = value.purchaseReasonValue |
|||
this.originalmessage.payTypeValue = value.payTypeValue |
|||
this.originalmessage.supplierName = value.supplierName |
|||
this.originalmessage.isInvoicing = value.isInvoicing |
|||
this.originalmessage.billType = value.billType |
|||
this.originalmessage.taxRate = value.taxRate |
|||
this.originalmessage.amountCount = value.amountCount |
|||
this.originalmessage.freight = value.freight |
|||
this.originalmessage.discountAmount = value.discountAmount |
|||
this.originalmessage.errorAmount = value.errorAmount |
|||
}, |
|||
resetState() { |
|||
this.viewState = 1 |
|||
}, |
|||
fullyWithdraw() { |
|||
if (this.formobj.pmsPurchasebackDetailList.length > 0) { |
|||
this.formobj.pmsPurchasebackDetailList.forEach((e) => { |
|||
if (e.goodsSpuName !== '') { |
|||
// 计算退货数量 = 采购数量 - 已退数量 |
|||
e.backCount = Math.round((parseFloat(e.count) - parseFloat(e.returnedCount !== '' ? e.returnedCount : '0')) * 100) / 100 |
|||
// 计算退货金额 |
|||
e.backAmount = Math.round((parseFloat(e.backCount) * parseFloat(e.taxPrice)) * 100) / 100 |
|||
} |
|||
}) |
|||
} |
|||
}, |
|||
// 计算退货金额 |
|||
backAmountInput(row) { |
|||
if (row.goodsSpuName !== '') { |
|||
row.backAmount = Math.round((parseFloat(row.taxPrice !== '' ? row.taxPrice : '0') * parseFloat(row.backCount !== '' ? row.backCount : '0')) * 100) / 100 |
|||
} |
|||
}, |
|||
saveOrUpdate() { |
|||
this.$refs['form_obj'].validate((valid) => { |
|||
if (valid) { |
|||
this.submitdisabled = true |
|||
this.formobj.receivableAmount = this.ysTotal |
|||
req.saveOrUpdate(this.formobj).then((res) => { |
|||
if (res.success) { |
|||
this.$message({ showClose: true, type: 'success', message: '保存成功' }) |
|||
// 子页面向父级页面传递值(关闭弹框) |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 操作成功,告诉父级页面关闭弹框 |
|||
code: 1 |
|||
} |
|||
}, '*') |
|||
} else { |
|||
this.submitdisabled = false |
|||
} |
|||
}).catch(() => { |
|||
this.submitdisabled = false |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
submit() { |
|||
this.$refs['form_obj'].validate((valid) => { |
|||
if (valid) { |
|||
this.submitdisabled = true |
|||
this.formobj.receivableAmount = this.ysTotal |
|||
req.submit(this.formobj).then((res) => { |
|||
if (res.success) { |
|||
this.$message({ showClose: true, type: 'success', message: '提交成功' }) |
|||
// 子页面向父级页面传递值(关闭弹框) |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 操作成功,告诉父级页面关闭弹框 |
|||
code: 1 |
|||
} |
|||
}, '*') |
|||
} else { |
|||
this.submitdisabled = false |
|||
} |
|||
}).catch(() => { |
|||
this.submitdisabled = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.span-sty { |
|||
width: 130px !important; |
|||
} |
|||
.addinputInfo { |
|||
margin-left: 120px !important; |
|||
} |
|||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw { |
|||
margin-left: 120px !important; |
|||
width: calc(100% - 115px); |
|||
} |
|||
.titleOne { |
|||
padding: 7px; |
|||
display: flex; |
|||
flex-direction: row; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
} |
|||
</style> |
@ -0,0 +1,350 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="viewState == 1"> |
|||
<div class="tab-header webtop"> |
|||
<div>{{ viewTitle }}</div> |
|||
<div> |
|||
<el-button type="danger" size="small" @click="openRevoke()">撤回</el-button> |
|||
</div> |
|||
</div> |
|||
<div class=""> |
|||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02"> |
|||
<el-row style="border-top: 1px solid #e0e3eb"> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">申请部门</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">申请人</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">申请日期</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">备注</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title">原单信息</div> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">单据编号</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.sourceBillNo }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">单据日期</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.createTime }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">采购人</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.purchaserName }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">采购类型</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.purchaseTypeValue }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">采购原因</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.purchaseReasonValue }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">付款方式</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.payTypeValue }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">供应商</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.supplierName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">是否开发票</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.isInvoicing }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div v-show="originalmessage.isInvoicing == '1'"> |
|||
<div class="span-sty">发票类型(税率)</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.billType }}({{ originalmessage.taxRate }})</span></el-form-item> |
|||
</div> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">备注</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.remarks }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title">款项情况</div> |
|||
<el-row> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">采购金额</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.amountCount }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">运费</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.freight }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">优惠金额</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.discountAmount }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">误差调整</div> |
|||
<el-form-item><span class="addinputInfo">{{ originalmessage.errorAmount }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="6"> |
|||
<div class="span-sty">应付金额</div> |
|||
<el-form-item><span class="addinputInfo">{{ yfTotal }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<div class="span-sty"><span class="icon">*</span>已付金额</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.paidAmount }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<div class="span-sty">欠款</div> |
|||
<el-form-item><span class="addinputInfo">{{ qkTotal }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title">商品列表 |
|||
</div> |
|||
<el-table :key="tableKey" :data="formobj.pmsPurchasebackDetailList" :index="index" border style="width: 100%"> |
|||
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/> |
|||
<el-table-column prop="goodsSpuName" label="商品名称" align="center" width="300" /> |
|||
<el-table-column prop="goodsSkuCode" label="图号" align="center" width="100" /> |
|||
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" width="100" /> |
|||
<el-table-column prop="unit" label="单位" align="center" width="100" /> |
|||
<el-table-column prop="count" label="采购数量" align="center" width="100" /> |
|||
<el-table-column prop="taxPrice" v-if="originalmessage.isInvoicing == '1'" label="含税单价" align="center" min-width="150" /> |
|||
<el-table-column prop="taxPrice" v-else label="不含税单价" align="center" min-width="150" /> |
|||
<el-table-column prop="amount" label="采购金额" align="center" width="140" /> |
|||
<el-table-column prop="returnedCount" label="已退数量" align="center" width="140" /> |
|||
<el-table-column prop="backCount" label="退货数量" align="center" min-width="100" /> |
|||
<el-table-column prop="backAmount" label="退货金额" align="center" width="140" /> |
|||
</el-table> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">数量</div> |
|||
<el-form-item><span class="addinputInfo">{{ slTotal }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">应收金额</div> |
|||
<el-form-item><span class="addinputInfo">{{ ysTotal }} = 退货金额:{{ thTotal }} - 运费:{{ formobj.backFreight }} - 退优惠:{{ formobj.backDiscountAmount }} - 抵扣欠款:{{ formobj.deductDebts }} + 误差调整:{{ formobj.backErrorAmount }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/purchase/purchasereturn' |
|||
|
|||
export default { |
|||
name: 'PurchaseReturnYiBan', |
|||
data() { |
|||
return { |
|||
viewTitle: '', |
|||
viewState: 1, |
|||
tableKey: 1, |
|||
index: 0, |
|||
formobj: { |
|||
sid: '', |
|||
remarks: '', |
|||
createBySid: '', |
|||
createByName: '', |
|||
sourceBillSid: '', |
|||
sourceBillNo: '', |
|||
billNo: '', |
|||
backErrorAmount: '', |
|||
backFreight: '', |
|||
backDiscountAmount: '', |
|||
deductDebts: '', |
|||
deductBillNo: '', |
|||
toPrepayment: '', |
|||
payableAmount: '', |
|||
paidAmount: '', |
|||
receivableAmount: '', |
|||
deptSid: '', |
|||
deptName: '', |
|||
procDefId: '', |
|||
nodeId: '', |
|||
procInstId: '', |
|||
nodeState: '', |
|||
taskId: '', |
|||
finishTime: '', |
|||
useOrgSid: '', |
|||
useOrgName: '', |
|||
createOrgSid: '', |
|||
createOrgName: '', |
|||
pmsPurchasebackDetailList: [] |
|||
}, |
|||
originalmessage: { |
|||
createTime: '', |
|||
purchaserName: '', |
|||
purchaseTypeValue: '', |
|||
purchaseReasonValue: '', |
|||
payTypeValue: '', |
|||
supplierName: '', |
|||
isInvoicing: '', |
|||
billType: '', |
|||
taxRate: '', |
|||
remarks: '', |
|||
amountCount: '', |
|||
freight: '', |
|||
discountAmount: '', |
|||
errorAmount: '' |
|||
}, |
|||
// 环节所需参数 |
|||
linkByParameter: { |
|||
businessSid: '', |
|||
comment: '', |
|||
instanceId: '', |
|||
taskId: '', |
|||
orgSidPath: '', |
|||
taskDefKey: '', |
|||
userSid: '' |
|||
}, |
|||
rules: {} |
|||
} |
|||
}, |
|||
created() { |
|||
console.log('url:' + window.location.href) |
|||
var one = window.location.href.indexOf('&data') + 6 |
|||
const data = window.location.href.substr(one) // url解码unescape()已从web中移除,尽量不使用 |
|||
const obj = JSON.parse(decodeURIComponent(data)) |
|||
console.log('iframe页面获取的obj:', obj) |
|||
// 点击(同意、终止、驳回、驳回)操作时所需的参数 |
|||
this.linkByParameter.businessSid = obj.businessSid |
|||
this.linkByParameter.instanceId = obj.instanceId |
|||
this.linkByParameter.taskId = obj.taskId |
|||
this.linkByParameter.taskDefKey = obj.taskDefKey |
|||
this.linkByParameter.userSid = window.sessionStorage.getItem('userSid') |
|||
// 加载表单数据 |
|||
this.showInfo(obj.businessSid) |
|||
}, |
|||
mounted() { |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 告诉父级页面,子页面的弹框高度。 |
|||
code: 2, |
|||
data: 500 + 'px' |
|||
} |
|||
}, '*') |
|||
}, |
|||
computed: { |
|||
// 数量 |
|||
slTotal() { |
|||
let sl = '0' |
|||
if (this.formobj.pmsPurchasebackDetailList.length > 0) { |
|||
this.formobj.pmsPurchasebackDetailList.forEach((e) => { |
|||
if (e.goodsSpuName !== '') { |
|||
sl = Math.round((parseFloat(sl) + parseFloat(e.backCount !== '' ? e.backCount : '0')) * 100) / 100 |
|||
} |
|||
}) |
|||
} |
|||
return sl |
|||
}, |
|||
// 退货金额 |
|||
thTotal() { |
|||
let th = '0' |
|||
if (this.formobj.pmsPurchasebackDetailList.length > 0) { |
|||
this.formobj.pmsPurchasebackDetailList.forEach((e) => { |
|||
if (e.goodsSpuName !== '') { |
|||
th = Math.round((parseFloat(th) + parseFloat(e.backAmount !== '' ? e.backAmount : '0')) * 100) / 100 |
|||
} |
|||
}) |
|||
} |
|||
return th |
|||
}, |
|||
ysTotal() { |
|||
let ys = '0' |
|||
ys = Math.round((parseFloat(ys) + parseFloat(this.thTotal) - parseFloat(this.formobj.backFreight !== '' ? this.formobj.backFreight : '0') - parseFloat(this.formobj.backDiscountAmount !== '' ? this.formobj.backDiscountAmount : '0') - parseFloat(this.formobj.deductDebts !== '' ? this.formobj.deductDebts : '0') + parseFloat(this.formobj.backErrorAmount !== '' ? this.formobj.backErrorAmount : '0')) * 100) / 100 |
|||
return ys |
|||
}, |
|||
// 应付金额 = 应付金额 - 退货单合计(退货金额 - 优惠 + 误差调整) - 运费 - 抵扣欠款 |
|||
yfTotal() { |
|||
let yf = '0' |
|||
yf = Math.round((parseFloat(yf) + parseFloat(this.formobj.payableAmount === '' ? '0' : this.formobj.payableAmount) - (parseFloat(this.thTotal) - parseFloat(this.formobj.backDiscountAmount !== '' ? this.formobj.backDiscountAmount : '0') + parseFloat(this.formobj.backErrorAmount !== '' ? this.formobj.backErrorAmount : '0')) - parseFloat(this.formobj.backFreight !== '' ? this.formobj.backFreight : '0') - parseFloat(this.formobj.deductDebts !== '' ? this.formobj.deductDebts : '0')) * 100) / 100 |
|||
return yf |
|||
}, |
|||
// 欠款 = 应付金额 - 已付金额 |
|||
qkTotal() { |
|||
let qk = '0' |
|||
qk = Math.round((parseFloat(this.yfTotal) - parseFloat(this.formobj.paidAmount === '' ? '0' : this.formobj.paidAmount)) * 100) / 100 |
|||
return qk |
|||
} |
|||
}, |
|||
methods: { |
|||
showInfo(sid) { |
|||
this.viewTitle = '采购退货单详情' |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
req.fetchDetailsBySid(sid).then((res) => { |
|||
if (res.success) { |
|||
this.formobj = res.data |
|||
this.originalmessage = this.formobj.pmsPurchaseChoiceBillDetailsVo |
|||
} |
|||
}) |
|||
}, |
|||
/** 确认撤回任务 */ |
|||
openRevoke() { |
|||
this.$confirm('是否确认执行撤回操作', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.handleRevoke() |
|||
}).catch(() => { |
|||
this.$message({ |
|||
type: 'info', |
|||
message: '已取消撤回' |
|||
}) |
|||
}) |
|||
}, |
|||
/** 撤回任务 */ |
|||
handleRevoke() { |
|||
req.revokeProcess(this.linkByParameter).then((response) => { |
|||
if (response.success) { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '执行成功', |
|||
type: 'success', |
|||
duration: 2000 |
|||
}) |
|||
this.nodeDialogVisible = false |
|||
// 子页面向父级页面传递值 |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 操作成功,告诉父级页面关闭弹框 |
|||
code: 1 |
|||
} |
|||
}, '*') |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.span-sty { |
|||
width: 130px !important; |
|||
} |
|||
.addinputInfo { |
|||
margin-left: 120px !important; |
|||
} |
|||
</style> |
@ -0,0 +1,259 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div> |
|||
<button-bar view-title="选择采购单" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/> |
|||
<div class=""> |
|||
<div class="searchcon"> |
|||
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button> |
|||
<div v-show="isSearchShow" class="search"> |
|||
<el-form ref="listQueryform" :inline="true" :model="listQuery" class="tab-header" label-width="100px"> |
|||
<el-form-item label="分公司"> |
|||
<el-input v-model="listQuery.params.createOrgName" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="申请部门"> |
|||
<el-input v-model="listQuery.params.deptName" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="申请人"> |
|||
<el-input v-model="listQuery.params.createByName" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="单据编号"> |
|||
<el-input v-model="listQuery.params.billNo" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="申请日期"> |
|||
<el-date-picker v-model="listQuery.params.createStartTime" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker> |
|||
<span style="padding: 0 8px">至</span> |
|||
<el-date-picker v-model="listQuery.params.createEndTime" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="办结日期"> |
|||
<el-date-picker v-model="listQuery.params.finishStartTime" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker> |
|||
<span style="padding: 0 8px">至</span> |
|||
<el-date-picker v-model="listQuery.params.finishEndTime" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="采购类型"> |
|||
<el-select v-model="listQuery.params.purchaseTypeValue" placeholder="请选择" clearable filterable> |
|||
<el-option v-for="item in procurementType_list" :key="item.sid" :label="item.supplierName" :value="item.sid"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="采购原因"> |
|||
<el-select v-model="listQuery.params.purchaseReasonValue" placeholder="请选择" clearable filterable> |
|||
<el-option v-for="item in procurementReason_list" :key="item.sid" :label="item.supplierName" :value="item.sid"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="付款方式"> |
|||
<el-select v-model="listQuery.params.payTypeValue" placeholder="请选择" clearable filterable> |
|||
<el-option v-for="item in paymentMethod_list" :key="item.sid" :label="item.supplierName" :value="item.sid"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="供应商"> |
|||
<el-input v-model="listQuery.params.supplierName" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="是否开票"> |
|||
<el-select v-model="listQuery.params.isInvoicing" placeholder="请选择" clearable filterable> |
|||
<el-option v-for="item in state_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="btn" style="text-align: center"> |
|||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button> |
|||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handresetting">重置</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class=""> |
|||
<el-table :key="tableKey" ref="multipleTable" v-loading="listLoading" :data="list" border style="width: 100%"> |
|||
<el-table-column width="60" fixed label="编号" type="index" :index="indexMethod" align="center"/> |
|||
<el-table-column label="操作" fixed width="80" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="primary" size="small" @click="handleConfirm(scope.row)">确认</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="billNo" label="单据编号" align="center" width="160" /> |
|||
<el-table-column prop="createOrgName" label="分公司" align="center" width="120" /> |
|||
<el-table-column prop="deptName" label="申请部门" align="center" width="120" /> |
|||
<el-table-column prop="createTime" label="申请日期" align="center" width="120" /> |
|||
<el-table-column prop="finishTime" label="办结日期" align="center" width="120" /> |
|||
<el-table-column prop="purchaseTypeValue" label="采购类型" align="center" width="100" /> |
|||
<el-table-column prop="purchaseReasonValue" label="采购原因" align="center" width="100" /> |
|||
<el-table-column prop="payTypeValue" label="付款方式" align="center" width="100" /> |
|||
<el-table-column prop="supplierName" label="供应商" align="center" min-width="150" /> |
|||
<el-table-column prop="isInvoicing" label="是否开票" align="center" width="100" /> |
|||
<el-table-column prop="amountCount" label="采购金额合计" align="center" width="140" /> |
|||
<el-table-column prop="payableAmount" label="应付金额合计" align="center" width="140" /> |
|||
</el-table> |
|||
</div> |
|||
<div class="pages"> |
|||
<div class="tit"/> |
|||
<!-- 翻页 --> |
|||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from '@/components/pagination' |
|||
import ButtonBar from '@/components/ButtonBar' |
|||
import req from '@/api/purchase/purchasereturn' |
|||
import { typeValues } from '@/api/Common/dictcommons' |
|||
|
|||
export default { |
|||
name: 'OriginalOrder', |
|||
components: { |
|||
Pagination, |
|||
ButtonBar |
|||
}, |
|||
data() { |
|||
return { |
|||
btndisabled: false, |
|||
btnList: [ |
|||
{ |
|||
type: 'info', |
|||
size: 'small', |
|||
icon: 'cross', |
|||
btnKey: 'doClose', |
|||
btnLabel: '关闭' |
|||
} |
|||
], |
|||
isSearchShow: false, |
|||
searchxianshitit: '隐藏查询条件', |
|||
tableKey: 0, |
|||
sids: [], |
|||
list: [], |
|||
procurementType_list: [], |
|||
procurementReason_list: [], |
|||
paymentMethod_list: [], |
|||
state_list: [ |
|||
{ |
|||
dictKey: '1', |
|||
dictValue: '是' |
|||
}, |
|||
{ |
|||
dictKey: '0', |
|||
dictValue: '否' |
|||
} |
|||
], |
|||
listLoading: false, |
|||
listQuery: { |
|||
current: 1, |
|||
size: 5, |
|||
params: { |
|||
createOrgName: '', |
|||
createOrgSid: '', |
|||
deptName: '', |
|||
createByName: '', |
|||
billNo: '', |
|||
createStartTime: '', |
|||
createEndTime: '', |
|||
finishStartTime: '', |
|||
finishEndTime: '', |
|||
purchaseTypeValue: '', |
|||
purchaseReasonValue: '', |
|||
payTypeValue: '', |
|||
supplierName: '', |
|||
isInvoicing: '' |
|||
}, |
|||
total: 1 |
|||
} |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$refs['btnbar'].setButtonList(this.btnList) |
|||
}, |
|||
methods: { |
|||
init() { |
|||
typeValues({ type: 'procurementType' }).then((res) => { |
|||
if (res.success) { |
|||
this.procurementType_list = res.data |
|||
} |
|||
}) |
|||
typeValues({ type: 'procurementReason' }).then((res) => { |
|||
if (res.success) { |
|||
this.procurementReason_list = res.data |
|||
} |
|||
}) |
|||
typeValues({ type: 'paymentMethod' }).then((res) => { |
|||
if (res.success) { |
|||
this.paymentMethod_list = res.data |
|||
} |
|||
}) |
|||
}, |
|||
// 搜索条件效果 |
|||
clicksearchShow() { |
|||
this.isSearchShow = !this.isSearchShow |
|||
if (this.isSearchShow) { |
|||
this.searchxianshitit = '隐藏查询条件' |
|||
} else { |
|||
this.searchxianshitit = '显示查询条件' |
|||
} |
|||
}, |
|||
btnHandle(btnKey) { |
|||
console.log('XXXXXXXXXXXXXXX ' + btnKey) |
|||
switch (btnKey) { |
|||
case 'doClose': |
|||
this.doClose() |
|||
break |
|||
default: |
|||
break |
|||
} |
|||
}, |
|||
indexMethod(index) { |
|||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
// 查询列表信息 |
|||
getList() { |
|||
this.listLoading = true |
|||
req.choiceBillListPage(this.listQuery).then((response) => { |
|||
this.listLoading = false |
|||
if (response.success) { |
|||
this.listQuery.total = response.data.total |
|||
this.list = response.data.records |
|||
} |
|||
}) |
|||
}, |
|||
// 查询按钮 |
|||
handleFilter() { |
|||
this.listQuery.current = 1 |
|||
this.getList() |
|||
}, |
|||
// 重置按钮 |
|||
handresetting() { |
|||
this.listQuery.current = 1 |
|||
this.listQuery.total = 0 |
|||
this.listQuery.size = 5 |
|||
this.listQuery.params.createOrgName = '' |
|||
this.listQuery.params.deptName = '' |
|||
this.listQuery.params.createByName = '' |
|||
this.listQuery.params.billNo = '' |
|||
this.listQuery.params.createStartTime = '' |
|||
this.listQuery.params.createEndTime = '' |
|||
this.listQuery.params.finishStartTime = '' |
|||
this.listQuery.params.finishEndTime = '' |
|||
this.listQuery.params.purchaseTypeValue = '' |
|||
this.listQuery.params.purchaseReasonValue = '' |
|||
this.listQuery.params.payTypeValue = '' |
|||
this.listQuery.params.supplierName = '' |
|||
this.listQuery.params.isInvoicing = '' |
|||
this.getList() |
|||
}, |
|||
showData(createOrgSid) { |
|||
this.listQuery.current = 1 |
|||
this.listQuery.total = 0 |
|||
this.listQuery.size = 5 |
|||
this.listQuery.params.createOrgSid = createOrgSid |
|||
this.getList() |
|||
}, |
|||
handleConfirm(row) { |
|||
this.$emit('backData', row) |
|||
}, |
|||
// 返回 |
|||
doClose() { |
|||
this.$emit('doback') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
</style> |
Loading…
Reference in new issue