You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1055 lines
38 KiB

2 years ago
<template>
<basic-container>
<!-- <div class="avue-crud">
<el-row :hidden="!search" style="padding:6px 18px">
&lt;!&ndash; 查询模块 &ndash;&gt;
<el-form :inline="true" :model="query">
<el-form-item label="提货证件:">
<el-input v-model="query.deliveryDocument" placeholder="请输入提货证件"></el-input>
</el-form-item>
<el-form-item label="证件类型:">
<el-input v-model="query.certificateType" placeholder="请输入证件类型"></el-input>
</el-form-item>
&lt;!&ndash; 查询按钮 &ndash;&gt;
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="searchChange"> </el-button>
<el-button icon="el-icon-delete" @click="searchReset()"> </el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="avue-crud__header">
&lt;!&ndash; 头部左侧按钮模块 &ndash;&gt;
<div class="avue-crud__left">
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"> </el-button>
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain> </el-button>
</div>
&lt;!&ndash; 头部右侧按钮模块 &ndash;&gt;
<div class="avue-crud__right">
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
<el-button icon="el-icon-search" @click="searchHide" circle></el-button>
</div>
</div>
</el-row>
<el-row>
&lt;!&ndash; 列表模块 &ndash;&gt;
<el-table ref="table" v-loading="loading"
@selection-change="selectionChange"
:data="data"
:height="height"
style="width: 100%"
:border="option.border">
<el-table-column type="selection" v-if="option.selection" width="55" align="center"></el-table-column>
<el-table-column type="expand" v-if="option.expand" align="center"></el-table-column>
<el-table-column v-if="option.index" label="#" type="index" width="50" align="center">
</el-table-column>
<template v-for="(item,index) in option.column">
&lt;!&ndash; table字段 &ndash;&gt;
<el-table-column v-if="item.hide!==true"
:prop="item.prop"
:label="item.label"
:width="item.width"
:key="index">
</el-table-column>
</template>
&lt;!&ndash; 操作栏模块 &ndash;&gt;
<el-table-column prop="menu" label="操作" :width="220" align="center">
<template #="{row}">
<el-button type="primary" text icon="el-icon-view" @click="handleView(row)">查看</el-button>
<el-button type="primary" text icon="el-icon-edit" @click="handleEdit(row)">编辑</el-button>
<el-button type="primary" text icon="el-icon-delete" @click="rowDel(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<el-row>
<div class="avue-crud__pagination" style="width:100%">
&lt;!&ndash; 分页模块 &ndash;&gt;
<el-pagination align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[10, 20, 30, 40, 50, 100]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total">
</el-pagination>
</div>
</el-row>
&lt;!&ndash; 表单模块 &ndash;&gt;
<el-dialog :title="title"
v-model="box"
width="50%"
:before-close="beforeClose"
append-to-body>
<el-form :disabled="view" ref="form" :model="form" label-width="80px">
&lt;!&ndash; 表单字段 &ndash;&gt;
<el-form-item label="提货时间" prop="pickUpTime">
<el-input v-model="form.pickUpTime" placeholder="请输入提货时间"/>
</el-form-item>
<el-form-item label="提货人" prop="consignee">
<el-input v-model="form.consignee" placeholder="请输入提货人"/>
</el-form-item>
<el-form-item label="提货车牌" prop="pickUpPlate">
<el-input v-model="form.pickUpPlate" placeholder="请输入提货车牌"/>
</el-form-item>
<el-form-item label="提货证件" prop="deliveryDocument">
<el-input v-model="form.deliveryDocument" placeholder="请输入提货证件"/>
</el-form-item>
<el-form-item label="证件类型" prop="certificateType">
<el-select v-model="form.certificateType" clearable placeholder="请选择证件类型">
<el-option
v-for="item in certificateTypeData"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="费用合计" prop="totalCost">
<el-input v-model="form.totalCost" placeholder="请输入费用合计"/>
</el-form-item>
</el-form>
&lt;!&ndash; 表单按钮 &ndash;&gt;
<template #footer>
<span v-if="!view" class="dialog-footer">
<el-button type="primary" icon="el-icon-circle-check" @click="handleSubmit"> </el-button>
<el-button icon="el-icon-circle-close" @click="box = false"> </el-button>
</span>
</template>
</el-dialog>
</div>-->
<div class="avue-crud" :style="`height:`+ height+';overflow:auto;' " >
2 years ago
<el-form :disabled="view" ref="form" :model="form" label-width="100px" :rules="rules" >
2 years ago
<!-- 表单字段 -->
<el-row :gutter="20">
<el-col :span="12">
2 years ago
<el-form-item label="提货时间" prop="pickUpTime">
<!-- <el-input v-model="form.pickUpTime" placeholder="请输入提货时间"/>-->
<el-date-picker style="width: 100%"
2 years ago
v-model="form.pickUpTime"
type="datetime"
placeholder="请输入提货时间"
format="YYYY-MM-DD hh:mm:ss"
value-format="YYYY-MM-DD hh:mm:ss"
/>
</el-form-item>
</el-col>
<el-col :span="12">
2 years ago
<el-form-item label="提货人" prop="consignee">
<el-input v-model="form.consignee" placeholder="请输入提货人"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="提货车牌号码" prop="pickUpPlate" label-width="98px">
2 years ago
<el-input v-model="form.pickUpPlate" placeholder="请输入提货车牌"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="提货证件号码" prop="deliveryDocument" label-width="120px">
2 years ago
<el-input v-model="form.deliveryDocument" placeholder="请输入提货证件"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
2 years ago
<el-form-item label="证件类型" prop="certificateType">
<el-select v-model="form.certificateType" clearable placeholder="请选择证件类型" style="width: 100%">
2 years ago
<el-option
v-for="item in certificateType"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
2 years ago
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
2 years ago
<el-form-item label="费用" prop="freightMark">
2 years ago
<el-checkbox-group v-model="form.freightMark" @change="handleCheckedCitiesChange">
<el-checkbox style="width: 16%;margin-bottom: 3%"
2 years ago
v-for="(item,index) in clientType"
:key="item.dictKey"
:label="item.dictKey"
>{{item.dictValue}}
<el-input type="number" v-model="item.remark" placeholder="请输入费用" :disabled = "this.form?.freightMark?.indexOf(item.dictKey) == -1"
2 years ago
@change="textbox($event,index)" style="width: 70%"/>
2 years ago
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="费用合计" prop="totalCost">
<el-input v-model="form.totalCost" placeholder="请输入费用合计"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="物品明细" prop="certificateType">
<el-tabs type="border-card" style="width: 100%">
<el-tab-pane label="定制品">
<el-button type="primary" link @click="handleAddOrder"> </el-button>
<el-table ref="table" v-loading="loading"
@selection-change="selectionChange"
:data="dataList"
style="width: 100%"
:border="option.border">
<template v-for="(item,index) in option.columnList">
<!-- table字段 -->
<el-table-column v-if="item.hide!==true"
:prop="item.prop"
:label="item.label"
:width="item.width"
:key="index">
</el-table-column>
</template>
<!-- 操作栏模块 -->
<!-- <el-table-column prop="menu" label="操作" :width="220" align="center">-->
<!-- <template #="{row}">-->
<!-- <el-button type="primary" text icon="el-icon-view" @click="handleView(row)">查看</el-button>-->
<!-- <el-button type="primary" text icon="el-icon-edit" @click="handleEdit(row)">编辑</el-button>-->
<!-- <el-button type="primary" text icon="el-icon-delete" @click="rowDel(row)">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</el-tab-pane>
2 years ago
<el-tab-pane label="库存品">
<el-button type="primary" text icon="el-icon-view" @click="handleAddView(row)">新增</el-button>
<el-table ref="table" v-loading="loading"
@selection-change="selectionChange"
:data="data"
style="width: 100%"
:border="option.border">
<!-- <el-table-column type="selection" v-if="option.selection" width="50" align="center"></el-table-column>-->
<el-table-column type="expand" v-if="option.expand" align="center"></el-table-column>
<el-table-column v-if="option.index" label="序号" type="index" width="70" align="center">
</el-table-column>
<template v-for="(item,index) in option.columnStock">
<!-- table字段 -->
<el-table-column v-if="item.hide!==true"
:prop="item.prop"
:label="item.label"
:width="item.width"
:key="index">
</el-table-column>
</template>
<!-- 操作栏模块 -->
<el-table-column prop="menu" label="添加数量" :width="220" align="center">
<template #="{row}">
<el-input v-model="row.inventoryQuantity" @blur="handleNumberRange($event,row)" ></el-input>
</template>
</el-table-column>
<!-- 操作栏模块 -->
<el-table-column prop="menu" label="操作" :width="220" align="center">
<template #="{row}">
<el-button type="primary" text icon="el-icon-delete" @click="rowStock(row)">移除</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
2 years ago
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="提货证件" prop="totalCost" label-width ='120px'>
<el-upload
v-model:file-list="fileListSell"
2 years ago
class="upload-demo"
:action="action"
:headers="headers"
multiple
:on-preview="handlePreview"
:on-success="(response, file, fileList) => {uploadSuccess(fileListSell)}"
2 years ago
:on-remove="handleRemove"
list-type="picture"
>
<el-button type="primary">上传</el-button>
<template #tip>
<div class="el-upload__tip">
只能上传jpg/png文件且不超过500kb
</div>
</template>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="文员确定图片" prop="totalCost" label-width ='120px'>
<el-upload
v-model:file-list="fileListClerk"
2 years ago
class="upload-demo"
:action="action"
:headers="headers"
multiple
2 years ago
:on-preview="handlePreview"
:on-success="(response, file, fileList) => {uploadSuccess(fileListClerk)}"
2 years ago
:on-remove="handleRemove"
list-type="picture"
>
<el-button type="primary">上传</el-button>
<template #tip>
<div class="el-upload__tip">
只能上传jpg/png文件且不超过500kb
</div>
</template>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="库管签收图片" prop="totalCost" label-width ='120px'>
<el-upload
v-model:file-list="fileListLibrary"
2 years ago
class="upload-demo"
:action="action"
:headers="headers"
multiple
2 years ago
:on-preview="handlePreview"
:on-success="(response, file, fileList) => {uploadSuccess(fileListLibrary)}"
2 years ago
:on-remove="handleRemove"
list-type="picture"
>
<el-button type="primary">上传</el-button>
<template #tip>
<div class="el-upload__tip">
只能上传jpg/png文件且不超过500kb
</div>
</template>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- 表单按钮 -->
<div class="foot" v-if="!view" >
<div class="dialog-footer" >
<el-button type="primary" icon="el-icon-circle-check" @click="handleSubmit('form')"> </el-button>
<!-- <el-button icon="el-icon-circle-close" @click="box = false"> </el-button>-->
</div>
</div>
</div>
2 years ago
<el-dialog v-model="dialogFormVisible" title="添加库存品" style="width: 80% ">
<el-table ref="table" v-loading="loading"
@selection-change="selectionChangeStock"
2 years ago
@row-click="handleHighlightChangeTable"
:data="dataOwn"
style="width: 100%"
:border="option.border">
<el-table-column type="selection" v-if="option.selection" width="50" align="center"></el-table-column>
<el-table-column type="expand" v-if="option.expand" align="center"></el-table-column>
<el-table-column v-if="option.index" label="序号" type="index" width="70" align="center">
</el-table-column>
<template v-for="(item,index) in option.columnStock">
<!-- table字段 -->
<el-table-column v-if="item.hide!==true"
:prop="item.prop"
:label="item.label"
:width="item.width"
:key="index">
</el-table-column>
</template>
2 years ago
<!-- 操作栏模块 -->
<el-table-column prop="menu" label="添加数量" :width="220" align="center">
<template #="{row}">
<el-input v-model="row.inventoryQuantity" @blur="handleNumberRange($event,row)" ></el-input>
</template>
</el-table-column>
</el-table>
<div class="avue-crud__pagination" style="width:100%">
<!-- 分页模块 -->
<el-pagination align="right"
background
@size-change="sizeChangeStock"
@current-change="currentChangeStock"
:current-page="pageStock.currentPage"
:page-sizes="[10, 20, 30, 40, 50, 100]"
:page-size="pageStock.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="pageStock.total">
</el-pagination>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogFormVisible = false">取消</el-button>
<!-- <el-button type="primary" @click="dialogFormVisible = false"> 确定 </el-button>-->
<el-button type="primary" @click="callFordelivery('1')"> 确定 </el-button>
</span>
</template>
</el-dialog>
2 years ago
</basic-container>
</template>
<script>
import { getList, getDetail, add, update, remove } from "@/api/distribution/distrilbutionBillLading";
import { getListOwn } from "@/api/distribution/distributionParcelList";
2 years ago
import option from "@/option/distribution/distrilbutionBillLading";
import { mapGetters } from "vuex";
import { getDictionaryBiz } from '@/api/system/dict';
import { getToken } from '@/utils/auth';
import { getListStockList } from '@/api/distribution/distributionStockList';
import { getListOne} from "@/api/distribution/distributionStockArticle";
2 years ago
export default {
data () {
return {
dialogFormVisible: false,
2 years ago
height: 0,
// 弹框标题
title: '',
// 是否展示弹框
box: false,
// 是否显示查询
search: true,
// 加载中
loading: true,
// 是否为查看模式
view: false,
// 查询信息
query: {},
// 分页信息
page: {
currentPage: 1,
pageSize: 10,
total: 40
},
// 分页信息
pageStock: {
currentPage: 1,
pageSize: 10,
total: 40
},
2 years ago
// 表单数据
form: {},
// 选择行
selectionList: [],
selectionListStock: [],// 库存品选择
2 years ago
// 表单配置
option: option,
// 表单列表
data: [],
dataList: [],
dataOwn: [],
2 years ago
clientType: [],
costList: [],
costListName: [],
certificateType: [],
fileListLibrary: [],
fileListSell: [],
fileListClerk: [],
fileList:[
// {
// name: 'food.jpeg',
// url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100',
// },
// {
// name: 'food2.jpeg',
// url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100',
// },
2 years ago
],
rules: {
pickUpTime: [
{ type: 'date', required: true, message: '请选择提货时间', trigger: 'change' }
],
consignee: [
{ required: true, message: '请输入提货人', trigger: 'blur' },
// { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
],
pickUpPlate: [
{ required: true, message: '请输入提货车牌号', trigger: 'change' }
],
deliveryDocument: [
{ required: true, message: '请输入提货证件码', trigger: 'change' },
// { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
],
certificateType: [
{ required: true, message: '请选择证件类型', trigger: 'change' }
],
freightMark: [
{ required: true, message: '请选择费用', trigger: 'change' }
],
totalCost: [
{ required: true, message: '请输入费用合计', trigger: 'change' }
],
},
2 years ago
}
},
mounted () {
this.init();
if(this.$route.query.type == '2'){
//查询提货编辑数据
this.getDetailOen();
}else{
this.onLoad(this.page);
}
2 years ago
},
watch:{
'$route.query.id':{
handler(newVal, oldVal) {
// console.log(newVal, oldVal);
if(this.$route.query.type == '2'){
//查询提货编辑数据
this.getDetailOen();
}else{
this.onLoad(this.page);
this.onLoadOwn(this.page);
}
},
deep: true,
immediate: true
}
},
2 years ago
computed: {
...mapGetters(["permission",'tagWel','tagList','tag']),
2 years ago
ids () {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
},
stockIds () {
let ids = [];
this.selectionListStock.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
},
2 years ago
headers() {
return {
"Blade-Auth":'Bearer ' + getToken()
}
},
action() {
// return '/api/logpm-basicdata/common/uploadFile'
return '/api/blade-resource/oss/endpoint/put-file'
2 years ago
}
},
methods: {
//查询提货详情信息
getDetailOen(){
getDetail(this.$route.query.id).then(res =>{
// console.log("详情信息》》》》",res.data.data);
let s = res.data.data;
this.form = s;
let f =[];
s.chargeList.forEach(c =>{
let a = this.clientType.find( i =>c.cost == i.dictKey );
if(!!c.cost && c.cost != '-1'){
f.push(c.cost)
}
if(!!a){
a.remark = c.money.substring(0,c.money.lastIndexOf("."))
this.costList[c.cost] = a.remark;
}
})
this.form.freightMark = f;
this.costListName = f;
this.form.totalCost = s.totalCost.substring(0,s.totalCost.lastIndexOf("."))
this.dataList = s.stockArticleVOS;
this.data = s.stockListVOS;
this.data.forEach( i =>{
i.available = i.quantityStock - i.quantityOccupied;
})
if (!!s.printVOS) {
let le1 = [];
let le2 = [];
let le3 = [];
const genreMapping = {
'1': le1, // 提
'2': le2, // 文
'3': le3, // 库
};
s.printVOS.forEach(i => {
if (i.genre in genreMapping) {
const q = {
name: i.siteName,
url: i.site
};
genreMapping[i.genre].push(q);
}
});
this.fileListLibrary = genreMapping['3'];
this.fileListSell = genreMapping['1'];
this.fileListClerk = genreMapping['2'];
// console.log("le1",le1);
// console.log("le2",le2);
// console.log("le3",le3);
}
this.loading = false;
})
},
//移除数据
rowStock (row) {
console.log(">>?>?><?",row);
this.data.forEach( i =>{
if(i.id === row.id){
this.data
}
})
let id1 = this.data.findIndex(item => {
if (item.id == row.id) {
return true
}
})
this.data.splice(id1, 1)
},
//确定
callFordelivery(inde){
2 years ago
let isa= false;
console.log("执行了");
this.selectionListStock.some( i =>{
2 years ago
console.log("asdgfasdv",i);
if(parseInt(i.inventoryQuantity) > parseInt(i.quantityStock) ){
// this.$message.warning("添加数量大于可以数量");
isa= true;
return ;
}
let a = this.data.filter((ele) => ele.id == i.id ).length >= 1
2 years ago
// console.log("asdgfasdv",a);
if(!a){
this.data.push(i);
}
})
2 years ago
if(!isa){
this.dialogFormVisible = false;
}
},
//数量校验
handleNumberRange(e,row) {
console.log("执行了2222",e,e.target.value,row);
if(e.target.value) {
e.target.value = e.target.value.replace(/[^\.\d]/g,'') //替换掉与数字无关的字符(中英文与符号都会被替换掉,只留下数字,此时值类型为字符串)
if(e.target.value) { //如果替换后还有值
e.target.value = parseInt(e.target.value); //把字符型转成整数型
}
if((e.target.value > row.available )) {
2 years ago
this.$message.error('数量不能大于可用数量')
// e.target.value = row.quantityStock;
return
}
}
},
uploadSuccess(fileList) {
console.log('123123123', fileList);
// console.log('123123123==fileListSell', this.fileListSell);
// console.log('123123123==fileListClerk', this.fileListClerk);
// console.log('123123123==fileListLibrary', this.fileListLibrary);
// this.form.fileName =
// this.$set(row, 'imageCos', fileList);
},
2 years ago
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
textbox(e,index) {
// console.log("e,index",e,index);
2 years ago
this.costList[index+1] = e;
2 years ago
//计算合计费用
let n = 0;
2 years ago
this.costList.forEach( i =>{
n += parseInt(i);
2 years ago
})
this.form.totalCost = n;
2 years ago
},
handleCheckedCitiesChange(value) {
console.log(">>>>>>>",value );
if(value.length < 1){
this.costList = [];
this.costListName = [];
}
this.clientType.forEach(i =>{
if(value.includes(i.dictKey)){
console.log(i);
i.pitch = true;
this.costListName = value;
}
});
},
init () {
this.height = this.setPx(document.body.clientHeight - 160);
//字典
getDictionaryBiz('delivery_cost').then(res => {
this.clientType = res.data.data;
}); //字典
getDictionaryBiz('certificate_type').then(res => {
this.certificateType = res.data.data;
});
},
searchHide () {
this.search = !this.search;
},
searchChange () {
this.onLoad(this.page);
},
searchReset () {
this.query = {};
this.page.currentPage = 1;
this.onLoad(this.page);
},
bianLier(costListName,clientType,costList,fei){
// console.log(">>>>>>>>>",costListName,clientType,costList,fei);
2 years ago
this.pan = false;
for (let i = 0;i< costListName.length;i++){
if(!costList){ this.pan = true; return }
for(let a = 0;a < clientType.length;a++){
// console.log("进来了",clientType[a].dictKey , costListName[i]);
if(clientType[a].dictKey == costListName[i]){
// console.log("进来了",clientType[a].dictKey , costListName[i]);
2 years ago
let zhi = costList[costListName[i]];
if(!zhi){
this.pan = true;
continue;
}else{
//2.添加
fei.set(clientType[a].dictKey,zhi);
}
}
}
}
},
async handleSubmit () {
2 years ago
this.$refs.form.validate( async valid=>{
if (valid) {
if (!this.form.id) {
let fei = new Map();
await this.bianLier(this.costListName,this.clientType,this.costList,fei);
this.form.fei = Object.fromEntries(fei);
this.form.stockArticleId = this.$route.query.id;
this.form.stockDTOList = this.data;
let o = [];
if(this.fileListClerk.length > 0){
this.fileListClerk.forEach( i =>{
// console.log("iiii文员",i);
2 years ago
let num = {};
num.state = "2";
num.name = i.name;
2 years ago
num.url = i.response.data.link;
o.push(num);
});
2 years ago
}
if(this.fileListLibrary.length > 0){
2 years ago
this.fileListLibrary.forEach( i =>{
// console.log("库管》》》",i);
2 years ago
let num = {};
num.state = "3";
num.name = i.name;
2 years ago
num.url = i.response.data.link;
o.push(num);
});
2 years ago
}
if(this.fileListSell.length > 0){
2 years ago
this.fileListSell.forEach( i =>{
// console.log(",.,.,.,.提货",i);
2 years ago
let num = {};
num.state = "1";
num.name = i.name;
2 years ago
num.url = i.response.data.link;
o.push(num);
});
}
this.form.printList = o.length > 0 ? o : [];
// console.log("this.form",this.form);
2 years ago
add(this.form).then(() => {
this.box = false;
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.contextmenuFlag = false;
this.$store.commit('DEL_TAG_CURRENT');
this.$router.push(this.tagWel);
});
} else {
let fei = new Map();
await this.bianLier(this.costListName,this.clientType,this.costList,fei);
this.form.fei = Object.fromEntries(fei);
this.form.stockDTOList = this.data;
let o = [];
const fileListMapping = {
fileListClerk: '2', // 文员
fileListLibrary: '3', // 库管
fileListSell: '1', // 提货
};
let mark = false;
Object.entries(fileListMapping).forEach(([fileList, state]) => {
if (this[fileList].length > 0) {
this[fileList].forEach(i => {
console.log("i>>>>",i);
let num = {
state,
};
if(!!i.response){
num.name = i.name;
num.url = i.response.data.link;
mark = true;
}else{
num.name = i.name;
num.url = i.url;
}
o.push(num);
});
}
});
this.form.printList = o.length > 0 ? o : [];
// console.log("修改》》》",this.form);
let up = {}
up.printList = o.length > 0 ? o : [];
up.fei = this.form.fei;
up.stockDTOList = this.form.stockDTOList;
up.id = this.form.id;
up.pickUpPlate = this.form.pickUpPlate;
up.pickUpTime = this.form.pickUpTime;
up.consignee = this.form.consignee;
up.deliveryDocument = this.form.deliveryDocument;
up.certificateType = this.form.certificateType;
up.totalCost = this.form.totalCost;
up.mark = mark;
console.log("修改提交数据》》》",up);
/*console.log(this.$route.matched) // 当前路由匹配的路由信息
console.log(tag,key);
let { tag, key } = this.findTag(this.$route.path);
this.$store.commit('DEL_TAG', tag);
if (tag.fullPath === this.tag.fullPath) {
tag = this.tagList[key - 1];
this.$router.push({
path: tag.path,
query: tag.query,
});
}
*/
update(up).then(() => {
// this.box = false;
// this.onLoad(this.page);
2 years ago
this.$message({
type: "success",
message: "操作成功!"
});
this.$store.commit('DEL_TAG_CURRENT');
this.$router.push(this.tagWel);
2 years ago
})
}
}
})
2 years ago
},
findTag(fullPath) {
let tag = this.tagList.find(item => item.fullPath === fullPath);
let key = this.tagList.findIndex(item => item.fullPath === fullPath);
return { tag, key };
},
2 years ago
handleAdd () {
this.title = '新增'
this.form = {}
this.box = true
},
handleEdit (row) {
this.title = '编辑'
this.box = true
getDetail(row.id).then(res => {
this.form = res.data.data;
});
},
handleView (row) {
this.title = '查看'
this.view = true;
this.box = true;
getDetail(row.id).then(res => {
this.form = res.data.data;
});
},
//查询自提订单
handleAddOrder(){
},
//库存品
handleAddView (row) {
this.dialogFormVisible = true;
this.onLoadList(this.pageStock);
},
2 years ago
handleDelete () {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.selectionClear();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
rowDel (row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
beforeClose (done) {
done()
this.form = {};
this.view = false;
},
selectionChange (list) {
this.selectionList = list;
},
2 years ago
handleHighlightChangeTable(row) {
if(!row.disabled){
this.$refs.table.toggleRowSelection(row);
}
},
selectionChangeStock (list) {
console.log("执行了啦啦啦",list);
this.selectionListStock = list;
},
2 years ago
selectionClear () {
this.selectionList = [];
// this.$refs.table.clearSelection();
},
currentChangeStock (currentPage) {
this.pageStock.currentPage = currentPage;
this.onLoadList(this.pageStock);
},
sizeChangeStock (pageSize) {
this.pageStock.pageSize = pageSize;
this.onLoadList(this.pageStock);
},
2 years ago
currentChange (currentPage) {
this.page.currentPage = currentPage;
this.onLoad(this.page);
},
sizeChange (pageSize) {
this.page.pageSize = pageSize;
this.onLoad(this.page);
},
2 years ago
onLoad (page, params = {}) {
this.loading = true;
params.id = this.$route.query.id;
getListOne(page.currentPage, page.pageSize, params).then(res => {
2 years ago
const data = res.data.data;
console.log(">>>>>>>>>===",data);
this.loading = false;
this.selectionClear();
});
} ,
//库存品
onLoadList (page, params = {}) {
this.loading = true;
getListStockList(page.currentPage, page.pageSize,params ).then(res => {
const dataOwn = res.data.data;
this.pageStock.total = dataOwn.total;
this.dataOwn = dataOwn.records;
this.dataOwn.forEach( i =>{
i.available = i.quantityStock - i.quantityOccupied;
})
this.loading = false;
this.selectionClear();
});
} ,
//包件信息
onLoadOwn (page, params = {}) {
this.loading = true;
this.query.stockArticleId = this.$route.query.id;
getListOwn(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
2 years ago
console.log("包件信息>>>>",res.data.data);
const dataList = res.data.data;
this.page.total = dataList.total;
this.dataList = dataList.records;
2 years ago
this.loading = false;
this.selectionClear();
});
}
}
};
</script>
<style >
.foot {
position: fixed;
right: 0;
bottom: 0;
left: 0;
z-index: 999;
height: 60px;
}
.foot .dialog-footer {
margin-bottom: 130px;
text-align: center;
}
.ca .el-radio__inner {
top: -18px;
left: -19px;
border-radius: 0;
border: 0;
width: 170px;
height: 34px;
background-color: transparent;
cursor: pointer;
box-sizing: border-box;
position: absolute;
}
.ca .el-radio__input.is-checked .el-radio__inner {
background: transparent;
}
</style>