|
@@ -124,7 +124,12 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item v-show="activeName == 'first'">
|
|
<el-form-item v-show="activeName == 'first'">
|
|
<el-button type="primary" @click="openDetails" v-if="!notRoutList.includes('uploadDetails')">
|
|
<el-button type="primary" @click="openDetails" v-if="!notRoutList.includes('uploadDetails')">
|
|
- <i class="el-icon-circle-check"></i>直接修改详单金额
|
|
|
|
|
|
+ <i class="el-icon-circle-check"></i>直接修改单价
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item v-show="activeName == 'first'">
|
|
|
|
+ <el-button type="primary" @click="openDetailsAdd" v-if="!notRoutList.includes('uploadDetails')">
|
|
|
|
+ <i class="el-icon-circle-check"></i>冲红
|
|
</el-button>
|
|
</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<!-- <el-form-item v-if="isShowOperate">
|
|
<!-- <el-form-item v-if="isShowOperate">
|
|
@@ -891,6 +896,33 @@
|
|
>确定</el-button
|
|
>确定</el-button
|
|
>
|
|
>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="冲红"
|
|
|
|
+ :visible.sync="showDetailsAdd"
|
|
|
|
+ >
|
|
|
|
+ <el-form style="margin-left:20%">
|
|
|
|
+ <el-form-item label="冲红金额">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="detailAmount"
|
|
|
|
+ style="width:200px"
|
|
|
|
+ type="number"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="冲红备注">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="detailRemark"
|
|
|
|
+ style="width:200px"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="addTruckDetail"
|
|
|
|
+ :loading="isLoading"
|
|
|
|
+ style="margin-left:40%"
|
|
|
|
+ >确定</el-button
|
|
|
|
+ >
|
|
|
|
+ </el-dialog>
|
|
<el-dialog :visible.sync="dialogVisible" width="80%">
|
|
<el-dialog :visible.sync="dialogVisible" width="80%">
|
|
<img width="100%" :src="dialogImageUrl" alt="" />
|
|
<img width="100%" :src="dialogImageUrl" alt="" />
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -1222,6 +1254,7 @@ export default {
|
|
detailAmount:null,
|
|
detailAmount:null,
|
|
detailsList:[],
|
|
detailsList:[],
|
|
showDetailsUpLoad:false,
|
|
showDetailsUpLoad:false,
|
|
|
|
+ showDetailsAdd:false,
|
|
detailRemark:null,
|
|
detailRemark:null,
|
|
showPhotoPreview:false,
|
|
showPhotoPreview:false,
|
|
previewList:[],
|
|
previewList:[],
|
|
@@ -1639,8 +1672,15 @@ export default {
|
|
if (this.setteldAllselectValue == 1) {
|
|
if (this.setteldAllselectValue == 1) {
|
|
data = this.tableData1
|
|
data = this.tableData1
|
|
} else {
|
|
} else {
|
|
- data = this.$refs.tableRef1.selection
|
|
|
|
|
|
+ let orderList= [];
|
|
|
|
+ this.$refs.tableRef1.selection.forEach((item)=>{
|
|
|
|
+ orderList.push(item.orderId);
|
|
|
|
+ });
|
|
|
|
+ console.log("orderList",orderList);
|
|
|
|
+ console.log("tableData1",this.tableData1);
|
|
|
|
+ data = this.tableData1.filter(item => orderList.indexOf(item.orderId)>=0);
|
|
}
|
|
}
|
|
|
|
+ console.log(data, 'data')
|
|
this.selecteddetailsOrderAmount = data.reduce((prev, item) => {
|
|
this.selecteddetailsOrderAmount = data.reduce((prev, item) => {
|
|
return item.detailsAmount + prev
|
|
return item.detailsAmount + prev
|
|
}, 0)
|
|
}, 0)
|
|
@@ -1735,9 +1775,6 @@ export default {
|
|
if (!this.detailAmount || !this.detailRemark) {
|
|
if (!this.detailAmount || !this.detailRemark) {
|
|
this.$message.warning('请填写所有信息!')
|
|
this.$message.warning('请填写所有信息!')
|
|
this.isLoading = false
|
|
this.isLoading = false
|
|
- } else if (this.detailsList.length < 1) {
|
|
|
|
- this.$message.warning('请上传凭证')
|
|
|
|
- this.isLoading = false
|
|
|
|
} else {
|
|
} else {
|
|
let data = []
|
|
let data = []
|
|
if (this.unSetteleAllselectValue == 1) {
|
|
if (this.unSetteleAllselectValue == 1) {
|
|
@@ -1750,9 +1787,11 @@ export default {
|
|
})
|
|
})
|
|
console.log(orderList, 'orderList')
|
|
console.log(orderList, 'orderList')
|
|
let formData = new window.FormData()
|
|
let formData = new window.FormData()
|
|
- this.detailsList.forEach((item,index)=>{
|
|
|
|
- formData.append('file'+index, item.raw)
|
|
|
|
- });
|
|
|
|
|
|
+ if(this.detailsList){
|
|
|
|
+ this.detailsList.forEach((item,index)=>{
|
|
|
|
+ formData.append('file'+index, item.raw)
|
|
|
|
+ });
|
|
|
|
+ }
|
|
formData.append('orderList', orderList)
|
|
formData.append('orderList', orderList)
|
|
formData.append('userId', getCookie('userId'))
|
|
formData.append('userId', getCookie('userId'))
|
|
formData.append('detailAmount',this.detailAmount);
|
|
formData.append('detailAmount',this.detailAmount);
|
|
@@ -1779,6 +1818,68 @@ export default {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ openDetailsAdd(){
|
|
|
|
+ console.log(this.$refs.tableRef.selection, 'selection')
|
|
|
|
+ if (
|
|
|
|
+ !this.$refs.tableRef.selection ||
|
|
|
|
+ this.$refs.tableRef.selection.length != 1
|
|
|
|
+ ) {
|
|
|
|
+ this.$message.warning('请选择需要冲红的订单,一次只允许修改一个')
|
|
|
|
+ return;
|
|
|
|
+ } else {
|
|
|
|
+ this.detailAmount = null
|
|
|
|
+ this.detailRemark = null
|
|
|
|
+ this.detailsList = []
|
|
|
|
+ let data = []
|
|
|
|
+ if (this.unSetteleAllselectValue == 1) {
|
|
|
|
+ data = this.tableData
|
|
|
|
+ } else {
|
|
|
|
+ data = this.$refs.tableRef.selection
|
|
|
|
+ }
|
|
|
|
+ for(let i=0;i<data.length;i++){
|
|
|
|
+ if(!data[i].orderId){
|
|
|
|
+ this.$message.warning('没有派发运单,无法修改此项')
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.showDetailsAdd = true
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ addTruckDetail(){
|
|
|
|
+ this.isLoading = true
|
|
|
|
+ if (!this.detailAmount || !this.detailRemark) {
|
|
|
|
+ this.$message.warning('请填写所有信息!')
|
|
|
|
+ this.isLoading = false
|
|
|
|
+ } else {
|
|
|
|
+ let data = []
|
|
|
|
+ if (this.unSetteleAllselectValue == 1) {
|
|
|
|
+ data = this.tableData
|
|
|
|
+ } else {
|
|
|
|
+ data = this.$refs.tableRef.selection
|
|
|
|
+ }
|
|
|
|
+ let orderList = data.map(e => {
|
|
|
|
+ return e.orderId
|
|
|
|
+ })
|
|
|
|
+ console.log(orderList, 'orderList')
|
|
|
|
+ let map = {
|
|
|
|
+ orderList:orderList,
|
|
|
|
+ userId:getCookie('userId'),
|
|
|
|
+ detailAmount:this.detailAmount,
|
|
|
|
+ detailRemark:this.detailRemark
|
|
|
|
+ }
|
|
|
|
+ this.axios.post('/api/v1/bms/addTruckDetail',map).then(res => {
|
|
|
|
+ if (res.data.status == 'succeed') {
|
|
|
|
+ this.$message.success('修改成功!')
|
|
|
|
+ this.setteldAllselectValue = 0
|
|
|
|
+ this.onclick();
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.data.data)
|
|
|
|
+ }
|
|
|
|
+ this.showDetailsAdd = false
|
|
|
|
+ this.isLoading = false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
receiveClick(src, title) {
|
|
receiveClick(src, title) {
|
|
// this.dialogImageUrl = src
|
|
// this.dialogImageUrl = src
|
|
downloadFile(src, `${this.downloadCapacityNo}${title}照片`, '.jpg')
|
|
downloadFile(src, `${this.downloadCapacityNo}${title}照片`, '.jpg')
|