Browse Source

表格组件新增类型,修改地图,修改部分页面表格部分

fix_bug_pro20231227
zhangsiyu 2 years ago
parent
commit
e1f0c12123
  1. 2
      index.html
  2. 8
      src/api/work/work.js
  3. 6
      src/components/tablecmt/tablecmt.vue
  4. 113
      src/page/index/top/index.vue
  5. 7
      src/utils/store.js
  6. 2079
      src/views/distribution/inventory/distrilbutionBillLading.vue
  7. 2
      src/views/distribution/inventory/distrilbutionBillLadingList.vue
  8. 1
      src/views/distribution/reservation/atlas1.vue
  9. 3302
      src/views/distribution/reservation/reservationAddFrom.vue

2
index.html

@ -23,7 +23,7 @@
</script>
<script type="text/javascript"
src='https://webapi.amap.com/maps?v=2.0&key=f003ec4feb3fcc4cf0742e94f569fd33&plugin=AMap.PlaceSearch,AMap.Geocoder,Map3D,ElasticMarker,AMap.Driving'></script>
src='https://webapi.amap.com/maps?v=1.4.14&key=f003ec4feb3fcc4cf0742e94f569fd33&plugin=AMap.PlaceSearch,AMap.Geocoder,Map3D,ElasticMarker,AMap.Driving'></script>
<script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
<script type="text/javascript"
src="https://api.map.baidu.com/api?v=1.0&type=webgl&ak=FpjVxjf9nGo47eLj9I0ZuUvSZm1wGGqr"></script>

8
src/api/work/work.js

@ -92,4 +92,12 @@ export const preserveCurrentWarehouse = data => {
method: 'post',
data,
});
};
export const getclearWarehouseCache = data => {
return request({
url: '/api/logpm-basicdata/warehouse/clearWarehouseCache',
method: 'get',
data,
});
};

6
src/components/tablecmt/tablecmt.vue

@ -86,7 +86,7 @@
<template #default="scope">
<el-text class="mx-2 tabculconte" v-if="(Number(column.type)<6&&Number(column.type)>0)">{{ scope.row[column.prop] }}</el-text>
<el-text style="" class="mx-2 tabculconte colors" v-if="column.type == 9" @click="godowns(scope.row[column.downprop])">{{ scope.row[column.prop] }}</el-text>
<el-input v-if="column.type == 10" v-model="scope.row[column.prop]" type="number" :min="0"></el-input>
<div class="slotbuts" v-if="column.type == 6">
<slot v-if="column.type == 6" :scope="scope">
</slot>
@ -163,6 +163,7 @@ interface TableColumnType {
* 7:图片
* 8:带背景的文字
* 9:下载附件
* 10.输入框的表格内容
*/
type: number | string;
/** 用于接受表头的值 */
@ -531,6 +532,9 @@ watchEffect(()=>{
color: #409EFF !important;
cursor: pointer !important;
}
.el-table .cell{
line-height: 22px !important;
}
.el-table .el-input__inner{
font-size: 12px !important;
}

113
src/page/index/top/index.vue

@ -44,9 +44,7 @@
<router-link to="/">{{ $t('navbar.dashboard') }}</router-link>
</el-dropdown-item>
<el-dropdown-item>
<div @click="showcl(true)">
切换仓库
</div>
<div @click="showcl(true)">切换仓库</div>
</el-dropdown-item>
<el-dropdown-item>
<router-link to="/info/index">{{ $t('navbar.userinfo') }}</router-link>
@ -62,19 +60,19 @@
</div>
</div>
<el-dialog v-model="isshow" title="切换仓库" width="30%">
<div style="display: flex;flex-direction: column;align-items: center;">
<div style="display: flex; flex-direction: column; align-items: center">
<el-select class="selecin" v-model="warehousevalue" placeholder="请选择切换的仓库">
<el-option
v-for="(item,index) in datalist"
v-for="(item, index) in datalist"
:key="item.id"
:label="item.name"
:value="index"
/>
</el-select>
<div class="copnbx">
<el-button @click="showcl(false)">取消</el-button>
<el-button type="primary" @click="confirmcks">确认</el-button>
</div>
<div class="copnbx">
<el-button @click="showcl(false)">取消</el-button>
<el-button type="primary" @click="confirmcks">确认</el-button>
</div>
</div>
</el-dialog>
</template>
@ -88,7 +86,11 @@ import topLogs from './top-logs.vue';
import topLang from './top-lang.vue';
import topFull from './top-full.vue';
import topSetting from '../setting.vue';
import { getMyWarehouseList , preserveCurrentWarehouse } from '@/api/work/work'
import {
getMyWarehouseList,
preserveCurrentWarehouse,
getclearWarehouseCache,
} from '@/api/work/work';
export default {
components: {
@ -104,14 +106,12 @@ export default {
name: 'top',
data() {
return {
isshow:false,
datalist:[],
warehousevalue:''
isshow: false,
datalist: [],
warehousevalue: '',
};
},
mounted(){
},
mounted() {},
filters: {},
created() {},
computed: {
@ -128,22 +128,40 @@ export default {
]),
},
methods: {
async confirmcks(){
if(typeof this.warehousevalue !='number'){
return
async confirmcks() {
if (typeof this.warehousevalue != 'number') {
return;
}
console.log(this.warehousevalue)
let res=await preserveCurrentWarehouse(this.datalist[this.warehousevalue])
if(res.data.code==200){
this.$message({message:'切换成功',type:'success'})
this.$router.push({
path:'/'
})
setTimeout(() => {
window.location.reload();
}, 1000);
}else{
this.$message({message:res.data.msg,type:'error'})
console.log(this.warehousevalue);
if (
this.datalist[this.warehousevalue].id == '0' &&
this.datalist[this.warehousevalue].name == '全部'
) {
let res = await getclearWarehouseCache({});
if (res.data.code == 200) {
this.$message({ message: '切换成功', type: 'success' });
this.$router.push({
path: '/',
});
setTimeout(() => {
window.location.reload();
}, 1000);
} else {
this.$message({ message: res.data.msg, type: 'error' });
}
} else {
let res = await preserveCurrentWarehouse(this.datalist[this.warehousevalue]);
if (res.data.code == 200) {
this.$message({ message: '切换成功', type: 'success' });
this.$router.push({
path: '/',
});
setTimeout(() => {
window.location.reload();
}, 1000);
} else {
this.$message({ message: res.data.msg, type: 'error' });
}
}
},
setCollapse() {
@ -160,13 +178,14 @@ export default {
});
});
},
showcl(flg){
this.isshow=flg
if(this.isshow){
getMyWarehouseList().then(res=>{
console.log(res.data.data,'getMyWarehouseList')
this.datalist=res.data.data
})
showcl(flg) {
this.isshow = flg;
if (this.isshow) {
getMyWarehouseList().then(res => {
console.log(res.data.data, 'getMyWarehouseList');
let arr = [{ name: '全部', id: '0' }];
this.datalist = arr.concat(res.data.data);
});
}
},
},
@ -174,14 +193,14 @@ export default {
</script>
<style lang="scss" scoped>
.copnbx{
margin-top: 30px;
button{
width: 120px;
height: 40px;
}
}
.selecin{
width: 60%;
.copnbx {
margin-top: 30px;
button {
width: 120px;
height: 40px;
}
}
.selecin {
width: 60%;
}
</style>

7
src/utils/store.js

@ -5,7 +5,7 @@ const keyName = website.key + '-';
/**
* 存储localStorage
*/
export const setStore = (params = {}) => {
export const setStore = (params = {},value) => {
try {
let { name, content, type } = params;
name = keyName + name;
@ -28,7 +28,10 @@ export const setStore = (params = {}) => {
keys.map(item=>{
localStorage.removeItem(item)
})
setStore(params)
if(value!=1){
setStore(params,1)
}
}
};
/**

2079
src/views/distribution/inventory/distrilbutionBillLading.vue

File diff suppressed because it is too large Load Diff

2
src/views/distribution/inventory/distrilbutionBillLadingList.vue

@ -617,7 +617,7 @@ export default {
label: '操作',
type: 6,
values: '',
width: '150',
width: '200',
checkarr: [],
fixed: 'right',
hide: true,

1
src/views/distribution/reservation/atlas1.vue

@ -84,6 +84,7 @@ function init(data) {
if (status === 'complete' && result.info === 'OK') {
// result
console.log(result.geocodes);
details.mapLoc.setCenter([result.geocodes[0].location.lng, result.geocodes[0].location.lat])
geocodess.push({
pontion: result.geocodes[0].location,
content: item.customerName + '--' + item.customerAddress + '--' + item.customerTelephone,

3302
src/views/distribution/reservation/reservationAddFrom.vue

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save