|
@@ -6,6 +6,11 @@
|
|
|
@click="backToList">返回列表
|
|
|
</el-button>
|
|
|
</div>
|
|
|
+ <el-button type="primary"
|
|
|
+ class="el-button--small-yh add-customer-btn-three"
|
|
|
+ :disabled="!form.id"
|
|
|
+ @click.stop="confirmReceipt">确认收货
|
|
|
+ </el-button>
|
|
|
<el-button type="success"
|
|
|
class="el-button--small-yh add-customer-btn-two"
|
|
|
:disabled="true"
|
|
@@ -28,7 +33,9 @@
|
|
|
<el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
|
|
|
<el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" size="small" type="date" placeholder="请选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
|
|
|
<selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :configuration="configuration"/>
|
|
|
- <selectComponent v-else-if="item.prop === 'salesCompany'" v-model="form[item.prop]" :configuration="sConfiguration"/>
|
|
|
+ <el-select v-else-if="item.prop === 'storageId'" style="width: 100%" v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
|
|
|
+ <el-option v-for="(item,index) in storageIdDic" :key="index" :label="item.cname" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
<el-input type="textarea" v-else-if="(item.prop === 'deliveryRemarks')" v-model="form[item.prop]" size="small" autocomplete="off" placeholder="请输入"></el-input>
|
|
|
<el-input v-else v-model="form[item.prop]" size="small" :disabled="item.disabled?true:false" placeholder="请输入" autocomplete="off"></el-input>
|
|
|
</el-form-item>
|
|
@@ -69,6 +76,61 @@
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.actualQuantity }}</span>
|
|
|
</template>
|
|
|
+ <template slot-scope="{row}" slot="billNo">
|
|
|
+ <span v-if="row.$cellEdit" style="float: left;color: #F56C6C;">*</span>
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.billNo"
|
|
|
+ style="width: 90%"
|
|
|
+ placeholder=" "
|
|
|
+ size="small"
|
|
|
+ @change="bingOut(row)"
|
|
|
+ ></el-input>
|
|
|
+ <span v-else>{{ row.billNo }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{row}" slot="contractNumber">
|
|
|
+ <span v-if="row.$cellEdit" style="float: left;color: #F56C6C;">*</span>
|
|
|
+ <el-select
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ style="width:90%"
|
|
|
+ v-model="row.contractNumber"
|
|
|
+ placeholder=" "
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ style="width:90%"
|
|
|
+ v-for="(item,index) in contractDic"
|
|
|
+ :key="index"
|
|
|
+ :label="item.orderNo"
|
|
|
+ :value="item.orderNo"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ <span v-else>{{ row.contractNumber }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="invoiceWeight" slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.invoiceWeight"
|
|
|
+ placeholder="请输入"
|
|
|
+ size="small"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d\d\d\d\d).*$/, "$1.$2")'
|
|
|
+ @input="totalChange(row.invoiceWeight)"
|
|
|
+ ></el-input>
|
|
|
+ <span v-else>{{ row.invoiceWeight }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="billWeight" slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.billWeight"
|
|
|
+ placeholder="请输入"
|
|
|
+ size="small"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d\d\d\d\d).*$/, "$1.$2")'
|
|
|
+ @input="totalChange(row.billWeight)"
|
|
|
+ ></el-input>
|
|
|
+ <span v-else>{{ row.billWeight }}</span>
|
|
|
+ </template>
|
|
|
<template slot="priceCategory" slot-scope="{row,index}">
|
|
|
<span style="margin-left: 12px;padding-top: 2px">{{ row.priceCategoryNames }}</span>
|
|
|
<el-button v-if="row.$cellEdit" type="text" size="mini" style="float: right" @click="choice(row)">选择</el-button>
|
|
@@ -140,11 +202,26 @@
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="commodityConfirm" v-if="selectKind != -1" :disabled="tableData.length !== 1">确定</el-button>
|
|
|
- <el-button type="primary" @click="importGoods" v-if="commodityData !== true && selectKind == -1" :disabled="tableData.length !== 1" >导入</el-button>
|
|
|
- <el-button type="primary" @click="importChoice" v-if="commodityData === true && selectKind == -1"
|
|
|
- :disabled="tableData.length !== 1">导入</el-button>
|
|
|
+<!-- <el-button type="primary" @click="importGoods" v-if="commodityData !== true && selectKind == -1" :disabled="tableData.length !== 1" >导入</el-button>-->
|
|
|
+<!-- <el-button type="primary" @click="importChoice" v-if="commodityData === true && selectKind == -1"-->
|
|
|
+<!-- :disabled="tableData.length !== 1">导入</el-button>-->
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ title="导入采购"
|
|
|
+ append-to-body
|
|
|
+ class="el-dialogDeep"
|
|
|
+ :visible.sync="procurementDialog"
|
|
|
+ width="60%"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ :close-on-press-escape="false">
|
|
|
+ <procurement-detail
|
|
|
+ :status="132"
|
|
|
+ :closeFun="procurementClose"
|
|
|
+ >
|
|
|
+ </procurement-detail>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -155,13 +232,19 @@ import {getSysNo} from "@/api/importTrade/purchase";
|
|
|
import {getDeptLazyTree, customerList} from "@/api/basicData/basicFeesDesc";
|
|
|
import {detailReceiptList,
|
|
|
submitReceiptList,
|
|
|
- removeGoodsItem,} from "@/api/importTrade/receipt"
|
|
|
+ removeGoodsItem,
|
|
|
+ getStorage,
|
|
|
+ getInventory,
|
|
|
+ confirmReceipt
|
|
|
+} from "@/api/importTrade/receipt"
|
|
|
import {
|
|
|
getList
|
|
|
} from "@/api/basicData/deliveryNotice"
|
|
|
import upLoadOption from "../../exportTrade/purchaseContract/config/uploadList.json";
|
|
|
import {detailListData } from "@/api/importTrade/purchase";
|
|
|
import { contrastObj,contrastList } from "@/util/contrastData";
|
|
|
+import { getOrgOrderNo } from "@/api/importTrade/salesContract"
|
|
|
+import { procurementDetail } from "@/components/procurement/procurementDetail";
|
|
|
|
|
|
export default {
|
|
|
name: "detailsPageEdit",
|
|
@@ -170,6 +253,9 @@ export default {
|
|
|
type: Object
|
|
|
}
|
|
|
},
|
|
|
+ components:{
|
|
|
+ procurementDetail
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
form: {},
|
|
@@ -177,6 +263,7 @@ export default {
|
|
|
customerContact: customerContact,
|
|
|
contactsForm: {},
|
|
|
contactsData: [],
|
|
|
+ contractDic:[],
|
|
|
selectKind:-1,
|
|
|
configuration:{
|
|
|
multipleChoices:false,
|
|
@@ -187,15 +274,6 @@ export default {
|
|
|
placeholder:'请点击右边按钮选择',
|
|
|
dicData:[]
|
|
|
},
|
|
|
- sConfiguration:{
|
|
|
- multipleChoices:false,
|
|
|
- multiple:false,
|
|
|
- disabled:false,
|
|
|
- searchShow:true,
|
|
|
- collapseTags:false,
|
|
|
- placeholder:'请点击右边按钮选择',
|
|
|
- dicData:[]
|
|
|
- },
|
|
|
basicData: {
|
|
|
column: [
|
|
|
{
|
|
@@ -204,7 +282,7 @@ export default {
|
|
|
disabled:true,
|
|
|
rules: [
|
|
|
{
|
|
|
- required: true,
|
|
|
+ required: false,
|
|
|
message: ' ',
|
|
|
trigger: 'blur'
|
|
|
}
|
|
@@ -214,7 +292,7 @@ export default {
|
|
|
prop: 'orderNo',
|
|
|
rules: [
|
|
|
{
|
|
|
- required: true,
|
|
|
+ required: false,
|
|
|
message: ' ',
|
|
|
trigger: 'blur'
|
|
|
}
|
|
@@ -230,29 +308,31 @@ export default {
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
- }, {
|
|
|
- label: '销售公司',
|
|
|
- prop: 'salesCompany',
|
|
|
+ }, {
|
|
|
+ label: '供应商',
|
|
|
+ prop: 'corpId',
|
|
|
dicData: [],
|
|
|
rules: [
|
|
|
{
|
|
|
- required: false,
|
|
|
+ required: true,
|
|
|
message: ' ',
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
- }, {
|
|
|
- label: '工厂/贸易商名称',
|
|
|
- prop: 'corpId',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '仓库名称',
|
|
|
+ type:'select',
|
|
|
+ prop: 'storageId',
|
|
|
dicData: [],
|
|
|
rules: [
|
|
|
{
|
|
|
- required: false,
|
|
|
+ required: true,
|
|
|
message: ' ',
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
- }, {
|
|
|
+ },{
|
|
|
label: '收货日期',
|
|
|
prop: 'businessDate',
|
|
|
type:'datetime',
|
|
@@ -263,10 +343,10 @@ export default {
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
- },{
|
|
|
- label: '仓库名称',
|
|
|
- prop: 'storageId',
|
|
|
- dicData: [],
|
|
|
+ }, {
|
|
|
+ label: '发票重量',
|
|
|
+ prop: 'invoiceWeight',
|
|
|
+ disabled: true,
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -274,9 +354,11 @@ export default {
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
- }, {
|
|
|
- label: '发票重量',
|
|
|
- prop: 'invoiceWeight',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '码单重量',
|
|
|
+ prop: 'billWeight',
|
|
|
+ disabled: true,
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -284,7 +366,8 @@ export default {
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
- }, {
|
|
|
+ },
|
|
|
+ {
|
|
|
label: '备注',
|
|
|
prop: 'deliveryRemarks',
|
|
|
span: 24,
|
|
@@ -297,6 +380,7 @@ export default {
|
|
|
//上传文件
|
|
|
upLoadOption: upLoadOption,
|
|
|
upLoadData:[],
|
|
|
+ storageIdDic:[],
|
|
|
upLoadForm:{},
|
|
|
dialogVisible: false,
|
|
|
treeOption: {
|
|
@@ -334,6 +418,8 @@ export default {
|
|
|
},
|
|
|
commodityData: false,
|
|
|
tableData: [],
|
|
|
+ //
|
|
|
+ procurementDialog:false,
|
|
|
//新旧数据对比
|
|
|
oldForm:{},
|
|
|
oldContactsData:[],
|
|
@@ -341,13 +427,17 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ getStorage().then(res =>{
|
|
|
+ this.storageIdDic = res.data
|
|
|
+ })
|
|
|
if (this.detailData.id) {
|
|
|
let id = this.detailData.id.replace(/\"/g, "")
|
|
|
detailReceiptList(id).then(res => {
|
|
|
this.form = res.data.data;
|
|
|
this.oldForm = Object.assign({},res.data.data);
|
|
|
- this.configuration.dicData = this.form.companyName
|
|
|
- this.sConfiguration.dicData = this.form.salesCompanyNameList
|
|
|
+ if(this.form.companyName){
|
|
|
+ this.configuration.dicData = this.form.companyName
|
|
|
+ }
|
|
|
if(this.form.deliveryItemsList){
|
|
|
this.contactsData = this.form.deliveryItemsList
|
|
|
this.oldContactsData = this.deepClone(this.form.deliveryItemsList)
|
|
@@ -357,17 +447,22 @@ export default {
|
|
|
this.oldUpLoadData = this.deepClone(this.form.deliveryFilesList)
|
|
|
}
|
|
|
})
|
|
|
- }else{
|
|
|
- getSysNo("JK-SH").then(res =>{
|
|
|
- this.$set(this.form,"sysNo", res.data.data)
|
|
|
- })
|
|
|
}
|
|
|
+ // else{
|
|
|
+ // getSysNo("JK-SH").then(res =>{
|
|
|
+ // this.$set(this.form,"sysNo", res.data.data)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
if(this.detailData.params){
|
|
|
detailListData(this.detailData.params.id).then(res =>{
|
|
|
- this.form.orderNo = res.data.data.orderNo;
|
|
|
+ // this.form.orderNo = res.data.data.orderNo;
|
|
|
+ // this.form.saleman = res.data.data.salesName;
|
|
|
+ // this.configuration.dicData = res.data.data.corpsName
|
|
|
+ // this.form.corpId = res.data.data.corpsName[0].cname
|
|
|
res.data.data.itemsVOList.forEach((item,index) =>{
|
|
|
this.detailData.params.orderItemIds.forEach((e,i) =>{
|
|
|
if(e == index){
|
|
|
+ item.srcId = item.id;
|
|
|
item.contractNumber = res.data.data.orderNo;
|
|
|
item.actualQuantity = item.purchaseQuantity;
|
|
|
item.contractAmount = item.amount;
|
|
@@ -377,14 +472,35 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
- res.data.data.orderNo = this.form.orderNo
|
|
|
- })
|
|
|
- getSysNo("JK-SH").then(res =>{
|
|
|
- this.$set(this.form,"sysNo", res.data.data)
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ //合计
|
|
|
+ totalChange(){
|
|
|
+ let invoiceList = this.contactsData.map(item => {
|
|
|
+ if(!item.invoiceWeight){
|
|
|
+ item.invoiceWeight = 0
|
|
|
+ }
|
|
|
+ return parseFloat(item.invoiceWeight);
|
|
|
+ });
|
|
|
+ let billList = this.contactsData.map(item => {
|
|
|
+ if(!item.billWeight){
|
|
|
+ item.billWeight = 0
|
|
|
+ }
|
|
|
+ return parseFloat(item.billWeight);
|
|
|
+ });
|
|
|
+ this.form.invoiceWeight = invoiceList.reduce((n,m) => n + m)
|
|
|
+ this.form.billWeight = billList.reduce((n,m) => n + m)
|
|
|
+ },
|
|
|
+ //提单号带出合同号
|
|
|
+ bingOut(row){
|
|
|
+ getOrgOrderNo(row.billNo).then(res =>{
|
|
|
+ if(res.data){
|
|
|
+ this.contractDic = res.data;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
//单价
|
|
|
priceChange(row) {
|
|
|
if (!row.price) {
|
|
@@ -463,10 +579,11 @@ export default {
|
|
|
};
|
|
|
submitReceiptList(submitDto).then(res => {
|
|
|
if(res.data.success){
|
|
|
- this.$message.success("操作成功!")
|
|
|
+ this.$message.success("保存成功!")
|
|
|
detailReceiptList(res.data.data.id).then(res => {
|
|
|
this.form = res.data.data;
|
|
|
this.oldForm = Object.assign({},res.data.data);
|
|
|
+
|
|
|
this.configuration.dicData = this.form.companyName
|
|
|
this.sConfiguration.dicData = this.form.salesCompanyNameList
|
|
|
if(this.form.deliveryItemsList){
|
|
@@ -488,6 +605,30 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ //确认收货
|
|
|
+ confirmReceipt(){
|
|
|
+ if(contrastObj(this.form,this.oldForm) || contrastList(this.contactsData,this.oldContactsData)
|
|
|
+ || contrastList(this.upLoadData,this.oldUpLoadData)
|
|
|
+ ){
|
|
|
+ this.$confirm("请先保存在进行收货?", {
|
|
|
+ confirmButtonText: "保存",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(()=>{
|
|
|
+ this.editCustomer()
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$confirm("是否确认全部收货?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(()=>{
|
|
|
+ this.form.deliveryItemsList = this.contactsData;
|
|
|
+ confirmReceipt(this.form).then(res =>{
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
//上传文件保存
|
|
|
upLoadSave(row, done, loading){
|
|
|
this.upLoadData.push(row)
|
|
@@ -531,10 +672,19 @@ export default {
|
|
|
//选择货品
|
|
|
commodityConfirm(){
|
|
|
if(this.tableData){
|
|
|
- this.importInventoryData[this.selectKind].priceCategory = this.tableData[0].id;
|
|
|
- this.$set(this.importInventoryData[this.selectKind],'priceCategoryNames',this.tableData[0].cname)
|
|
|
+ this.contactsData[this.selectKind].priceCategory = this.tableData[0].id;
|
|
|
+ this.contactsData[this.selectKind].itemDescription = this.tableData[0].cnameDescription;
|
|
|
+ this.$set(this.contactsData[this.selectKind],'priceCategoryNames',this.tableData[0].cname)
|
|
|
+ // let params = {
|
|
|
+ // corpId : this.form.corpId,
|
|
|
+ // storageId: this.form.storageId,
|
|
|
+ // goodId: this.contactsData[this.selectKind].priceCategory,
|
|
|
+ // cntrNo: this.contactsData[this.selectKind].containerNo ,
|
|
|
+ // billNo: this.contactsData[this.selectKind].billNo ,
|
|
|
+ // contractNumber: this.contactsData[this.selectKind].contractNumber,
|
|
|
+ // }
|
|
|
this.dialogVisible = !this.dialogVisible
|
|
|
- this.selectKind = -1
|
|
|
+ this.selectKind = -1;
|
|
|
}
|
|
|
},
|
|
|
//点击商品明细选择触发
|
|
@@ -545,8 +695,10 @@ export default {
|
|
|
},
|
|
|
//商品新增触发
|
|
|
commoditySelection() {
|
|
|
- this.dialogVisible = !this.dialogVisible
|
|
|
- this.commodityData = false
|
|
|
+ this.procurementDialog = true;
|
|
|
+ // this.$refs.crudContact.rowCellAdd();
|
|
|
+ // this.dialogVisible = !this.dialogVisible
|
|
|
+ // this.commodityData = false
|
|
|
},
|
|
|
//导入页左商品类型查询
|
|
|
nodeClick(data) {
|
|
@@ -670,6 +822,12 @@ export default {
|
|
|
top: 115px;
|
|
|
}
|
|
|
|
|
|
+.add-customer-btn-three {
|
|
|
+ position: fixed;
|
|
|
+ right: 266px;
|
|
|
+ top: 115px;
|
|
|
+}
|
|
|
+
|
|
|
.el-dialogDeep {
|
|
|
::v-deep .el-dialog {
|
|
|
margin: 1vh auto 0 !important;
|
|
@@ -681,4 +839,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+::v-deep .el-form-item__content{
|
|
|
+ line-height: 32px;
|
|
|
+}
|
|
|
</style>
|