gongxu
This commit is contained in:
parent
7ed06d8b40
commit
4e01229e6e
|
@ -268,4 +268,34 @@ export function deleterffield(id, data) {
|
|||
method: 'delete',
|
||||
data
|
||||
})
|
||||
}
|
||||
//技术文件
|
||||
|
||||
export function gettechdocList(query) {
|
||||
return request({
|
||||
url: '/mtm/techdoc/',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
export function createtechdoc(data) {
|
||||
return request({
|
||||
url: '/mtm/techdoc/',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function updatetechdoc(id, data) {
|
||||
return request({
|
||||
url: `/mtm/techdoc/${id}/`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function deletetechdoc(id, data) {
|
||||
return request({
|
||||
url: `/mtm/techdoc/${id}/`,
|
||||
method: 'delete',
|
||||
data
|
||||
})
|
||||
}
|
|
@ -178,7 +178,7 @@ export default {
|
|||
},
|
||||
options: [{
|
||||
value: 1,
|
||||
label: '产品'
|
||||
label: '成品'
|
||||
}, {
|
||||
value: 2,
|
||||
label: '半成品'
|
||||
|
|
|
@ -167,7 +167,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
//物料列表
|
||||
//工序列表
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
getProcessList(this.listQuery).then((response) => {
|
||||
|
|
|
@ -73,29 +73,29 @@
|
|||
<el-tab-pane label="输入物料">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleinputCreate"
|
||||
>新增</el-button>
|
||||
|
||||
<el-table
|
||||
|
||||
:data="inputtableData.results"
|
||||
border
|
||||
:data="inputtableData"
|
||||
border
|
||||
fit
|
||||
stripe
|
||||
highlight-current-row
|
||||
v-el-height-adaptive-table="{bottomOffset: 50}"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料编号">
|
||||
<el-table-column label="物料编号" min-width="100">
|
||||
<template slot-scope="scope">{{scope.row.material_.number}}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="物料名称">
|
||||
<el-table-column label="物料名称" min-width="100">
|
||||
<template slot-scope="scope"> {{scope.row.material_.name}}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="计量单位">
|
||||
<el-table-column label="计量单位" min-width="100">
|
||||
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="单位消耗量">
|
||||
<el-table-column label="单位消耗量" min-width="100">
|
||||
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||
</el-table-column>
|
||||
|
||||
|
@ -104,7 +104,6 @@
|
|||
<el-table-column
|
||||
align="center"
|
||||
label="操作"
|
||||
width="220px"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
|
||||
|
@ -169,12 +168,10 @@
|
|||
>新增</el-button>
|
||||
<el-table
|
||||
|
||||
:data="outputtableData.results"
|
||||
:data="outputtableData"
|
||||
border
|
||||
fit
|
||||
stripe
|
||||
highlight-current-row
|
||||
v-el-height-adaptive-table="{bottomOffset: 50}"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料编号">
|
||||
|
@ -263,12 +260,10 @@
|
|||
>新增</el-button>
|
||||
<el-table
|
||||
|
||||
:data="usedsteptableData.results"
|
||||
:data="usedsteptableData"
|
||||
border
|
||||
fit
|
||||
stripe
|
||||
highlight-current-row
|
||||
v-el-height-adaptive-table="{bottomOffset: 50}"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
|
||||
|
@ -282,7 +277,6 @@
|
|||
<el-table-column
|
||||
align="center"
|
||||
label="操作"
|
||||
width="220px"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
|
||||
|
@ -338,8 +332,88 @@
|
|||
>新增</el-button>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="技术文件">
|
||||
<el-button type="primary" icon="el-icon-plus"
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handletechdocCreate"
|
||||
>新增</el-button>
|
||||
<el-table
|
||||
:data="techdoctableData"
|
||||
border
|
||||
fit
|
||||
stripe
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="文件名称">
|
||||
<template slot-scope="scope">{{ scope.row.name }}</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column align="center" label="文件">
|
||||
<template slot-scope="scope" v-if="scope.row.file_">
|
||||
<el-link :href="scope.row.file_.path" >{{scope.row.file_.name}}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="操作"
|
||||
width="220px"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
|
||||
|
||||
<el-link
|
||||
v-if="checkPermission(['process_update'])"
|
||||
@click="handletechdocEdit(scope)"
|
||||
>编辑</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="checkPermission(['process_delete'])"
|
||||
type="danger"
|
||||
@click="handletechdocDelete(scope)"
|
||||
>删除</el-link
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-dialog
|
||||
:visible.sync="dialogVisiblet"
|
||||
:title="dialogTypet === 'edit' ? '编辑文件' : '新增文件'"
|
||||
>
|
||||
<el-form
|
||||
ref="Formt"
|
||||
:model="techdoc"
|
||||
label-width="100px"
|
||||
label-position="right"
|
||||
|
||||
>
|
||||
<el-form-item label="文件名称" prop="name">
|
||||
<el-input v-model="techdoc.name" placeholder="工序名称" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="内容" prop="content">
|
||||
<el-input type="textarea" :rows="6" v-model="techdoc.content" placeholder="内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件" prop="template" v-if="dialogVisiblet">
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:action="upUrl"
|
||||
:on-preview="handlePreview"
|
||||
:on-success="handleUpSuccess"
|
||||
:on-remove="handleRemove"
|
||||
:headers="upHeaders"
|
||||
:file-list="fileList"
|
||||
:limit="1"
|
||||
accept=".doc,.docx,.xls,.xlsx,.ppt,.pptx"
|
||||
>
|
||||
<el-button size="small" type="primary">上传文件</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div style="text-align: right">
|
||||
<el-button type="danger" @click="dialogVisiblet = false">取消</el-button>
|
||||
<el-button type="primary" @click="techdocconfirm('Formt')">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
|
@ -349,8 +423,9 @@
|
|||
<script>
|
||||
import { getMaterialList,getMaterial,getInputmaterialList,createInputmaterial,updateInputmaterial
|
||||
,deleteInputmaterial,getOutputmaterialList,createOutputmaterial,updateOutputmaterial,deleteOutputmaterial,
|
||||
getUsedstepList,createUsedstep,deleteUsedstep,getStepList } from "@/api/mtm";
|
||||
getUsedstepList,createUsedstep,deleteUsedstep,getStepList,gettechdocList,createtechdoc,updatetechdoc,deletetechdoc } from "@/api/mtm";
|
||||
|
||||
import { upUrl, upHeaders } from "@/api/file";
|
||||
import checkPermission from "@/utils/permission";
|
||||
import { genTree } from "@/utils";
|
||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||
|
@ -362,6 +437,9 @@ const defaultoutputmaterial = {
|
|||
};
|
||||
const defaultusedstep = {
|
||||
|
||||
};
|
||||
const defaulttechdoc = {
|
||||
|
||||
};
|
||||
|
||||
export default {
|
||||
|
@ -370,16 +448,20 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
materialoptions:[],
|
||||
inputtableData:{count: 0},
|
||||
inputmaterial: defaultinputmaterial,
|
||||
|
||||
outputtableData:{count: 0},
|
||||
inputtableData:"",
|
||||
techdoc: defaulttechdoc,
|
||||
inputmaterial: defaultinputmaterial,
|
||||
techdoctableData:"",
|
||||
outputtableData:"",
|
||||
outputmaterial: defaultoutputmaterial,
|
||||
usedsteptableData:{count: 0},
|
||||
usedsteptableData:"",
|
||||
usedstep: defaultusedstep,
|
||||
materialList: {
|
||||
count: 0,
|
||||
},
|
||||
upHeaders: upHeaders(),
|
||||
upUrl: upUrl(),
|
||||
fileList:[],
|
||||
stepoptions:[],
|
||||
processoptions:[],
|
||||
listQuery: {
|
||||
|
@ -387,18 +469,18 @@ export default {
|
|||
page_size: 20,
|
||||
},
|
||||
listQueryinput: {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
page: 0,
|
||||
},
|
||||
listQueryoutput: {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
page: 0,
|
||||
},
|
||||
listQueryusedstep: {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
page: 0,
|
||||
},
|
||||
values:1,
|
||||
listQuerytechdoc:{
|
||||
page: 0,
|
||||
},
|
||||
values:7,
|
||||
products:"",
|
||||
dialogType: "new",
|
||||
dialogVisible:false,
|
||||
|
@ -406,6 +488,8 @@ export default {
|
|||
dialogVisible1:false,
|
||||
dialogTypeusedstep: "new",
|
||||
dialogVisibleusedstep:false,
|
||||
dialogTypet: "new",
|
||||
dialogVisiblet:false,
|
||||
listLoading: true,
|
||||
|
||||
};
|
||||
|
@ -468,6 +552,7 @@ export default {
|
|||
this.getOutputmaterialLists();
|
||||
this.getstepList();
|
||||
this. getUsedstepLists();
|
||||
this.gettechdocLists();
|
||||
|
||||
},
|
||||
|
||||
|
@ -480,6 +565,7 @@ export default {
|
|||
|
||||
this.listQueryinput.process=this.process;
|
||||
this.listQueryinput.product=this.product
|
||||
//this.listQueryinput.page=0;
|
||||
getInputmaterialList(this.listQueryinput).then((response) => {
|
||||
if (response.data) {
|
||||
|
||||
|
@ -560,6 +646,7 @@ export default {
|
|||
|
||||
this.listQueryoutput.process=this.process;
|
||||
this.listQueryoutput.product=this.product
|
||||
// this.listQueryoutput.page=0;
|
||||
getOutputmaterialList(this.listQueryoutput).then((response) => {
|
||||
if (response.data) {
|
||||
|
||||
|
@ -639,6 +726,7 @@ export default {
|
|||
|
||||
this.listQueryusedstep.process=this.process;
|
||||
this.listQueryusedstep.product=this.product
|
||||
// this.listQueryusedstep.page=0;
|
||||
getUsedstepList(this.listQueryusedstep).then((response) => {
|
||||
if (response.data) {
|
||||
|
||||
|
@ -673,6 +761,8 @@ export default {
|
|||
this.$refs["Formusedstep"].clearValidate();
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
handleusedstepEdit(scope) {
|
||||
this.outputmaterial = Object.assign({}, scope.row); // copy obj
|
||||
this.dialogType1 = "edit";
|
||||
|
@ -709,30 +799,103 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
//技术文件
|
||||
gettechdocLists(){
|
||||
this.listQuerytechdoc.process=this.process;
|
||||
this.listQuerytechdoc.product=this.product;
|
||||
// this.listQuerytechdoc.page=0;
|
||||
gettechdocList(this.listQuerytechdoc).then((response) => {
|
||||
if (response.data) {
|
||||
|
||||
this.techdoctableData = response.data;//技术文件
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
handletechdocCreate(){
|
||||
this.techdoc = Object.assign({}, defaulttechdoc);
|
||||
this.dialogTypet = "new";
|
||||
this.dialogVisiblet = true;
|
||||
this.fileList=[];
|
||||
this.$nextTick(() => {
|
||||
this.$refs["Formt"].clearValidate();
|
||||
});
|
||||
},
|
||||
handlePreview(file) {
|
||||
if ("url" in file) {
|
||||
window.open(file.url);
|
||||
} else {
|
||||
window.open(file.response.data.path);
|
||||
}
|
||||
},
|
||||
handleUpSuccess(res, file, filelist) {
|
||||
this.techdoc.file = res.data.id;
|
||||
},
|
||||
handleRemove(file, filelist){
|
||||
this.techdoc.file = null;
|
||||
},
|
||||
|
||||
|
||||
handletechdocEdit(scope) {
|
||||
this.techdoc = Object.assign({}, scope.row); // copy obj
|
||||
this.dialogTypet = "edit";
|
||||
this.dialogVisiblet = true;
|
||||
if (this.techdoc.file) {
|
||||
this.fileList = [
|
||||
{
|
||||
name:this.techdoc.file_.name,
|
||||
url: this.techdoc.file_.path,
|
||||
},
|
||||
];
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs["Formt"].clearValidate();
|
||||
});
|
||||
},
|
||||
handletechdocDelete(scope) {
|
||||
this.$confirm("确认删除?", "警告", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "取消",
|
||||
type: "error",
|
||||
})
|
||||
.then(async () => {
|
||||
await deletetechdoc(scope.row.id);
|
||||
this.gettechdocLists();
|
||||
this.$message.success("成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
},
|
||||
|
||||
async techdocconfirm(form) {
|
||||
this.$refs[form].validate((valid) => {
|
||||
if (valid) {
|
||||
const isEdit = this.dialogTypet === "edit";
|
||||
|
||||
if (isEdit) {
|
||||
updatetechdoc(this.techdoc.id, this.techdoc).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.gettechdocLists();
|
||||
this.dialogVisiblet = false;
|
||||
this.$message.success("成功");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.techdoc.process=this.process;
|
||||
this.techdoc.product=this.product;
|
||||
createtechdoc(this.techdoc).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.gettechdocLists();
|
||||
this.dialogVisiblet = false;
|
||||
this.$message.success("成功");
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.el-col {
|
||||
border-radius: 4px;
|
||||
}
|
||||
.bg-purple-dark {
|
||||
background: #99a9bf;
|
||||
}
|
||||
.bg-purple {
|
||||
background: #d3dce6;
|
||||
}
|
||||
.bg-purple-light {
|
||||
background: #e5e9f2;
|
||||
}
|
||||
.grid-content {
|
||||
border-radius: 4px;
|
||||
min-height: 36px;
|
||||
}
|
||||
.box-card{
|
||||
height:130px;
|
||||
}
|
||||
</style>
|
|
@ -29,7 +29,14 @@
|
|||
<el-table-column label="步骤编号">
|
||||
<template slot-scope="scope">{{ scope.row.number }}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="相关设备">
|
||||
<template slot-scope="scope" v-if="scope.row.equipments">
|
||||
<el-tag v-for="item in scope.row.equipments_"
|
||||
:key="item.number"
|
||||
:label="item.name"
|
||||
:value="item.number">{{item.name}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="操作"
|
||||
|
|
Loading…
Reference in New Issue