Commit a2dc4644 by yucheng.jiang

工装台账维护

parent 1b6a2d13
...@@ -7,14 +7,11 @@ ...@@ -7,14 +7,11 @@
</div> </div>
<div class="filter"> <div class="filter">
<label>工装编号:</label> <label>工装编号:</label>
<Select v-model="frockCode" label-in-value clearable filterable filter-by-label class="searchSelect"> <Input type="text" class="searchInput" v-model="frockcode" />
<Option </div>
v-for="(item,index) in frockList" <div class="filter">
:value="item.id" <label>工装名称:</label>
:key="index" <Input type="text" class="searchInput" v-model="frockname" />
:label="item.name"
>{{ item.name }}</Option>
</Select>
</div> </div>
<div class="filter"> <div class="filter">
<label>状态:</label> <label>状态:</label>
...@@ -26,10 +23,10 @@ ...@@ -26,10 +23,10 @@
<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>
<Upload <!-- <Upload
style="display:inline-block" style="display:inline-block"
ref="upload" ref="upload"
:action="action" :action="action"
...@@ -79,33 +76,40 @@ ...@@ -79,33 +76,40 @@
<span v-show="type==1">{{$t('1002')}}</span> <span v-show="type==1">{{$t('1002')}}</span>
<span v-show="type==2">{{$t('1003')}}</span> <span v-show="type==2">{{$t('1003')}}</span>
</p> </p>
<div style=""> <div class="demo-spin-col">
<Spin fix v-if="spinShow">
<div>正在上传...</div>
</Spin>
<div class="filter"> <div class="filter">
<label>工装类型:</label> <label><i>*</i>工装类型:</label>
<Cascader class="searchSelect" :data="frockTypeTree" change-on-select v-model="parentType" @on-change="changeFrockType1"></Cascader> <Cascader class="searchSelect" :data="frockTypeTree" v-model="parentType" change-on-select @on-change="changeFrockType1"></Cascader>
</div> </div>
<div class="filter"> <div class="filter">
<label><i>*</i>管理类型:</label> <label><i>*</i>管理类型:</label>
<Select v-model="mtype" clearable class="searchSelect"> <Select v-model="addmtype" class="searchSelect">
<Option :value="1">单件</Option> <Option :value="1">单件</Option>
<Option :value="2">批次</Option> <Option :value="2">批次</Option>
</Select> </Select>
</div> </div>
<div class="filter"> <div class="filter">
<label><i>*</i>工装名称:</label> <label><i>*</i>工装名称:</label>
<Input type="text" class="searchInput" v-model="frockname" /> <Input type="text" class="searchInput" v-model="addfrockname" />
</div> </div>
<div class="filter"> <div class="filter">
<label><i>*</i>工装料号:</label> <label><i>*</i>工装料号:</label>
<Input type="text" class="searchInput" v-model="frockno" /> <Input type="text" class="searchInput" v-model="addfrockno" />
</div> </div>
<div class="filter"> <div class="filter">
<label><i>*</i>工装编号:</label> <label><i>*</i>工装编号:</label>
<Input type="text" class="searchInput" v-model="frockcode" /> <Input type="text" class="searchInput" v-model="addfrockcode" />
</div>
<div class="filter">
<label><i>*</i>规格型号:</label>
<Input type="text" class="searchInput" v-model="addfrockspec" />
</div> </div>
<div class="filter"> <div class="filter">
<label><i>*</i>数量:</label> <label><i>*</i>数量:</label>
<InputNumber type="text" class="searchInput" :formatter="value => `${parseInt(value)}`" v-model="num" /> <InputNumber type="text" class="searchInput" :min="1" :formatter="value => `${parseInt(value)}`" v-model="addnum" />
</div> </div>
<div class="filter"> <div class="filter">
<label><i>*</i>状态:</label> <label><i>*</i>状态:</label>
...@@ -116,19 +120,26 @@ ...@@ -116,19 +120,26 @@
</div> </div>
<div class="filter"> <div class="filter">
<label>备注:</label> <label>备注:</label>
<Input type="text" class="searchInput" v-model="remark" /> <Input type="text" class="searchInput" v-model="addremark" />
</div> </div>
<div class="filter"> <div>
<label>上传文件:</label> <label>上传文件:</label>
<div class="frockUploadFile"> <div class="accountInfoUploadFile">
<Upload <Upload
:before-upload="handleUpload" ref="upload"
:show-upload-list="false"
:on-success="handleSuccess" :on-success="handleSuccess"
:before-upload="handleBeforeUpload"
:on-error="handleError" :on-error="handleError"
type="drag"
:headers="headers" :headers="headers"
:action="fileAction"> :action="UploadAction">
<Button class="UFbtn" icon="ios-cloud-upload-outline" :title="filename">{{filename?filename:'上传文件'}}</Button> <div class="descicon" style="">
<Icon type="md-cloud-upload" size="15"></Icon>
<span>上传文件</span>
</div>
</Upload> </Upload>
<div v-show="filename" class="hasfile">{{filename}}<Icon @click.native="delfile" type="ios-close-circle" size="15" /></div>
</div> </div>
</div> </div>
</div> </div>
...@@ -147,8 +158,8 @@ export default { ...@@ -147,8 +158,8 @@ export default {
frockTypeTree:[],//树形结构 frockTypeTree:[],//树形结构
frockType:[],//工装类型 frockType:[],//工装类型
frockTypeid:'', frockTypeid:'',
frockList:[],//工装编号 frockcode:'',//工装编号
frockCode:'',//工装编号 frockname:'',//工装名称
status:'',//状态 status:'',//状态
//列表 //列表
...@@ -170,108 +181,137 @@ export default { ...@@ -170,108 +181,137 @@ export default {
}, },
{ {
title:'工装类型', title:'工装类型',
key:'' key:'category'
}, },
{ {
title:'管理类型', title:'管理类型',
key:'' key:'managetype',
render:(h,params)=>{
let str = '';
if(params.row.managetype===1){
str = '单件';
}else if(params.row.managetype===2){
str = '批次';
}
return h('span',str);
}
}, },
{ {
title:'工装料号', title:'工装料号',
key:'' key:'partnumber'
}, },
{ {
title:'工装名称', title:'工装名称',
key:'' key:'name'
}, },
{ {
title:'工装编号', title:'工装编号',
key:'' key:'code'
}, },
{ {
title:'规格型号', title:'规格型号',
key:'' key:'specification'
}, },
{ {
title:'数量', title:'数量',
key:'' key:'number'
}, },
{ {
title:'状态', title:'状态',
key:'' key:'status',
render:(h,params)=>{
let str = '';
if(params.row.status===1){
str = '可用';
}else{
str = '停用';
}
return h('span',str);
}
}, },
{ {
title:'备注', title:'备注',
key:'' key:'remark'
}, },
{ {
title:'附件', title:'附件',
key:'' key:'filename',
render:(h,params)=>{
return h('span',{
style:{
color:'#2b85e4'
}
},params.row.filename);
}
}, },
{ {
title:'维护人', title:'维护人',
key:'' key:'updator'
}, },
{ {
title:'维护时间', title:'维护时间',
key:'' key:'updatetime'
} }
], ],
//弹窗 //弹窗
detailobj:{},
addmodal:false, addmodal:false,
type:0,//1添加 2编辑 type:0,//1添加 2编辑
parentType:[],//父级类型 parentType:[],//父级类型
parentTypeid:'', parentTypeid:'',
frockTypename:'',//工装类型名称 frockTypename:'',//工装类型名称
mtype:'',//管理类型 addmtype:1,//管理类型
frockname:'',//工装名称 addfrockname:'',//工装名称
frockno:'',//工装料号 addfrockno:'',//工装料号
frockcode:'',//工装编号 addfrockcode:'',//工装编号
num:0, addnum:0,
addstatus:'1',//状态 1可用 0停用 addstatus:'1',//状态 1可用 0停用
remark:'',//备注 addfrockspec:'',//规格型号
addremark:'',//备注
filename: '',//文件名称 filename: '',//文件名称
fileurl:'',//文件路径 fileurl:'',//文件路径
loadingStatus: false, UploadAction: this.axios.publicPath + "config/upload/UploadImage",
fileAction: this.axios.publicPath + "config/upload/UploadImage",
headers: { headers: {
token: localStorage.getItem("token"), token: localStorage.getItem("token"),
timestamp: localStorage.getItem("timestamp"), timestamp: localStorage.getItem("timestamp"),
nonce: localStorage.getItem("nonce"), nonce: localStorage.getItem("nonce"),
sign: localStorage.getItem("sign"), sign: localStorage.getItem("sign"),
}, },
spinShow:false,
} }
}, },
created(){ created(){
this.initFrockType();//工装类型
this.tosearch();
this.tableColumns1 = this.$time.initTableTitle(this.tableColumns1);
}, },
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.contentTree(arr);
// this.contentTree(arr); this.frockTypeTree = 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 != undefined && ele.children != undefined &&
ele.children != null ele.children != null &&
ele.children.length != 0
) { ) {
this.contentTree(ele.children); this.contentTree(ele.children);
}else{
ele.children = []
} }
}); });
}, },
...@@ -283,8 +323,10 @@ export default { ...@@ -283,8 +323,10 @@ export default {
}, },
changeFrockType1(value){ changeFrockType1(value){
this.parentTypeid = ""; this.parentTypeid = "";
this.parentType = [];
if(value!=undefined && value.length){ if(value!=undefined && value.length){
this.parentTypeid = value[value.length - 1]; this.parentTypeid = value[value.length - 1];
this.parentType = value;
} }
}, },
//获取工装列表 //获取工装列表
...@@ -308,64 +350,190 @@ export default { ...@@ -308,64 +350,190 @@ export default {
}, },
search(toexcel){ search(toexcel){
let params = { let params = {
frockTypeid:this.frockType,//工装类型id category:this.frockType,//工装类型id
frockid:this.frockCode, //工装id code:this.frockcode,
staus:this.status, //0停用 1可用 name:this.frockname,
state: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({
url: "/acc/FixtureTools/GetPageList",
params,
method: "get",
})
.then((res) => {
if(toexcel === 1){
if (res.data.ret === 1) {
window.location.href =
axios.publicPath + "" + res.data.data;
} else {
this.$Message.error(this.$t(res.data.msg));
}
}
else{
this.total = 0;
this.tableData1 = [];
let data = res.data.data;
if (res.data.ret == 1 &&Array.isArray(data)&&data.length) {
this.total = res.data.total;
this.tableData1 = res.data.data;
}
}
});
},
add(){
this.type = 1;
this.parentType = [];//工装类型 清空
this.parentTypeid = '';
this.addmtype = 1;//管理类型
this.addfrockname = '';//工装名称
this.addfrockno = '';//工装料号
this.addfrockcode = '';//工装编号
this.addnum = 1;
this.addfrockspec = '';
this.addstatus = '1';//状态 1可用 0停用
this.addremark = '';//备注
this.filename = '';//文件名称
this.fileurl = '';//文件路径
this.addmodal = true;
},
edit(){
if(!this.detailobj || !this.detailobj.id){
this.$Message.error(this.$t('1017'));
return false;
}
this.type = 2;
this.parentTypeid = this.detailobj.categoryid;
this.parentType = this.detailobj.categoryids;
this.addmtype = this.detailobj.managetype;//管理类型
this.addfrockname = this.detailobj.name;//工装名称
this.addfrockno = this.detailobj.partnumber;//工装料号
this.addfrockcode = this.detailobj.code;//工装编号
this.addnum = this.detailobj.number;
this.addfrockspec = this.detailobj.specification;
this.addstatus = this.detailobj.status+'';//状态 1可用 0停用
this.addremark = this.detailobj.remark;//备注
this.filename = this.detailobj.filename;//文件名称
this.fileurl = this.detailobj.fileurl;//文件路径
this.addmodal = true;
},
addPost(){
if(!this.parentTypeid){
this.$Message.error("请选择工装类型");
return false;
}
if(!this.addfrockname){
this.$Message.error("请输入工装名称");
return false;
}
if(!this.addfrockno){
this.$Message.error("请输入工装料号");
return false;
}
if(!this.addfrockcode){
this.$Message.error("请输入工装编号");
return false;
}
if(!this.addfrockspec){
this.$Message.error("请输入规格型号");
return false;
}
if(!this.addnum){
this.$Message.error("请输入工装数量");
return false;
}
let url = '';
let id = '';
if(this.type === 1){
url = '/acc/FixtureTools/Add';
id = 0;
}
else{
url = '/acc/FixtureTools/Update';
id = this.detailobj.id;
}
let data = {
id:id,
categoryid:this.parentTypeid,//工装类型id
managetype:this.addmtype,
partnumber:this.addfrockno,//料号
code:this.addfrockcode,//编号
name:this.addfrockname,//名称
specifition:this.addfrockspec,//规格型号
number:this.addnum,//数量
remark:this.addremark,//备注
status:this.addstatus,//附件
fileurl:this.fileurl,
filename:this.filename
}
this.axios.request({
url: url,
data,
method: "post",
}).then((res) => {
if (res.data.ret == 1) {
this.addmodal = false;
if(this.type===1){
this.tosearch();
this.$Message.success(this.$t('1055'));
}
else{
this.$Message.success(this.$t('1060'));
this.search(0);
}
} else {
this.$Message.error(this.$t(res.data.msg+''));
}
});
},
/*********文件上传 start******** */
handleBeforeUpload(file){
this.spinShow = true;
if(!file){
this.spinShow = false;
return false;
}
},
handleSuccess (res,file) {
this.spinShow = false;
if (res.ret == 1) {
this.$Message.success(this.$t("100378"));
this.filename = file.name;
this.fileurl = res.data;
} else {
this.$Message.error(this.$t(res.msg+''));
}
},
handleError(){
this.$Message.error(this.$t("600512") + "!");
},
delfile(){
this.filename = '';
this.fileurl = '';
},
/*********文件上传 end******** */
//导出模板
loadexcel() {
// this.axios.request({ // this.axios.request({
// url: "/fms/accountInfo/search", // url: "/config/Download/GetTemplate?name=StorageLocation",
// params,
// method: "get", // method: "get",
// }) // })
// .then((res) => { // .then((res) => {
// if(toexcel === 1){
// if (res.data.ret === 1) { // if (res.data.ret === 1) {
// window.location.href = // window.location.href =
// axios.publicPath + "" + res.data.data; // this.axios.publicPath + "" + res.data.data;
// } else { // } else {
// this.$Message.error(this.$t(res.data.msg)); // this.$Message.error(this.$t(res.data.msg));
// } // }
// }
// else{
// this.total = 0;
// this.tableData1 = [];
// let data = res.data.data;
// if (res.data.ret == 1 &&Array.isArray(data)&&data.length) {
// this.total = res.data.total;
// this.tableData1 = res.data.data;
// }
// }
// }); // });
}, },
add(){
this.type = 1;
this.addmodal = true;
},
handleUpload (file) {
this.file = file;
return false;
},
handleSuccess (res) {
console.log(222222)
console.log(res)
this.loadingStatus = true;
setTimeout(() => {
this.file = null;
this.loadingStatus = false;
this.$Message.success('Success')
}, 1500);
},
handleError(error){
console.log(1111111)
console.log(error)
},
addPost(){
},
handleRowChange(currentRow, oldCurrentRow) { handleRowChange(currentRow, oldCurrentRow) {
this.detailobj = currentRow; this.detailobj = currentRow;
}, },
...@@ -381,13 +549,39 @@ export default { ...@@ -381,13 +549,39 @@ export default {
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less">
.frockUploadFile{ .accountInfoUploadFile{
display:inline-block; display:inline-block;
.UFbtn{ position: relative;
width:140px; left: 5px;
.ivu-upload{
display: inline-block;
width: 140px;
height: 29px;
vertical-align: middle;
.descicon{
width: 140px;
height:29px; height:29px;
line-height: 15px; line-height: 29px;
}
}
.ivu-upload-drag{
border:1px solid #dcdee2!important;
}
.ivu-upload-drag:hover {
border: 1px solid #2d8cf0!important;
}
.hasfile{
display: inline-block;
position: relative;
left: -140px;
top: 29px;
i{
color: red;
font-size: 15px;
cursor: pointer;
vertical-align: top;
}
} }
} }
</style> </style>
\ No newline at end of file
...@@ -134,6 +134,7 @@ export default { ...@@ -134,6 +134,7 @@ export default {
created(){ created(){
this.initFrockType();//工装类型树形结构 this.initFrockType();//工装类型树形结构
this.tosearch(); this.tosearch();
this.tableColumns1 = this.$time.initTableTitle(this.tableColumns1);
}, },
methods:{ methods:{
//工装类型 //工装类型
......
...@@ -212,6 +212,7 @@ export default { ...@@ -212,6 +212,7 @@ export default {
}, },
created(){ created(){
this.initWarehouse();//仓库 this.initWarehouse();//仓库
this.tableColumns1 = this.$time.initTableTitle(this.tableColumns1);
}, },
methods:{ methods:{
//仓库下拉框 //仓库下拉框
......
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