Commit 35ce306d authored by 仇晓婷's avatar 仇晓婷

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

parents a24d5e0f 8bc7e4b3
......@@ -233,6 +233,9 @@ html body {
.pl20 {
padding-left: 20px
}
.pt15 {
padding-top: 15px
}
.bnone {
border: none;
......
......@@ -16,70 +16,69 @@
</template>
<script>
export default {
name: 'op',
name: "op",
props: {
icon:{
type:String
icon: {
type: String
},
oprate: {
type: String
},
type: {
type:String,
default:"text"
type: String,
default: "text"
},
title:{
type:String
title: {
type: String
},
msg:{
type:String,
default:"确认要删除吗?"
msg: {
type: String,
default: "确认要删除吗?"
}
},
data(){
data() {
return {
text:"",
css:"detail"
}
text: "",
css: "detail"
};
},
created(){
var oprates={
detail:"查看",
edit:"编辑",
add:"添加",
delete:"删除"
created() {
var oprates = {
detail: "查看",
edit: "编辑",
add: "添加",
delete: "删除"
};
if(oprates[this.oprate]){
this.text=oprates[this.oprate]
this.css=this.oprate;
}else if(this.oprate){
this.css=this.oprate;
}else if(this.type=='icon'){
this.css='icon'
if (oprates[this.oprate]) {
this.text = oprates[this.oprate];
this.css = this.oprate;
} else if (this.oprate) {
this.css = this.oprate;
} else if (this.type == "icon") {
this.css = "icon";
}
},
methods:{
handler(){
if(this.oprate=="delete"){
methods: {
handler() {
if (this.oprate == "delete") {
this.$Modal.confirm({
title: '确认',
content: '<p>'+this.msg+'</p>',
title: "确认",
content: "<p>" + this.msg + "</p>",
onOk: () => {
this.$emit("click",event)
this.$emit("click", event);
}
});
}else{
this.$emit("click",event)
} else {
this.$emit("click", event);
}
}
}
}
};
</script>
<style lang="less">
a.op{
a.op {
display: inline;
margin: 0 3px;
}
</style>
\ No newline at end of file
<template>
<div class="parameter">
<div v-if="load" style="width:100px;margin:0 auto;padding-top:60px;">
<Spin size="large"></Spin>
</div>
<div v-show="!load">
<Form ref="form" label-position="top" :model="entity" :rules="rules">
<Row :gutter="24">
<Col span="24" style="height:80px;">
<FormItem label="模板名称" prop="tempName">
<Input v-model="entity.tempName"></Input>
</FormItem>
</Col>
<Col span="24" style="height:60px;">
<FormItem label="模板描述">{{entity.tempInfo}}</FormItem>
</Col>
<Col span="24">
<FormItem label="排序规则"></FormItem>
</Col>
</Row>
</Form>
<div>
<div
class="listFather"
v-for="(item,index) in tempDataList"
v-dragging="{ item: item, list: tempDataList, group: 'item'}"
:key="item.name"
title="拖动上下移动"
>
<div>
<Icon type="md-move" />
{{index+1}}.{{item.name}}
</div>
<div
class="listChildren"
v-for="(item1,index1) in item.sons"
v-dragging="{ item: item1, list: item.sons, group: 'item1' }"
:key="index1"
>
<div>
<Icon type="md-move" />
{{index1+1}}.{{item1.name}}
</div>
</div>
</div>
</div>
<Row>
<Col span="24" style="text-align:right;height:60px;line-height:60px">
<Button type="primary" @click="handleSubmit">确定</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</Col>
</Row>
</div>
</div>
</template>
<script>
import Api from "./api";
export default {
data() {
return {
entity: {
id: null,
tempName: "",
tempInfo: ""
},
tempDataList: [],
tempInfo: "",
listTemp: [],
listTempShort: [],
rules: {
tempName: [{ required: true, message: "必填", trigger: "blur" }]
},
load: true
};
},
props: {},
created() {},
mounted() {
this.$dragging.$on("dragged", ({ value }) => {
if (this.listTemp.length < 1 && value.list.length < 5) {
this.listTemp = this.tempDataList;
this.listTempShort = value.list;
this.listTemp.forEach(dataAdd1 => {
if (dataAdd1.sons && dataAdd1.sons.length > 0) {
dataAdd1.sons = [];
dataAdd1.sons = this.listTempShort;
}
});
} else if (this.listTemp.length > 1 && value.list.length < 5) {
this.listTempShort = value.list;
this.listTemp.forEach(dataAdd => {
if (dataAdd.sons && dataAdd.sons.length > 0) {
dataAdd.sons = [];
dataAdd.sons = this.listTempShort;
}
});
} else {
this.listTempShort = [];
this.listTemp = value.list;
}
this.outInfo(this.listTemp);
});
this.$dragging.$on("dragend", () => {});
setTimeout(() => {
this.loadInfo();
}, 600);
},
methods: {
//加载模板描述信息
loadInfo() {
let tempList = [];
Api.addsorttemplateplus().then(r => {
if (r.success) {
tempList = r.result.templateList;
this.tempDataList = tempList;
this.entity.id = r.result.id;
this.entity.tempName = "";
//this.entity.tempName = r.result.templateName;
this.outInfo(tempList);
this.$emit("changeStatu", r.result.id);
}
});
},
//返回模板描述信息
outInfo(list) {
this.tempInfo = "";
list.forEach(data => {
if (data.sons && data.sons.length > 0) {
let dataInfo = "";
data.sons.forEach(dataChild => {
dataInfo += dataChild.name + "-->";
});
dataInfo = dataInfo.substring(0, dataInfo.length - 3);
this.tempInfo +=
data.name.substr(0, data.name.length - 2) +
"【" +
dataInfo +
"】-->";
} else {
this.tempInfo += data.name.substr(0, data.name.length - 2) + "-->";
}
});
this.load = false;
this.tempInfo = this.tempInfo.substring(0, this.tempInfo.length - 3);
this.entity.tempInfo = this.tempInfo;
},
handleSubmit() {
this.$refs.form.validate(valid => {
if (valid) {
let params = {
id: this.entity.id,
templateName: this.entity.tempName,
templateDesc: this.entity.tempInfo,
templateList:
this.listTemp.length < 1 ? this.tempDataList : this.listTemp
};
Api.savesorttemplate(params)
.then(res => {
if (res.success && res.result) {
this.$Message.success("新增成功");
let paramsData = {
id: this.entity.id,
name: this.entity.tempName,
info: this.entity.tempInfo
};
this.$emit("on-ok", paramsData);
this.$emit("on-close");
this.$emit("changeStatu", 0);
} else {
this.$Message.error("新增失败");
this.$emit("on-close");
}
})
.catch(e => {
this.$Message.error("数据异常!");
});
}
});
},
handleClose() {
let params = {
id: this.entity.id
};
Api.removesorttemplate(params).then(r => {
if (r.success) {
} else {
this.$Message.error("删除失败");
}
});
this.$emit("on-close");
},
l(key) {
let vkey = "mes_op_task_plan_simulate" + "." + key;
return this.$t(vkey) || key;
}
},
computed: {},
watch: {}
};
</script>
<style lang="less">
.parameter {
.ivu-form-item {
margin-bottom: 4px;
vertical-align: top;
zoom: 1;
}
.ivu-form .ivu-form-item-label {
font-weight: bold;
padding: 0;
}
.listFather {
padding: 5px 5px 0px 5px;
border-bottom: #ccc solid 1px;
line-height: 30px;
cursor: move;
}
.listFather:hover {
background: #e9f2fd;
}
.listChildren {
padding: 5px 5px 5px 20px;
border-bottom: #ccc dotted 1px;
line-height: 25px;
cursor: move;
}
.listChildren:hover {
background: #d3e6fb;
}
}
</style>
\ No newline at end of file
......@@ -84,5 +84,26 @@ export default {
apsupdate(params) {
return Api.post(`${designUrl}/routingdetail/apsupdate `, params);
},
//排序模板相关start-----
//获取排序规则下拉列表
getdropsortlist() {
return Api.get(`${apsUrl}/apspoolappservices/getdropsortlist`);
},
//点击新增初始化数据
addsorttemplateplus(){
return Api.post(`${apsUrl}/apspoolappservices/addsorttemplateplus`);
},
//保存模板
savesorttemplate(params) {
return Api.post(`${apsUrl}/apspoolappservices/savesorttemplate`, params);
},
//使用排产规则
usesorttemplate (params) {
return Api.post(`${apsUrl}/apspoolappservices/usesorttemplate `, params);
},
//删除排产模板
removesorttemplate(params){
return Api.post(`${apsUrl}/apspoolappservices/removesorttemplate `, params);
}
//排序模板相关end-----
}
......@@ -15,7 +15,19 @@
>
<template slot="easySearch"></template>
<template slot="searchBack">
<Select placeholder="选择历史方案" style="width: 150px;"></Select>
<Select
placeholder="选择排序优先级"
v-model="tempValue"
style="width: 150px;"
@on-change="tempValueChange"
clearable
>
<Option v-for="(item,index) in listTemp" :key="index" :value="item.id" :label="item.name"></Option>
</Select>
<a style="font-weight: bold;" @click="openaddModalTemp">
<Icon type="md-color-palette" size="14" />&nbsp;自定义排序模板
</a>&nbsp;&nbsp;&nbsp;&nbsp;
<Select placeholder="选择历史方案" style="width: 150px;"></Select>&nbsp;&nbsp;&nbsp;&nbsp;
<DatePicker
type="date"
placeholder="设置基准日期"
......@@ -42,6 +54,16 @@
<Button type="primary" class="mr10 ml10" @click="removeOk">移出排产</Button>
</template>
</DataGrid>
<Modal
v-model="addModalTemp"
title="自定义排序模板"
footer-hide
width="1000"
class="tempModal"
@on-cancel="tempCancel"
>
<Temp :data="listTemp" @changeStatu="changeStatu" ref="tempRef"></Temp>
</Modal>
<Modal v-model="addModal" title="工序参数设置" footer-hide width="1000">
<Add
@on-close="cancel"
......@@ -71,12 +93,14 @@
<script>
import Api from "./api";
import Add from "./add";
import Temp from "./temp";
import Expand from "./components/excute";
export default {
name: "list",
components: {
Add,
Expand
Expand,
Temp
},
data() {
return {
......@@ -92,6 +116,7 @@ export default {
detailModal: false,
deletelModal: false,
apsModal: false,
addModalTemp: false,
list: [],
curId: 0,
columns: [
......@@ -310,11 +335,15 @@ export default {
count: 0 //生产计划数量
},
//设置参数结束
circleModal: false //进度条
circleModal: false, //进度条
listTemp: [], //自定义模板排序下拉框列表
tempValue: null,
tempStatu: 0 //新建模型时传过来的id值
};
},
mounted() {
this.loadList();
this.loadTemp();
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
......@@ -328,6 +357,15 @@ export default {
}
});
},
loadTemp() {
Api.getdropsortlist().then(resDrop => {
//加载排序模板列表
if (resDrop.success) {
this.listTemp = resDrop.result;
}
});
},
addOk() {
this.list = [];
this.loadList();
......@@ -545,7 +583,49 @@ export default {
};
}
this.addModal = true;
},
//自定义排序模板相关start------
//打开自定义排序模板窗口
openaddModalTemp() {
this.addModalTemp = true;
},
tempCancel() {
if (this.tempStatu != 0) {
let params = {
id: this.tempStatu
};
Api.removesorttemplate(params).then(r => {
if (r.success) {
this.$refs.tempRef.cancel()
} else {
this.$Message.error("删除失败");
}
});
}
},
changeStatu(val) {
this.tempStatu = val;
},
//选择排序模板
tempValueChange(val) {
let params = {
id: val
};
Api.usesorttemplate(params).then(r => {
if (r.success) {
this.$Message.success("设置成功");
this.list = [];
this.loadList();
}
else
{
this.$Message.error("设置失败");
}
}).catch(e=>{
this.$Message.error("访问失败");
});
},
//自定义排序模板相关end------
}
};
</script>
......@@ -581,4 +661,18 @@ export default {
top: 0;
}
}
.tempModal {
.ivu-modal-body {
padding: 16px;
font-size: 14px;
line-height: 1.5;
padding-top: 2px;
padding-bottom: 0px;
}
.ivu-modal-footer {
border-top: none;
padding: 12px 18px 12px 18px;
text-align: right;
}
}
</style>
<template>
<div>
<Row>
<Col span="6" class="pt15">
<DataGrid
:columns="columnsTemp"
ref="gridTemp"
:data="data"
:high="false"
:page="false"
:batch="false"
:easy="false"
:set="false"
:height="575"
:tool="false"
></DataGrid>
</Col>
<Col span="18">
<Component :is="add" @on-close="cancel" @on-ok="addData" @changeStatu="changeStatu"></Component>
</Col>
</Row>
<Row>
<Col span="6" class="h50 tr">
<Button type="primary" @click="addTempModal">新增模板</Button>
</Col>
<Col span="18"></Col>
</Row>
</div>
</template>
<script>
import Api from "./api";
export default {
data() {
return {
add: null,
tempModal: false,
columnsTemp: [
{
key: "name",
title: "模板名称",
align: "left",
render: (h, params) => {
return h(
"Tooltip",
{
props: {
content:
params.row.name +
":"+params.row.desc,
placement: "left-start",
transfer: true,
maxWidth: "800"
}
},
params.row.name
);
}
},
{
title: " ",
key: "action",
width: 60,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h("op", {
props: {
icon: "ios-trash",
type: "icon",
title: "删除模板",
oprate: "delete",
msg: "确定删除模板?"
},
on: { click: () => this.remove(params.row) }
})
]);
}
}
]
};
},
props: {
data: {
type: Array,
default: () => {
return [];
}
}
},
created() {},
mounted() {},
methods: {
addTempModal() {
if (this.add == null) {
this.add = () => import("./addTemp");
}
},
handleSubmit() {
this.$refs.form.validate(valid => {
if (valid) {
}
});
},
//删除模板
remove(row) {
let params = {
id: row.id
};
Api.removesorttemplate(params).then(r => {
if (r.success) {
this.$Message.success("删除成功");
this.data.splice(row._index, 1);
} else {
this.$Message.success("删除失败");
}
});
},
handleClose() {
this.$emit("on-close");
},
addData(obj) {
//this.data.splice(0, 0,obj);
this.data.push(obj);
},
cancel() {
this.add = null;
},
changeStatu(val) {
this.$emit("changeStatu", val);
},
l(key) {
let vkey = "mes_op_task_plan_simulate" + "." + key;
return this.$t(vkey) || key;
}
},
computed: {},
watch: {}
};
</script>
<style lang="less">
</style>
\ No newline at end of file
......@@ -172,6 +172,9 @@ html body {
.pl20 {
padding-left: 20px;
}
.pt15 {
padding-top: 15px;
}
.bnone {
border: none;
}
......@@ -728,6 +731,11 @@ html [type=button] {
font-size: 24px;
color: #249e91;
}
.icon_box a.icon .ivu-icon-ios-cog {
font-weight: bold;
font-size: 24px;
color: #249e91;
}
.body-box .bj-box {
position: relative;
height: 45px;
......
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