xiugaineirong
This commit is contained in:
parent
01e44e44df
commit
a816d45988
|
@ -226,6 +226,36 @@ export function deleteOutputmaterial(id, data) {
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//其他材料
|
||||||
|
export function getOthermaterialList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/mtm/othermaterial/',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function createOthermaterial(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mtm/othermaterial/',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function updateOthermaterial(id, data) {
|
||||||
|
return request({
|
||||||
|
url: `/mtm/othermaterial/${id}/`,
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function deleteOthermaterial(id, data) {
|
||||||
|
return request({
|
||||||
|
url: `/mtm/othermaterial/${id}/`,
|
||||||
|
method: 'delete',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
//子工序
|
//子工序
|
||||||
|
|
||||||
export function getUsedstepList(query) {
|
export function getUsedstepList(query) {
|
||||||
|
|
|
@ -79,7 +79,7 @@
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="技术指标">
|
<el-table-column label="技术指标" show-overflow-tooltip>
|
||||||
<template slot-scope="scope">{{ scope.row.parameter }}</template>
|
<template slot-scope="scope">{{ scope.row.parameter }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="保管人">
|
<el-table-column label="保管人">
|
||||||
|
@ -208,8 +208,13 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="技术指标" prop="parameter">
|
<el-form-item label="技术指标" prop="parameter">
|
||||||
<el-input v-model="equipment.parameter" placeholder="技术指标" />
|
|
||||||
|
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
:rows="4"
|
||||||
|
v-model="equipment.parameter"
|
||||||
|
placeholder="技术指标"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="存放位置" prop="place">
|
<el-form-item label="存放位置" prop="place">
|
||||||
<el-input v-model="equipment.place" placeholder="存放位置" />
|
<el-input v-model="equipment.place" placeholder="存放位置" />
|
||||||
|
|
|
@ -232,13 +232,16 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="输入物料" prop="unit">
|
<el-form-item label="输入物料" prop="unit">
|
||||||
<el-select filterable style="width: 100%" v-model="inputmaterial.material" placeholder="请选择">
|
<el-select filterable style="width: 50%" v-model="inputmaterial.material" placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in materialoptions"
|
v-for="item in materialoptions"
|
||||||
:key="item.value"
|
:key="item.id"
|
||||||
:label="item.label"
|
:label="item.name"
|
||||||
:value="item.value">
|
:value="item.id">
|
||||||
|
<span style="float: left">{{ item.name }}</span>
|
||||||
|
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.specification }}</span>
|
||||||
</el-option>
|
</el-option>
|
||||||
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="排序" prop="sort">
|
<el-form-item label="排序" prop="sort">
|
||||||
|
@ -330,12 +333,14 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="输出物料" prop="unit">
|
<el-form-item label="输出物料" prop="unit">
|
||||||
<el-select style="width: 100%" v-model="outputmaterial.material" placeholder="请选择">
|
<el-select style="width: 50%" v-model="outputmaterial.material" placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in materialoptions"
|
v-for="item in materialoptions"
|
||||||
:key="item.value"
|
:key="item.id"
|
||||||
:label="item.label"
|
:label="item.name"
|
||||||
:value="item.value">
|
:value="item.id">
|
||||||
|
<span style="float: left">{{ item.name }}</span>
|
||||||
|
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.specification }}</span>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -359,6 +364,103 @@
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
|
<el-tab-pane label="工具工装">
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="handleotherCreate"
|
||||||
|
>新增</el-button>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
|
||||||
|
:data="othertableData"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
<el-table-column label="物料编号" min-width="100">
|
||||||
|
<template slot-scope="scope">{{scope.row.material_.number}}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="物料名称" min-width="100">
|
||||||
|
<template slot-scope="scope"> {{scope.row.material_.name}}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="计量单位" min-width="100">
|
||||||
|
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="单位消耗量" min-width="100">
|
||||||
|
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="操作"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['material_update'])"
|
||||||
|
@click="handleotherEdit(scope)"
|
||||||
|
>编辑</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['material_delete'])"
|
||||||
|
type="danger"
|
||||||
|
@click="handleotherDelete(scope)"
|
||||||
|
>删除</el-link
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="dialogVisibleother"
|
||||||
|
:title="dialogTypeother === 'edit' ? '编辑工具工装' : '新增工具工装'"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="Formother"
|
||||||
|
:model="othermaterial"
|
||||||
|
label-width="80px"
|
||||||
|
label-position="right"
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-form-item label="消耗量" prop="count">
|
||||||
|
<el-input-number v-model="othermaterial.count" :min="0" placeholder="输入整数或小数" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="输入物料" prop="unit">
|
||||||
|
<el-select filterable style="width: 50%" v-model="othermaterial.material" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in materialoptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id">
|
||||||
|
<span style="float: left">{{ item.name }}</span>
|
||||||
|
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.specification }}</span>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="排序" prop="sort">
|
||||||
|
<el-input-number
|
||||||
|
v-model="othermaterial.sort"
|
||||||
|
:min="-2147483648"
|
||||||
|
:max="2147483647"
|
||||||
|
></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div style="text-align: right">
|
||||||
|
<el-button type="danger" @click="dialogVisibleother = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="otherconfirm('Formother')">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</el-tab-pane>
|
||||||
|
|
||||||
<el-tab-pane label="子工序列表">
|
<el-tab-pane label="子工序列表">
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="handleusedstepCreate"
|
<el-button type="primary" icon="el-icon-plus" @click="handleusedstepCreate"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
|
@ -532,7 +634,8 @@
|
||||||
import { getMaterialList,getMaterial,getInputmaterialList,createInputmaterial,updateInputmaterial
|
import { getMaterialList,getMaterial,getInputmaterialList,createInputmaterial,updateInputmaterial
|
||||||
,deleteInputmaterial,getOutputmaterialList,createOutputmaterial,updateOutputmaterial,deleteOutputmaterial,
|
,deleteInputmaterial,getOutputmaterialList,createOutputmaterial,updateOutputmaterial,deleteOutputmaterial,
|
||||||
getUsedstepList,createUsedstep,deleteUsedstep,getStepList,gettechdocList,createtechdoc,updatetechdoc,deletetechdoc
|
getUsedstepList,createUsedstep,deleteUsedstep,getStepList,gettechdocList,createtechdoc,updatetechdoc,deletetechdoc
|
||||||
,getsubproducationList,createsubproducation,updatesubproducation,deletesubproducation,getProcessList } from "@/api/mtm";
|
,getsubproducationList,createsubproducation,updatesubproducation,deletesubproducation,getProcessList ,
|
||||||
|
getOthermaterialList,createOthermaterial,deleteOthermaterial} from "@/api/mtm";
|
||||||
import { quillEditor } from 'vue-quill-editor'
|
import { quillEditor } from 'vue-quill-editor'
|
||||||
import 'quill/dist/quill.core.css'
|
import 'quill/dist/quill.core.css'
|
||||||
import 'quill/dist/quill.snow.css'
|
import 'quill/dist/quill.snow.css'
|
||||||
|
@ -548,6 +651,7 @@ const defaultinputmaterial = {
|
||||||
const defaultoutputmaterial = {
|
const defaultoutputmaterial = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
const defaultother = {};
|
||||||
const defaultusedstep = {
|
const defaultusedstep = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -569,11 +673,13 @@ export default {
|
||||||
editorOption: {} ,
|
editorOption: {} ,
|
||||||
processOptions:[],
|
processOptions:[],
|
||||||
is_main:false,
|
is_main:false,
|
||||||
|
othermaterial:defaultother,
|
||||||
techdoc: defaulttechdoc,
|
techdoc: defaulttechdoc,
|
||||||
subproducation:defaultsubproducation,
|
subproducation:defaultsubproducation,
|
||||||
inputmaterial: defaultinputmaterial,
|
inputmaterial: defaultinputmaterial,
|
||||||
techdoctableData:"",
|
techdoctableData:"",
|
||||||
outputtableData:"",
|
outputtableData:"",
|
||||||
|
othertableData:"",
|
||||||
outputmaterial: defaultoutputmaterial,
|
outputmaterial: defaultoutputmaterial,
|
||||||
usedsteptableData:"",
|
usedsteptableData:"",
|
||||||
usedstep: defaultusedstep,
|
usedstep: defaultusedstep,
|
||||||
|
@ -601,6 +707,9 @@ export default {
|
||||||
listQueryusedstep: {
|
listQueryusedstep: {
|
||||||
page: 0,
|
page: 0,
|
||||||
},
|
},
|
||||||
|
listQueryother: {
|
||||||
|
page: 0,
|
||||||
|
},
|
||||||
listQuerytechdoc:{
|
listQuerytechdoc:{
|
||||||
page: 0,
|
page: 0,
|
||||||
},
|
},
|
||||||
|
@ -619,6 +728,8 @@ export default {
|
||||||
dialogVisibleusedstep:false,
|
dialogVisibleusedstep:false,
|
||||||
dialogTypet: "new",
|
dialogTypet: "new",
|
||||||
dialogVisiblet:false,
|
dialogVisiblet:false,
|
||||||
|
dialogVisibleother:false,
|
||||||
|
dialogTypeother: "new",
|
||||||
listLoading: true,
|
listLoading: true,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -648,7 +759,7 @@ export default {
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
getMaterialList({pageoff:true}).then((response) => {
|
getMaterialList({pageoff:true}).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.materialoptions = genTree(response.data);
|
this.materialoptions = response.data;
|
||||||
}
|
}
|
||||||
this.listLoading = false;
|
this.listLoading = false;
|
||||||
});
|
});
|
||||||
|
@ -680,29 +791,16 @@ export default {
|
||||||
handlespChange(row){
|
handlespChange(row){
|
||||||
this.subproduction = row.id;
|
this.subproduction = row.id;
|
||||||
this.processes = row.process;
|
this.processes = row.process;
|
||||||
this.getmaterialList();//物料列表
|
|
||||||
this.getInputmaterialLists();//输入物料
|
this.getInputmaterialLists();//输入物料
|
||||||
|
|
||||||
this.getOutputmaterialLists();//输出物料
|
this.getOutputmaterialLists();//输出物料
|
||||||
|
this.getOthermaterialLists();//辅助工装
|
||||||
this.getstepList();//子工序
|
this.getstepList();//子工序
|
||||||
this. getUsedstepLists();//
|
this. getUsedstepLists();//
|
||||||
this.gettechdocLists();//技术文件
|
this.gettechdocLists();//技术文件
|
||||||
},
|
},
|
||||||
//工艺点击信息
|
|
||||||
|
|
||||||
stepclick(id)
|
|
||||||
{
|
|
||||||
this.process = id;
|
|
||||||
// alert(this.process)
|
|
||||||
this.getmaterialList();//物料列表
|
|
||||||
this.getInputmaterialLists();//输入物料
|
|
||||||
|
|
||||||
this.getOutputmaterialLists();//输出物料
|
|
||||||
this.getstepList();//子工序
|
|
||||||
this. getUsedstepLists();//
|
|
||||||
this.gettechdocLists();//技术文件
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
//产品分解
|
//产品分解
|
||||||
getsubproducationList(){
|
getsubproducationList(){
|
||||||
|
@ -798,6 +896,7 @@ export default {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs["Form"].clearValidate();
|
this.$refs["Form"].clearValidate();
|
||||||
});
|
});
|
||||||
|
this.getmaterialList();//物料列表
|
||||||
},
|
},
|
||||||
handleinputEdit(scope) {
|
handleinputEdit(scope) {
|
||||||
this.inputmaterial = Object.assign({}, scope.row); // copy obj
|
this.inputmaterial = Object.assign({}, scope.row); // copy obj
|
||||||
|
@ -878,6 +977,7 @@ export default {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs["Forms"].clearValidate();
|
this.$refs["Forms"].clearValidate();
|
||||||
});
|
});
|
||||||
|
this.getmaterialList();//物料列表
|
||||||
},
|
},
|
||||||
handleoutputEdit(scope) {
|
handleoutputEdit(scope) {
|
||||||
this.outputmaterial = Object.assign({}, scope.row); // copy obj
|
this.outputmaterial = Object.assign({}, scope.row); // copy obj
|
||||||
|
@ -931,6 +1031,84 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//输入其他物料列表
|
||||||
|
|
||||||
|
getOthermaterialLists(){
|
||||||
|
|
||||||
|
this.listQueryother.subproduction=this.subproduction;
|
||||||
|
getOthermaterialList(this.listQueryother).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
|
||||||
|
this.othertableData = response.data;//工装列表
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//输入其他物料
|
||||||
|
handleotherCreate() {
|
||||||
|
this.othermaterial = Object.assign({}, defaultother);
|
||||||
|
this.dialogTypeother = "new";
|
||||||
|
this.dialogVisibleother = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Formother"].clearValidate();
|
||||||
|
});
|
||||||
|
this.getmaterialList();//物料列表
|
||||||
|
},
|
||||||
|
handleotherEdit(scope) {
|
||||||
|
this.othermaterial = Object.assign({}, scope.row); // copy obj
|
||||||
|
this.dialogTypeother = "edit";
|
||||||
|
this.dialogVisibleother = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Formother"].clearValidate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleotherDelete(scope) {
|
||||||
|
this.$confirm("确认删除?", "警告", {
|
||||||
|
confirmButtonText: "确认",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "error",
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
await deleteOthermaterial(scope.row.id);
|
||||||
|
this.getOthermaterialLists()
|
||||||
|
this.$message.success("成功");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async otherconfirm(form) {
|
||||||
|
this.$refs[form].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const isEdit = this.dialogTypeother === "edit";
|
||||||
|
if (isEdit) {
|
||||||
|
this.othermaterial.subproduction=this.subproduction;
|
||||||
|
updateOthermaterial(this.othermaterial.id, this.othermaterial).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.getOthermaterialLists()
|
||||||
|
this.dialogVisibleother = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.othermaterial.subproduction=this.subproduction;
|
||||||
|
createOthermaterial(this.othermaterial).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.getOthermaterialLists()
|
||||||
|
this.dialogVisibleother = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//子工序列表
|
//子工序列表
|
||||||
|
|
||||||
getUsedstepLists(){
|
getUsedstepLists(){
|
||||||
|
|
Loading…
Reference in New Issue