17 changed files with 3391 additions and 1528 deletions
@ -1,8 +1,743 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="viewState == 1"> |
|||
<div class="tab-header webtop"> |
|||
<!-- 标题 --> |
|||
<div>{{title}}采购订单</div> |
|||
<!-- start 添加修改按钮 --> |
|||
<div> |
|||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
<!-- end 添加修改按钮 --> |
|||
<!-- end 详情按钮 --> |
|||
</div> |
|||
|
|||
<div class="listconadd"> |
|||
|
|||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02"> |
|||
<!-- <div class="title"> |
|||
<div>基础信息</div> |
|||
</div> --> |
|||
<el-row class="first_row"> |
|||
|
|||
<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.deptName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">制单日期</div> |
|||
<el-form-item> |
|||
<el-date-picker v-model="formobj.createTime" type="date" class="addinputw addinputInfo" |
|||
value-format="yyyy-MM-dd" placeholder="选择日期"> |
|||
</el-date-picker></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
|
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty"><span class="must">*</span> 供应商</div> |
|||
<el-form-item prop="supplierName"> <el-select v-model="formobj.supplierName" filterable clearable |
|||
placeholder="请选择供应商" class="addinputw addinputInfo" @change="supplierNameSelect"> |
|||
<el-option v-for="item in supplierList" :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"><span class="must">*</span> 收货仓库</div> |
|||
<el-form-item prop="wareHouseName"> |
|||
<el-select v-model="formobj.wareHouseName" placeholder="请选择收货仓库" class="addinputw addinputInfo" |
|||
@change="selectWarehouseName"> |
|||
<el-option v-for="item in warehouseList" :key="item.sid" :label="item.warehouseName" |
|||
:value="item.sid" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty"><span class="must">*</span> 业务员</div> |
|||
<el-form-item prop="purchaserName"> |
|||
<el-select v-model="formobj.purchaserName" filterable clearable placeholder="请选择业务员" |
|||
class="addinputw addinputInfo" @change="allOrgperSelect"> |
|||
<el-option v-for="item in allOrgperList" :key="item.sid" :label="item.name" :value="item.sid"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
|
|||
<el-row> |
|||
<el-col :span="16"> |
|||
<div class="span-sty">银行账号</div> |
|||
<el-form-item prop="bankAccount"> <el-input class="addinputw addinputInfo" |
|||
v-model="formobj.purchaseBillAmount.bankAccount" clearable placeholder="" |
|||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" /></el-form-item> |
|||
|
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">货币类别</div> |
|||
<el-form-item prop="currencyValue"> |
|||
<el-select v-model="formobj.purchaseBillAmount.currencyValue" placeholder="请选择货币类别" |
|||
class="addinputw addinputInfo" @change="selectCurrency"> |
|||
<el-option v-for="(item,i) in currencyTypeList" :key="item.dictKey" :label="item.dictValue" |
|||
:value="item.dictKey" /> |
|||
</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 prop="freight"> <el-input class="addinputw addinputInfo" |
|||
v-model="formobj.purchaseBillAmount.freight" clearable placeholder="" |
|||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">运费分摊方式</div> |
|||
<el-form-item prop="freightShareTypeValue"> |
|||
<el-select v-model="formobj.purchaseBillAmount.freightShareTypeValue" placeholder="请选择分摊方式" |
|||
class="addinputw addinputInfo" @change="selectFreightShareType"> |
|||
<el-option v-for="item in shareTypeList" :key="item.dictKey" :label="item.dictValue" |
|||
:value="item.dictKey" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty"> 结算账户</div> |
|||
<el-form-item prop="settleAccountValue"> |
|||
<el-select v-model="formobj.purchaseBillAmount.settleAccountValue" filterable clearable |
|||
placeholder="请选择结算账户" class="addinputw addinputInfo" @change="selectSettleAccount"> |
|||
<el-option v-for="item in settlementList" :key="item.dictKey" :label="item.dictValue" |
|||
:value="item.dictKey" /> |
|||
</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 prop="otherAmountName"> <el-input class="addinputw addinputInfo" |
|||
v-model="formobj.purchaseBillAmount.otherAmountName" clearable placeholder="" |
|||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /> |
|||
</el-form-item> |
|||
|
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">其他费用分摊方式</div> |
|||
<el-form-item prop="otherShareTypeValue"> |
|||
<el-select v-model="formobj.purchaseBillAmount.otherShareTypeValue" placeholder="请选择分摊方式" |
|||
class="addinputw addinputInfo" @change="selectOtherShareType"> |
|||
<el-option v-for="item in shareTypeList" :key="item.dictKey" :label="item.dictValue" |
|||
:value="item.dictKey" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">预付金额</div> |
|||
<el-form-item prop="prepayment"> <el-input class="addinputw addinputInfo" |
|||
v-model="formobj.purchaseBillAmount.prepayment" clearable placeholder="" |
|||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
|
|||
<el-col :span="24"> |
|||
<div class="span-sty">附件</div> |
|||
<el-form-item prop="imgList"> |
|||
<upload-img ref="uploadImg" class="addinputw" v-model="imgList" :limit="50" bucket="map" |
|||
:upload-data="{ type: '0001' }" @change="backData2" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="span-sty">备注</div> |
|||
<el-form-item> <el-input v-model="formobj.remarks" placeholder="" class="addinputw addinputInfo" |
|||
type="textarea" :rows="4" clearable /></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
|
|||
<div class="title titleOne"> |
|||
<div>商品列表</div> |
|||
<el-button type="primary" size="mini" class="btntopblueline" @click="goodsAdd()">添加</el-button> |
|||
</div> |
|||
<el-table v-loading="listLoading" :data="formobj.purchaseBillDetailList" border style="width: 100%;"> |
|||
<!-- <el-table-column fixed width="50" type="selection" align="center" /> --> |
|||
<el-table-column fixed width="80" label="序号" type="index" :index="indexMethod" align="center" /> |
|||
<el-table-column fixed label="操作" wid align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="primary" size="mini" @click="deleteGoods(scope.row)">删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="商品编码" prop="goodsSkuCode" width="150" align="center" /> |
|||
<el-table-column label="商品名称" prop="goodsSpuName" width="150" align="center" /> |
|||
<el-table-column label="商品规格" prop="goodsSkuOwnSpec" width="150" align="center" /> |
|||
<el-table-column label="单位" prop="unit" width="120" align="center" /> |
|||
<el-table-column label="采购数量" align="center" width="180"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.count" clearable placeholder="" |
|||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" @input="calculation(scope.row)" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="单价" prop="cost" width="120" align="center" /> |
|||
<el-table-column label="折扣率(%)" align="center" width="180"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.discountRate" clearable placeholder="" |
|||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" |
|||
@input="calculation(scope.row)" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="discountPrice" label="折扣单价" width="150" align="center" /> |
|||
<!-- <el-table-column prop="shareAmount" label="分摊金额" width="150" align="center" /> --> |
|||
<el-table-column prop="amount" label="总价" width="120" align="center" /> |
|||
<el-table-column label="预计到货日期" align="center" width="180"> |
|||
<template slot-scope="scope"> |
|||
<el-date-picker v-model="scope.row.deliveryDate" type="date" value-format="yyyy-MM-dd" |
|||
placeholder="选择日期" /> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
</el-form> |
|||
|
|||
</div> |
|||
</div> |
|||
<!-- 选择商品 --> |
|||
<chooseproducts v-show="viewState == 2" ref="divSp" @backData="backData" @doback="resetState" /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/purchase/purchaseOrder.js' |
|||
import chooseproducts from './relation/chooseproducts' |
|||
import { |
|||
getOrgSidByPath, |
|||
choiceSupplierInfo, |
|||
getWarehouses, |
|||
selAllByOrgSidPath, |
|||
typeValues |
|||
} from '@/api/Common/dictcommons' |
|||
import uploadImg from '@/components/uploadFile/uploadImg' |
|||
import { |
|||
getCurrentDate |
|||
} from '@/utils/index.js' |
|||
export default { |
|||
components: { |
|||
chooseproducts, |
|||
uploadImg |
|||
}, |
|||
data() { |
|||
return { |
|||
title: "【新增】", |
|||
viewState: 1, |
|||
listLoading: false, |
|||
submitdisabled: false, |
|||
formobj: { |
|||
"sid": "", |
|||
"remarks": "", |
|||
"createTime": getCurrentDate(), |
|||
"createBySid": window.sessionStorage.getItem('userSid'), |
|||
"createByName": window.sessionStorage.getItem('userName'), |
|||
"sourceBillSid": "", |
|||
"sourceBillNo": "", |
|||
"billNo": "", |
|||
"purchaseTypeKey": "", |
|||
"purchaseTypeValue": "", |
|||
"purchaseReasonKey": "", |
|||
"purchaseReasonValue": "", |
|||
"payTypeKey": "", |
|||
"payTypeValue": "", |
|||
"supplierSid": "", |
|||
"supplierName": "", |
|||
"supplierPhone": "", |
|||
"purchaserSid": "", |
|||
"purchaserName": "", |
|||
"deliveryDate": "", |
|||
"wareHouseSid": "", |
|||
"wareHouseName": "", |
|||
"deptSid": window.sessionStorage.getItem('departmentSid'), |
|||
"deptName": window.sessionStorage.getItem('departmentName'), |
|||
"useOrgSid": window.sessionStorage.getItem('orgSid'), |
|||
"createOrgSid": window.sessionStorage.getItem('orgSid'), |
|||
"orgPath": window.sessionStorage.getItem('orgSid'), |
|||
"purchaseBillAmount": { |
|||
"sid": "", |
|||
"billSid": "", |
|||
"errorAmount": "", |
|||
"discountAmount": "", |
|||
"payableAmount": "", |
|||
"freight": "", |
|||
"freightShareTypeKey": "", |
|||
"freightShareTypeValue": "", |
|||
"otherAmountName": "", |
|||
"otherShareTypeKey": "", |
|||
"otherShareTypeValue": "", |
|||
"settleAccountKey": "", |
|||
"settleAccountValue": "", |
|||
"prepayment": "", |
|||
"paymentTerm": "", |
|||
"bankName": "", |
|||
"bankAccountName": "", |
|||
"bankAccount": "", |
|||
"currencyKey": "", |
|||
"currencyValue": "" |
|||
}, |
|||
"purchaseBillExtend": { |
|||
"sid": "", |
|||
"billSid": "", |
|||
"logisticsNum": "", |
|||
"productProgress": "", |
|||
"receiveStateKey": "", |
|||
"receiveStateValue": "", |
|||
"deliveryStateKey": "", |
|||
"deliveryStateValue": "" |
|||
}, |
|||
"purchaseBillDetailList": [], |
|||
"purchaseAppendixList": [ |
|||
|
|||
] |
|||
}, |
|||
supplierList: [], |
|||
warehouseList: [], |
|||
allOrgperList: [], |
|||
currencyTypeList: [], |
|||
settlementList: [], |
|||
shareTypeList: [], |
|||
rules: { |
|||
createTime: [{ |
|||
required: true, |
|||
message: '请选择日期', |
|||
trigger: 'change' |
|||
}], |
|||
supplierName: [{ |
|||
required: true, |
|||
message: '请选择供应商', |
|||
trigger: 'change' |
|||
}], |
|||
wareHouseName: [{ |
|||
required: true, |
|||
message: '请选择收货仓库', |
|||
trigger: 'change' |
|||
}], |
|||
purchaserName: [{ |
|||
required: true, |
|||
message: '请选择业务员', |
|||
trigger: 'change' |
|||
}], |
|||
|
|||
}, |
|||
imgList: [] |
|||
} |
|||
}, |
|||
created() { |
|||
|
|||
}, |
|||
methods: { |
|||
|
|||
init() { |
|||
|
|||
getOrgSidByPath({ |
|||
orgPath: window.sessionStorage.getItem('defaultOrgPath') |
|||
}).then((res) => { |
|||
if (res.success) { |
|||
this.formobj.createOrgSid = res.data |
|||
this.formobj.useOrgSid = res.data |
|||
} |
|||
}) |
|||
|
|||
// 供应商 |
|||
choiceSupplierInfo({ |
|||
deptSid: window.sessionStorage.getItem('departmentSid') |
|||
}).then((resp) => { |
|||
if (resp.success) { |
|||
this.supplierList = resp.data |
|||
} |
|||
}) |
|||
|
|||
// 仓库 |
|||
getWarehouses({ |
|||
orgPath: window.sessionStorage.getItem('defaultOrgPath'), |
|||
}).then((res) => { |
|||
if (res.success) { |
|||
this.warehouseList = res.data |
|||
} |
|||
}) |
|||
|
|||
// 业务员 |
|||
selAllByOrgSidPath({ |
|||
orgSidPath: window.sessionStorage.getItem('defaultOrgPath') |
|||
}).then((res) => { |
|||
if (res.success) { |
|||
this.allOrgperList = res.data |
|||
} |
|||
}) |
|||
|
|||
// 货币 |
|||
typeValues({ |
|||
type: 'wms_busType' |
|||
}).then((res) => { |
|||
if (res.success) { |
|||
this.currencyTypeList = res.data |
|||
} |
|||
}) |
|||
|
|||
// 结算账户 |
|||
typeValues({ |
|||
type: 'wms_busType' |
|||
}).then((res) => { |
|||
if (res.success) { |
|||
this.settlementList = res.data |
|||
} |
|||
}) |
|||
|
|||
// 分摊方式 |
|||
typeValues({ |
|||
type: 'wms_busType' |
|||
}).then((res) => { |
|||
if (res.success) { |
|||
this.shareTypeList = res.data |
|||
} |
|||
}) |
|||
|
|||
|
|||
|
|||
}, |
|||
|
|||
calculation(row) { |
|||
|
|||
row.discountPrice = (Number(row.cost) * Number(row.discountRate) / 100).toFixed(2) |
|||
row.amount = (Number(row.count) * Number(row.discountPrice)).toFixed(2) |
|||
|
|||
}, |
|||
|
|||
goodsAdd() { |
|||
this.viewState = 2 |
|||
this.$refs['divSp'].showAdd(this.formobj.createOrgSid) |
|||
}, |
|||
deleteGoods(row) { |
|||
console.log("deleteGoods》》》》", row) |
|||
|
|||
this.$confirm("是否确定删除此商品?", '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
const index = this.formobj.purchaseBillDetailList.findIndex((item) => item === row) |
|||
console.log("index》》》》", index) |
|||
this.formobj.purchaseBillDetailList.splice(index, 1) |
|||
|
|||
}) |
|||
}, |
|||
backData2(value) { |
|||
console.log('backData2》》》》', value) |
|||
console.log('imgList', this.imgList) |
|||
|
|||
for (var i = 0; i < this.imgList.length; i++) { |
|||
this.formobj.purchaseAppendixList.push({ |
|||
url: this.imgList[i].url |
|||
}) |
|||
} |
|||
|
|||
|
|||
}, |
|||
backData(value) { |
|||
this.viewState = 1 |
|||
console.log('>>>>>>>>>backData', value) |
|||
|
|||
for (var i = 0; i < value.length; i++) { |
|||
|
|||
this.formobj.purchaseBillDetailList.push( |
|||
|
|||
{ |
|||
|
|||
"sid": "", |
|||
"remarks": "", |
|||
"billSid": "", |
|||
"goodsSpuSid": value[i].sid, |
|||
"goodsSpuName": value[i].goodsName, |
|||
"goodsSkuSid": "", |
|||
"goodsSkuTitle": "", |
|||
"goodsSkuCode": value[i].goodsSkuCode, |
|||
"goodsSN": "", |
|||
"goodsNum": "", |
|||
"goodsSkuOwnSpec": value[i].goodsSkuOwnSpec, |
|||
"unit": value[i].unit, |
|||
"cost": value[i].cost, |
|||
"count": "1", |
|||
"discountRate": value[i].discountRate, |
|||
"discountPrice": "0.00", |
|||
"shareAmount": "0.00", |
|||
"shareRate": "0.00", |
|||
"amount": "0.00", |
|||
"cycle": "", |
|||
"deliveryDate": "", |
|||
"taxAmount": "0.00", |
|||
"taxPrice": "0.00" |
|||
} |
|||
|
|||
) |
|||
|
|||
} |
|||
|
|||
}, |
|||
|
|||
resetState() { |
|||
this.viewState = 1 |
|||
}, |
|||
|
|||
indexMethod(index) { |
|||
return index + 1 |
|||
}, |
|||
saveOrUpdate() { |
|||
console.log('>>>>>>>>>saveOrUpdate', this.formobj) |
|||
|
|||
this.$refs['form_obj'].validate((valid) => { |
|||
if (valid) { |
|||
|
|||
if (this.formobj.purchaseBillDetailList.length == 0) { |
|||
this.$message({ |
|||
showClose: true, |
|||
type: 'warning', |
|||
message: '请添加采购商品' |
|||
}) |
|||
return |
|||
} |
|||
|
|||
for (var i = 0; i < this.formobj.purchaseBillDetailList.length; i++) { |
|||
var item = this.formobj.purchaseBillDetailList[i] |
|||
if (Number(item.count) == 0) { |
|||
this.$message({ |
|||
showClose: true, |
|||
type: 'warning', |
|||
message: '商品采购数量不能为0或空' |
|||
}) |
|||
return |
|||
} |
|||
|
|||
if (Number(item.discountRate) == 0) { |
|||
this.$message({ |
|||
showClose: true, |
|||
type: 'warning', |
|||
message: '商品折扣率不能为0或空' |
|||
}) |
|||
return |
|||
} |
|||
|
|||
} |
|||
|
|||
this.submitdisabled = true |
|||
req.save(this.formobj).then((res) => { |
|||
if (res.success) { |
|||
this.$message({ |
|||
showClose: true, |
|||
type: 'success', |
|||
message: '保存成功' |
|||
}) |
|||
this.handleReturn('true') |
|||
} else { |
|||
this.submitdisabled = false |
|||
} |
|||
}).catch(() => { |
|||
this.submitdisabled = false |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
handleReturn(isreload) { |
|||
if (isreload === 'true') this.$emit('reloadlist') |
|||
this.submitdisabled = false |
|||
this.formobj = { |
|||
"sid": "", |
|||
"remarks": "", |
|||
"createTime": getCurrentDate(), |
|||
"createBySid": window.sessionStorage.getItem('userSid'), |
|||
"createByName": window.sessionStorage.getItem('userName'), |
|||
"sourceBillSid": "", |
|||
"sourceBillNo": "", |
|||
"billNo": "", |
|||
"purchaseTypeKey": "", |
|||
"purchaseTypeValue": "", |
|||
"purchaseReasonKey": "", |
|||
"purchaseReasonValue": "", |
|||
"payTypeKey": "", |
|||
"payTypeValue": "", |
|||
"supplierSid": "", |
|||
"supplierName": "", |
|||
"supplierPhone": "", |
|||
"purchaserSid": "", |
|||
"purchaserName": "", |
|||
"deliveryDate": "", |
|||
"wareHouseSid": "", |
|||
"wareHouseName": "", |
|||
"deptSid": window.sessionStorage.getItem('departmentSid'), |
|||
"deptName": window.sessionStorage.getItem('departmentName'), |
|||
"useOrgSid": '', |
|||
"createOrgSid": '', |
|||
"orgPath": '', |
|||
"purchaseBillAmount": { |
|||
"sid": "", |
|||
"billSid": "", |
|||
"errorAmount": "", |
|||
"discountAmount": "", |
|||
"payableAmount": "", |
|||
"freight": "", |
|||
"freightShareTypeKey": "", |
|||
"freightShareTypeValue": "", |
|||
"otherAmountName": "", |
|||
"otherShareTypeKey": "", |
|||
"otherShareTypeValue": "", |
|||
"settleAccountKey": "", |
|||
"settleAccountValue": "", |
|||
"prepayment": "", |
|||
"paymentTerm": "", |
|||
"bankName": "", |
|||
"bankAccountName": "", |
|||
"bankAccount": "", |
|||
"currencyKey": "", |
|||
"currencyValue": "" |
|||
}, |
|||
"purchaseBillExtend": { |
|||
"sid": "", |
|||
"billSid": "", |
|||
"logisticsNum": "", |
|||
"productProgress": "", |
|||
"receiveStateKey": "", |
|||
"receiveStateValue": "", |
|||
"deliveryStateKey": "", |
|||
"deliveryStateValue": "" |
|||
}, |
|||
"purchaseBillDetailList": [], |
|||
"purchaseAppendixList": [ |
|||
|
|||
] |
|||
} |
|||
this.$emit('doback') |
|||
}, |
|||
|
|||
showAdd() { |
|||
this.init() |
|||
|
|||
this.title = '【新增】' |
|||
|
|||
}, |
|||
showEdit(row) { |
|||
|
|||
this.init() |
|||
|
|||
this.title = '【编辑】' |
|||
|
|||
const loading = this.$loading({ |
|||
lock: true, |
|||
text: 'Loading', |
|||
spinner: 'el-icon-loading', |
|||
background: 'rgba(0, 0, 0, 0.7)' |
|||
}) |
|||
|
|||
req.fetchDetailsBySid(row.sid) |
|||
.then(resp => { |
|||
if (resp.success) { |
|||
this.formobj = resp.data |
|||
loading.close() |
|||
this.imgList = [] |
|||
for (var i = 0; i < resp.data.purchaseAppendixList.length; i++) { |
|||
this.imgList.push({ |
|||
url: resp.data.purchaseAppendixList[i].url |
|||
}) |
|||
} |
|||
|
|||
} |
|||
}) |
|||
.catch(e => { |
|||
loading.close() |
|||
this.formobj = {} |
|||
}) |
|||
}, |
|||
|
|||
supplierNameSelect(val) { |
|||
console.log("supplierNameSelect", val); |
|||
const choose = this.supplierList.filter((item) => item.sid == val) |
|||
console.log('>>>>>>>>>supplierNameSelect', choose) |
|||
this.formobj.supplierName = choose[0].supplierName |
|||
this.formobj.supplierSid = choose[0].sid |
|||
|
|||
}, |
|||
selectWarehouseName(val) { |
|||
|
|||
console.log("selectWarehouseName", val); |
|||
const choose = this.warehouseList.filter((item) => item.sid == val) |
|||
console.log('>>>>>>>>>selectWarehouseName', choose) |
|||
this.formobj.wareHouseName = choose[0].warehouseName |
|||
this.formobj.wareHouseSid = choose[0].sid |
|||
|
|||
|
|||
}, |
|||
allOrgperSelect(val) { |
|||
console.log("allOrgperSelect", val); |
|||
|
|||
const choose = this.allOrgperList.filter((item) => item.sid == val) |
|||
console.log('>>>>>>>>>allOrgperSelect', choose) |
|||
this.formobj.purchaserName = choose[0].name |
|||
this.formobj.purchaserSid = choose[0].sid |
|||
|
|||
}, |
|||
selectCurrency(val) { |
|||
|
|||
}, |
|||
selectFreightShareType(val) { |
|||
|
|||
}, |
|||
selectSettleAccount(val) { |
|||
|
|||
}, |
|||
selectOtherShareType(val) { |
|||
|
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
/deep/ .el-form-item__error { |
|||
margin-left: 120px !important; |
|||
} |
|||
|
|||
.must { |
|||
color: #f00; |
|||
} |
|||
|
|||
.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); |
|||
} |
|||
|
|||
.first_row { |
|||
border-top: 1px solid #E0E3EB; |
|||
} |
|||
|
|||
<style> |
|||
</style> |
|||
.titleOne { |
|||
padding: 7px; |
|||
display: flex; |
|||
flex-direction: row; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
} |
|||
</style> |
|||
|
@ -1,8 +1,225 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="viewState == 1"> |
|||
<div class="tab-header webtop"> |
|||
<!-- 标题 --> |
|||
<div>采购订单详情</div> |
|||
<!-- start 添加修改按钮 --> |
|||
<div> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
<!-- end 添加修改按钮 --> |
|||
<!-- end 详情按钮 --> |
|||
</div> |
|||
|
|||
<div class="listconadd"> |
|||
|
|||
<el-form ref="form_obj" :model="formobj" class="formaddcopy02"> |
|||
<!-- <div class="title"> |
|||
<div>基础信息</div> |
|||
</div> --> |
|||
<el-row class="first_row"> |
|||
|
|||
<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.deptName }}</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"><span class="must">*</span> 供应商</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.supplierName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty"><span class="must">*</span> 收货仓库</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.wareHouseName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty"><span class="must">*</span> 业务员</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchaserName }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
|
|||
<el-row> |
|||
<el-col :span="16"> |
|||
<div class="span-sty"><span class="must">*</span> 银行账号</div> |
|||
<el-form-item><span |
|||
class="addinputInfo">{{ formobj.purchaseBillAmount.bankAccount }}</span></el-form-item> |
|||
|
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty"><span class="must">*</span> 货币类别</div> |
|||
<el-form-item><span |
|||
class="addinputInfo">{{ formobj.purchaseBillAmount.currencyValue }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
|
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty"><span class="must">*</span> 采购运费</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchaseBillAmount.freight }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty"><span class="must">*</span> 运费分摊方式</div> |
|||
<el-form-item><span |
|||
class="addinputInfo">{{ formobj.purchaseBillAmount.freightShareTypeValue }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty"><span class="must">*</span> 结算账户</div> |
|||
<el-form-item><span |
|||
class="addinputInfo">{{ formobj.purchaseBillAmount.settleAccountValue }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
|
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty"><span class="must">*</span> 其他费用</div> |
|||
<el-form-item><span |
|||
class="addinputInfo">{{ formobj.purchaseBillAmount.otherAmountName }}</span></el-form-item> |
|||
|
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty"><span class="must">*</span> 其他费用分摊方式</div> |
|||
<el-form-item><span |
|||
class="addinputInfo">{{ formobj.purchaseBillAmount.otherShareTypeValue }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty"><span class="must">*</span> 预付金额</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.purchaseBillAmount.prepayment }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
|
|||
<el-col :span="24"> |
|||
<div class="span-sty"><span class="must">*</span> 附件</div> |
|||
<el-form-item><el-image class="addinputInfo" style="width: 150px;height: 150px" |
|||
v-for="(item, index) in formobj.purchaseAppendixList" :key="index" :src="item.url" |
|||
:preview-src-list="formobj.purchaseAppendixList" /></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 titleOne"> |
|||
<div>商品列表</div> |
|||
</div> |
|||
<el-table v-loading="listLoading" :data="formobj.purchaseBillDetailList" border style="width: 100%;"> |
|||
<el-table-column fixed width="80" 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="goodsSkuOwnSpec" label="规格型号" align="center" /> |
|||
<el-table-column prop="unit" label="单位" align="center" /> |
|||
<el-table-column prop="count" label="采购数量" align="center" /> |
|||
<el-table-column prop="cost" label="单价" align="center" /> |
|||
<el-table-column prop="discountRate" label="折扣率(%)" align="center" /> |
|||
<el-table-column prop="discountPrice" label="折扣单价" align="center" /> |
|||
<el-table-column prop="shareAmount" label="分摊金额" align="center" /> |
|||
<el-table-column prop="amount" label="总价" align="center" /> |
|||
|
|||
</el-table> |
|||
|
|||
</el-form> |
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/purchase/purchaseOrder.js' |
|||
export default { |
|||
components: {}, |
|||
data() { |
|||
return { |
|||
viewState: 1, |
|||
listLoading: false, |
|||
formobj: { |
|||
|
|||
}, |
|||
} |
|||
}, |
|||
created() { |
|||
|
|||
}, |
|||
methods: { |
|||
|
|||
indexMethod(index) { |
|||
return index + 1 |
|||
}, |
|||
|
|||
showAdd(row) { |
|||
req.fetchDetailsBySid(row.sid).then((resp) => { |
|||
if (resp.success) { |
|||
this.formobj = resp.data |
|||
} else { |
|||
this.$message({ |
|||
type: 'warning', |
|||
message: "数据异常。", |
|||
showClose: true |
|||
}) |
|||
} |
|||
}).catch(() => { |
|||
this.$message({ |
|||
type: 'warning', |
|||
message: "数据异常。", |
|||
showClose: true |
|||
}) |
|||
}) |
|||
|
|||
}, |
|||
handleReturn() { |
|||
this.$emit('doback') |
|||
}, |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
/deep/ .el-form-item__error { |
|||
margin-left: 120px !important; |
|||
} |
|||
|
|||
.must { |
|||
color: #f00; |
|||
} |
|||
|
|||
.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); |
|||
} |
|||
|
|||
.first_row { |
|||
border-top: 1px solid #E0E3EB; |
|||
} |
|||
|
|||
<style> |
|||
</style> |
|||
.titleOne { |
|||
padding: 7px; |
|||
display: flex; |
|||
flex-direction: row; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
} |
|||
</style> |
|||
|
@ -0,0 +1,165 @@ |
|||
<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.goodsName" 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> |
|||
<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="goodsName" label="商品名称" align="center" /> |
|||
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" /> |
|||
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" /> |
|||
<el-table-column prop="unit" label="单位" align="center" /> |
|||
<el-table-column prop="cost" label="单价" align="center" /> |
|||
<el-table-column prop="discountRate" 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 req from '@/api/purchase/purchaseOrder.js' |
|||
export default { |
|||
name: 'SelectVehicle', |
|||
components: { |
|||
Pagination |
|||
}, |
|||
data() { |
|||
return { |
|||
isSearchShow: false, |
|||
searchxianshitit: '隐藏查询条件', |
|||
tableKey: 0, |
|||
sids: [], |
|||
list: [], |
|||
listLoading: false, |
|||
listQuery: { |
|||
current: 1, |
|||
size: 10, |
|||
params: { |
|||
createOrgSid: '', |
|||
goodsName: '', |
|||
goodsSkuCode: '', |
|||
}, |
|||
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 |
|||
req.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 = 10 |
|||
this.listQuery.total = 0 |
|||
this.listQuery.params.goodsName = '' |
|||
this.listQuery.params.goodsSkuCode = '' |
|||
this.getList() |
|||
}, |
|||
handleSelectionChange(row) { |
|||
this.sids = row |
|||
}, |
|||
showAdd(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> |
File diff suppressed because it is too large
Loading…
Reference in new issue