Commit 0601ef31 authored by 佟礼's avatar 佟礼

Merge branch 'product' of 39.98.128.195:zhouyx/mes-ui into product

parents da86cb88 2f4b52fd
...@@ -99,6 +99,9 @@ export default { ...@@ -99,6 +99,9 @@ export default {
SimpleSearch: typeof (params) == 'string' ? params : params.simpleSearch, //快速搜索 SimpleSearch: typeof (params) == 'string' ? params : params.simpleSearch, //快速搜索
SkipCount: params.SkipCount ? params.SkipCount : 0, SkipCount: params.SkipCount ? params.SkipCount : 0,
MaxResultCount: params.MaxResultCount ? params.MaxResultCount : 20, MaxResultCount: params.MaxResultCount ? params.MaxResultCount : 20,
projectNumber: params.projectNumber, //项目号
batchNumber: params.batchNumber, //批次号
urgencyLevel: params.urgencyLevel, //紧急程度
}; };
return Api.get(`${PlanUrl}/mesorder/getpagedmesorders`, model); return Api.get(`${PlanUrl}/mesorder/getpagedmesorders`, model);
}, },
......
...@@ -48,13 +48,13 @@ export default { ...@@ -48,13 +48,13 @@ export default {
///浏览器窗口大小变化 ///浏览器窗口大小变化
return (() => { return (() => {
window.screenHeight = window.innerHeight; window.screenHeight = window.innerHeight;
this.divHeight = window.innerHeight - 180 + "px"; this.divHeight = window.innerHeight - 260 + "px";
})(); })();
}; };
}, },
created() { created() {
this.loadTree() this.loadTree()
var theight = window.innerHeight - 180 + 'px' var theight = window.innerHeight - 260 + 'px'
this.divHeight = theight this.divHeight = theight
}, },
methods: { methods: {
......
...@@ -1045,7 +1045,7 @@ export default { ...@@ -1045,7 +1045,7 @@ export default {
insert_flag: '插单', insert_flag: '插单',
important_flag:"插单", important_flag:"插单",
outside_time: '外协时间', outside_time: '外协时间',
discrete_percent: '离散百分比%', discrete_percent: '离散',
taskseq_des: '', taskseq_des: '',
workshopcode: '', workshopcode: '',
routing_detail_id: '', routing_detail_id: '',
......
...@@ -7,6 +7,13 @@ ...@@ -7,6 +7,13 @@
<Icon type="ios-keypad" /> <Icon type="ios-keypad" />
<div class="top_menu_box"> <div class="top_menu_box">
<table class="t_table_box"> <table class="t_table_box">
<tr>
<td class="t_title">
<a class="a_goIndex" @click="goIndex">
<b class="title">首页</b>
</a>
</td>
</tr>
<tr v-for="(item,i) in filterSider"> <tr v-for="(item,i) in filterSider">
<td class="t_title"> <td class="t_title">
<b class="title" <b class="title"
...@@ -277,6 +284,9 @@ export default { ...@@ -277,6 +284,9 @@ export default {
this.$router.push(u.path) this.$router.push(u.path)
this.isActive = u.id this.isActive = u.id
}, },
goIndex(){
this.$router.push("/")
},
}, },
mounted() { mounted() {
document.addEventListener("scroll", this.handleScroll, { passive: true }); document.addEventListener("scroll", this.handleScroll, { passive: true });
...@@ -382,6 +392,9 @@ export default { ...@@ -382,6 +392,9 @@ export default {
.t_title{ .t_title{
min-width: 120px; min-width: 120px;
background: #515a6e; background: #515a6e;
.a_goIndex{
color: #fff;
}
.title{ .title{
padding: 5px 10px; padding: 5px 10px;
} }
......
...@@ -3,54 +3,28 @@ ...@@ -3,54 +3,28 @@
<Form ref="form" :model="entity" :rules="rules" :label-width="100"> <Form ref="form" :model="entity" :rules="rules" :label-width="100">
<Row :gutter="20"> <Row :gutter="20">
<Col span="12"> <Col span="12">
<div class="left-up"> <div class="filedset" style="height:238px">
<p class="title-c">参数设置</p> <p class="title">多台分配设置</p>
<FormItem :label="l('plan_method')" prop="plan_method"> <div class="duo">
<i-switch v-model="entity.plan_method" size="large"> <FormItem :label="l('multi_machine')" prop="multiple">
<span slot="open">On</span> <i-switch v-model="entity.multiple" size="large">
<span slot="close">Off</span> <span slot="open"></span>
</i-switch> <span slot="close"></span>
</FormItem>
<FormItem :label="l('calId')" prop="calId">
<Select v-model="entity.calId" style="width:150px">
<Option
v-for="(item,index) in listCal"
:key="index"
:value="item.calid"
:label="item.calname"
></Option>
</Select>
</FormItem>
<FormItem :label="l('overTime')" prop="overTime">
<i-switch v-model="entity.overTime" size="large">
<span slot="open">On</span>
<span slot="close">Off</span>
</i-switch> </i-switch>
</FormItem> </FormItem>
<FormItem :label="l('efficiencyValue')" prop="efficiencyValue"> <FormItem label="多台数量" prop="multipleCount">
<Input v-model="entity.efficiencyValue" style="width:150px"></Input> <InputNumber v-model="entity.multipleCount"></InputNumber>
</FormItem>
<FormItem :label="l('run_time')" prop="run_time">
<InputNumber v-model="entity.run_time"></InputNumber>
</FormItem> </FormItem>
<FormItem :label="l('isDiscrete')" prop="isDiscrete"> <FormItem label="生产设备">
<i-switch v-model="entity.isDiscrete" size="large"> <EquipSelect v-model="entity.multipleEquipPks" multiple></EquipSelect>
<span slot="open">On</span>
<span slot="close">Off</span>
</i-switch>
</FormItem>
<FormItem :label="l('discrete')" prop="discrete">
<InputNumber v-model="entity.discrete"></InputNumber>
</FormItem>
<FormItem :label="l('discrete_percent')" prop="discrete_percent">
<InputNumber v-model="entity.discrete_percent"></InputNumber>
</FormItem> </FormItem>
</div> </div>
<div class="left-donw"> </div>
<p class="title-c">参数级别</p> <div class="filedset">
<p class="title">快速设置</p>
<div class="icon"> <div class="icon">
<Dropdown trigger="custom" :visible="visible" style="width:150px"> <Dropdown trigger="hover">
<a href="javascript:void(0)" @click="handleOpen"> <a href="javascript:void(0)">
<Icon type="md-git-compare" /> <Icon type="md-git-compare" />
</a> </a>
<DropdownMenu slot="list" style="text-align: center;"> <DropdownMenu slot="list" style="text-align: center;">
...@@ -78,74 +52,75 @@ ...@@ -78,74 +52,75 @@
</a> </a>
<span>是否离散</span> <span>是否离散</span>
</DropdownItem> </DropdownItem>
<div style="margin:10px;"> <!-- <div>
<Button type="primary" @click="handleOk">确定</Button> <Button type="text" class="ib" @click="handleOk">确定</Button><Button type="text" class="ib" @click="handle">关闭</Button>
<Button type="primary" @click="handle">关闭</Button> </div>-->
</div>
</DropdownMenu> </DropdownMenu>
</Dropdown> </Dropdown>
</div> </div>
<div class="slider"> <div class="slider">
<Slider v-model="entity.level" :step="20" show-stops></Slider> <h3 v-text="entity.level"></h3>
<div class="slow"></div> <Slider
<div class="fast"></div> v-model="entity.level"
:step="1"
:min="0"
:max="levelRules.length-1"
:marks="levelMarks"
show-stops
@on-change="setParameter"
></Slider>
</div>
</div>
<div class="filedset">
<p class="title">应用范围</p>
<div class="slider">
<Slider v-model="entity.flog" :step="1" :min="0" :max="5" :marks="marks" size="large"></Slider>
</div> </div>
</div> </div>
</Col> </Col>
<Col span="12"> <Col span="12">
<div class="right-up"> <div class="filedset">
<p class="title-d">多台分配设置</p> <p class="title">参数设置</p>
<div class="duo"> <FormItem :label="l('plan_method')" prop="planState">
<Row> <i-switch v-model="entity.planState" size="large">
<Col :span="12"> <span slot="open">平行</span>
<FormItem :label="l('multi_machine')" prop="multi_machine"> <span slot="close">重叠</span>
<i-switch v-model="entity.switch4" size="large">
<span slot="open">On</span>
<span slot="close">Off</span>
</i-switch> </i-switch>
</FormItem> </FormItem>
</Col> <FormItem :label="l('calId')" prop="calId">
<Col :span="12"> <Select v-model="entity.calId">
<FormItem label="多台数量" prop="abbre">
<InputNumber v-model="entity.abbre"></InputNumber>
</FormItem>
</Col>
</Row>
<FormItem label="班组结构">
<Select v-model="entity.shopId" placeholder="请选择" style="width:150px" prop="shopId">
<Option <Option
v-for="(item,index) in list" v-for="(item,index) in listCal"
:key="index" :key="index"
:value="item.value" :value="item.id"
:label="item.title" :label="item.calname"
style="display:none"
></Option> ></Option>
<Tree key="mytree" :data="data1" ref="mytree" :render="renderContent"></Tree>
</Select> </Select>
</FormItem> </FormItem>
<div class="check-box"> <Divider />
<CheckboxGroup v-model="entity.fruit"> <FormItem :label="l('overTime')" prop="over">
<Checkbox label="10985553333(数控车床 车工班)"></Checkbox> <i-switch v-model="entity.over" size="large">
<br /> <span slot="open">加班</span>
<Checkbox label="10985553333(数控车床 车工班)"></Checkbox> <span slot="close">不加班</span>
<br /> </i-switch>
<Checkbox label="10985553333(数控车床 车工班)"></Checkbox> </FormItem>
<br /> <FormItem :label="l('efficiencyValue')" prop="efficiencyValue">
<Checkbox label="10985553333(数控车床 车工班)"></Checkbox> <InputNumber v-model="entity.efficiencyValue" :step="0.1"></InputNumber>
<br /> </FormItem>
</CheckboxGroup> <Divider />
</div> <FormItem :label="l('isDiscrete')" prop="lisan">
</div> <i-switch v-model="entity.lisan" size="large">
</div> <span slot="open"></span>
<div class="left-donw right-down"> <span slot="close"></span>
<p class="title-c">参数应用</p> </i-switch>
<div class="slider"> </FormItem>
<Slider v-model="entity.value2" :step="33.3" show-stops></Slider> <FormItem :label="l('discrete')" prop="discrete">
<div class="slow">工序</div> <InputNumber v-model="entity.discrete"></InputNumber>
<div class="ding">订单</div> </FormItem>
<div class="ling">零件</div> <FormItem :label="l('discrete_percent')" prop="discrete_percent">
<div class="fast">所有</div> <InputNumber v-model="entity.discrete_percent"></InputNumber>
</div> </FormItem>
</div> </div>
</Col> </Col>
</Row> </Row>
...@@ -162,29 +137,82 @@ export default { ...@@ -162,29 +137,82 @@ export default {
data() { data() {
return { return {
entity: { entity: {
flog: 0, //参数应用 partTaskPk: 0,
planMethod: "转序规则", // 平行 重叠 opTaskPk: 0,
taskSeq: "",
flog: 0, //参数应用范围
level: 0, //参数规则ID
calId: null,
planState: true,
planMethod: "重叠", // 平行 重叠
over: false,
overTime: "不加班", //"六日加班", 不加班 加班
efficiencyValue: 11, // 效率系数, 必须大于 0
shopId: null, shopId: null,
level: 100, lisan: true,
value2: 100, isDiscrete: "否",
fruit: [] discrete: 1, //离散数值 必须大于 1
multiple: true,
multipleEquip: "是", //"是否多台安排设备", 否 是
multipleCount: 1, //多台数量
multipleEquipPks: [],
multipleEquipIds: "" //"设备id", 用英文逗号分隔
},
levelRules:[],
levelMarks: {
0: "慢",
5: "快"
},
rules: {
// calId: [
// { required: true, message: "必填", type: "number", trigger: "change" }
// ]
}, },
list: [], list: [],
data1: [], data1: [],
marks: {
0: "工序",
1: "计划",
2: "产品",
3: "项目",
4: "批次",
5: "所有"
},
listCal: [], listCal: [],
visible: false, visible: false
rules: { // rules: {
businessName: [{ required: true, message: "必填", trigger: "blur" }], // businessName: [{ required: true, message: "必填", trigger: "blur" }],
businessCode: [{ required: true, message: "必填", trigger: "blur" }] // businessCode: [{ required: true, message: "必填", trigger: "blur" }]
} // }
}; };
}, },
mounted() { props: {
opTaskPk: {
//工单ID
type: Number,
default: 0
},
partTaskPk: {
//生产计划ID
type: Number,
default: 0
},
taskSeq: {
//工序编号
type: String,
default: ""
},
count: {
//生产计划数量
type: Number,
default: 0
}
},
created() {
this.getCal(); //获取连班策略 this.getCal(); //获取连班策略
this.apsGet(); //获取参数级别和转序等的关系 this.apsGet(); //获取参数级别和转序等的关系
this.initTree(); //获取当前登录人所在车间下的所有部门
}, },
mounted() {},
methods: { methods: {
getCal() { getCal() {
Api.getallcal().then(res => { Api.getallcal().then(res => {
...@@ -195,75 +223,61 @@ export default { ...@@ -195,75 +223,61 @@ export default {
}, },
apsGet() { apsGet() {
Api.apsGetall().then(res => { Api.apsGetall().then(res => {
// if (res.success) {
// }
});
},
handleSubmit() {
this.$refs.form.validate(valid => {
if (valid) {
Api.apsschedulupdateparameter(this.entity).then(res => {
if (res.success) { if (res.success) {
console.log(res.result)
this.levelRules = res.result;
let max=this.levelRules.length-1;
// let marks = `{0:"慢", ${max}:"快"}`;
// marks = marks.replace(/(\d+):/g,"\"$1\":");
// this.levelMarks = JSON.parse(marks);
// this.entity.level=0;
} }
}); });
} else { },
this.$Message.error("Fail!"); setParameter(v) {
// alert(v)
let parameters = this.levelRules[v].prams;
parameters.map(u => {
if (u.parametersCode == "PlanMethod") {
this.entity.planState = u.parameterValue == "平行";
this.entity.planMethod = u.parameterValue;
} else if (u.parametersCode == "OverTime") {
this.entity.over = u.OverTime == "不加班";
this.entity.overTime = u.parameterValue;
} else if (u.parametersCode == "Discrete") {
this.entity.lisan = u.parameterValue == "是";
this.entity.isDiscrete = u.parameterValue;
} }
console.log(u);
}); });
}, },
initTree() { handleSubmit() {
var sumData = []; this.$refs.form.validate(valid => {
Api.userdepartmentsofworkshop() if (valid) {
.then(r => { this.entity.multipleEquipIds = this.entity.multipleEquipPks.join();
this.entity.planMethod = this.entity.planState ? "重叠" : "平行";
if (r.result) { this.entity.overTime = this.entity.over ? "不加班" : "加班";
this.data1 = r.result; this.entity.isDiscrete = this.entity.lisan ? "是" : "否";
this.entity.multipleEquip = this.entity.multiple ? "是" : "否";
Api.apsschedulupdateparameter(this.entity)
.then(res => {
if (res.result.state) {
this.$Message.success(res.result.msg);
this.$emit("on-parameter-ok");
} else { } else {
this.$Message.error("加载部门失败!"); this.$Message.error(res.result.msg);
} }
}) })
.catch(err => {}); .catch(e => {
}, this.$Message.error("数据异常!");
renderContent(h, { root, node, data }) { });
//渲染树的样式
return h(
"span",
{
style: {
cursor: "pointer"
},
on: {
click: () => {
this.handleSelect(data); //手动选择树节点
}
} }
}, });
data.title
);
},
handleSelect(data) {
let obj = {
label: data.title,
value: data.value
};
this.list = [];
this.list.push(obj);
alert(this.list[0].value)
this.entity.shopId = this.list[0].value;
}, },
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
}, },
handleOpen() {
this.visible = true;
},
handle() {
this.visible = false;
},
handleOk() {},
l(key) { l(key) {
let vkey = "mes_op_task_plan_simulate" + "." + key; let vkey = "mes_op_task_plan_simulate" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
...@@ -271,31 +285,16 @@ export default { ...@@ -271,31 +285,16 @@ export default {
} }
}; };
</script> </script>
<style lang="less" scoped> <style lang="less">
.parameter { .parameter {
margin: 10px; margin: 10px;
.left-up { .filedset {
position: relative;
border: 1px solid #e0e0e0;
padding: 25px 0;
.title-c {
width: 68px;
padding-left: 5px;
background: #fff;
position: absolute;
top: -9px;
left: 25px;
color: #2680eb;
}
}
.left-donw {
margin-top: 15px;
position: relative; position: relative;
border: 1px solid #e0e0e0; border: 1px solid #e0e0e0;
padding: 25px 0; padding: 25px 10px 0 10px;
margin-bottom: 20px;
.title-c { .title {
width: 68px; display: inline-block;
padding-left: 5px; padding-left: 5px;
background: #fff; background: #fff;
position: absolute; position: absolute;
...@@ -303,61 +302,19 @@ export default { ...@@ -303,61 +302,19 @@ export default {
left: 25px; left: 25px;
color: #2680eb; color: #2680eb;
} }
.slider {
margin: 0 50px 0 50px;
position: relative;
.slow {
position: absolute;
top: 7px;
left: -5px;
}
.fast {
position: absolute;
top: 7px;
right: -10px;
}
.ding {
position: absolute;
top: 7px;
left: 30%;
}
.ling {
position: absolute;
top: 7px;
right: 30%;
}
}
.icon { .icon {
text-align: right;
padding-right: 15px;
margin-top: -15px;
}
}
.right-up {
position: relative;
border: 1px solid #e0e0e0;
padding: 25px 0;
.title-d {
width: 95px;
padding-left: 5px;
margin-left: 10px;
background: #fff;
position: absolute; position: absolute;
top: -9px; right: 10px;
left: 25px; top: 10px;
color: #2680eb;
} }
.check-box { .slider {
height: 348px; padding: 20px 20px;
border-top: 1px solid #e0e0e0; .ivu-slider-marks-item {
padding: 15px; width: 60px;
padding-left: 0; text-align: center;
margin-left: 25px; // margin-right: -20px;
overflow: auto;
} }
} }
.right-down {
height: 92px;
} }
.click-btn { .click-btn {
text-align: right; text-align: right;
......
...@@ -66,7 +66,12 @@ export default { ...@@ -66,7 +66,12 @@ export default {
} }
}, },
props: { props: {
eid: Number row: {
type:Object,
default:()=>{
return null
}
}
}, },
methods: { methods: {
load(v) { load(v) {
...@@ -84,7 +89,7 @@ export default { ...@@ -84,7 +89,7 @@ export default {
this.disabled = false this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success('保存成功')
this.$emit('on-ok') this.$emit('on-option-ok')
} else { } else {
this.$Message.error('保存失败') this.$Message.error('保存失败')
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<StoreHouseLeft @storeIds="storeIds" :type='2'></StoreHouseLeft> <StoreHouseLeft @storeIds="storeIds" :type='2'></StoreHouseLeft>
</Sider> </Sider>
<Content class="content"> <Content class="content">
<DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch"> <DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch" :height="tdHeight">
<template slot="searchForm"> <template slot="searchForm">
<Search /> <Search />
</template> </template>
...@@ -82,6 +82,7 @@ export default { ...@@ -82,6 +82,7 @@ export default {
deletelModal: false, deletelModal: false,
setNumModal: false, setNumModal: false,
inventoryModal: false, inventoryModal: false,
tdHeight:0,
curId: 0, curId: 0,
easySearch: { easySearch: {
keys: { op: 'code,name', value: '', default: true }, keys: { op: 'code,name', value: '', default: true },
...@@ -256,7 +257,7 @@ export default { ...@@ -256,7 +257,7 @@ export default {
}, },
mounted() {}, mounted() {},
created() { created() {
this.tdHeight = window.innerHeight - 260
}, },
methods: { methods: {
addOk() { addOk() {
......
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
ref="grid" ref="grid"
:conditions="easySearch" :datalist="dataList" :total="ptotal" :conditions="easySearch" :datalist="dataList" :total="ptotal"
placeholder="请输入查询条件" placeholder="请输入查询条件"
:high="true" > :high="true"
:height="tdHeight" >
<template slot="searchForm"> <template slot="searchForm">
<Search /> <Search />
</template> </template>
...@@ -103,6 +104,7 @@ export default { ...@@ -103,6 +104,7 @@ export default {
deletelModal: false, deletelModal: false,
setNumModal: false, setNumModal: false,
inventoryModal: false, inventoryModal: false,
tdHeight:0,
curId: 0, curId: 0,
easySearch: { easySearch: {
keys: { op: 'code,name', value: '', default: true }, keys: { op: 'code,name', value: '', default: true },
...@@ -165,7 +167,7 @@ export default { ...@@ -165,7 +167,7 @@ export default {
} }
}, },
mounted() {}, mounted() {},
created() {}, created() {this.tdHeight = window.innerHeight - 260},
methods: { methods: {
addOk() { addOk() {
this.addModal = false this.addModal = false
......
<template> <template>
<Layout class="full"> <Layout class="full">
<Sider hide-trigger :style="{background: '#fff'}" width="260" > <Sider hide-trigger :style="{background: '#fff'}" width="260">
<div class="zh-tree" :style="{height:treeHeight+'px'}"> <div class="zh-tree" :style="{height:treeHeight+'px'}">
<h3 class="zh-title">产品结构</h3> <h3 class="zh-title">产品结构</h3>
<div class="zh-box" > <div class="zh-box">
<Input search placeholder="请输入查询条件" v-model="treeInputSearch" /> <Input search placeholder="请输入查询条件" v-model="treeInputSearch" />
<Tree :data="searchList" :style="{height:(treeHeight-115)+'px'}" style="overflow:auto;width:215px;" @on-select-change="selectTreeNode"></Tree> <Tree
:data="searchList"
:style="{height:(treeHeight-115)+'px'}"
style="overflow:auto;width:215px;"
@on-select-change="selectTreeNode"
></Tree>
</div> </div>
</div> </div>
</Sider> </Sider>
...@@ -43,6 +48,28 @@ ...@@ -43,6 +48,28 @@
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span="12">
<FormItem label="项目号" style="width:100%">
<Input v-model="orderSearchForm.projectNumber" placeholder style="width:240px" />
</FormItem>
</Col>
<Col span="12">
<FormItem label="批次号" style="width:100%">
<Input v-model="orderSearchForm.batchNumber" placeholder style="width:240px" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="12">
<FormItem label="紧急程度" style="width:100%">
<dictionary
code="plan.order.urgencyLevel"
v-model="orderSearchForm.urgencyLevel"
style="width:240px"
></dictionary>
</FormItem>
</Col>
<Col span="12"> <Col span="12">
<FormItem label="任务类型" style="width:100%"> <FormItem label="任务类型" style="width:100%">
<dictionary <dictionary
...@@ -52,6 +79,8 @@ ...@@ -52,6 +79,8 @@
></dictionary> ></dictionary>
</FormItem> </FormItem>
</Col> </Col>
</Row>
<Row>
<Col span="12"> <Col span="12">
<FormItem label="阶段" style="width:100%"> <FormItem label="阶段" style="width:100%">
<dictionary <dictionary
...@@ -61,8 +90,6 @@ ...@@ -61,8 +90,6 @@
></dictionary> ></dictionary>
</FormItem> </FormItem>
</Col> </Col>
</Row>
<Row>
<Col span="12"> <Col span="12">
<FormItem label="材料" style="width:100%"> <FormItem label="材料" style="width:100%">
<dictionary <dictionary
...@@ -72,13 +99,13 @@ ...@@ -72,13 +99,13 @@
></dictionary> ></dictionary>
</FormItem> </FormItem>
</Col> </Col>
</Row>
<Row>
<Col span="12"> <Col span="12">
<FormItem label="数量" style="width:100%"> <FormItem label="数量" style="width:100%">
<InputNumber :min="0" v-model="orderSearchForm.quantity" style="width:240px"></InputNumber> <InputNumber :min="0" v-model="orderSearchForm.quantity" style="width:240px"></InputNumber>
</FormItem> </FormItem>
</Col> </Col>
</Row>
<Row>
<Col span="12"> <Col span="12">
<FormItem label="甲方客户" style="width:100%"> <FormItem label="甲方客户" style="width:100%">
<dictionary <dictionary
...@@ -88,15 +115,6 @@ ...@@ -88,15 +115,6 @@
></dictionary> ></dictionary>
</FormItem> </FormItem>
</Col> </Col>
<Col span="12">
<FormItem label="3D打印承制单位" style="width:100%">
<dictionary
code="plan.order.printSupply"
v-model="orderSearchForm.printSupply"
style="width:240px"
></dictionary>
</FormItem>
</Col>
</Row> </Row>
<Row> <Row>
<Col span="12"> <Col span="12">
...@@ -161,42 +179,45 @@ ...@@ -161,42 +179,45 @@
</template> </template>
<script> <script>
import CustomTable from '@/components/customTable/customTable.vue' import CustomTable from "@/components/customTable/customTable.vue";
export default { export default {
components: { CustomTable }, components: { CustomTable },
data() { data() {
return { return {
treeData: [], treeData: [],
treeInputSearch: '', treeInputSearch: "",
ocolumn: [], ocolumn: [],
treeHeight: '', treeHeight: "",
tableHeight: '', tableHeight: "",
ids: [], ids: [],
orderSearchForm: { orderSearchForm: {
productId: '', //产品id productId: "", //产品id
productName: '', //产品名称 productName: "", //产品名称
taskType: '', //任务类型 taskType: "", //任务类型
stage: '', //阶段 stage: "", //阶段
materialId: '', //材料 materialId: "", //材料
quantity: null, //数量 quantity: null, //数量
guestName: '', //甲方客户 guestName: "", //甲方客户
printSupply: '', //3D打印承制单位 printSupply: "", //3D打印承制单位
functionaryOffice: '', //厂内责任机关 functionaryOffice: "", //厂内责任机关
mainDepartmentId: '', //厂内责任主体部门ID mainDepartmentId: "", //厂内责任主体部门ID
taskRequire: '', //任务接点要求 taskRequire: "", //任务接点要求
putintDocmentCode: '', //甲方投产输入文件编号 putintDocmentCode: "", //甲方投产输入文件编号
technologyDocmentCode: '', //甲方技术输入文件编号 technologyDocmentCode: "", //甲方技术输入文件编号
outerDrawnNumber: '', //外部图号/模型号 outerDrawnNumber: "", //外部图号/模型号
modelVersion: '', //模型版本 modelVersion: "", //模型版本
taskCode: '', //甲方任务号 taskCode: "", //甲方任务号
designer: '', //甲方设计人员 designer: "", //甲方设计人员
officeFunctionary: '', //厂内机关负责人 officeFunctionary: "", //厂内机关负责人
mainRoutingPeople: '', //厂内主工艺人员 mainRoutingPeople: "", //厂内主工艺人员
routing_Method: '', //工艺方法 routing_Method: "", //工艺方法
outer_Envelope_Size: '', //包装尺寸 outer_Envelope_Size: "", //包装尺寸
demandStartDate: '', //开始时间 demandStartDate: "", //开始时间
demandFinishDate: '', //完成时间 demandFinishDate: "", //完成时间
remark: '' //备注 remark: "", //备注
projectNumber: "", //项目号
batchNumber: "", //批次号
urgencyLevel: null //紧急程度
}, },
list: [], list: [],
data1: [], data1: [],
...@@ -214,139 +235,137 @@ export default { ...@@ -214,139 +235,137 @@ export default {
mainDeptList: [], //厂内主体部门下拉 mainDeptList: [], //厂内主体部门下拉
taskTypeList: [], //任务类型 taskTypeList: [], //任务类型
statusList: [] //状态类型 statusList: [] //状态类型
} };
}, },
created() { created() {
this.treeHeight = window.innerHeight - 150 this.treeHeight = window.innerHeight - 150;
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
mounted() { mounted() {
this.initTree() this.initTree();
this.tableHeight = window.innerHeight - 220 this.tableHeight = window.innerHeight - 220;
this.$refs.CustomTable.getTableHeight(this.tableHeight) this.$refs.CustomTable.getTableHeight(this.tableHeight);
window.onresize = () => { window.onresize = () => {
///浏览器窗口大小变化 ///浏览器窗口大小变化
return (() => { return (() => {
window.screenHeight = window.innerHeight window.screenHeight = window.innerHeight;
this.treeHeight = window.screenHeight - 150 this.treeHeight = window.screenHeight - 150;
this.tableHeight = window.screenHeight - 220 this.tableHeight = window.screenHeight - 220;
this.$refs.CustomTable.getTableHeight(this.tableHeight) this.$refs.CustomTable.getTableHeight(this.tableHeight);
})() })();
} };
//dev状态下使用静态数据 //dev状态下使用静态数据
}, },
computed: { computed: {
searchList() { searchList() {
let nodeList = this.treeData let nodeList = this.treeData;
var text = this.treeInputSearch var text = this.treeInputSearch;
var newNodeList = [] var newNodeList = [];
function searchTree(nodeLists, value) { function searchTree(nodeLists, value) {
for (let i = 0; i < nodeLists.length; i++) { for (let i = 0; i < nodeLists.length; i++) {
if (nodeLists[i].title.indexOf(value) != -1) { if (nodeLists[i].title.indexOf(value) != -1) {
newNodeList.push(nodeLists[i]) newNodeList.push(nodeLists[i]);
} else if (nodeLists[i].children.length > 0) { } else if (nodeLists[i].children.length > 0) {
searchTree(nodeLists[i].children, value) searchTree(nodeLists[i].children, value);
} }
} }
} }
if (text != '') { if (text != "") {
searchTree(nodeList, text) searchTree(nodeList, text);
} else { } else {
return nodeList return nodeList;
} }
return newNodeList return newNodeList;
} }
}, },
methods: { methods: {
initTree() { initTree() {
var sumData = [] var sumData = [];
this.$http.order.getallselecttree().then((res) => { this.$http.order.getallselecttree().then(res => {
if (res.result) { if (res.result) {
for (var i = 0; i < res.result.length; i++) { for (var i = 0; i < res.result.length; i++) {
sumData = sumData.concat(res.result[i]) sumData = sumData.concat(res.result[i]);
} }
this.treeData = sumData this.treeData = sumData;
this.data1 = JSON.parse(JSON.stringify(sumData)) this.data1 = JSON.parse(JSON.stringify(sumData));
} else { } else {
this.$Message.error('加载产品树失败!') this.$Message.error("加载产品树失败!");
} }
}) });
}, },
selectTreeNode(value) { selectTreeNode(value) {
if (value.length > 0) { if (value.length > 0) {
this.ids = [] this.ids = [];
this.getAllIds(value) this.getAllIds(value);
if (this.ids.length > 0) { if (this.ids.length > 0) {
this.orderSearchForm.productId = this.ids.join(',') this.orderSearchForm.productId = this.ids.join(",");
} else { } else {
this.orderSearchForm.productId = '-1' this.orderSearchForm.productId = "-1";
this.orderSearchForm.productName = '' this.orderSearchForm.productName = "";
} }
this.$refs.CustomTable.easySearch(this.orderSearchForm) this.$refs.CustomTable.easySearch(this.orderSearchForm);
} }
}, },
//得到此树节点下所有是产品的productId //得到此树节点下所有是产品的productId
getAllIds(trees) { getAllIds(trees) {
trees.forEach((data, index) => { trees.forEach((data, index) => {
var that = this var that = this;
if (data.isProduct) { if (data.isProduct) {
this.ids.push(data.productId) this.ids.push(data.productId);
} }
if (data.children.length > 0) { if (data.children.length > 0) {
this.getAllIds(data.children) this.getAllIds(data.children);
} }
}) });
}, },
handleSelect(data) { handleSelect(data) {
if (data.length > 0) { if (data.length > 0) {
this.selectdata = [] this.selectdata = [];
this.selectdata = data this.selectdata = data;
this.list = [] this.list = [];
this.list.push({ label: data[0].title, value: data[0].id }) this.list.push({ label: data[0].title, value: data[0].id });
//this.formValidate.classType=data[0].id; //this.formValidate.classType=data[0].id;
if (data[0].isProduct == '1') { if (data[0].isProduct == "1") {
this.orderSearchForm.productName = data[0].id this.orderSearchForm.productName = data[0].id;
this.orderSearchForm.productId = data[0].productId this.orderSearchForm.productId = data[0].productId;
} else { } else {
this.$Message.error('此节点不是产品,请选择产品节点!') this.$Message.error("此节点不是产品,请选择产品节点!");
} }
} }
}, },
renderContent(h, { root, node, data }) { renderContent(h, { root, node, data }) {
//渲染树的样式 //渲染树的样式
return h( return h(
'span', "span",
{ {
style: { style: {
color: data.isProduct != '1' ? '#249E91' : '#333', //根据选中状态设置样式 color: data.isProduct != "1" ? "#249E91" : "#333", //根据选中状态设置样式
cursor: 'pointer' cursor: "pointer"
}, },
on: { on: {
click: () => { click: () => {
let arrTree = [] let arrTree = [];
arrTree.push(data) arrTree.push(data);
this.handleSelect(arrTree) //手动选择树节点 this.handleSelect(arrTree); //手动选择树节点
} }
} }
}, },
data.title data.title
) );
}, },
formReset(ttt) { formReset(ttt) {
// alert("555") // alert("555")
//this.orderSearchForm=this.orderSearchForm; //this.orderSearchForm=this.orderSearchForm;
} }
} }
} };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.full .full {
{
margin-top: 0; margin-top: 0;
.content .content {
{
margin-top: 10px; margin-top: 10px;
} }
} }
......
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