
27 changed files with 3062 additions and 762 deletions
@ -0,0 +1,164 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div> |
|||
<div class="tab-header webtop"> |
|||
<div>选择商品</div> |
|||
<div> |
|||
<el-button type="primary" size="small" @click="AddUpdateReturn">确定</el-button> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
</div> |
|||
<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" label-width="120px" class="tab-header"> |
|||
<el-form-item label="商品名称" class="searchlist"> |
|||
<el-input v-model="listQuery.params.goodsSpuName" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="图号" class="searchlist"> |
|||
<el-input v-model="listQuery.params.goodsSkuCode" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="供应商" class="searchlist"> |
|||
<el-input v-model="listQuery.params.manufacturerName" placeholder="" clearable /> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="btn" style="text-align: center;"> |
|||
<el-button type="primary" icon="el-icon-search" @click="handleFilter" size="small">查询</el-button> |
|||
<el-button type="primary" icon="el-icon-refresh" @click="handleReset" size="small">重置</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="listtop"> |
|||
<div class="tit">商品列表</div> |
|||
<!-- <pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>--> |
|||
</div> |
|||
<div class=""> |
|||
<el-table :key="tableKey" ref="multipleTable" v-loading="listLoading" :data="list" border style="width: 100%" @selection-change="handleSelectionChange"> |
|||
<el-table-column width="50px" type="selection" align="center"/> |
|||
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center"/> |
|||
<el-table-column prop="goodsSpuName" label="商品名称" align="center" /> |
|||
<el-table-column prop="goodsSkuCode" label="图号" align="center" /> |
|||
<el-table-column prop="indexes" label="规格" align="center" /> |
|||
<el-table-column prop="goodsUnitName" label="单位" align="center" /> |
|||
<el-table-column prop="manufacturerName" label="供应商" align="center" /> |
|||
</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 { chooseproducts } from '@/api/Common/dictcommons' |
|||
|
|||
export default { |
|||
name: 'SelectVehicle', |
|||
components: { |
|||
Pagination |
|||
}, |
|||
data() { |
|||
return { |
|||
isSearchShow: false, |
|||
searchxianshitit: '隐藏查询条件', |
|||
tableKey: 0, |
|||
sids: [], |
|||
list: [], |
|||
number: '', |
|||
listLoading: false, |
|||
listQuery: { |
|||
current: 1, |
|||
size: 5, |
|||
params: { |
|||
createOrgSid: '', |
|||
goodsSpuName: '', |
|||
goodsSkuCode: '', |
|||
manufacturerName: '' |
|||
}, |
|||
total: 0 |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
// 搜索条件效果 |
|||
clicksearchShow() { |
|||
this.isSearchShow = !this.isSearchShow |
|||
if (this.isSearchShow) { |
|||
this.searchxianshitit = '隐藏查询条件' |
|||
} else { |
|||
this.searchxianshitit = '显示查询条件' |
|||
} |
|||
}, |
|||
indexMethod(index) { |
|||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
// 查询列表信息 |
|||
getList() { |
|||
this.listLoading = true |
|||
chooseproducts(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() |
|||
}, |
|||
// 重置按钮 |
|||
handleReset() { |
|||
this.listQuery.current = 1 |
|||
this.listQuery.size = 5 |
|||
this.listQuery.total = 0 |
|||
this.listQuery.params.goodsSpuName = '' |
|||
this.listQuery.params.goodsSkuCode = '' |
|||
this.listQuery.params.manufacturerName = '' |
|||
this.getList() |
|||
}, |
|||
handleSelectionChange(row) { |
|||
this.sids = row |
|||
}, |
|||
showData(value, createOrgSid) { |
|||
// const aa = [] |
|||
// if (value.length > 0) { |
|||
// for (var i = 0; i < value.length; i++) { |
|||
// aa.push(value[i].saleVehSid) |
|||
// } |
|||
// this.listQuery.params.saleVehSids = aa |
|||
// } else { |
|||
// this.listQuery.params.saleVehSids = [] |
|||
// }`` |
|||
this.listQuery.params.createOrgSid = createOrgSid |
|||
this.listQuery.current = 1 |
|||
this.listQuery.size = 5 |
|||
this.listQuery.total = 0 |
|||
this.getList() |
|||
}, |
|||
// 添加修改返回 |
|||
AddUpdateReturn() { |
|||
if (this.sids.length > 0) { |
|||
this.$emit('backData', this.sids) |
|||
} else { |
|||
this.$notify({ title: '提示', message: '请至少选择一条记录进行操作', type: 'error', duration: 2000 }) |
|||
} |
|||
}, |
|||
// 返回 |
|||
handleReturn() { |
|||
this.$emit('doback') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
</style> |
@ -0,0 +1,578 @@ |
|||
<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="8"> |
|||
<div class="span-sty">采购类型</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchaseTypeValue }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">采购原因</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchaseReasonValue }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">付款方式</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.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">{{ formobj.supplierName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">是否需要发票</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchaseBillInvoice.isInvoicing == '1' ? '是' : '否' }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div v-show="formobj.purchaseBillInvoice.isInvoicing == '1'"> |
|||
<div class="span-sty">发票类型(税率)</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchaseBillInvoice.billType }}({{ formobj.purchaseBillInvoice.taxRate }})</span></el-form-item> |
|||
</div> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row v-show="formobj.payTypeValue == '预付款'"> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">预付款情况</div> |
|||
<el-form-item><span class="addinputInfo">当前预付款项金额:{{ formobj.prepaymentAmount }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row v-show="formobj.payTypeValue == '月结'"> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">月结欠款情况</div> |
|||
<el-form-item><span class="addinputInfo">累计欠款金额:{{ formobj.owedAmount }}</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 v-if="formobj.payTypeValue == '单笔付款'"> |
|||
<div class="title">订金及付款申请</div> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">是否先付货款</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchasePay.isFirstPay == '1' ? '是' : '否' }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8" v-if="formobj.purchasePay.isFirstPay == '0'"> |
|||
<div class="span-sty">审批通过后付订金</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchasePay.deposit }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8" v-if="formobj.purchasePay.isFirstPay == '0'"> |
|||
<div class="span-sty">验货后付货款</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchasePay.goodsMoney }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="16" v-else> |
|||
<div class="span-sty">审批通过后付货款</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchasePay.goodsMoney }}</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">{{ formobj.purchasePay.accountName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">开户行</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchasePay.bankName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">银行账号</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchasePay.bankAccount }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="16"> |
|||
<div class="span-sty">其他费用名称</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchasePay.otherAmountName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">其他费用合计</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchasePay.otherAmount }}</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.purchasePay.payRemark }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">附件</div> |
|||
<el-form-item><el-image class="addinputInfo" style="width: 150px;height: 150px" v-for="(item, index) in formobj.purchasePay.filePaths" :key="index" :src="item" :preview-src-list="formobj.purchasePay.filePaths" /></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</div> |
|||
<div class="title ">商品列表</div> |
|||
<el-table :key="tableKey" :data="formobj.pmsPurchaseBillDetailList" :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" min-width="100" /> |
|||
<el-table-column prop="taxPrice" v-if="formobj.purchaseBillInvoice.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> |
|||
<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">{{ yfTotal }} = 采购金额:{{ cgTotal }} + 运费:{{ formobj.freight }} - 优惠:{{ formobj.discountAmount }} + 误差调整:{{ formobj.errorAmount }}</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/procurement' |
|||
|
|||
export default { |
|||
name: 'ProcurementDaiBan', |
|||
data() { |
|||
return { |
|||
viewTitle: '', |
|||
viewState: 1, |
|||
tableKey: 1, |
|||
index: 0, |
|||
formobj: { |
|||
sid: '', |
|||
remarks: '', |
|||
createBySid: '', |
|||
createByName: '', |
|||
createTime: '', |
|||
sourceBillSid: '', |
|||
sourceBillNo: '', |
|||
billNo: '', |
|||
purchaseTypeKey: '', |
|||
purchaseTypeValue: '', |
|||
purchaseReasonKey: '', |
|||
purchaseReasonValue: '', |
|||
payTypeKey: '', |
|||
payTypeValue: '', |
|||
errorAmount: '', |
|||
supplierSid: '', |
|||
supplierName: '', |
|||
supplierPhone: '', |
|||
purchaserSid: '', |
|||
purchaserName: '', |
|||
deliveryDate: '', |
|||
freight: '', |
|||
discountAmount: '', |
|||
payableAmount: '', |
|||
prepaymentAmount: '', |
|||
owedAmount: '', |
|||
deptSid: '', |
|||
deptName: '', |
|||
procDefId: '', |
|||
nodeId: '', |
|||
procInstId: '', |
|||
nodeState: '', |
|||
taskId: '', |
|||
finishTime: '', |
|||
useOrgSid: '', |
|||
useOrgName: '', |
|||
createOrgSid: '', |
|||
createOrgName: '', |
|||
purchasePay: { |
|||
sid: '', |
|||
billSid: '', |
|||
isFirstPay: '', |
|||
deposit: '', |
|||
goodsMoney: '', |
|||
accountName: '', |
|||
bankName: '', |
|||
bankAccount: '', |
|||
otherAmountName: '', |
|||
otherAmount: '', |
|||
payRemark: '', |
|||
filePaths: [] |
|||
}, |
|||
purchaseBillInvoice: { |
|||
billSid: '', |
|||
isInvoicing: '', |
|||
billTypeKey: '', |
|||
billType: '', |
|||
taxRate: '' |
|||
}, |
|||
pmsPurchaseBillDetailList: [] |
|||
}, |
|||
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.pmsPurchaseBillDetailList.length > 0) { |
|||
this.formobj.pmsPurchaseBillDetailList.forEach((e) => { |
|||
if (e.goodsSpuName !== '') { |
|||
sl = Math.round((parseFloat(sl) + parseFloat(e.count !== '' ? e.count : '0')) * 100) / 100 |
|||
} |
|||
}) |
|||
} |
|||
return sl |
|||
}, |
|||
// 采购金额 |
|||
cgTotal() { |
|||
let cg = '0' |
|||
if (this.formobj.pmsPurchaseBillDetailList.length > 0) { |
|||
this.formobj.pmsPurchaseBillDetailList.forEach((e) => { |
|||
if (e.goodsSpuName !== '') { |
|||
cg = Math.round((parseFloat(cg) + parseFloat(e.amount !== '' ? e.amount : '0')) * 100) / 100 |
|||
} |
|||
}) |
|||
} |
|||
return cg |
|||
}, |
|||
yfTotal() { |
|||
let yf = '0' |
|||
yf = Math.round((parseFloat(yf) + parseFloat(this.cgTotal) + parseFloat(this.formobj.freight !== '' ? this.formobj.freight : '0') - parseFloat(this.formobj.discountAmount !== '' ? this.formobj.discountAmount : '0') + parseFloat(this.formobj.errorAmount !== '' ? this.formobj.errorAmount : '0')) * 100) / 100 |
|||
return yf |
|||
} |
|||
}, |
|||
methods: { |
|||
showInfo(sid) { |
|||
this.viewTitle = '采购单详情' |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
req.fetchDetailsBySid(sid).then((res) => { |
|||
if (res.success) { |
|||
this.formobj = res.data |
|||
if (this.formobj.purchasePay.filePaths.length > 0) { |
|||
const aa = [] |
|||
this.formobj.purchasePay.filePaths.forEach((e) => { |
|||
aa.push(e.url) |
|||
}) |
|||
this.formobj.purchasePay.filePaths = aa |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
// 加签 |
|||
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,586 @@ |
|||
<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="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="8"> |
|||
<div class="span-sty">采购类型</div> |
|||
<el-form-item> |
|||
<el-select class="addinputInfo" v-model="formobj.purchaseTypeValue" placeholder="请选择" @change="purchaseTypeChange" clearable filterable> |
|||
<el-option v-for="item in procurementType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">采购原因</div> |
|||
<el-form-item> |
|||
<el-select class="addinputInfo" v-model="formobj.purchaseReasonValue" placeholder="请选择" @change="purchaseReasonChange" clearable filterable> |
|||
<el-option v-for="item in procurementReason_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">付款方式</div> |
|||
<el-form-item> |
|||
<el-select class="addinputInfo" v-model="formobj.payTypeValue" placeholder="请选择" @change="payTypeChange" clearable filterable> |
|||
<el-option v-for="item in paymentMethod_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">供应商</div> |
|||
<el-form-item> |
|||
<el-select class="addinputInfo" v-model="formobj.supplierSid" placeholder="请选择" @change="supplierChange" clearable filterable> |
|||
<el-option v-for="item in supplier_list" :key="item.sid" :label="item.supplierName" :value="item.sid"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">是否需要发票</div> |
|||
<el-form-item> |
|||
<el-radio-group class="addinputInfo" style="font-size: 1px" @change="isInvoicingChange" v-model="formobj.purchaseBillInvoice.isInvoicing"> |
|||
<el-radio label="1">是</el-radio> |
|||
<el-radio label="0">否</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div v-show="formobj.purchaseBillInvoice.isInvoicing == '1'"> |
|||
<div class="span-sty">发票类型(税率)</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchaseBillInvoice.billType }}({{ formobj.purchaseBillInvoice.taxRate }})</span></el-form-item> |
|||
</div> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row v-show="formobj.payTypeValue == '预付款'"> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">预付款情况</div> |
|||
<el-form-item><span class="addinputInfo">当前预付款项金额:<el-input style="width: 30%" @keyup.native="formobj.prepaymentAmount = getNumber(formobj.prepaymentAmount, 2)" v-model="formobj.prepaymentAmount" clearable placeholder="" /></span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row v-show="formobj.payTypeValue == '月结'"> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">月结欠款情况</div> |
|||
<el-form-item><span class="addinputInfo">累计欠款金额:<el-input style="width: 30%" @keyup.native="formobj.owedAmount = getNumber(formobj.owedAmount, 2)" v-model="formobj.owedAmount" clearable placeholder="" /></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 addinputw" v-model="formobj.remarks" clearable placeholder=""/></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div v-if="formobj.payTypeValue == '单笔付款'"> |
|||
<div class="title">订金及付款申请</div> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">是否先付货款</div> |
|||
<el-form-item> |
|||
<el-radio-group class="addinputInfo" style="font-size: 1px" v-model="formobj.purchasePay.isFirstPay"> |
|||
<el-radio label="1">是</el-radio> |
|||
<el-radio label="0">否</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8" v-if="formobj.purchasePay.isFirstPay == '0'"> |
|||
<div class="span-sty">审批通过后付订金</div> |
|||
<el-form-item> |
|||
<el-input class="addinputInfo addinputw" @keyup.native="formobj.purchasePay.deposit = getNumber(formobj.purchasePay.deposit, 2)" v-model="formobj.purchasePay.deposit" clearable placeholder=""/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8" v-if="formobj.purchasePay.isFirstPay == '0'"> |
|||
<div class="span-sty">验货后付货款</div> |
|||
<el-form-item> |
|||
<el-input class="addinputInfo addinputw" @keyup.native="formobj.purchasePay.goodsMoney = getNumber(formobj.purchasePay.goodsMoney, 2)" v-model="formobj.purchasePay.goodsMoney" clearable placeholder=""/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="16" v-else> |
|||
<div class="span-sty">审批通过后付货款</div> |
|||
<el-form-item> |
|||
<el-input class="addinputInfo addinputw" @keyup.native="formobj.purchasePay.goodsMoney = getNumber(formobj.purchasePay.goodsMoney, 2)" v-model="formobj.purchasePay.goodsMoney" clearable placeholder=""/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">收款账户名称</div> |
|||
<el-form-item> |
|||
<el-select class="addinputInfo" v-model="formobj.purchasePay.accountName" placeholder="请选择" @change="accountChange" clearable filterable> |
|||
<el-option v-for="item in account_list" :key="item.bankAccount" :label="item.accountName" :value="item.accountName"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">开户行</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchasePay.bankName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">银行账号</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchasePay.bankAccount }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="16"> |
|||
<div class="span-sty">其他费用名称</div> |
|||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.purchasePay.otherAmountName" clearable placeholder=""/></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">其他费用合计</div> |
|||
<el-form-item><el-input class="addinputInfo addinputw" @keyup.native="formobj.purchasePay.otherAmount = getNumber(formobj.purchasePay.otherAmount, 2)" v-model="formobj.purchasePay.otherAmount" clearable placeholder=""/></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 addinputw" v-model="formobj.purchasePay.payRemark" clearable placeholder=""/></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">附件</div> |
|||
<el-form-item> |
|||
<upload-img ref="uploadImg" class="addinputInfo" :accept="accept" v-model="formobj.purchasePay.filePaths" :limit="50" bucket="map" :upload-data="{ type: '0001' }"/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</div> |
|||
<div class="title titleOne"> |
|||
<div>商品列表</div> |
|||
<el-button type="primary" size="mini" class="btntopblueline" @click="selectProducts">选择商品</el-button> |
|||
</div> |
|||
<el-table :key="tableKey" :data="formobj.pmsPurchaseBillDetailList" :index="index" border style="width: 100%"> |
|||
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/> |
|||
<el-table-column fixed label="操作" align="center" width="100"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="danger" size="small" @click="commodityDelete(scope.$index)">删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
<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 label="采购数量" align="center" min-width="100"> |
|||
<template slot-scope="scope"> |
|||
<el-input @input="amountInput(scope.row)" @keyup.native="scope.row.count = getNumber(scope.row.count, 2)" v-model="scope.row.count" clearable placeholder="" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column v-if="formobj.purchaseBillInvoice.isInvoicing == '1'" label="含税单价" align="center" min-width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-input @input="amountInput(scope.row)" @keyup.native="scope.row.taxPrice = getNumber(scope.row.taxPrice, 2)" v-model="scope.row.taxPrice" clearable placeholder="" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column v-else label="不含税单价" align="center" min-width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-input @input="amountInput(scope.row)" @keyup.native="scope.row.taxPrice = getNumber(scope.row.taxPrice, 2)" v-model="scope.row.taxPrice" clearable placeholder="" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="amount" 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">{{ yfTotal }} = 采购金额:{{ cgTotal }} + 运费:<el-input @keyup.native="formobj.freight = getNumber(formobj.freight, 2)" v-model="formobj.freight" style="width: 160px" clearable placeholder="" /> - 优惠:<el-input @keyup.native="formobj.discountAmount = getNumber(formobj.discountAmount, 2)" v-model="formobj.discountAmount" style="width: 160px" clearable placeholder="" /> + 误差调整:<el-input @keyup.native="formobj.errorAmount = getNumber(formobj.errorAmount, 2)" v-model="formobj.errorAmount" style="width: 160px" clearable placeholder="" /></span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
<!-- 选择商品 --> |
|||
<chooseproducts v-show="viewState == 2" ref="divSp" @backData="backData" @doback="resetState" /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/purchase/procurement' |
|||
import { typeValues, getOrgSidByPath, choiceSupplierInfo } from '@/api/Common/dictcommons' |
|||
import chooseproducts from './relation/chooseproducts' |
|||
import uploadImg from '@/components/uploadFile/uploadImg' |
|||
|
|||
export default { |
|||
name: 'ProcurementEdit', |
|||
components: { |
|||
chooseproducts, |
|||
uploadImg |
|||
}, |
|||
data() { |
|||
return { |
|||
viewTitle: '', |
|||
viewState: 1, |
|||
submitdisabled: false, |
|||
tableKey: 1, |
|||
index: 0, |
|||
accept: '.jpg,.jpeg,.png', |
|||
procurementType_list: [], |
|||
procurementReason_list: [], |
|||
paymentMethod_list: [], |
|||
supplier_list: [], |
|||
account_list: [], |
|||
formobj: { |
|||
sid: '', |
|||
remarks: '', |
|||
createBySid: '', |
|||
createByName: '', |
|||
createTime: '', |
|||
sourceBillSid: '', |
|||
sourceBillNo: '', |
|||
billNo: '', |
|||
purchaseTypeKey: '', |
|||
purchaseTypeValue: '', |
|||
purchaseReasonKey: '', |
|||
purchaseReasonValue: '', |
|||
payTypeKey: '', |
|||
payTypeValue: '', |
|||
errorAmount: '', |
|||
supplierSid: '', |
|||
supplierName: '', |
|||
supplierPhone: '', |
|||
purchaserSid: '', |
|||
purchaserName: '', |
|||
deliveryDate: '', |
|||
freight: '', |
|||
discountAmount: '', |
|||
payableAmount: '', |
|||
prepaymentAmount: '', |
|||
owedAmount: '', |
|||
deptSid: '', |
|||
deptName: '', |
|||
procDefId: '', |
|||
nodeId: '', |
|||
procInstId: '', |
|||
nodeState: '', |
|||
taskId: '', |
|||
finishTime: '', |
|||
useOrgSid: '', |
|||
useOrgName: '', |
|||
createOrgSid: '', |
|||
createOrgName: '', |
|||
purchasePay: { |
|||
sid: '', |
|||
billSid: '', |
|||
isFirstPay: '', |
|||
deposit: '', |
|||
goodsMoney: '', |
|||
accountName: '', |
|||
bankName: '', |
|||
bankAccount: '', |
|||
otherAmountName: '', |
|||
otherAmount: '', |
|||
payRemark: '', |
|||
filePaths: [] |
|||
}, |
|||
purchaseBillInvoice: { |
|||
billSid: '', |
|||
isInvoicing: '', |
|||
billTypeKey: '', |
|||
billType: '', |
|||
taxRate: '' |
|||
}, |
|||
pmsPurchaseBillDetailList: [] |
|||
}, |
|||
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.pmsPurchaseBillDetailList.length > 0) { |
|||
this.formobj.pmsPurchaseBillDetailList.forEach((e) => { |
|||
if (e.goodsSpuName !== '') { |
|||
sl = Math.round((parseFloat(sl) + parseFloat(e.count !== '' ? e.count : '0')) * 100) / 100 |
|||
} |
|||
}) |
|||
} |
|||
return sl |
|||
}, |
|||
// 采购金额 |
|||
cgTotal() { |
|||
let cg = '0' |
|||
if (this.formobj.pmsPurchaseBillDetailList.length > 0) { |
|||
this.formobj.pmsPurchaseBillDetailList.forEach((e) => { |
|||
if (e.goodsSpuName !== '') { |
|||
cg = Math.round((parseFloat(cg) + parseFloat(e.amount !== '' ? e.amount : '0')) * 100) / 100 |
|||
} |
|||
}) |
|||
} |
|||
return cg |
|||
}, |
|||
yfTotal() { |
|||
let yf = '0' |
|||
yf = Math.round((parseFloat(yf) + parseFloat(this.cgTotal) + parseFloat(this.formobj.freight !== '' ? this.formobj.freight : '0') - parseFloat(this.formobj.discountAmount !== '' ? this.formobj.discountAmount : '0') + parseFloat(this.formobj.errorAmount !== '' ? this.formobj.errorAmount : '0')) * 100) / 100 |
|||
return yf |
|||
} |
|||
}, |
|||
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 |
|||
} |
|||
}) |
|||
}, |
|||
showInfo(sid) { |
|||
this.viewTitle = '【编辑】采购单' |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
this.init() |
|||
req.fetchDetailsBySid(sid).then((res) => { |
|||
if (res.success) { |
|||
this.formobj = res.data |
|||
this.formobj.instanceId = res.data.procInstId |
|||
choiceSupplierInfo({ orgSid: this.formobj.createOrgSid }).then((resp) => { |
|||
if (resp.success) { |
|||
this.supplier_list = resp.data |
|||
} |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
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 |
|||
}, |
|||
purchaseTypeChange(value) { |
|||
const choose = this.procurementType_list.filter((item) => item.dictValue === value) |
|||
if (choose !== null && choose.length > 0) { |
|||
this.formobj.purchaseTypeKey = choose[0].dictKey |
|||
} else { |
|||
this.formobj.purchaseTypeKey = '' |
|||
} |
|||
}, |
|||
purchaseReasonChange(value) { |
|||
const choose = this.procurementReason_list.filter((item) => item.dictValue === value) |
|||
if (choose !== null && choose.length > 0) { |
|||
this.formobj.purchaseReasonKey = choose[0].dictKey |
|||
} else { |
|||
this.formobj.purchaseReasonKey = '' |
|||
} |
|||
}, |
|||
payTypeChange(value) { |
|||
const choose = this.paymentMethod_list.filter((item) => item.dictValue === value) |
|||
if (choose !== null && choose.length > 0) { |
|||
this.formobj.payTypeKey = choose[0].dictKey |
|||
} else { |
|||
this.formobj.payTypeKey = '' |
|||
} |
|||
}, |
|||
supplierChange(value) { |
|||
const choose = this.supplier_list.filter((item) => item.sid === value) |
|||
if (choose !== null && choose.length > 0) { |
|||
this.formobj.supplierName = choose[0].supplierName |
|||
this.account_list = choose[0].supplierBankChoices |
|||
} else { |
|||
this.formobj.supplierName = '' |
|||
this.account_list = [] |
|||
} |
|||
}, |
|||
isInvoicingChange(val) { |
|||
if (val === '1') { |
|||
const choose = this.supplier_list.filter((item) => item.sid === this.formobj.supplierSid) |
|||
if (choose !== null && choose.length > 0) { |
|||
this.formobj.purchaseBillInvoice.billType = choose[0].billingTypeValue |
|||
this.formobj.purchaseBillInvoice.billTypeKey = choose[0].billingTypeKey |
|||
this.formobj.purchaseBillInvoice.taxRate = choose[0].taxRate |
|||
} |
|||
} else { |
|||
this.formobj.purchaseBillInvoice.billType = '' |
|||
this.formobj.purchaseBillInvoice.billTypeKey = '' |
|||
this.formobj.purchaseBillInvoice.taxRate = '' |
|||
} |
|||
}, |
|||
accountChange(value) { |
|||
const choose = this.account_list.filter((item) => item.accountName === value) |
|||
if (choose !== null && choose.length > 0) { |
|||
this.formobj.purchasePay.bankAccount = choose[0].bankAccount |
|||
this.formobj.purchasePay.bankName = choose[0].bankName |
|||
} else { |
|||
this.formobj.purchasePay.bankAccount = '' |
|||
this.formobj.purchasePay.bankName = '' |
|||
} |
|||
}, |
|||
selectProducts() { |
|||
this.viewState = 2 |
|||
const aa = [] |
|||
this.$refs['divSp'].showData(aa, this.formobj.createOrgSid) |
|||
}, |
|||
backData(value) { |
|||
this.viewState = 1 |
|||
if (value.length > 0) { |
|||
value.forEach((e) => { |
|||
this.formobj.pmsPurchaseBillDetailList.push({ |
|||
sid: '', |
|||
billSid: '', |
|||
goodSpuSid: e.goodsSpuSid, |
|||
goodsSpuName: e.goodsSpuName, |
|||
goodsSkuSid: e.goodsSkuSid, |
|||
goodsSkuTitle: '', |
|||
goodsSkuCode: e.goodsSkuCode, |
|||
goodsSkuOwnSpec: e.indexes, |
|||
unit: e.goodsUnitName, |
|||
warehouseSid: '', |
|||
warehouseName: '', |
|||
cost: '', |
|||
count: '', |
|||
taxAmount: '', |
|||
taxPrice: '', |
|||
amount: '' |
|||
}) |
|||
}) |
|||
} |
|||
}, |
|||
resetState() { |
|||
this.viewState = 1 |
|||
}, |
|||
commodityDelete(index) { |
|||
this.formobj.pmsPurchaseBillDetailList.splice(index, 1) |
|||
}, |
|||
// 计算采购金额 |
|||
amountInput(row) { |
|||
if (row.goodsSpuName !== '') { |
|||
row.amount = Math.round((parseFloat(row.taxPrice !== '' ? row.taxPrice : '0') * parseFloat(row.count !== '' ? row.count : '0')) * 100) / 100 |
|||
} |
|||
}, |
|||
saveOrUpdate() { |
|||
this.$refs['form_obj'].validate((valid) => { |
|||
if (valid) { |
|||
this.submitdisabled = true |
|||
this.formobj.payableAmount = this.yfTotal |
|||
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.payableAmount = this.yfTotal |
|||
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,370 @@ |
|||
<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="8"> |
|||
<div class="span-sty">采购类型</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchaseTypeValue }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">采购原因</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchaseReasonValue }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">付款方式</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.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">{{ formobj.supplierName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">是否需要发票</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchaseBillInvoice.isInvoicing == '1' ? '是' : '否' }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div v-show="formobj.purchaseBillInvoice.isInvoicing == '1'"> |
|||
<div class="span-sty">发票类型(税率)</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchaseBillInvoice.billType }}({{ formobj.purchaseBillInvoice.taxRate }})</span></el-form-item> |
|||
</div> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row v-show="formobj.payTypeValue == '预付款'"> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">预付款情况</div> |
|||
<el-form-item><span class="addinputInfo">当前预付款项金额:{{ formobj.prepaymentAmount }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row v-show="formobj.payTypeValue == '月结'"> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">月结欠款情况</div> |
|||
<el-form-item><span class="addinputInfo">累计欠款金额:{{ formobj.owedAmount }}</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 v-if="formobj.payTypeValue == '单笔付款'"> |
|||
<div class="title">订金及付款申请</div> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">是否先付货款</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchasePay.isFirstPay == '1' ? '是' : '否' }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8" v-if="formobj.purchasePay.isFirstPay == '0'"> |
|||
<div class="span-sty">审批通过后付订金</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchasePay.deposit }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8" v-if="formobj.purchasePay.isFirstPay == '0'"> |
|||
<div class="span-sty">验货后付货款</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchasePay.goodsMoney }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="16" v-else> |
|||
<div class="span-sty">审批通过后付货款</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchasePay.goodsMoney }}</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">{{ formobj.purchasePay.accountName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">开户行</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchasePay.bankName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">银行账号</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchasePay.bankAccount }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="16"> |
|||
<div class="span-sty">其他费用名称</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchasePay.otherAmountName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">其他费用合计</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchasePay.otherAmount }}</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.purchasePay.payRemark }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">附件</div> |
|||
<el-form-item><el-image class="addinputInfo" style="width: 150px;height: 150px" v-for="(item, index) in formobj.purchasePay.filePaths" :key="index" :src="item" :preview-src-list="formobj.purchasePay.filePaths" /></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</div> |
|||
<div class="title ">商品列表</div> |
|||
<el-table :key="tableKey" :data="formobj.pmsPurchaseBillDetailList" :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" min-width="100" /> |
|||
<el-table-column prop="taxPrice" v-if="formobj.purchaseBillInvoice.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> |
|||
<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">{{ yfTotal }} = 采购金额:{{ cgTotal }} + 运费:{{ formobj.freight }} - 优惠:{{ formobj.discountAmount }} + 误差调整:{{ formobj.errorAmount }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/purchase/procurement' |
|||
|
|||
export default { |
|||
name: 'ProcurementYiBan', |
|||
data() { |
|||
return { |
|||
viewTitle: '', |
|||
viewState: 1, |
|||
tableKey: 1, |
|||
index: 0, |
|||
formobj: { |
|||
sid: '', |
|||
remarks: '', |
|||
createBySid: '', |
|||
createByName: '', |
|||
createTime: '', |
|||
sourceBillSid: '', |
|||
sourceBillNo: '', |
|||
billNo: '', |
|||
purchaseTypeKey: '', |
|||
purchaseTypeValue: '', |
|||
purchaseReasonKey: '', |
|||
purchaseReasonValue: '', |
|||
payTypeKey: '', |
|||
payTypeValue: '', |
|||
errorAmount: '', |
|||
supplierSid: '', |
|||
supplierName: '', |
|||
supplierPhone: '', |
|||
purchaserSid: '', |
|||
purchaserName: '', |
|||
deliveryDate: '', |
|||
freight: '', |
|||
discountAmount: '', |
|||
payableAmount: '', |
|||
prepaymentAmount: '', |
|||
owedAmount: '', |
|||
deptSid: '', |
|||
deptName: '', |
|||
procDefId: '', |
|||
nodeId: '', |
|||
procInstId: '', |
|||
nodeState: '', |
|||
taskId: '', |
|||
finishTime: '', |
|||
useOrgSid: '', |
|||
useOrgName: '', |
|||
createOrgSid: '', |
|||
createOrgName: '', |
|||
purchasePay: { |
|||
sid: '', |
|||
billSid: '', |
|||
isFirstPay: '', |
|||
deposit: '', |
|||
goodsMoney: '', |
|||
accountName: '', |
|||
bankName: '', |
|||
bankAccount: '', |
|||
otherAmountName: '', |
|||
otherAmount: '', |
|||
payRemark: '', |
|||
filePaths: [] |
|||
}, |
|||
purchaseBillInvoice: { |
|||
billSid: '', |
|||
isInvoicing: '', |
|||
billTypeKey: '', |
|||
billType: '', |
|||
taxRate: '' |
|||
}, |
|||
pmsPurchaseBillDetailList: [] |
|||
}, |
|||
// 环节所需参数 |
|||
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.pmsPurchaseBillDetailList.length > 0) { |
|||
this.formobj.pmsPurchaseBillDetailList.forEach((e) => { |
|||
if (e.goodsSpuName !== '') { |
|||
sl = Math.round((parseFloat(sl) + parseFloat(e.count !== '' ? e.count : '0')) * 100) / 100 |
|||
} |
|||
}) |
|||
} |
|||
return sl |
|||
}, |
|||
// 采购金额 |
|||
cgTotal() { |
|||
let cg = '0' |
|||
if (this.formobj.pmsPurchaseBillDetailList.length > 0) { |
|||
this.formobj.pmsPurchaseBillDetailList.forEach((e) => { |
|||
if (e.goodsSpuName !== '') { |
|||
cg = Math.round((parseFloat(cg) + parseFloat(e.amount !== '' ? e.amount : '0')) * 100) / 100 |
|||
} |
|||
}) |
|||
} |
|||
return cg |
|||
}, |
|||
yfTotal() { |
|||
let yf = '0' |
|||
yf = Math.round((parseFloat(yf) + parseFloat(this.cgTotal) + parseFloat(this.formobj.freight !== '' ? this.formobj.freight : '0') - parseFloat(this.formobj.discountAmount !== '' ? this.formobj.discountAmount : '0') + parseFloat(this.formobj.errorAmount !== '' ? this.formobj.errorAmount : '0')) * 100) / 100 |
|||
return yf |
|||
} |
|||
}, |
|||
methods: { |
|||
showInfo(sid) { |
|||
this.viewTitle = '采购单详情' |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
req.fetchDetailsBySid(sid).then((res) => { |
|||
if (res.success) { |
|||
this.formobj = res.data |
|||
if (this.formobj.purchasePay.filePaths.length > 0) { |
|||
const aa = [] |
|||
this.formobj.purchasePay.filePaths.forEach((e) => { |
|||
aa.push(e.url) |
|||
}) |
|||
this.formobj.purchasePay.filePaths = aa |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
/** 确认撤回任务 */ |
|||
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,164 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div> |
|||
<div class="tab-header webtop"> |
|||
<div>选择商品</div> |
|||
<div> |
|||
<el-button type="primary" size="small" @click="AddUpdateReturn">确定</el-button> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
</div> |
|||
<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" label-width="120px" class="tab-header"> |
|||
<el-form-item label="商品名称" class="searchlist"> |
|||
<el-input v-model="listQuery.params.goodsSpuName" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="图号" class="searchlist"> |
|||
<el-input v-model="listQuery.params.goodsSkuCode" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="供应商" class="searchlist"> |
|||
<el-input v-model="listQuery.params.manufacturerName" placeholder="" clearable /> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="btn" style="text-align: center;"> |
|||
<el-button type="primary" icon="el-icon-search" @click="handleFilter" size="small">查询</el-button> |
|||
<el-button type="primary" icon="el-icon-refresh" @click="handleReset" size="small">重置</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="listtop"> |
|||
<div class="tit">商品列表</div> |
|||
<!-- <pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>--> |
|||
</div> |
|||
<div class=""> |
|||
<el-table :key="tableKey" ref="multipleTable" v-loading="listLoading" :data="list" border style="width: 100%" @selection-change="handleSelectionChange"> |
|||
<el-table-column width="50px" type="selection" align="center"/> |
|||
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center"/> |
|||
<el-table-column prop="goodsSpuName" label="商品名称" align="center" /> |
|||
<el-table-column prop="goodsSkuCode" label="图号" align="center" /> |
|||
<el-table-column prop="indexes" label="规格" align="center" /> |
|||
<el-table-column prop="goodsUnitName" label="单位" align="center" /> |
|||
<el-table-column prop="manufacturerName" label="供应商" align="center" /> |
|||
</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 { chooseproducts } from '@/api/Common/dictcommons' |
|||
|
|||
export default { |
|||
name: 'SelectVehicle', |
|||
components: { |
|||
Pagination |
|||
}, |
|||
data() { |
|||
return { |
|||
isSearchShow: false, |
|||
searchxianshitit: '隐藏查询条件', |
|||
tableKey: 0, |
|||
sids: [], |
|||
list: [], |
|||
number: '', |
|||
listLoading: false, |
|||
listQuery: { |
|||
current: 1, |
|||
size: 5, |
|||
params: { |
|||
createOrgSid: '', |
|||
goodsSpuName: '', |
|||
goodsSkuCode: '', |
|||
manufacturerName: '' |
|||
}, |
|||
total: 0 |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
// 搜索条件效果 |
|||
clicksearchShow() { |
|||
this.isSearchShow = !this.isSearchShow |
|||
if (this.isSearchShow) { |
|||
this.searchxianshitit = '隐藏查询条件' |
|||
} else { |
|||
this.searchxianshitit = '显示查询条件' |
|||
} |
|||
}, |
|||
indexMethod(index) { |
|||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
// 查询列表信息 |
|||
getList() { |
|||
this.listLoading = true |
|||
chooseproducts(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() |
|||
}, |
|||
// 重置按钮 |
|||
handleReset() { |
|||
this.listQuery.current = 1 |
|||
this.listQuery.size = 5 |
|||
this.listQuery.total = 0 |
|||
this.listQuery.params.goodsSpuName = '' |
|||
this.listQuery.params.goodsSkuCode = '' |
|||
this.listQuery.params.manufacturerName = '' |
|||
this.getList() |
|||
}, |
|||
handleSelectionChange(row) { |
|||
this.sids = row |
|||
}, |
|||
showData(value, createOrgSid) { |
|||
// const aa = [] |
|||
// if (value.length > 0) { |
|||
// for (var i = 0; i < value.length; i++) { |
|||
// aa.push(value[i].saleVehSid) |
|||
// } |
|||
// this.listQuery.params.saleVehSids = aa |
|||
// } else { |
|||
// this.listQuery.params.saleVehSids = [] |
|||
// }`` |
|||
this.listQuery.params.createOrgSid = createOrgSid |
|||
this.listQuery.current = 1 |
|||
this.listQuery.size = 5 |
|||
this.listQuery.total = 0 |
|||
this.getList() |
|||
}, |
|||
// 添加修改返回 |
|||
AddUpdateReturn() { |
|||
if (this.sids.length > 0) { |
|||
this.$emit('backData', this.sids) |
|||
} else { |
|||
this.$notify({ title: '提示', message: '请至少选择一条记录进行操作', type: 'error', duration: 2000 }) |
|||
} |
|||
}, |
|||
// 返回 |
|||
handleReturn() { |
|||
this.$emit('doback') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
</style> |
Loading…
Reference in new issue