Commit 8c0f4574 authored by 仇晓婷's avatar 仇晓婷

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

parents f7f10fe3 7a5b4b1f
......@@ -528,6 +528,18 @@ export default {
});
}
};
}
if (u.type == "workShopName") {
u.render = (h, params) => {
let values = u.key;
if (params.row[values]) {
return h("WorkShopName", {
props: {
value: params.row[values]
}
});
}
};
}
if (u.type == "date" || u.type == "dateTime") {
u.render = (h, params) => {
......
<template>
<div>
<label>{{workShop.name}}</label>
</div>
</template>
<script>
export default {
name: "workShopName",
props: {
value: {
type: [Number, String],
default: 0,
},
},
data() {
return {
data: [],
workShop: {},
};
},
mounted() {
this.load();
},
methods: {
load() {
if (this.value) {
var depart = this.$store.getters.getDepartment(this.value);
if (depart) {
this.workShop = depart;
}
}
},
},
watch: {
value(v) {
if (v > 0) this.load();
},
},
};
</script>
<style lang="less">
.s2 {
color: red;
}
.s1 {
color: #333;
}
.s0 {
color: #ddd;
}
</style>
\ No newline at end of file
......@@ -131,7 +131,7 @@ export default {
]
}
Api.getpaged(parme).then((res) => {
console.log(res)
// console.log(res)
})
},
openview(rowData){
......
......@@ -275,7 +275,8 @@ export default {
title: this.l("productingPreparationPeople"),
align: "left",
high: true,
hide: true
hide: true,
type:'workShopName'
},
{
key: "productingPreparationFinishDate",
......@@ -289,7 +290,8 @@ export default {
title: this.l("quotationPeople"),
align: "left",
high: true,
hide: true
hide: true,
type: "user"
},
{
key: "quotationFinishDate",
......@@ -530,6 +532,7 @@ export default {
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
await store.dispatch('loadDepartments');//加载部门
},
computed: {
searchList() {
......
......@@ -196,18 +196,34 @@ export default {
realWorkingHours: 0,
realRuntime: 0,
isParticipateIntime: null,
equipType: ""
equipType: "",
},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }]
}
name: [{ required: true, message: "必填", trigger: "blur" }],
equipTypeId: [
{
required: true,
message: "请选择任务类型",
trigger: "change",
type: "number",
},
],
resourceType: [
{
required: true,
message: "请选择任务类型",
trigger: "change",
type: "number",
},
],
},
};
},
props: {
v: Object,
eid: Number,
headid: Number,
maxNum: Number
maxNum: Number,
},
mounted() {
if (this.eid > 0) {
......@@ -216,13 +232,13 @@ export default {
},
methods: {
handleSubmit() {
this.$refs.form.validate(v => {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
this.entity.routingHeaderId = this.headid;
this.entity.taskSeq = this.maxNum;
Api.create(this.entity)
.then(r => {
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
......@@ -231,7 +247,7 @@ export default {
this.$Message.error("保存失败");
}
})
.catch(err => {
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
......@@ -239,11 +255,14 @@ export default {
}
});
},
clearEquip() {
alert("dfr");
},
handleClose() {
this.$emit("on-close");
},
load(v) {
Api.get({ id: v }).then(r => {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.entity.id = 0;
});
......@@ -275,12 +294,38 @@ export default {
equipChange(v, items) {
this.entity.equipType = items.equip_name;
this.entity.equipTypeId = items.id;
if (v != null) {
this.rules.equipTypeId[0].required = true;
this.rules.resourceType[0].required = false;
} else {
if (this.entity.resourceId != null && this.entity.resourceId > 0) {
this.rules.equipTypeId[0].required = false;
this.rules.resourceType[0].required = true;
} else {
this.rules.equipTypeId[0].required = true;
this.rules.resourceType[0].required = true;
}
}
},
resourceChange(v, items) {
this.entity.resourceId = v[1];
this.entity.resourceType = v[0];
this.entity.resourceCode = items[1].__label;
}
if (v != null) {
this.rules.equipTypeId[0].required = false;
this.rules.resourceType[0].required = true;
} else {
if (this.entity.equipTypeId != null && this.entity.equipTypeId > 0) {
this.rules.equipTypeId[0].required = true;
this.rules.resourceType[0].required = false;
} else {
this.rules.equipTypeId[0].required = true;
this.rules.resourceType[0].required = true;
}
}
},
},
watch: {
v() {
......@@ -290,8 +335,8 @@ export default {
if (v > 0) {
this.load(v);
}
}
}
},
},
};
</script>
<style type="less">
......
......@@ -166,90 +166,7 @@ export default {
align: "right",
hide: true
},
// {
// key: "resourceId",
// title: this.l("resourceId"),
// align: "left"
// },
// {
// key: "setupTime",
// title: this.l("setupTime"),
// align: "left"
// },
// {
// key: "transportTime",
// title: this.l("transportTime"),
// align: "left"
// },
// {
// key: "checkTime",
// title: this.l("checkTime"),
// align: "left"
// },
// {
// key: "checkFlag",
// title: this.l("checkFlag"),
// align: "left",
// code: "Process.routing_detail.check_flag"
// },
// {
// key: "departmentId",
// title: this.l("departmentId"),
// align: "left"
// },
// {
// key: "milestoneId",
// title: this.l("milestoneId"),
// align: "left"
// },
// { key: "phaseId", title: this.l("phaseId"), align: "left", high: true },
// {
// key: "status",
// title: this.l("status"),
// align: "left",
// code: "Process.Status"
// },
// {
// key: "performanceHours",
// title: this.l("performanceHours"),
// align: "left"
// },
// {
// key: "resourceCode",
// title: this.l("resourceCode"),
// align: "left",
// easy: true
// },
// {
// key: "realWorkingHours",
// title: this.l("realWorkingHours"),
// align: "left"
// },
// {
// key: "performanceWorkingHours",
// title: this.l("performanceWorkingHours"),
// align: "left"
// },
// {
// key: "equipTypeId",
// title: this.l("equipTypeId"),
// align: "left"
// },
// {
// key: "note",
// title: this.l("note"),
// align: "left",
// easy: true
// },
{
key: "creationTime",
title: this.l("creationTime"),
......
......@@ -29,6 +29,7 @@ import RoleSelect from '@/components/page/roleSelect.vue'
import UserExamSelect from '@/components/page/userExamSelect.vue'
import DepartmentSelect from '@/components/page/departmentSelect.vue'
import WorkShopSelect from '@/components/page/workShopSelect.vue'
import WorkShopName from '@/components/page/workShopName.vue'
import workShopDefault from '@/components/page/workShopDefault.vue'
import WorkShop from '@/components/page/workShop.vue'
import EquipSelect from '@/components/page/equipSelect.vue'
......@@ -105,6 +106,7 @@ Vue.component("Materiel", Materiel)
Vue.component("RoleSelect", RoleSelect)
Vue.component("UserExamSelect", UserExamSelect)
Vue.component("WorkShopSelect", WorkShopSelect)
Vue.component("WorkShopName",WorkShopName)
Vue.component("workShopDefault", workShopDefault)
Vue.component("WorkShop", WorkShop)
Vue.component("EquipSelect", EquipSelect)
......
......@@ -4,10 +4,12 @@ export const state = () => ({
counter: 0,
dictionary: new Map(), //所有字典项
userMap: new Map(), //所有用户缓存;
departmentsMap: new Map(), //部门缓存;
userInfo: {
userId: 0,
userName: ""
},
departments:{},//部门列表
cart: [],
count: 0,
countAps: 0, //aps排产
......@@ -41,7 +43,13 @@ export const getters = {
if (state.userMap && state.userMap.get) {
return state.userMap.get(key);
}
}
},
getDepartment: (state) => (key) => {
let items = state.departmentsMap.get(key);
if (items) {
return items;
}
},
}
export const mutations = {
increment(state) {
......@@ -78,6 +86,10 @@ export const mutations = {
},
setCountRun(state, count) { //设置流水排产数量
state.countRun = count;
},
setDepartments(state,departmentsMap)
{
state.departmentsMap = departmentsMap;
}
}
......@@ -113,7 +125,6 @@ export const actions = {
let {
result
} = await Api.get(url);
var map = new Map();
for (const key in result) {
......@@ -128,8 +139,18 @@ export const actions = {
r.result.map(u => {
umap.set(u.id, u);
});
commit("setUsers", umap)
}
commit("setUsers", umap);
},
async loadDepartments({
commit
}) {
let rdep = await Api.get(`${systemUrl}/department/getplantdepartments`);
var mapDep = new Map();
rdep.result.items.map(u => {
mapDep.set(u.id, u);
});
commit("setDepartments", mapDep);
},
}
export const plugins = [
......
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