Commit fbe41166 authored by renjintao's avatar renjintao

order

parent ea431ce7
...@@ -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);
}, },
......
<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,140 +235,138 @@ export default { ...@@ -214,140 +235,138 @@ 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;
}
} }
</style> </style>
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