Commit 24792d89 authored by 康振飞's avatar 康振飞

质量检验

parent 6e020789
<template id="producttree"> <template id="producttree">
<div> <div>
<div class="contentRight" :style="{height:divHeihgt}"> <div class="contentRight" :style="{height:divHeihgt}">
<div class="clear"> <div class="clear">
<Row><Col span="8"> <Input search enter-button placeholder="产品名称" v-model="productName" @on-search="search" style="width:290px;" /></Col><Col span="16"> <Row>
<div style="float:right" class="paddingbtn"> <Col span="8">
<Button type="primary" @click="add">新增产品</Button> <Input
<Button type="primary" @click="addclass">层级类型</Button> search
<!-- <Button type="primary" @click="del">阶段</Button> --> enter-button
placeholder="产品名称"
v-model="productName"
@on-search="search"
style="width:290px;"
/>
</Col>
<Col span="16">
<div style="float:right" class="paddingbtn">
<Button type="primary" @click="add">新增产品</Button>
<Button type="primary" @click="addclass">层级类型</Button>
<!-- <Button type="primary" @click="del">阶段</Button> -->
</div>
</Col>
</Row>
</div>
<div class>
<tree-grid :items="data" :columns="columns" @on-row-click="rowClick"></tree-grid>
</div> </div>
</Col></Row>
</div>
<div class="">
<tree-grid :items="data" :columns="columns" @on-row-click="rowClick"></tree-grid>
</div>
</div> </div>
<Modal v-model="modal0" title="添加/编辑产品" :width="800" :mask-closable="false" :loading="myloading" <Modal
ok-text="保存" cancel-text="取消" @on-ok="ok0('ProcuctformValidate')" @on-cancel='cancel0'> v-model="modal0"
title="添加/编辑产品"
:width="800"
:mask-closable="false"
:loading="myloading"
ok-text="保存"
cancel-text="取消"
@on-ok="ok0('ProcuctformValidate')"
@on-cancel="cancel0"
>
<add-product ref="addproduct"></add-product> <add-product ref="addproduct"></add-product>
<!-- <div slot="footer" style="text-align:center"> <!-- <div slot="footer" style="text-align:center">
<Button type="primary" @click="ok0('ProcuctformValidate')">保存</Button> <Button type="primary" @click="ok0('ProcuctformValidate')">保存</Button>
...@@ -24,22 +45,30 @@ ...@@ -24,22 +45,30 @@
style="border-color: rgb(204, 204, 204);background-color:white;color:black" style="border-color: rgb(204, 204, 204);background-color:white;color:black"
@click="cancel0" @click="cancel0"
>取消</Button> >取消</Button>
</div> --> </div>-->
</Modal> </Modal>
<Modal v-model="modal1" title="层级类型" :width="800" :mask-closable="false"> <Modal v-model="modal1" title="层级类型" :width="800" :mask-closable="false">
<div @click="cancelClick"> <div @click="cancelClick">
<div class="clear"> <div class="clear">
<Button type="primary" @click="addchild" style="float:right">新增</Button> <Button type="primary" @click="addchild" style="float:right">新增</Button>
</div> </div>
<div class="martop10"> <div class="martop10">
<!-- <tb :tbPro="tbPro"></tb> --> <!-- <tb :tbPro="tbPro"></tb> -->
<tree-grid :items="leveldata" :columns="levelcolumns" @on-row-click="levelrowClick"></tree-grid> <tree-grid :items="leveldata" :columns="levelcolumns" @on-row-click="levelrowClick"></tree-grid>
</div> </div>
</div> </div>
</Modal> </Modal>
<Modal v-model="modal2" title="新增层级类型" :width="440" :mask-closable="false" :loading="myloading" <Modal
ok-text="保存" cancel-text="取消" @on-ok="ok('formValidate')" @on-cancel='cancel'> v-model="modal2"
title="新增层级类型"
:width="440"
:mask-closable="false"
:loading="myloading"
ok-text="保存"
cancel-text="取消"
@on-ok="ok('formValidate')"
@on-cancel="cancel"
>
<add ref="addclass"></add> <add ref="addclass"></add>
<!-- <div slot="footer" style="text-align:center"> <!-- <div slot="footer" style="text-align:center">
<Button type="primary" @click="ok('formValidate')">保存</Button> <Button type="primary" @click="ok('formValidate')">保存</Button>
...@@ -48,47 +77,49 @@ ...@@ -48,47 +77,49 @@
style="border-color: rgb(204, 204, 204);background-color:white;color:black" style="border-color: rgb(204, 204, 204);background-color:white;color:black"
@click="cancel" @click="cancel"
>取消</Button> >取消</Button>
</div> --> </div>-->
</Modal> </Modal>
<myconfirm ref="mysel0" v-on:confirmok="myselok" v-on:confirmcancel="myselcancel"></myconfirm> <myconfirm ref="mysel0" v-on:confirmok="myselok" v-on:confirmcancel="myselcancel"></myconfirm>
<myconfirm ref="mysel" v-on:confirmok="ok3" v-on:confirmcancel="cancel3"></myconfirm> <myconfirm ref="mysel" v-on:confirmok="ok3" v-on:confirmcancel="cancel3"></myconfirm>
<myconfirm ref="mysel1" v-on:confirmok="copyok" v-on:confirmcancel="copycancel"> <myconfirm ref="mysel1" v-on:confirmok="copyok" v-on:confirmcancel="copycancel">
<div slot="confimcon"><p>确认要复制此节点及其子节点吗?</p></div> <div slot="confimcon">
<p>确认要复制此节点及其子节点吗?</p>
</div>
</myconfirm> </myconfirm>
</div> </div>
</template> </template>
<script> <script>
import treeGrid from '@/components/treeGrid' import treeGrid from "@/components/treeGrid";
import tb from '../../basicData/roleManagent/components/tb' import tb from "../../basicData/roleManagent/components/tb";
import add from './addclass' import add from "./addclass";
import addProduct from './addproduct' import addProduct from "./addproduct";
import myconfirm from './components/myconfirm' import myconfirm from "./components/myconfirm";
import service from '@/plugins/request' import service from "@/plugins/request";
export default { export default {
components: { treeGrid,tb,add ,addProduct,myconfirm}, components: { treeGrid, tb, add, addProduct, myconfirm },
data() { data() {
return { return {
myloading:true, myloading: true,
productName:'', productName: "",
model1:'', model1: "",
divHeihgt:"", divHeihgt: "",
modal0:false, modal0: false,
isedit0:false, isedit0: false,
modal1:false, modal1: false,
modal2:false, modal2: false,
modal3:false, modal3: false,
isedit:false, isedit: false,
formValidate0:{}, formValidate0: {},
formValidate1:{}, formValidate1: {},
pid:0, pid: 0,
lid:0, lid: 0,
delName:'', delName: "",
cilckListRowData:{}, cilckListRowData: {},
productClassType:-1, productClassType: -1,
upProductId:-1, upProductId: -1,
clickindex:-1, clickindex: -1,
clickindexLevel:-1, clickindexLevel: -1,
clickindexLevelData:{}, clickindexLevelData: {},
//产品树列 //产品树列
columns: [ columns: [
// { // {
...@@ -100,72 +131,74 @@ export default { ...@@ -100,72 +131,74 @@ export default {
// hidden: true // hidden: true
// }, // },
{ {
title: '产品分类/名称', title: "产品分类/名称",
key: 'name' key: "name"
}, },
{ {
title: '层级类型', title: "层级类型",
key: 'upName' key: "upName"
}, },
{ {
title: '产品图号', title: "产品图号",
key: 'drawingNo' key: "drawingNo"
}, },
{ {
title: '物料编号', title: "物料编号",
key: 'mmcode' key: "mmcode"
}, },
{ {
title: '主承制单位', title: "主承制单位",
key: 'madeCompanyName' key: "madeCompanyName"
}, },
{ {
title: '操作', title: "操作",
type: 'action', type: "action",
width:150, width: 150,
actions: [ actions: [
{ {
oprate: 'edit', oprate: "edit",
text: '编辑', text: "编辑",
class: 'edit', class: "edit"
}, },
{ {
oprate: 'delete', oprate: "delete",
text: '删除', text: "删除",
class: 'remove', class: "remove"
} }
], ]
} }
], ],
data: [], data: [],
//层级类型列 //层级类型列
leveldata:[], leveldata: [],
levelcolumns:[ levelcolumns: [
{ {
title: '类型名称', title: "类型名称",
key: 'name' key: "name"
}, },
{ {
title: '上级类型名称', title: "上级类型名称",
key: 'upName' key: "upName"
}, },
{ {
title: '操作', title: "操作",
type: 'action', type: "action",
width: 150, width: 150,
actions: [{ actions: [
oprate: 'detail', {
text: '编辑', oprate: "detail",
class: 'edit', text: "编辑",
}, { class: "edit"
oprate: 'delete', },
text: '删除', {
class: 'remove', oprate: "delete",
}], text: "删除",
class: "remove"
}
]
} }
], ]
// tbPro:{ // tbPro:{
// isBorder: true, // isBorder: true,
// stripe: true, // stripe: true,
...@@ -216,343 +249,371 @@ export default { ...@@ -216,343 +249,371 @@ export default {
// ], // ],
// data: [] // data: []
// } // }
} };
}, },
methods: { methods: {
search(){ search() {
var name=this.productName var name = this.productName;
this.loadProduct(name) this.loadProduct(name);
}, },
//新增产品 //新增产品
add() { add() {
this.isedit0=false; this.isedit0 = false;
this.$refs.addproduct.selectdata=[] this.$refs.addproduct.selectdata = [];
this.$refs.addproduct.list=[] this.$refs.addproduct.list = [];
this.$refs.addproduct.$refs['ProcuctformValidate'].resetFields(); this.$refs.addproduct.$refs["ProcuctformValidate"].resetFields();
//如果是选中一行新增,判断是不是最下面的层级或者是产品 //如果是选中一行新增,判断是不是最下面的层级或者是产品
let bl=false; let bl = false;
this.upProductId=-1; this.upProductId = -1;
this.productClassType=-1; this.productClassType = -1;
let data=this.cilckListRowData; let data = this.cilckListRowData;
console.log(data) console.log(data);
if(data.id) if (data.id) {
{ this.$refs.addproduct.formValidate.classType = data.id;
this.$refs.addproduct.formValidate.classType=data.id this.productClassType = data.id;
this.productClassType=data.id; this.$refs.addproduct.list.push({ label: data.name, value: data.id });
this.$refs.addproduct.list.push({label:data.name,value:data.id}) if (data.isProduct > 0) {
if(data.isProduct>0){ bl = true;
bl=true this.upProductId = data.id;
this.upProductId=data.id //this.$refs.addproduct.formValidate.classType=-1
//this.$refs.addproduct.formValidate.classType=-1 this.productClassType = -1;
this.productClassType=-1; } else {
}else{ if (data.children == null) {
if(data.children==null) bl = true;
{ this.upProductId = 0;
bl=true } else {
this.upProductId=0 bl = this.checkProduct(data.children);
} if (bl) {
else{ this.upProductId = 0;
bl=this.checkProduct(data.children)
if(bl){this.upProductId=0}
} }
} }
if(!bl){ }
this.$Message.error('请选择最下面的层级或产品') if (!bl) {
return; this.$Message.error("请选择最下面的层级或产品");
} return;
}
} }
this.modal0=true; this.modal0 = true;
this.$refs.addproduct.formValidate.disabled=false this.$refs.addproduct.formValidate.disabled = false;
delete this.$refs.addproduct.formValidate.id; delete this.$refs.addproduct.formValidate.id;
//新增产品时的层级树 //新增产品时的层级树
var that=this; var that = this;
var url=`${designUrl}/productlevel/getallselecttreenew` var url = `${designUrl}/productlevel/getallselecttreenew`;
service.get(`${url}`).then(response=>{ service.get(`${url}`).then(response => {
that.$refs.addproduct.data1 = response.result;
that.$refs.addproduct.data1=(response.result) });
})
}, },
rowClick(data, event, index, txt){ rowClick(data, event, index, txt) {
this.cilckListRowData=data; this.cilckListRowData = data;
console.log(data) console.log(data);
if(txt=="编辑"){ if (txt == "编辑") {
if(data.isProduct>0){ if (data.isProduct > 0) {
this.isedit0=true; this.isedit0 = true;
this.modal0=true; this.modal0 = true;
let {name,drawingNo,remark,mmcode,madeCompany,classType}=data let {
name,
drawingNo,
remark,
mmcode,
madeCompany,
classType
} = data;
//let classType=data.levelName //let classType=data.levelName
this.$refs.addproduct.list=[] this.$refs.addproduct.list = [];
this.$refs.addproduct.list.push({label:data.upName,value:classType}) this.$refs.addproduct.list.push({
this.$refs.addproduct.componaylist=[] label: data.upName,
this.$refs.addproduct.componaylist.push({label:data.madeCompanyName,value:madeCompany}) value: classType
this.$refs.addproduct.formValidate={classType: classType, name: name,drawingNo:drawingNo, });
supportsum:1,madeCompany:madeCompany, remark:remark,mmcode:mmcode,disabled:true,id:data.id} this.$refs.addproduct.componaylist = [];
} this.$refs.addproduct.componaylist.push({
else{ label: data.madeCompanyName,
this.isedit=true value: madeCompany
this.modal2=true; });
let {name,upId,upName}=data this.$refs.addproduct.formValidate = {
this.$refs.addclass.list=[] classType: classType,
this.$refs.addclass.list.push({label:upName,value:upId}) name: name,
this.$refs.addclass.formValidate={name:name,upid:upId,upname:upName,id:data.id,disabled:true} drawingNo: drawingNo,
supportsum: 1,
madeCompany: madeCompany,
remark: remark,
mmcode: mmcode,
disabled: true,
id: data.id
};
} else {
this.isedit = true;
this.modal2 = true;
let { name, upId, upName } = data;
this.$refs.addclass.list = [];
this.$refs.addclass.list.push({ label: upName, value: upId });
this.$refs.addclass.formValidate = {
name: name,
upid: upId,
upname: upName,
id: data.id,
disabled: true
};
} }
} }
if(txt=="删除"){ if (txt == "删除") {
if(data.isProduct>0){ if (data.isProduct > 0) {
//this.$Message.error('暂时不能删除产品'); //this.$Message.error('暂时不能删除产品');
// return // return
this.modal3=true; this.modal3 = true;
this.$refs.mysel.confirmmodal=this.modal3 this.$refs.mysel.confirmmodal = this.modal3;
this.pid=data.id this.pid = data.id;
this.delName="产品" this.delName = "产品";
} } else {
else{ var i = data.children.length;
var i=data.children.length; this.lid = data.id;
this.lid=data.id this.delName = "层级";
this.delName="层级" if (i > 0) {
if(i>0){ this.$Message.error("层级下有子节点,请先删除子节点!");
this.$Message.error('层级下有子节点,请先删除子节点!') return;
return;
} }
this.modal3=true; this.modal3 = true;
this.$refs.mysel.confirmmodal=this.modal3 this.$refs.mysel.confirmmodal = this.modal3;
} }
} }
if(txt=="复制"){ if (txt == "复制") {
this.$refs.mysel1.confirmmodal=true this.$refs.mysel1.confirmmodal = true;
} }
}, },
del() {}, del() {},
//产品列表 //产品列表
loadProduct(seoName){ loadProduct(seoName) {
var url=`${designUrl}/productlevel/getproducttreenew` var url = `${designUrl}/productlevel/getproducttreenew`;
service.get(`${url}`,{seoName: seoName}).then(response=>{ service.get(`${url}`, { seoName: seoName }).then(response => {
this.data=response.result this.data = response.result;
}) });
}, },
//保存产品 //保存产品
checkProduct(data){ checkProduct(data) {
var j=0; var j = 0;
var bl=false; var bl = false;
data.forEach((item,i)=>{ data.forEach((item, i) => {
if(item.isProduct==1){ if (item.isProduct == 1) {
j++ j++;
} }
}) });
if(data.length==j){ if (data.length == j) {
bl=true bl = true;
} }
return bl return bl;
}, },
ok0(name){ ok0(name) {
this.$refs.addproduct.$refs[name].validate((valid) => { this.$refs.addproduct.$refs[name].validate(valid => {
if (valid) { if (valid) {
if (this.isedit0) { if (this.isedit0) {
} else { } else {
// console.log(1) // console.log(1)
var bl=false var bl = false;
var bl1=false var bl1 = false;
var selectId=-1; var selectId = -1;
var sel=this.$refs.addproduct.selectdata var sel = this.$refs.addproduct.selectdata;
console.log(sel) console.log(sel);
if(sel.length>0){ if (sel.length > 0) {
bl1=true bl1 = true;
//是产品 //是产品
if(sel[0].isProduct>0){ if (sel[0].isProduct > 0) {
bl=true bl = true;
selectId=sel[0].productId selectId = sel[0].productId;
this.$refs.addproduct.formValidate.classType=-1 this.$refs.addproduct.formValidate.classType = -1;
}else{ } else {
if(sel[0].children==null) if (sel[0].children == null) {
{ bl = true;
bl=true selectId = 0;
selectId=0 } else {
} bl = this.checkProduct(sel[0].children);
else{ if (bl) {
bl=this.checkProduct(sel[0].children) selectId = 0;
if(bl){selectId=0} }
} }
} }
if(!bl){ if (!bl) {
this.$Message.error('请选择最下面的层级或产品') this.$Message.error("请选择最下面的层级或产品");
return; return;
} }
} }
} }
this.formValidate0 = this.$refs.addproduct.formValidate this.formValidate0 = this.$refs.addproduct.formValidate;
if(!this.isedit0){ if (!this.isedit0) {
if(bl1){ if (bl1) {
this.formValidate0.upId=selectId this.formValidate0.upId = selectId;
} } else {
else{ this.formValidate0.upId = this.upProductId;
this.formValidate0.upId=this.upProductId console.log(this.formValidate0.upId);
console.log(this.formValidate0.upId) console.log(this.formValidate0);
console.log(this.formValidate0) this.formValidate0.classType = this.productClassType;
this.formValidate0.classType=this.productClassType
} }
} }
var url=`${designUrl}/productinfo/createorupdate` var url = `${designUrl}/productinfo/createorupdate`;
service.post(`${url}`,JSON.stringify({ProductInfo:this.formValidate0})).then(response=>{ service
if(response.success){ .post(`${url}`, JSON.stringify({ ProductInfo: this.formValidate0 }))
this.$Message.success('保存成功') .then(response => {
this.loadProduct() if (response.success) {
//this.loadlevel() this.$Message.success("保存成功");
this.modal0 = false this.loadProduct();
} //this.loadlevel()
}).catch(error=>{ this.modal0 = false;
this.$Message.error('保存失败') }
}) })
.catch(error => {
this.$Message.error("保存失败");
});
} else { } else {
setTimeout(() => { setTimeout(() => {
this.myloading = false this.myloading = false;
this.$nextTick(() => { this.$nextTick(() => {
this.myloading = true this.myloading = true;
}) });
}, 500) }, 500);
this.$Message.error('请输入必填项') this.$Message.error("请输入必填项");
} }
}) });
}, },
cancel0(){ cancel0() {
this.modal0=false; this.modal0 = false;
}, },
// 删除产品/层级 // 删除产品/层级
ok3(bl){ ok3(bl) {
var url="" var url = "";
var that=this var that = this;
if(this.delName=="产品"){ if (this.delName == "产品") {
url=`${designUrl}/productinfo/delete?id=${this.pid}` url = `${designUrl}/productinfo/delete?id=${this.pid}`;
} }
if(this.delName=="层级"){ if (this.delName == "层级") {
url = `${designUrl}/productlevel/delete?id=${this.lid}`;
url=`${designUrl}/productlevel/delete?id=${this.lid}` }
} service
service.delete(`${url}`).then(response=>{ .delete(`${url}`)
if (response.result.status) { .then(response => {
this.$Message.success('删除成功') if (response.result.status) {
this.loadProduct() this.$Message.success("删除成功");
this.loadlevel() this.loadProduct();
} this.loadlevel();
else{ } else {
this.$Message.error(response.result.message) this.$Message.error(response.result.message);
} }
}).catch((error) => {
this.$Message.error()
}) })
this.$refs.mysel.confirmmodal=this.modal3=bl; .catch(error => {
this.$Message.error();
});
this.$refs.mysel.confirmmodal = this.modal3 = bl;
}, },
cancel3(bl){ cancel3(bl) {
this.$refs.mysel.confirmmodal=this.modal3=bl; this.$refs.mysel.confirmmodal = this.modal3 = bl;
}, },
copyok(bl){ copyok(bl) {
this.$refs.mysel1.confirmmodal=bl this.$refs.mysel1.confirmmodal = bl;
}, },
copycancel(bl){ copycancel(bl) {
this.$refs.mysel1.confirmmodal=bl this.$refs.mysel1.confirmmodal = bl;
}, },
//层级列表 //层级列表
loadlevel(){ loadlevel() {
var url=`${designUrl}/productlevel/gettree` var url = `${designUrl}/productlevel/gettree`;
service.get(`${url}`).then(response=>{ service.get(`${url}`).then(response => {
this.leveldata=response.result this.leveldata = response.result;
}) });
}, },
cancelClick(){ cancelClick() {
this.clickindexLevelData={} this.clickindexLevelData = {};
this.clickindexLevel=-1 this.clickindexLevel = -1;
this.$refs.addclass.formValidate.upid=0 this.$refs.addclass.formValidate.upid = 0;
this.$refs.addclass.list=[] this.$refs.addclass.list = [];
this.$refs.addclass.list.push({label: '根节点', value: 0 }) this.$refs.addclass.list.push({ label: "根节点", value: 0 });
this.$refs.addclass.data=[] this.$refs.addclass.data = [];
}, },
levelrowClick(data, event, index, txt){ levelrowClick(data, event, index, txt) {
this.clickindexLevel=data.id this.clickindexLevel = data.id;
this.clickindexLevelData=data this.clickindexLevelData = data;
event.stopPropagation(); event.stopPropagation();
if(txt=="编辑"){ if (txt == "编辑") {
this.isedit=true this.isedit = true;
this.modal2=true; this.modal2 = true;
let {name,upId,upName}=data let { name, upId, upName } = data;
this.$refs.addclass.list=[] this.$refs.addclass.list = [];
this.$refs.addclass.list.push({label:upName,value:upId}) this.$refs.addclass.list.push({ label: upName, value: upId });
this.$refs.addclass.formValidate={name:name,upid:upId,upname:upName,id:data.id,disabled:true} this.$refs.addclass.formValidate = {
name: name,
upid: upId,
upname: upName,
id: data.id,
disabled: true
};
} }
if(txt=="删除"){ if (txt == "删除") {
this.lid = data.id;
this.lid=data.id this.delName = "层级";
this.delName="层级" var i = data.children.length;
var i=data.children.length; if (i > 0) {
if(i>0){ this.$Message.error("层级下有子节点,请先删除子节点!");
this.$Message.error('层级下有子节点,请先删除子节点!') return;
return;
} }
this.modal3=true; this.modal3 = true;
this.$refs.mysel.confirmmodal=this.modal3 this.$refs.mysel.confirmmodal = this.modal3;
} }
}, },
//层级列表 //层级列表
addclass() { addclass() {
this.loadlevel() this.loadlevel();
this.isEdit=false this.isEdit = false;
this.modal1=true; this.modal1 = true;
this.clickindexLevel=-1 this.clickindexLevel = -1;
this.clickindexLevelData={} this.clickindexLevelData = {};
}, },
//新增层级 //新增层级
addchild(event){ addchild(event) {
this.modal2=true; this.modal2 = true;
//阻止冒泡 //阻止冒泡
event.stopPropagation(); event.stopPropagation();
delete this.$refs.addclass.formValidate.id; delete this.$refs.addclass.formValidate.id;
this.$refs.addclass.formValidate.disabled=false this.$refs.addclass.formValidate.disabled = false;
this.$refs.addclass.list=[] this.$refs.addclass.list = [];
this.$refs.addclass.data=[] this.$refs.addclass.data = [];
if(this.clickindexLevel>0){ if (this.clickindexLevel > 0) {
this.$refs.addclass.formValidate.upid=this.clickindexLevel this.$refs.addclass.formValidate.upid = this.clickindexLevel;
let {name}=this.clickindexLevelData let { name } = this.clickindexLevelData;
this.$refs.addclass.list.push({label: `${name}`, value: this.clickindexLevel}) this.$refs.addclass.list.push({
var url=`${designUrl}/productlevel/getselecttree` label: `${name}`,
service.get(`${url}`, {id:this.clickindexLevel}).then(response=>{ value: this.clickindexLevel
this.$refs.addclass.data=response.result });
}) var url = `${designUrl}/productlevel/getselecttree`;
}else { service.get(`${url}`, { id: this.clickindexLevel }).then(response => {
this.$refs.addclass.formValidate.upid=0 this.$refs.addclass.data = response.result;
this.$refs.addclass.list.push({label: '根节点', value: 0 }) });
this.$refs.addclass.data=[] } else {
this.$refs.addclass.formValidate.upid = 0;
this.$refs.addclass.list.push({ label: "根节点", value: 0 });
this.$refs.addclass.data = [];
} }
this.$refs.addclass.formValidate.name="" this.$refs.addclass.formValidate.name = "";
//this.$refs.addclass.$refs['formValidate'].resetFields(); //this.$refs.addclass.$refs['formValidate'].resetFields();
}, },
edit1(data){ edit1(data) {
this.isEdit = true this.isEdit = true;
this.modal2 = true this.modal2 = true;
this.$refs.addclass.$refs['formValidate'].resetFields(); this.$refs.addclass.$refs["formValidate"].resetFields();
let {prename,name,isProduct}=data.row; let { prename, name, isProduct } = data.row;
this.$refs.addclass.list=[]; this.$refs.addclass.list = [];
this.$refs.addclass.list.push({label:prename,value:prename}) this.$refs.addclass.list.push({ label: prename, value: prename });
this.$refs.addclass.formValidate={name:name,prename:prename,isproduct:isProduct} this.$refs.addclass.formValidate = {
name: name,
prename: prename,
isproduct: isProduct
};
}, },
del1(){ del1() {
this.$refs.mysel0.confirmmodal=true; this.$refs.mysel0.confirmmodal = true;
// this.$Modal.confirm({ // this.$Modal.confirm({
// title: '提示', // title: '提示',
// okText: '确定', // okText: '确定',
...@@ -564,63 +625,67 @@ export default { ...@@ -564,63 +625,67 @@ export default {
// } // }
// }) // })
}, },
myselok(bl){ myselok(bl) {
this.$refs.mysel0.confirmmodal=bl; this.$refs.mysel0.confirmmodal = bl;
}, },
myselcancel(bl){ myselcancel(bl) {
this.$refs.mysel0.confirmmodal=bl; this.$refs.mysel0.confirmmodal = bl;
}, },
ok(name){ ok(name) {
var url=`${designUrl}/productlevel/createorupdate` var url = `${designUrl}/productlevel/createorupdate`;
this.$refs.addclass.$refs[name].validate((valid) => { this.$refs.addclass.$refs[name].validate(valid => {
if (valid) { if (valid) {
//this.$Message.success('Success!'); //this.$Message.success('Success!');
if (this.isedit) { if (this.isedit) {
} else { } else {
} }
this.formValidate1 = this.$refs.addclass.formValidate this.formValidate1 = this.$refs.addclass.formValidate;
service.post(`${url}`,JSON.stringify({ProductLevel:this.formValidate1})).then(response=>{ service
if(response.result.status){ .post(
this.$Message.success('保存成功') `${url}`,
this.loadlevel() JSON.stringify({ ProductLevel: this.formValidate1 })
this.loadProduct() )
this.modal2 = false .then(response => {
} if (response.result.status) {
else{ this.$Message.success("保存成功");
this.$Message.error(response.result.message) this.loadlevel();
} this.loadProduct();
}).catch(error=>{ this.modal2 = false;
this.$Message.error('保存失败') } else {
}) this.$Message.error(response.result.message);
}
})
.catch(error => {
this.$Message.error("保存失败");
});
//this.modal2 = false //this.modal2 = false
} else { } else {
setTimeout(() => { setTimeout(() => {
this.myloading = false this.myloading = false;
this.$nextTick(() => { this.$nextTick(() => {
this.myloading = true this.myloading = true;
}) });
}, 500) }, 500);
this.$Message.error('请输入必填项') this.$Message.error("请输入必填项");
} }
}) });
}, },
cancel(){ cancel() {
this.modal2=false this.modal2 = false;
} }
}, },
created(){ created() {
this.loadProduct() this.loadProduct();
this.divHeihgt= window.innerHeight - 130+"px"; this.divHeihgt = window.innerHeight - 130 + "px";
},
mounted() {
window.onresize = () => {
return (() => {
this.divHeihgt = window.innerHeight - 130+"px";
})()
}
}, },
} mounted() {
window.onresize = () => {
return (() => {
this.divHeihgt = window.innerHeight - 130 + "px";
})();
};
}
};
</script> </script>
<style scoped> <style scoped>
</style> </style>
...@@ -319,6 +319,23 @@ export default { ...@@ -319,6 +319,23 @@ export default {
}, },
// 搜索 // 搜索
tableSearch() { tableSearch() {
console.warn("查询数据")
let val = this.searchIterms;
console.log(val)
let parmes = {
"status": 0,
"simpleSearch": val,
"skipCount":0,
"maxResultCount": 10
}
this.searchlaode(parmes)
},
searchlaode(parmes){
let url = `${PlanUrl}/ordercheck/waitexecuteorderlist`;
service.post(`${url}`,parmes).then(res => {
this.mDatas = res.result.items
this.search.total = res.result.totalCount
});
}, },
searchModel(){ searchModel(){
this.showModel = true; this.showModel = true;
......
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