This commit is contained in:
cun-nan 2024-03-28 14:39:24 +08:00
parent c6a2f7ff72
commit 393629664a
5 changed files with 178 additions and 39 deletions

View File

@ -40,7 +40,7 @@
<img src="../../assets/logo/logo.png" alt="" style="width: 60px;height: 50px; margin-right: 10px"> <img src="../../assets/logo/logo.png" alt="" style="width: 60px;height: 50px; margin-right: 10px">
</div> </div>
<div> <div>
蓝鲸智慧油站欢迎您 {{storeName || "蓝鲸智慧油站"}}欢迎您
</div> </div>
</div> </div>
@ -58,12 +58,14 @@ import Search from '@/components/HeaderSearch'
import FuintDoc from '@/components/Fuint/Doc' import FuintDoc from '@/components/Fuint/Doc'
import ScreenData from '@/components/ScreenData' import ScreenData from '@/components/ScreenData'
import {getCountdownApi} from "@/api/store"; import {getCountdownApi} from "@/api/store";
import {ljStoreInfo} from "@/api/staff/store";
export default { export default {
data() { data() {
return { return {
// //
day: -1, day: -1,
storeName:"",
} }
}, },
components: { components: {
@ -102,6 +104,7 @@ export default {
}, },
created() { created() {
this.getCountdown() this.getCountdown()
this.getStore()
}, },
methods: { methods: {
toggleSideBar() { toggleSideBar() {
@ -121,6 +124,11 @@ export default {
goToCashier() { goToCashier() {
window.open(this.pcUrl+'#/homeindex?id=0') window.open(this.pcUrl+'#/homeindex?id=0')
}, },
getStore(){
ljStoreInfo().then(res => {
this.storeName = res.data.name
})
},
// //
getCountdown() { getCountdown() {
getCountdownApi().then(res=> { getCountdownApi().then(res=> {

View File

@ -187,6 +187,16 @@
>{{dict.label}}</el-radio> >{{dict.label}}</el-radio>
</el-radio-group> </el-radio-group>
</span> </span>
<span v-else-if="ruleForm.deptType==='1'">
<el-radio-group :disabled="isTopDept" v-model="ruleForm.deptType">
<el-radio
v-for="dict in judgementNodeType(dict.type.node_type)"
:key="dict.value"
:label="dict.value"
v-if="dict.value!='4'"
>{{dict.label}}</el-radio>
</el-radio-group>
</span>
<span v-else> <span v-else>
<el-radio-group :disabled="isTopDept" v-model="ruleForm.deptType"> <el-radio-group :disabled="isTopDept" v-model="ruleForm.deptType">
<el-radio <el-radio
@ -637,19 +647,19 @@
<el-form-item label="角色名称" prop="roleName"> <el-form-item label="角色名称" prop="roleName">
<el-input v-model="form1.roleName" @input="$forceUpdate()" style="width: 300px" placeholder="请输入角色名称" /> <el-input v-model="form1.roleName" @input="$forceUpdate()" style="width: 300px" placeholder="请输入角色名称" />
</el-form-item> </el-form-item>
<el-form-item label="角色类型" prop="roleType"> <!-- <el-form-item label="角色类型" prop="roleType">-->
<el-select <!-- <el-select-->
v-model="form1.roleType" <!-- v-model="form1.roleType"-->
placeholder="角色类型" <!-- placeholder="角色类型"-->
@change="changeMenu" <!-- @change="changeMenu"-->
style="width: 300px" <!-- style="width: 300px"-->
> <!-- >-->
<!-- <el-option key="1" label="超级管理员" value="1"/>--> <!--&lt;!&ndash; <el-option key="1" label="超级管理员" value="1"/>&ndash;&gt;-->
<!-- <el-option key="2" label="普通管理员" value="2"/>--> <!--&lt;!&ndash; <el-option key="2" label="普通管理员" value="2"/>&ndash;&gt;-->
<el-option key="3" label="油站角色" value="3"/> <!-- <el-option key="3" label="油站角色" value="3"/>-->
<el-option key="4" label="公司角色" value="4"/> <!-- <el-option key="4" label="公司角色" value="4"/>-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="状态"> <el-form-item label="状态">
<el-radio-group v-model="form1.status"> <el-radio-group v-model="form1.status">
<el-radio key="A" label="A" value="A">启用</el-radio> <el-radio key="A" label="A" value="A">启用</el-radio>
@ -1098,7 +1108,6 @@ export default {
}, },
handleAdd1(){ handleAdd1(){
this.reset1(); this.reset1();
this.getMenuTreeselect(2);
this.form1.storeId = this.Thetree[0].id this.form1.storeId = this.Thetree[0].id
this.openDuty = true; this.openDuty = true;
this.title = "添加角色"; this.title = "添加角色";
@ -1106,6 +1115,7 @@ export default {
}, },
// //
getMenuTreeselect(merchantId) { getMenuTreeselect(merchantId) {
// merchantId deptType
return menuTreeselect({merchantId:merchantId}).then(response => { return menuTreeselect({merchantId:merchantId}).then(response => {
this.menuOptions = response.data; this.menuOptions = response.data;
return response return response
@ -1122,10 +1132,10 @@ export default {
}, },
handleUpdate1(data){ handleUpdate1(data){
this.reset1(); this.reset1();
let val = null; // let val = null;
if (data.dutyType == '3') val = 1; // if (data.dutyType == '3') val = 1;
if (data.dutyType == '4') val = 2; // if (data.dutyType == '4') val = 2;
const roleMenu = this.getMenuTreeselect(val); // const roleMenu = this.getMenuTreeselect(val);
const roleId = data.dutyId const roleId = data.dutyId
getRole(roleId).then(response => { getRole(roleId).then(response => {
this.form1.roleName = response.data.roleInfo.name; this.form1.roleName = response.data.roleInfo.name;
@ -1137,15 +1147,15 @@ export default {
this.title = "修改角色"; this.title = "修改角色";
let checkedKeys = response.data.checkedKeys let checkedKeys = response.data.checkedKeys
this.$nextTick(() => { // this.$nextTick(() => {
roleMenu.then(res => { // roleMenu.then(res => {
checkedKeys.forEach((v) => { // checkedKeys.forEach((v) => {
this.$nextTick(()=>{ // this.$nextTick(()=>{
this.$refs.menu.setChecked(v, true ,false); // this.$refs.menu.setChecked(v, true ,false);
}) // })
}) // })
}); // });
}); // });
}); });
}, },
handleStatusChangeDuty(data){ handleStatusChangeDuty(data){
@ -1226,7 +1236,7 @@ export default {
initPage() { initPage() {
this.activeName= 'list', this.activeName= 'list',
this.userList= 'list', this.userList= 'list',
this.cleanUp() // this.cleanUp()
this.getList() this.getList()
}, },
@ -1269,7 +1279,6 @@ export default {
this.isTopDept = flag this.isTopDept = flag
// //
this.queryParams.deptId = data.id this.queryParams.deptId = data.id
this.queryParams1.storeId = data.id this.queryParams1.storeId = data.id
@ -1280,6 +1289,7 @@ export default {
// this.getList(); // this.getList();
this.onlyGetUser() this.onlyGetUser()
this.getDutyList() this.getDutyList()
this.getMenuTreeselect(data.deptType);
}, },
// //
@ -1387,6 +1397,9 @@ export default {
if (this.activeName=="duty"){ if (this.activeName=="duty"){
this.getDutyList() this.getDutyList()
} }
if (this.activeName=="info"){
this.getDutyList()
}
}, },
// //
// //
@ -1495,7 +1508,7 @@ export default {
if (this.ruleForm.storeNum) { if (this.ruleForm.storeNum) {
this.storeNum = true this.storeNum = true
} }
if(res.data.status == 'qy'){ if(res.data.status === 'qy'){
this.value10 = true this.value10 = true
}else { }else {
this.value10 = false this.value10 = false

View File

@ -255,10 +255,10 @@ public class BackendSourceController extends BaseController {
@ApiOperation(value = "获取菜单下拉树列表") @ApiOperation(value = "获取菜单下拉树列表")
@RequestMapping(value = "/treeselect", method = RequestMethod.GET) @RequestMapping(value = "/treeselect", method = RequestMethod.GET)
public ResponseObject treeselect(HttpServletRequest request, TAccount account) { public ResponseObject treeselect(HttpServletRequest request, TAccount account) {
if (ObjectUtils.isNotEmpty(account.getDeptType()) && account.getDeptType().equals("3")){ if (ObjectUtils.isNotEmpty(account.getMerchantId()) && account.getMerchantId()==3){
account.setMerchantId(2);
}else {
account.setMerchantId(1); account.setMerchantId(1);
}else {
account.setMerchantId(2);
} }
String token = request.getHeader("Access-Token"); String token = request.getHeader("Access-Token");
AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token); AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);

View File

@ -72,6 +72,8 @@
} else { } else {
if (str.includes("storeId")) { if (str.includes("storeId")) {
storeId = str.split("=")[1] storeId = str.split("=")[1]
}else if(str.includes("sn")){
sn = str.split("=")[1]
} }
} }
uni.setStorageSync("storeId", storeId) uni.setStorageSync("storeId", storeId)

View File

@ -232,7 +232,6 @@
let staffId = ""; let staffId = "";
let sn = ""; let sn = "";
console.log("115151515:" + str);
if (str.includes("&")) { if (str.includes("&")) {
let arr = str.split("&"); let arr = str.split("&");
arr.forEach(item => { arr.forEach(item => {
@ -245,20 +244,30 @@
} }
}) })
} else { } else {
storeId = str.split("=")[1] if (str.includes("storeId")){
storeId = str.split("=")[1]
}else{
sn = str.split("=")[1]
this.getStoreIdBySn(sn);
}
} }
uni.setStorageSync("storeId", storeId) uni.setStorageSync("storeId", storeId)
uni.setStorageSync("sn", sn) uni.setStorageSync("sn", sn)
uni.setStorageSync("inviteStaffId", staffId) uni.setStorageSync("inviteStaffId", staffId)
this.storeId = uni.getStorageSync("storeId") this.storeId = uni.getStorageSync("storeId")
this.staffId = uni.getStorageSync("inviteStaffId") this.staffId = uni.getStorageSync("inviteStaffId")
this.getStore(uni.getStorageSync("storeId")); if (uni.getStorageSync("storeId")){
this.getStaffList(uni.getStorageSync("storeId")); this.getStore(uni.getStorageSync("storeId"));
this.getStaffList(uni.getStorageSync("storeId"));
}
} }
} else { } else {
if (uni.getStorageSync("storeId")) { if (uni.getStorageSync("storeId")) {
this.getStore(uni.getStorageSync("storeId")); this.getStore(uni.getStorageSync("storeId"));
this.getStaffList(uni.getStorageSync("storeId")); this.getStaffList(uni.getStorageSync("storeId"));
}else{
this.getStoreIdBySn(uni.getStorageSync("sn"));
} }
} }
@ -269,11 +278,112 @@
// this.isExistStoreId(); // this.isExistStoreId();
this.getStore(uni.getStorageSync("storeId")); this.getStore(uni.getStorageSync("storeId"));
this.getStaffList(uni.getStorageSync("storeId")); this.getStaffList(uni.getStorageSync("storeId"));
// this.getStoreIdBySn("byx19509291");
// this.getStore(0); // this.getStore(0);
this.getTheJudgmentIsTheSame() this.getTheJudgmentIsTheSame()
}, },
methods: { methods: {
//
getAddress(storeId) {
let _this = this;
uni.getLocation({
// 使wgs84 使gcj02
type: 'gcj02', // 使
success: function(res) {
if (_this.longitude == "" && _this.latitude == "") {
_this.longitude = res.longitude;
_this.latitude = res.latitude
}
console.log('经度: ' + _this.longitude);
console.log('纬度: ' + _this.latitude);
request({
url: 'business/storeInformation/store/recentlyStore',
method: 'post',
data: {
"lon": _this.longitude,
"lat": _this.latitude,
"storeId": storeId,
"isLogin": _this.AppToken ? "0" : "1", // 0
},
}).then((response) => {
console.log(response, "2154");
// uni.showToast({
// title:"121984:"+storeId
// })
if (response.data.store) {
_this.store = response.data.store
uni.setStorageSync("storeId", response.data.store.id)
uni.setStorageSync("chainStoreId", response.data.store.chainStoreId)
_this.getOilNumber(response.data.store.id);
} else {
uni.showToast({
title: "当前店铺已关闭!!!",
icon: "none"
})
}
}).catch(err => {})
// uni.showToast({
// title: "",
// icon: "none"
// })
},
fail: function(err) {
_this.getStore(2);
// uni.showToast({
// title: ""
// })
console.log('获取位置信息失败: ' + err.errMsg);
}
});
},
//
getUserAuthority() {
let _this = this;
// this.getAddress();
uni.getSetting({
async success(res) {
if (!res.authSetting['scope.userLocation']) {
// uni.authorize({
// scope: 'scope.userLocation',
// success() {
// //
// // _this.isExistStoreId()
// },
// fail() {
// //
// }
// })
await _this.getAddress(uni.getStorageSync("storeId"));
} else {
//
// _this.isExistStoreId()
await _this.getAddress(uni.getStorageSync("storeId"));
}
},
fail(err) {
}
})
},
// snstoreId
getStoreIdBySn(sn){
request({
url: "business/tag/oilTag/getSn/" + sn,
method: 'get'
}).then((res) => {
uni.setStorageSync("storeId", res.data.storeId)
if (res.data.storeId){
this.getStore(uni.getStorageSync("storeId"));
}else{
this.getAddress(uni.getStorageSync("storeId"));
}
})
},
// //
openKey() { openKey() {
this.show = true this.show = true
@ -292,6 +402,9 @@
// uni.showToast({ // uni.showToast({
// title:333 // title:333
// }) // })
if (!id) {
return;
}
let _this = this; let _this = this;
request({ request({
url: "business/storeInformation/store/queryStoreById", url: "business/storeInformation/store/queryStoreById",
@ -321,7 +434,7 @@
}) })
}, },
// //
getAddress() { getAddress1() {
let _this = this; let _this = this;
uni.getLocation({ uni.getLocation({
// 使wgs84 使gcj02 // 使wgs84 使gcj02
@ -391,6 +504,9 @@
}, },
// //
getStaffList(storeId) { getStaffList(storeId) {
if (!storeId) {
return;
}
let _this = this; let _this = this;
request({ request({
url: "business/member/staff/queryList1/" + storeId, url: "business/member/staff/queryList1/" + storeId,