Commit ec2949f8 by yucheng.jiang

工装类型

parent d46d88c5
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</div> </div>
<div class="searchBtn"> <div class="searchBtn">
<Button type="primary" class="twoWord" icon="ios-search" @click="tosearch()">{{ $t(1001) }}</Button> <Button type="primary" class="twoWord" icon="ios-search" @click="tosearch()">{{ $t(1001) }}</Button>
<!-- <Button type="success" class="twoWord" icon="md-add-circle" @click="add()">{{$t('1002')}}</Button> --> <Button type="success" class="twoWord" icon="md-add-circle" @click="add()">{{$t('1002')}}</Button>
<!-- <Button type="warning" class="twoWord" icon="ios-create-outline" @click="edit()">{{$t('1003')}}</Button> <!-- <Button type="warning" class="twoWord" icon="ios-create-outline" @click="edit()">{{$t('1003')}}</Button>
<Button type="error" class="twoWord intervalRight" icon="md-close-circle" @click="dele()">{{ $t(1004) }}</Button> <Button type="error" class="twoWord intervalRight" icon="md-close-circle" @click="dele()">{{ $t(1004) }}</Button>
<Button type="primary" class="fourWord" icon="md-download" @click="loadexcel()">{{$t('1005')}}</Button> <Button type="primary" class="fourWord" icon="md-download" @click="loadexcel()">{{$t('1005')}}</Button>
...@@ -74,6 +74,67 @@ ...@@ -74,6 +74,67 @@
</div> </div>
</div> </div>
<Modal class="newModalClass" v-model="addmodal" :styles="{width:'650px'}">
<p slot="header">
<span v-show="type==1">{{$t('1002')}}</span>
<span v-show="type==2">{{$t('1003')}}</span>
</p>
<div style="">
<div class="filter">
<label>工装类型:</label>
<Cascader class="searchSelect" :data="frockTypeTree" change-on-select v-model="parentType" @on-change="changeFrockType1"></Cascader>
</div>
<div class="filter">
<label><i>*</i>管理类型:</label>
<Select v-model="mtype" clearable class="searchSelect">
<Option :value="1">单件</Option>
<Option :value="2">批次</Option>
</Select>
</div>
<div class="filter">
<label><i>*</i>工装名称:</label>
<Input type="text" class="searchInput" v-model="frockname" />
</div>
<div class="filter">
<label><i>*</i>工装料号:</label>
<Input type="text" class="searchInput" v-model="frockno" />
</div>
<div class="filter">
<label><i>*</i>工装编号:</label>
<Input type="text" class="searchInput" v-model="frockcode" />
</div>
<div class="filter">
<label><i>*</i>数量:</label>
<InputNumber type="text" class="searchInput" :formatter="value => `${parseInt(value)}`" v-model="num" />
</div>
<div class="filter">
<label><i>*</i>状态:</label>
<RadioGroup v-model="addstatus">
<Radio label="1"><span>可用</span></Radio>
<Radio label="0"><span>停用</span></Radio>
</RadioGroup>
</div>
<div class="filter">
<label>备注:</label>
<Input type="text" class="searchInput" v-model="remark" />
</div>
<div class="filter">
<label>上传文件:</label>
<div class="frockUploadFile">
<Upload
:before-upload="handleUpload"
:on-success="uploadFile"
:action="fileAction">
<Button class="UFbtn" icon="ios-cloud-upload-outline" :title="filename">{{filename?filename:'上传文件'}}</Button>
</Upload>
</div>
</div>
</div>
<div slot="footer">
<Button type="text" size="large" @click="this.addmodal=false">{{$t('1033')}}</Button>
<Button type="primary" size="large" @click="addPost()">{{$t('1011')}}</Button>
</div>
</Modal>
</div> </div>
</template> </template>
<script> <script>
...@@ -154,6 +215,24 @@ export default { ...@@ -154,6 +215,24 @@ export default {
key:'' key:''
} }
], ],
//弹窗
addmodal:false,
type:0,//1添加 2编辑
parentType:[],//父级类型
parentTypeid:'',
frockTypename:'',//工装类型名称
mtype:'',//管理类型
frockname:'',//工装名称
frockno:'',//工装料号
frockcode:'',//工装编号
num:0,
addstatus:'1',//状态 1可用 0停用
remark:'',//备注
filename: '',//文件名称
fileurl:'',//文件路径
loadingStatus: false,
fileAction: this.axios.publicPath + "config/upload/UploadImage",
} }
}, },
created(){ created(){
...@@ -194,6 +273,26 @@ export default { ...@@ -194,6 +273,26 @@ export default {
this.frockTypeid = value[value.length - 1]; this.frockTypeid = value[value.length - 1];
} }
}, },
changeFrockType1(value){
this.parentTypeid = "";
if(value!=undefined && value.length){
this.parentTypeid = value[value.length - 1];
}
},
//获取工装列表
getFrocks(){
// this.axios.request({
// url: "/fms/accountInfo/frockList",
// method: "get",
// })
// .then((res) => {
// this.frockList = [];
// let data = res.data.data;
// if (res.data.ret == 1&&Array.isArray(data)&&data.length) {
// this.frockList = data;
// }
// });
},
tosearch(){ tosearch(){
this.page = 1; this.page = 1;
this.pagesize = 10; this.pagesize = 10;
...@@ -201,14 +300,16 @@ export default { ...@@ -201,14 +300,16 @@ export default {
}, },
search(toexcel){ search(toexcel){
let params = { let params = {
frockTypeid:this.frockTypeid,//工装类型id frockTypeid:this.frockType,//工装类型id
frockid:this.frockCode, //工装id
staus:this.status, //0停用 1可用
page:this.page, page:this.page,
pagesize:this.pagesize, pagesize:this.pagesize,
toexcel:toexcel //0查询 1导出 toexcel:toexcel //0查询 1导出
} }
this.detailobj = {}; this.detailobj = {};
// this.axios.request({ // this.axios.request({
// url: "/fms/typeMaintenance/search", // url: "/fms/accountInfo/search",
// params, // params,
// method: "get", // method: "get",
// }) // })
...@@ -232,6 +333,27 @@ export default { ...@@ -232,6 +333,27 @@ export default {
// } // }
// }); // });
}, },
add(){
this.type = 1;
this.addmodal = true;
},
handleUpload (file) {
this.file = file;
return false;
},
uploadFile (res) {
console.log(222222)
console.log(res)
this.loadingStatus = true;
setTimeout(() => {
this.file = null;
this.loadingStatus = false;
this.$Message.success('Success')
}, 1500);
},
addPost(){
},
handleRowChange(currentRow, oldCurrentRow) { handleRowChange(currentRow, oldCurrentRow) {
this.detailobj = currentRow; this.detailobj = currentRow;
}, },
...@@ -247,6 +369,13 @@ export default { ...@@ -247,6 +369,13 @@ export default {
} }
} }
</script> </script>
<style> <style lang="less" scoped>
.frockUploadFile{
display:inline-block;
.UFbtn{
width:140px;
height:29px;
line-height: 15px;
}
}
</style> </style>
\ No newline at end of file
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</div> </div>
</div> </div>
<div slot="footer"> <div slot="footer">
<Button type="text" size="large" @click="this.addmodal=false">{{$t('1033')}}</Button> <Button type="text" size="large" @click="addmodal=false">{{$t('1033')}}</Button>
<Button type="primary" size="large" @click="addPost()">{{$t('1011')}}</Button> <Button type="primary" size="large" @click="addPost()">{{$t('1011')}}</Button>
</div> </div>
</Modal> </Modal>
...@@ -106,11 +106,11 @@ export default { ...@@ -106,11 +106,11 @@ export default {
}, },
{ {
title:'工装类型', title:'工装类型',
key:'frockType' key:'name'
}, },
{ {
title:'上级类型', title:'上级类型',
key:'parentType' key:'parentname'
} }
], ],
...@@ -123,27 +123,26 @@ export default { ...@@ -123,27 +123,26 @@ export default {
}, },
created(){ created(){
this.initFrockType();//工装类型树形结构 this.initFrockType();//工装类型树形结构
this.tosearch();
}, },
methods:{ methods:{
//工装类型 //工装类型
initFrockType(){ initFrockType(){
// this.axios.request({ this.axios.request({
// url: "/fms/typeMaintenance/frockTypeList", url: "/acc/FixtureTools/GetCategoryList",
// method: "get", method: "get",
// }) })
// .then((res) => { .then((res) => {
// if (res.data.ret == 1) { if (res.data.ret == 1) {
// let arr = res.data.data.children; let arr = res.data.data;
// this.frockTypeTree = arr; this.frockTypeTree = arr;
// this.contentTree(arr); this.contentTree(arr);
// } }
// }); });
}, },
contentTree (arr) { contentTree (arr) {
arr.forEach(ele => { arr.forEach(ele => {
ele.disabled = false; ele.disabled = false;
ele.value = ele.id;
ele.label = ele.name;
if ( if (
ele.children.length != 0 && ele.children.length != 0 &&
ele.children != undefined && ele.children != undefined &&
...@@ -172,39 +171,42 @@ export default { ...@@ -172,39 +171,42 @@ export default {
}, },
search(toexcel){ search(toexcel){
let params = { let params = {
frockTypeid:this.frockTypeid,//工装类型id id:this.frockTypeid,//工装类型id
page:this.page, page:this.page,
pagesize:this.pagesize, pagesize:this.pagesize,
toexcel:toexcel //0查询 1导出 toexcel:toexcel //0查询 1导出
} }
this.detailobj = {}; this.detailobj = {};
// this.axios.request({ this.axios.request({
// url: "/fms/typeMaintenance/search", url: "/acc/FixtureTools/GetCategoryPageList",
// params, params,
// method: "get", method: "get",
// }) })
// .then((res) => { .then((res) => {
// if(toexcel === 1){ if(toexcel === 1){
// if (res.data.ret === 1) { if (res.data.ret === 1) {
// window.location.href = window.location.href =
// axios.publicPath + "" + res.data.data; axios.publicPath + "" + res.data.data;
// } else { } else {
// this.$Message.error(this.$t(res.data.msg)); this.$Message.error(this.$t(res.data.msg));
// } }
// } }
// else{ else{
// this.total = 0; this.total = 0;
// this.tableData1 = []; this.tableData1 = [];
// let data = res.data.data; let data = res.data.data;
// if (res.data.ret == 1 &&Array.isArray(data)&&data.length) { if (res.data.ret == 1 &&Array.isArray(data)&&data.length) {
// this.total = res.data.total; this.total = res.data.total;
// this.tableData1 = res.data.data; this.tableData1 = res.data.data;
// } }
// } }
// }); });
}, },
add(){ add(){
this.addmodal = true; this.addmodal = true;
this.parentType = [];
this.parentTypeid = '';
this.frockTypename = '';
this.type = 1; this.type = 1;
}, },
addPost(){ addPost(){
...@@ -215,24 +217,26 @@ export default { ...@@ -215,24 +217,26 @@ export default {
let url = ''; let url = '';
let id = ''; let id = '';
if(this.type === 1){ if(this.type === 1){
url = '/fms/typeMaintenance/add'; url = '/acc/FixtureTools/AddCategory';
id = 0; id = 0;
} }
else{ else{
url = '/fms/typeMaintenance/update'; url = '/acc/FixtureTools/UpdateCategory';
id = this.detailobj.id; id = this.detailobj.id;
} }
let data = { let data = {
id:id, id:id,
parentid:0, parentid:this.parentTypeid?this.parentTypeid:0,
name:'' name:this.frockTypename
} }
this.axios.request({ this.axios.request({
url: "/fms/typeMaintenance/frockTypeList", url: url,
method: "get", data,
method: "post",
}).then((res) => { }).then((res) => {
if (res.data.ret == 1) { if (res.data.ret == 1) {
this.addmodal = false; this.addmodal = false;
this.initFrockType();//重新初始化类型
if(this.type===1){ if(this.type===1){
this.tosearch(); this.tosearch();
this.$Message.success(this.$t('1055')); this.$Message.success(this.$t('1055'));
......
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