Commit c02693ba authored by 仇晓婷's avatar 仇晓婷

Merge branch 'product' of http://git.mes123.com/zhouyx/mes-ui into product

parents d9c0b093 ad07d409
......@@ -2,22 +2,20 @@
<Poptip placement="bottom-start" trigger="hover" width="240" transfer>
<label :class="css">{{ user.name }}</label>
<div slot="content">
<Avatar
v-if="user.face"
size="large"
:src="user.face"
></Avatar>
<Avatar v-if="user.face" size="large" :src="user.face"></Avatar>
<Avatar
v-else
size="large"
style="color: #f56a00;background-color: #fde3cf; text-align:center"
:icon="user.gender=='男'?'md-person':'md-woman'"
></Avatar>
<div>姓名:{{ user.name }}
<div>
姓名:{{ user.name }}
<tag v-if="user.isDeleted">已删除</tag>
</div>
<div>状态:
<state :value="user.status" type="tag" code="User.base.status"/>
<div>
状态:
<state :value="user.status" type="tag" code="User.base.status" />
</div>
<div>性别:{{ user.gender }}</div>
<div>部门:{{ user.department }}</div>
......@@ -27,7 +25,7 @@
</template>
<script>
export default {
name: 'User',
name: "User",
props: {
value: {
type: [Number, String],
......@@ -38,58 +36,55 @@ export default {
return {
user: {
name: this.value,
face: '',
gender: '',
roles: '',
department: '',
loginName: '',
face: "",
gender: "",
roles: "",
status:0,
department: "",
loginName: "",
id: 0
},
css:"s0"
}
css: "s0"
};
},
mounted() {
//{"id":77,"name":"杨华馥","gender":"男","department":"北京生产车间","roles":"admin","status":1,"isDeleted":false}
this.load()
this.load();
},
methods: {
load() {
if (this.value) {
var user = this.$store.getters.getUser(this.value)
var user = this.$store.getters.getUser(this.value);
if (user) {
this.user = user
} else {
this.$api
.get(`${systemUrl}/user/getuser`, { id: this.value })
.then((r) => {
// alert(JSON.stringify( r.result))
if (r.success) {
this.user = r.result
if(this.user.isDeleted){
this.css="s2"
}else if(this.user.status==1){
this.css="s1"
}
if(this.user.face){
this.user.face=fileUrlDown+this.user.face;
}
// this.$store.commit('addUser', r.result)
}
})
this.user = user;
if (this.user.isDeleted) {
this.css = "s2";
} else if (this.user.status == 1) {
this.css = "s1";
}
if (this.user.face) {
this.user.face = fileUrlDown + this.user.face;
}
}
}
}
},
watch: {
value(v) {
if (v > 0) this.load()
if (v > 0) this.load();
}
}
}
};
</script>
<style lang="less">
.s2{color: red;}
.s1{color: #333}
.s0{color:#ddd}
.s2 {
color: red;
}
.s1 {
color: #333;
}
.s0 {
color: #ddd;
}
</style>
\ No newline at end of file
......@@ -96,6 +96,17 @@ henq.getDate = (strDate) => {
}).match(/\d+/g) + ')');
return date;
}
henq.group=(array, f)=> {
const groups = {};
array.forEach(function (o) {
const group = JSON.stringify(f(o));
groups[group] = groups[group] || [];
groups[group].push(o);
});
return Object.keys(groups).map(function (group) {
return groups[group];
});
}
henq.toTree = (list, rootId, format, parentFiledName) => {
var upId = parentFiledName;
let i = 0;
......
......@@ -14,10 +14,21 @@
<Radio label="2">已排产</Radio>
</RadioGroup>
{{listTask.length}}
<span class="check">
<RadioGroup v-model="listShow" type="button" size="small">
<Radio label="订单" title="订单分类">
<Icon type="ios-albums" />
</Radio>
<Radio label="工单" title="时间顺序">
<Icon type="ios-calendar" />
</Radio>
</RadioGroup>
</span>
</p>
<div class="dispatch_part_body" :style="{height:byheight}">
<!-- {{ids}} -->
<Row :gutter="15" class="card_body01">
<!-- <p>订单号:{{item.mesCode}}</p> v-for="(item,index) in listTask" :key="index" -->
<Col span="8" class="dispatch_card" v-for="(item,index) in listTask" :key="index">
<Card>
<p slot="title" class="card_top">
......@@ -247,6 +258,7 @@ export default {
byheight: '450px',
button1: '全部',
button2: '设备',
listShow: '订单',
shebei: '',
dateRange: {
//禁选工时时间区间
......@@ -428,13 +440,6 @@ export default {
let formData = this.listTask
let timebegin = formData[0].beginTime
let timend = formData[0].endTime
if (this.button2 == '设备') {
this.entity.taskTime = [timebegin,timend]
this.facilityModal = true
} else {
this.pentity.taskTime = [timebegin,timend]
this.manModal = true
}
this.newList = []
chekids.forEach((v) => {
var item = formData.filter((u) => {
......@@ -444,6 +449,20 @@ export default {
this.newList.push(item[0])
}
})
if (this.button2 == '设备') {
this.entity.taskTime = [timebegin,timend]
this.facilityModal = true
} else {
this.pentity.taskTime = [timebegin,timend]
if(formData.map(t=>{
this.newList.filter(m=>{
m.id = t.id
})
})){
}
this.manModal = true
}
console.log('选中的数据', this.newList)
},
// 设备派工
......@@ -481,7 +500,11 @@ export default {
// console.log(item)
this.$refs['formpepole'].validate((valid) => {
if(valid){
Api.saveTeamentry(item).then((res) => {
let params = {
isDispatch: 1,//派工是1,保存是0
entryList: item
}
Api.saveTeamentry(params).then((res) => {
if (res.success) {
this.$Message.success('人员派工成功。')
this.getUserInfoFn()
......@@ -494,7 +517,6 @@ export default {
this.$Message.error('校验不通过...')
}
})
},
// 拆分方法
setChai(item, index) {
......@@ -512,6 +534,29 @@ export default {
detail.pid = this.$u.guid()
detail.quantity = this.chaiNum
this.listTask.splice(this.rowIndex + 1, 0, detail)
this.saveFameData()
},
// 拆分保存
saveFameData() {
// let item = this.newList
// item.map((u) => {
// u.userIds = this.peploeId
// u.remark = this.pentity.remark
// })
// console.log(item)
let params = {
isDispatch: 0,//派工是1,保存是0
entryList: this.listTask
}
Api.saveTeamentry(params).then((res) => {
if (res.success) {
this.$Message.success('拆分成功。')
// this.getUserInfoFn()
// this.manModal = false
} else {
this.$Message.error('拆分失败...')
}
})
},
// 删除行
removeDetail(item, index) {
......
import createVuexAlong from 'vuex-along'
import Api from '@/plugins/request'
export const state = () => ({
counter: 0,
dictionary: new Map(), //所有字典项
userMap: [], //所有用户缓存;
userInfo: {
userId: 0,
userName: ""
},
cart:[],
count: 0,
countAps:0,//aps排产
countAi:0,//智能排产
countAll:0,//整机排产
countRun:0,//流水排产
export const state=()=>({
counter:0,
dictionary: new Map(),//所有字典项
userMap:new Map(),//所有用户缓存;
userInfo:{
userId:0,
userName:""
}
})
export const getters = {
export const getters={
dictionaryByKey: (state) => (key) => {
if(state.dictionary){
return;
}
let result = [];
let items = state.dictionary.get(key);
if (items) {
......@@ -25,79 +22,51 @@ export const getters = {
}
return result;
},
getUser: state => key => {
// try{
// if(state.userMap.has(key)){
// return state.userMap.get(key);
// }
// }catch(e){
// console.log(e);
// }
let user = state.userMap.filter(u => {
return u.id == key
});
if (user.length > 0) {
return user[0]
} else {
return null;
getUser:(state)=>key=>{
// debugger
if(state.userMap&&state.userMap.get){
return state.userMap.get(key);
}
}
}
export const mutations = {
increment(state) {
state.counter++
},
setUserInfo(state, userInfo) {
state.userInfo = userInfo;
// sessionStorage.setItem("userInfo", JSON.stringify(userInfo));
// sessionStorage.setItem("token", userInfo.token);
},
addUser(state, user) {
state.userMap.push(user);
},
setDictionary(state, dictionary) {
state.dictionary = dictionary;
},
setCart(state, cart) {
state.cart = cart;
},
setCartCount(state, count) {
state.count = count;
},
setCountAps(state, count) {//设置aps排产数量
state.countAps = count;
},
setCountAi(state, count) {//设置智能排产数量
state.countAi = count;
},
setCountAll(state, count) {//设置整机排产数量
state.countAll = count;
},
setCountRun(state, count) {//设置流水排产数量
state.countRun = count;
}
export const mutations={
increment(state){
state.counter++
},
setUserInfo(state, userInfo) {
state.userInfo = userInfo;
// sessionStorage.setItem("userInfo", JSON.stringify(userInfo));
// sessionStorage.setItem("token", userInfo.token);
},
setUsers(state,users){
state.userMap=users;
},
addUser(state,user){
state.userMap.push(user);
},
setDictionary(state, dictionary) {
state.dictionary = dictionary;
},
}
export const actions = {
async loadUser({
commit
}, key) {
let {
result
} = await this.$api.get(`${systemUrl}/user/getuser`, {
id: key
export const actions={
async loadUser({commit},key){
let { result } = await Api.get(`${systemUrl}/user/getuser`,{id:key});
console.warn("result",result)
commit("addUser",result);
},
async loadUsers({commit}){
let { result } = await Api.get(`${systemUrl}/user/getuserlist`);
var map=new Map();
result.map(u=>{
map.set(u.id,u);
});
console.warn("result", result)
commit("addUser", result);
commit("setUsers",map)
},
async loadDictionary({
commit
}) {
async loadDictionary({ commit }) {
let url = `${systemUrl}/Dictionary/GetAll`
let {
result
} = await Api.get(url);
let { result } = await Api.get(url);
var map = new Map();
......@@ -110,20 +79,20 @@ export const actions = {
}
}
export const plugins = [
createVuexAlong({
// 设置保存的集合名字,避免同站点下的多项目数据冲突
name: "hyhmes",
local: {
list: ["hyhmes"],
// 过滤模块 ma 数据, 将其他的存入 localStorage
isFilter: true,
},
session: {
// 保存模块 ma 中的 a1 到 sessionStorage
list: ["hyhmes.session"],
},
}),
]
//设置 strict 为不严格模式,即可在actions中修改state
export const strict = false;
export const plugins= [
createVuexAlong({
// 设置保存的集合名字,避免同站点下的多项目数据冲突
name: "hyhmes",
local: {
list: ["hyhmes"],
// 过滤模块 ma 数据, 将其他的存入 localStorage
isFilter: true,
},
session: {
// 保存模块 ma 中的 a1 到 sessionStorage
list: ["hyhmes.session"],
},
}),
]
//设置 strict 为不严格模式,即可在actions中修改state
export const strict=false;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment