|
@@ -6,6 +6,12 @@
|
|
|
@click="backToList">返回列表
|
|
|
</el-button>
|
|
|
</div>
|
|
|
+ <el-button type="primary"
|
|
|
+ class="el-button--small-yh add-customer-btn-three"
|
|
|
+ :disabled="!form.id"
|
|
|
+ @click.stop="confirmGoods">
|
|
|
+ {{goodsDisable ? "撤回发货":"确认发货"}}
|
|
|
+ </el-button>
|
|
|
<el-button type="success"
|
|
|
class="el-button--small-yh add-customer-btn-two"
|
|
|
:disabled="true"
|
|
@@ -14,7 +20,7 @@
|
|
|
<el-button
|
|
|
class="el-button--small-yh add-customer-btn"
|
|
|
type="primary"
|
|
|
- :disabled="disabled"
|
|
|
+ :disabled="disabled || goodsDisable"
|
|
|
@click="editCustomer"
|
|
|
>{{ form.id ? '确认修改' : '确认新增' }}
|
|
|
</el-button>
|
|
@@ -26,15 +32,18 @@
|
|
|
<el-row>
|
|
|
<el-col v-for="(item,index) in basicData.column" :key="index" :span="item.span?item.span:8">
|
|
|
<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"/>
|
|
|
+ <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" :disabled="item.disabled?true:false || goodsDisable" 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-input type="age" v-else v-model="form[item.prop]" :disabled="item.disabled?true:false" placeholder="请输入" size="small" autocomplete="off"></el-input>
|
|
|
+ <el-select v-else-if="item.prop === 'storageId'" style="width: 100%" :disabled="item.disabled?true:false || goodsDisable" 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')" :disabled="item.disabled?true:false || goodsDisable" v-model="form[item.prop]" size="small" autocomplete="off" placeholder="请输入"></el-input>
|
|
|
+ <el-input type="age" v-else v-model="form[item.prop]" :disabled="item.disabled?true:false || goodsDisable" placeholder="请输入" size="small" autocomplete="off"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</basic-container>
|
|
|
- <containerTitle title="收货明细"></containerTitle>
|
|
|
+ <containerTitle title="发货明细"></containerTitle>
|
|
|
<basic-container style="margin-bottom: 10px">
|
|
|
<avue-crud
|
|
|
:option="customerContact"
|
|
@@ -46,6 +55,65 @@
|
|
|
@row-update="rowUpdate"
|
|
|
@row-del="rowDel"
|
|
|
>
|
|
|
+ <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="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" :disabled="goodsDisable" style="float: right" @click="choice(row)">选择</el-button>
|
|
|
+ </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="price" slot-scope="{ row }">
|
|
|
<el-input
|
|
|
v-if="row.$cellEdit"
|
|
@@ -68,14 +136,11 @@
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.actualQuantity }}</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>
|
|
|
- </template>
|
|
|
<template slot-scope="{row,index}" slot="menu">
|
|
|
<el-button
|
|
|
type="text"
|
|
|
size="small"
|
|
|
+ :disabled="goodsDisable"
|
|
|
@click="rowCell(row,index)"
|
|
|
>{{ row.$cellEdit ? '保存' : '修改' }}
|
|
|
</el-button>
|
|
@@ -84,6 +149,7 @@
|
|
|
<el-button type="primary"
|
|
|
icon="el-icon-plus"
|
|
|
size="small"
|
|
|
+ :disabled="goodsDisable"
|
|
|
@click="commoditySelection"
|
|
|
>新增
|
|
|
</el-button>
|
|
@@ -151,13 +217,17 @@
|
|
|
import customerContact from "./config/customerContact.json"
|
|
|
import {detailInvoiceList,
|
|
|
submitInvoiceList,
|
|
|
- removeGoodsItem,} from "@/api/importTrade/invoice"
|
|
|
+ removeGoodsItem,
|
|
|
+ confirmGoods,
|
|
|
+ cancelGoods
|
|
|
+} from "@/api/importTrade/invoice"
|
|
|
import {getDeptLazyTree } from "@/api/basicData/basicFeesDesc";
|
|
|
import commodity from "./config/commodity.json"
|
|
|
import {corpsbank, getList} from "@/api/basicData/deliveryNotice"
|
|
|
import upLoadOption from "../../exportTrade/purchaseContract/config/uploadList.json";
|
|
|
-import {getSysNo} from "@/api/importTrade/purchase";
|
|
|
import { contrastObj,contrastList } from "@/util/contrastData";
|
|
|
+import {getStorage} from "@/api/importTrade/receipt"
|
|
|
+import { getOrgOrderNo } from "@/api/importTrade/salesContract"
|
|
|
|
|
|
export default {
|
|
|
name: "detailsPageEdit",
|
|
@@ -170,9 +240,12 @@ export default {
|
|
|
return {
|
|
|
form: {},
|
|
|
disabled: false,
|
|
|
+ goodsDisable:false,
|
|
|
customerContact: customerContact,
|
|
|
contactsForm: {},
|
|
|
contactsData: [],
|
|
|
+ storageIdDic:[],
|
|
|
+ contractDic:[],
|
|
|
selectKind:-1,
|
|
|
configuration:{
|
|
|
multipleChoices:false,
|
|
@@ -183,15 +256,6 @@ export default {
|
|
|
placeholder:'请点击右边按钮选择',
|
|
|
dicData:[]
|
|
|
},
|
|
|
- sConfiguration:{
|
|
|
- multipleChoices:false,
|
|
|
- multiple:false,
|
|
|
- disabled:false,
|
|
|
- searchShow:true,
|
|
|
- collapseTags:false,
|
|
|
- placeholder:'请点击右边按钮选择',
|
|
|
- dicData:[]
|
|
|
- },
|
|
|
basicData: {
|
|
|
column: [
|
|
|
{
|
|
@@ -199,8 +263,9 @@ export default {
|
|
|
prop: 'sysNo',
|
|
|
disabled:true,
|
|
|
}, {
|
|
|
- label: '合同号',
|
|
|
- prop: 'orderNo',
|
|
|
+ label: '客户名称',
|
|
|
+ prop: 'corpId',
|
|
|
+ type:'component',
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -209,32 +274,19 @@ export default {
|
|
|
}
|
|
|
]
|
|
|
}, {
|
|
|
- label: '发货日期',
|
|
|
- prop: 'businessDate',
|
|
|
- type:'datetime',
|
|
|
- rules: [
|
|
|
- {
|
|
|
- required: false,
|
|
|
- message: ' ',
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
- ]
|
|
|
- }, {
|
|
|
- label: '业务员',
|
|
|
- prop: 'saleman',
|
|
|
- dicData: [],
|
|
|
+ label: '仓库名称',
|
|
|
+ prop: 'storageId',
|
|
|
rules: [
|
|
|
{
|
|
|
- required: false,
|
|
|
+ required: true,
|
|
|
message: ' ',
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
}, {
|
|
|
- label: '销售公司',
|
|
|
- prop: 'salesCompany',
|
|
|
- type:'component',
|
|
|
- dicData: [],
|
|
|
+ label: '发货日期',
|
|
|
+ prop: 'businessDate',
|
|
|
+ type:'datetime',
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -243,9 +295,8 @@ export default {
|
|
|
}
|
|
|
]
|
|
|
}, {
|
|
|
- label: '工厂/贸易商名称',
|
|
|
- prop: 'corpId',
|
|
|
- type:'component',
|
|
|
+ label: '业务员',
|
|
|
+ prop: 'saleman',
|
|
|
dicData: [],
|
|
|
rules: [
|
|
|
{
|
|
@@ -254,10 +305,10 @@ export default {
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
- }, {
|
|
|
- label: '仓库名称',
|
|
|
- prop: 'storageId',
|
|
|
- dicData: [],
|
|
|
+ }, {
|
|
|
+ label: '发票重量',
|
|
|
+ prop: 'invoiceWeight',
|
|
|
+ disabled: true,
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -265,9 +316,10 @@ export default {
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
- }, {
|
|
|
- label: '发票重量',
|
|
|
- prop: 'invoiceWeight',
|
|
|
+ },{
|
|
|
+ label: '码单重量',
|
|
|
+ prop: 'billWeight',
|
|
|
+ disabled: true,
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -275,7 +327,7 @@ export default {
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
- }, {
|
|
|
+ },{
|
|
|
label: '备注',
|
|
|
prop: 'deliveryRemarks',
|
|
|
span: 24,
|
|
@@ -332,13 +384,16 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ getStorage().then(res =>{
|
|
|
+ this.storageIdDic = res.data
|
|
|
+ })
|
|
|
if (this.detailData.id) {
|
|
|
let id = this.detailData.id.replace(/\"/g, "")
|
|
|
detailInvoiceList(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
|
|
|
+ this.goodsDisable = res.data.data.deliveryStatus === "已发货" ? true :false
|
|
|
+ // this.configuration.dicData = this.form.companyName
|
|
|
if(this.form.deliveryItemsList){
|
|
|
this.contactsData = this.form.deliveryItemsList
|
|
|
this.oldContactsData = this.deepClone(this.form.deliveryItemsList)
|
|
@@ -348,25 +403,51 @@ export default {
|
|
|
this.oldUpLoadData = this.deepClone(this.form.deliveryFilesList)
|
|
|
}
|
|
|
})
|
|
|
- }else {
|
|
|
- getSysNo("JK-FH").then(res => {
|
|
|
- this.$set(this.form, "sysNo", res.data.data)
|
|
|
- })
|
|
|
}
|
|
|
if (this.detailData.form) {
|
|
|
this.form = JSON.parse(this.detailData.form);
|
|
|
this.form.id = null
|
|
|
+ this.form.sysNo = null
|
|
|
this.form.orderItemsList.forEach(item =>{
|
|
|
+ item.srcId = item.id
|
|
|
+ item.contractNumber = item.orgOrderNo
|
|
|
+ item.contractAmount = item.amount
|
|
|
+ delete item.actualQuantity
|
|
|
delete item.id
|
|
|
})
|
|
|
this.contactsData = this.form.orderItemsList
|
|
|
delete this.form.orderItemsList
|
|
|
- getSysNo("JK-FH").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;
|
|
|
+ row.contractNumber = res.data[0].orderNo
|
|
|
+ }
|
|
|
+ }).catch(()=>{
|
|
|
+ row.contractNumber = ''
|
|
|
+ })
|
|
|
+ },
|
|
|
//单价
|
|
|
priceChange(row) {
|
|
|
if (!row.price) {
|
|
@@ -444,6 +525,49 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ confirmGoods(){
|
|
|
+ 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{
|
|
|
+ if(!this.goodsDisable){
|
|
|
+ this.$confirm("是否确认发货?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(()=>{
|
|
|
+ this.form.deliveryItemsList = this.contactsData;
|
|
|
+ confirmGoods(this.form).then(res =>{
|
|
|
+ if(res.data.success){
|
|
|
+ this.$message.success("发货成功!")
|
|
|
+ this.goodsDisable = res.data.data.deliveryStatus === "已发货" ? true :false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$confirm("是否撤回发货?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(()=>{
|
|
|
+ this.form.deliveryItemsList = this.contactsData;
|
|
|
+ cancelGoods(this.form).then(res =>{
|
|
|
+ if(res.data.success){
|
|
|
+ this.$message.success("撤销成功!")
|
|
|
+ this.goodsDisable = res.data.data.deliveryStatus === "已发货" ? true :false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
//修改提交触发
|
|
|
editCustomer(status) {
|
|
|
this.$refs["form"].validate((valid) => {
|
|
@@ -466,8 +590,8 @@ export default {
|
|
|
detailInvoiceList(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
|
|
|
+ this.goodsDisable = res.data.data.deliveryStatus === "已发货" ? true :false
|
|
|
+ // this.configuration.dicData = this.form.companyName
|
|
|
if(this.form.deliveryItemsList){
|
|
|
this.contactsData = this.form.deliveryItemsList
|
|
|
this.oldContactsData = this.deepClone(this.form.deliveryItemsList)
|
|
@@ -551,7 +675,6 @@ export default {
|
|
|
},
|
|
|
//确认导入触发
|
|
|
importGoods() {
|
|
|
- // this.contactsData = this.contactsData.concat(this.tableData)
|
|
|
if (this.tableData.length > 0) {
|
|
|
for (let item in this.tableData) {
|
|
|
const params = {
|
|
@@ -665,4 +788,12 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.add-customer-btn-three {
|
|
|
+ position: fixed;
|
|
|
+ right: 266px;
|
|
|
+ top: 115px;
|
|
|
+}
|
|
|
+::v-deep .el-form-item__content{
|
|
|
+ line-height: 32px;
|
|
|
+}
|
|
|
</style>
|