chejiancaozuo
This commit is contained in:
parent
d5336df9fc
commit
1665ee1f76
|
@ -2,8 +2,8 @@
|
|||
ENV = 'development'
|
||||
|
||||
# base api
|
||||
VUE_APP_BASE_API = 'http://127.0.0.1:8000/api'
|
||||
#VUE_APP_BASE_API = 'http://47.95.0.242:2222/api'
|
||||
#VUE_APP_BASE_API = 'http://127.0.0.1:8000/api'
|
||||
VUE_APP_BASE_API = 'http://47.95.0.242:2222/api'
|
||||
|
||||
|
||||
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
|
||||
|
|
|
@ -69,3 +69,13 @@ export function getmaterialbatchList(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//库存审核
|
||||
export function audit(id, data) {
|
||||
return request({
|
||||
url: `/inm/fifo/${id}/audit/`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -57,3 +57,11 @@ export function deleteTestitem(id, data) {
|
|||
data
|
||||
})
|
||||
}
|
||||
//提交物料检查项目
|
||||
export function createTestrecord(data) {
|
||||
return request({
|
||||
url: '/qm/testrecord/',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -15,3 +15,28 @@ export function getwmaterialList(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
//车间操作
|
||||
export function createWork(data) {
|
||||
return request({
|
||||
url: '/wpm/do/init/',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
//提交
|
||||
export function submitWork(data) {
|
||||
return request({
|
||||
url: '/wpm/do/submit/',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
//子工序半成品
|
||||
export function getwproductList(query) {
|
||||
return request({
|
||||
url: '/wpm/wproduct/',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -40,15 +40,17 @@
|
|||
highlight-current-row
|
||||
max-height="600"
|
||||
>
|
||||
|
||||
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="仓库">
|
||||
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template>
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.warehouse_.name
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="出库入人员">
|
||||
<template slot-scope="scope">{{ scope.row.operator_.username }}</template>
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.operator_.username
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="出入库时间">
|
||||
<template slot-scope="scope">{{ scope.row.inout_date }}</template>
|
||||
|
@ -56,18 +58,24 @@
|
|||
<el-table-column label="出入库类型">
|
||||
<template slot-scope="scope">{{ types_[scope.row.type] }}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="操作"
|
||||
width="220px"
|
||||
>
|
||||
<el-table-column label="是否审核">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.is_audited == false">未审核</el-tag>
|
||||
<el-tag v-else>已审核</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" label="操作" width="220px">
|
||||
<template slot-scope="scope">
|
||||
<el-link
|
||||
v-if="checkPermission(['warehouse_update'])"
|
||||
@click="handleDetail(scope)"
|
||||
>查看详情</el-link
|
||||
>查看</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="scope.row.is_audited == false"
|
||||
@click="handleAudit(scope)"
|
||||
>审核</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="checkPermission(['warehouse_delete'])"
|
||||
|
@ -98,13 +106,31 @@
|
|||
:rules="rule1"
|
||||
>
|
||||
<el-form-item label="仓库" prop="warehouse">
|
||||
<el-select v-model="inventory.warehouse" placeholder="请选择" filterable >
|
||||
<el-option v-for="item in warehouseData" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-select
|
||||
v-model="inventory.warehouse"
|
||||
placeholder="请选择"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in warehouseData"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作人" prop="operator">
|
||||
<el-select v-model="inventory.operator" placeholder="请选择" filterable >
|
||||
<el-option v-for="item in userData" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-select
|
||||
v-model="inventory.operator"
|
||||
placeholder="请选择"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userData"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库时间" prop="inout_date">
|
||||
|
@ -120,40 +146,88 @@
|
|||
|
||||
<div v-for="(item, index) in inventory.details" :key="index">
|
||||
<el-row>
|
||||
<el-col :span="8" style="margin-right:10px;">
|
||||
<el-form-item class="material" label="物料:" :prop="'details.'+index+'.material'" >
|
||||
<el-col :span="8" style="margin-right: 10px">
|
||||
<el-form-item
|
||||
class="material"
|
||||
label="物料:"
|
||||
:prop="'details.' + index + '.material'"
|
||||
>
|
||||
<el-select v-model="item.material" size="small">
|
||||
<el-option v-for="item in materialoptions"
|
||||
<el-option
|
||||
v-for="item in materialoptions"
|
||||
:key="item.value"
|
||||
:value="item.value"
|
||||
:label="item.label">
|
||||
:label="item.label"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" style="margin-right:10px;">
|
||||
<el-form-item class="count" label="数量" :prop="'details.'+index+'.count'" >
|
||||
<el-input-number v-model="item.count" :min="0"></el-input-number>
|
||||
<el-col :span="8" style="margin-right: 10px">
|
||||
<el-form-item
|
||||
class="count"
|
||||
label="数量"
|
||||
:prop="'details.' + index + '.count'"
|
||||
>
|
||||
<el-input-number
|
||||
v-model="item.count"
|
||||
:min="0"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" style="margin-right:10px;">
|
||||
<el-form-item class="batch" label="批次" :prop="'details.'+index+'.batch'" >
|
||||
<el-col :span="6" style="margin-right: 10px">
|
||||
<el-form-item
|
||||
class="batch"
|
||||
label="批次"
|
||||
:prop="'details.' + index + '.batch'"
|
||||
>
|
||||
<el-input v-model="item.batch" placeholder="批次号"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 删除按钮 -->
|
||||
<el-col :span="1">
|
||||
<el-tooltip class="item" effect="dark" content="删除" placement="top">
|
||||
<el-button @click="deleteItem(index)" style='border:none;background:none;padding:0px;margin-top:4px;'>
|
||||
<i class="el-icon-remove-outline" style='font-size:20px;'></i>
|
||||
<el-tooltip
|
||||
class="item"
|
||||
effect="dark"
|
||||
content="删除"
|
||||
placement="top"
|
||||
>
|
||||
<el-button
|
||||
@click="deleteItem(index)"
|
||||
style="
|
||||
border: none;
|
||||
background: none;
|
||||
padding: 0px;
|
||||
margin-top: 4px;
|
||||
"
|
||||
>
|
||||
<i class="el-icon-remove-outline" style="font-size: 20px"></i>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div>
|
||||
<el-tooltip class="item" effect="dark" content="添加条件" placement="top">
|
||||
<el-button @click="addConditions" style='cursor:pointer;width:95%;color:#fe000c;border:1px dashed #fe000c;height:40px;padding:0px;margin-top: 2px;margin-left:20px;font-size:26px'>
|
||||
<el-tooltip
|
||||
class="item"
|
||||
effect="dark"
|
||||
content="添加条件"
|
||||
placement="top"
|
||||
>
|
||||
<el-button
|
||||
@click="addConditions"
|
||||
style="
|
||||
cursor: pointer;
|
||||
width: 95%;
|
||||
color: #fe000c;
|
||||
border: 1px dashed #fe000c;
|
||||
height: 40px;
|
||||
padding: 0px;
|
||||
margin-top: 2px;
|
||||
margin-left: 20px;
|
||||
font-size: 26px;
|
||||
"
|
||||
>
|
||||
+
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
|
@ -167,7 +241,12 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {getfifoList,createInventory,getWarehouseList} from "@/api/inm";
|
||||
import {
|
||||
getfifoList,
|
||||
createInventory,
|
||||
getWarehouseList,
|
||||
audit,
|
||||
} from "@/api/inm";
|
||||
import checkPermission from "@/utils/permission";
|
||||
import { getMaterialList } from "@/api/mtm";
|
||||
import { getUserList } from "@/api/user";
|
||||
|
@ -176,11 +255,10 @@ import Pagination from "@/components/Pagination"; // secondary package based on
|
|||
const defaulteinventory = {
|
||||
details: [
|
||||
{
|
||||
material:'', // 物料
|
||||
count:'',//数量
|
||||
batch:'',//批次
|
||||
|
||||
}
|
||||
material: "", // 物料
|
||||
count: "", //数量
|
||||
batch: "", //批次
|
||||
},
|
||||
],
|
||||
};
|
||||
export default {
|
||||
|
@ -192,13 +270,10 @@ export default {
|
|||
count: 0,
|
||||
},
|
||||
types_: {
|
||||
|
||||
1:'生产领料',
|
||||
2:'销售提货',
|
||||
3:'采购入库',
|
||||
4:'生产入库',
|
||||
|
||||
|
||||
1: "生产领料",
|
||||
2: "销售提货",
|
||||
3: "采购入库",
|
||||
4: "生产入库",
|
||||
},
|
||||
listQuery: {
|
||||
page: 1,
|
||||
|
@ -212,14 +287,13 @@ export default {
|
|||
dialogType: "new",
|
||||
rule1: {
|
||||
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
this.getlists()
|
||||
this.getlists();
|
||||
this.getList();
|
||||
this.getUser();
|
||||
this.getmaterialList();
|
||||
|
@ -236,11 +310,10 @@ export default {
|
|||
}
|
||||
this.listLoading = false;
|
||||
});
|
||||
|
||||
},
|
||||
//出入库详情
|
||||
handleDetail(scope) {
|
||||
this.$router.push({name: "fifodetail", params: { id: scope.row.id }, })
|
||||
this.$router.push({ name: "fifodetail", params: { id: scope.row.id } });
|
||||
},
|
||||
|
||||
getlists() {
|
||||
|
@ -252,27 +325,25 @@ export default {
|
|||
});
|
||||
},
|
||||
getUser() {
|
||||
getUserList({page:0}).then(res => {
|
||||
getUserList({ page: 0 }).then((res) => {
|
||||
if (res.data) {
|
||||
this.userData = genTree(res.data);
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
addConditions() {
|
||||
|
||||
if (this.inventory.details.length <= 10) {
|
||||
this.inventory.details.push({
|
||||
material:'', // 物料
|
||||
count:'', //数量
|
||||
batch:'', // 批次
|
||||
|
||||
material: "", // 物料
|
||||
count: "", //数量
|
||||
batch: "", // 批次
|
||||
});
|
||||
} else {
|
||||
this.$message('最多可添加十项条件');
|
||||
this.$message("最多可添加十项条件");
|
||||
}
|
||||
},
|
||||
deleteItem(index) {
|
||||
this.inventory.details.splice(index, 1)
|
||||
this.inventory.details.splice(index, 1);
|
||||
},
|
||||
//物料
|
||||
getmaterialList() {
|
||||
|
@ -284,15 +355,13 @@ export default {
|
|||
this.listLoading = false;
|
||||
});
|
||||
},
|
||||
handleCreate()
|
||||
{
|
||||
handleCreate() {
|
||||
this.inventory.details = [
|
||||
{
|
||||
material:'', // 物料
|
||||
count:'',//数量
|
||||
batch:'',//批次
|
||||
|
||||
}
|
||||
material: "", // 物料
|
||||
count: "", //数量
|
||||
batch: "", //批次
|
||||
},
|
||||
];
|
||||
this.inventory = Object.assign({}, defaulteinventory);
|
||||
this.dialogType = "new";
|
||||
|
@ -301,6 +370,22 @@ export default {
|
|||
this.$refs["Form"].clearValidate();
|
||||
});
|
||||
},
|
||||
//审核
|
||||
handleAudit(scope) {
|
||||
this.$confirm("是否通过?", "提示", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "取消",
|
||||
type: "error",
|
||||
})
|
||||
.then(async () => {
|
||||
await audit(scope.row.id);
|
||||
this.getList();
|
||||
this.$message.success("已审核");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
},
|
||||
handleFilter() {
|
||||
this.listQuery.page = 1;
|
||||
this.getList();
|
||||
|
@ -309,13 +394,12 @@ export default {
|
|||
this.listQuery = {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
}
|
||||
};
|
||||
this.getList();
|
||||
},
|
||||
|
||||
|
||||
async confirm(form) {
|
||||
console.log(this.inventory)
|
||||
console.log(this.inventory);
|
||||
|
||||
createInventory(this.inventory).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
|
@ -324,10 +408,7 @@ export default {
|
|||
this.$message.success("成功");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,32 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<div>
|
||||
<el-input
|
||||
v-model="listQuery.search"
|
||||
placeholder="仓库名称/仓库编号"
|
||||
style="width: 300px"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="handleFilter"
|
||||
/>
|
||||
<el-button
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleFilter"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-refresh-left"
|
||||
@click="resetFilter"
|
||||
>重置</el-button
|
||||
>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card style="margin-top: 2px">
|
||||
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="fifodetailList.results"
|
||||
|
@ -36,8 +10,6 @@
|
|||
highlight-current-row
|
||||
max-height="600"
|
||||
>
|
||||
|
||||
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料名称">
|
||||
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
|
||||
|
@ -47,19 +19,44 @@
|
|||
<template slot-scope="scope">{{ scope.row.batch }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料编号">
|
||||
<template slot-scope="scope">{{ scope.row.material_.number }}</template>
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.material_.number
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料单位">
|
||||
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料型号">
|
||||
<template slot-scope="scope">{{ scope.row.material_.specification }}</template>
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.material_.specification
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="入库数量">
|
||||
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否检查">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.is_tested == false">未检查</el-tag>
|
||||
<el-tag v-else>已检查</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查是否合格">
|
||||
<template slot-scope="scope" v-if="scope.row.is_tested == true">
|
||||
<el-tag v-if="scope.row.is_testok == false">不合格</el-tag>
|
||||
<el-tag v-else>合格</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column align="center" label="操作" width="220px">
|
||||
<template slot-scope="scope">
|
||||
<el-link
|
||||
v-if="scope.row.is_tested == false"
|
||||
@click="handleMaterial(scope)"
|
||||
>检查</el-link
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="fifodetailList.count > 0"
|
||||
|
@ -70,12 +67,144 @@
|
|||
/>
|
||||
</el-card>
|
||||
|
||||
<el-dialog title="物料检查表" :visible.sync="outerVisible">
|
||||
<el-select style="width: 100%" v-model="recordform" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in recordformList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<el-dialog
|
||||
width="30%"
|
||||
title="检查项目"
|
||||
:visible.sync="innerVisible"
|
||||
append-to-body
|
||||
>
|
||||
<el-form label-width="80px" label-position="right">
|
||||
<el-row v-for="(item, $index) in fieldList" :key="$index">
|
||||
<el-form-item
|
||||
v-if="item.field_type === 'string'"
|
||||
:label="item.field_name"
|
||||
>
|
||||
<el-input placeholder="请输入" v-model="item.sort" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-else-if="item.field_type === 'int'"
|
||||
:label="item.field_name"
|
||||
>
|
||||
<el-input
|
||||
type="number"
|
||||
placeholder="请输入"
|
||||
v-model="item.sort"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-else-if="item.field_type === 'float'"
|
||||
:label="item.field_name"
|
||||
>
|
||||
<el-input
|
||||
type="number"
|
||||
placeholder="请输入"
|
||||
v-model="item.sort"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-else-if="item.field_type === 'date'"
|
||||
:label="item.field_name"
|
||||
>
|
||||
<el-date-picker
|
||||
v-model="item.create_time"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 100%"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-else-if="item.field_type === 'datetime'"
|
||||
:label="item.field_name"
|
||||
>
|
||||
<el-date-picker
|
||||
v-model="item.create_time"
|
||||
type="datetime"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
style="width: 100%"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-else-if="item.field_type === 'select'"
|
||||
:label="item.field_name"
|
||||
>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="item.sort"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item1 in item.field_choice"
|
||||
:key="item1"
|
||||
:label="item1"
|
||||
:value="item1"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-else-if="item.field_type === 'selects'"
|
||||
:label="item.field_name"
|
||||
>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="optio"
|
||||
multiple
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item1 in item.field_choice"
|
||||
:key="item1"
|
||||
:label="item1"
|
||||
:value="item1"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="是否合格" prop="sort_str">
|
||||
<el-radio v-model="is_testok" label="true">检查合格</el-radio>
|
||||
<el-radio v-model="is_testok" label="false">检查不合格</el-radio>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="innerVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitfield"
|
||||
>提交检查项目</el-button
|
||||
>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="outerVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitrecordform"
|
||||
>填写检查项目</el-button
|
||||
>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getfifodetailList } from "@/api/inm";
|
||||
import checkPermission from "@/utils/permission";
|
||||
import { getMaterialList} from "@/api/mtm";
|
||||
import { getMaterialList, getrecordformList, getrffieldList } from "@/api/mtm";
|
||||
import { createTestrecord } from "@/api/qm";
|
||||
import { getUserList } from "@/api/user";
|
||||
import { genTree } from "@/utils";
|
||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||
|
@ -84,22 +213,32 @@ export default {
|
|||
components: { Pagination },
|
||||
data() {
|
||||
return {
|
||||
|
||||
InventoryList: {
|
||||
count: 0,
|
||||
},
|
||||
|
||||
fifodetailList: {
|
||||
count: 0,
|
||||
},
|
||||
listQuery: {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
},
|
||||
|
||||
listLoading: true,
|
||||
dialogVisible: false,
|
||||
dialogType: "new",
|
||||
fieldList: {
|
||||
count: 0,
|
||||
},
|
||||
is_testok: "true",
|
||||
field: [],
|
||||
recordformList: [],
|
||||
recordform: "",
|
||||
fifo_detail: "",
|
||||
listQueryrecordform: {
|
||||
page: 0,
|
||||
},
|
||||
outerVisible: false,
|
||||
innerVisible: false,
|
||||
testrecord: {},
|
||||
rule1: {
|
||||
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
|
||||
},
|
||||
};
|
||||
},
|
||||
|
@ -121,11 +260,56 @@ export default {
|
|||
}
|
||||
this.listLoading = false;
|
||||
});
|
||||
|
||||
|
||||
|
||||
},
|
||||
handleMaterial(scope) {
|
||||
//调该物料对应的检查表
|
||||
this.outerVisible = true;
|
||||
this.fifo_detail = scope.row.id;
|
||||
this.listQueryrecordform.material = scope.row.material;
|
||||
this.listQueryrecordform.type = 2;
|
||||
getrecordformList(this.listQueryrecordform).then((response) => {
|
||||
if (response.data) {
|
||||
this.recordformList = response.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
//根据选择的表,渲染检查项目
|
||||
submitrecordform() {
|
||||
if (this.recordform != "") {
|
||||
getrffieldList({ form: this.recordform, page: 0 }).then((response) => {
|
||||
if (response.data) {
|
||||
this.fieldList = response.data;
|
||||
this.innerVisible = true;
|
||||
}
|
||||
});
|
||||
} else this.$message.error("请选择检查表!");
|
||||
},
|
||||
//提交检查项目
|
||||
submitfield() {
|
||||
let _this = this;
|
||||
_this.field = []; //检查项目
|
||||
this.fieldList.forEach((item) => {
|
||||
|
||||
_this.field.push({
|
||||
form_field:item.id,
|
||||
field_value:item.sort
|
||||
});
|
||||
});
|
||||
|
||||
console.log(this.recordform);
|
||||
this.testrecord.form = this.recordform;
|
||||
this.testrecord.record_data = _this.field;
|
||||
this.testrecord.fifo_item = this.fifo_detail;
|
||||
|
||||
this.testrecord.is_testok = this.is_testok;
|
||||
createTestrecord(this.testrecord).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.innerVisible = false;
|
||||
this.outerVisible = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
</div>
|
||||
</el-card>
|
||||
<el-card style="margin-top: 2px">
|
||||
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="InventoryList.results"
|
||||
|
@ -36,8 +35,6 @@
|
|||
highlight-current-row
|
||||
max-height="600"
|
||||
>
|
||||
|
||||
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料批次">
|
||||
<template slot-scope="scope">{{ scope.row.batch }}</template>
|
||||
|
@ -47,21 +44,23 @@
|
|||
</el-table-column>
|
||||
|
||||
<el-table-column label="物料编号">
|
||||
<template slot-scope="scope">{{ scope.row.material_.number }}</template>
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.material_.number
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="仓库名称">
|
||||
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template>
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.warehouse_.name
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="仓库编号">
|
||||
<template slot-scope="scope">{{ scope.row.warehouse_.number }}</template>
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.warehouse_.number
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料总存量">
|
||||
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="InventoryList.count > 0"
|
||||
|
@ -71,11 +70,16 @@
|
|||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getInventoryList,getfifoList,getmaterialbatchList,createInventory,getWarehouseList } from "@/api/inm";
|
||||
import {
|
||||
getInventoryList,
|
||||
getfifoList,
|
||||
getmaterialbatchList,
|
||||
createInventory,
|
||||
getWarehouseList,
|
||||
} from "@/api/inm";
|
||||
import checkPermission from "@/utils/permission";
|
||||
import { getMaterialList } from "@/api/mtm";
|
||||
import { getUserList } from "@/api/user";
|
||||
|
@ -86,7 +90,6 @@ export default {
|
|||
components: { Pagination },
|
||||
data() {
|
||||
return {
|
||||
|
||||
InventoryList: {
|
||||
count: 0,
|
||||
},
|
||||
|
@ -98,16 +101,13 @@ export default {
|
|||
|
||||
rule1: {
|
||||
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
|
||||
this.getList();
|
||||
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
|
@ -121,9 +121,6 @@ export default {
|
|||
}
|
||||
this.listLoading = false;
|
||||
});
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
handleFilter() {
|
||||
|
@ -134,13 +131,9 @@ export default {
|
|||
this.listQuery = {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
}
|
||||
};
|
||||
this.getList();
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -55,11 +55,7 @@
|
|||
<el-table-column label="创建时间">
|
||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="操作"
|
||||
width="220px"
|
||||
>
|
||||
<el-table-column align="center" label="操作" width="220px">
|
||||
<template slot-scope="scope">
|
||||
<el-link
|
||||
v-if="checkPermission(['warehouse_update'])"
|
||||
|
@ -108,7 +104,6 @@
|
|||
<el-form-item label="具体地点" prop="place">
|
||||
<el-input v-model="warehouse.place" placeholder="具体地点" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div style="text-align: right">
|
||||
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
||||
|
@ -118,14 +113,17 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getWarehouseList, createWarehouse,updateWarehouse,deleteWarehouse } from "@/api/inm";
|
||||
import {
|
||||
getWarehouseList,
|
||||
createWarehouse,
|
||||
updateWarehouse,
|
||||
deleteWarehouse,
|
||||
} from "@/api/inm";
|
||||
import checkPermission from "@/utils/permission";
|
||||
|
||||
|
||||
import { genTree } from "@/utils";
|
||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||
const defaultewarehouse = {
|
||||
};
|
||||
const defaultewarehouse = {};
|
||||
export default {
|
||||
components: { Pagination },
|
||||
data() {
|
||||
|
@ -134,16 +132,20 @@ export default {
|
|||
warehouseList: {
|
||||
count: 0,
|
||||
},
|
||||
options: [{
|
||||
options: [
|
||||
{
|
||||
value: 0,
|
||||
label: '运转正常'
|
||||
}, {
|
||||
label: "运转正常",
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '停用'
|
||||
}, {
|
||||
label: "停用",
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '报废'
|
||||
}],
|
||||
label: "报废",
|
||||
},
|
||||
],
|
||||
listQuery: {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
|
@ -179,7 +181,7 @@ export default {
|
|||
},
|
||||
//跳转到该仓库的物料表
|
||||
handleMaterial(scope) {
|
||||
this.$router.push({name: "inventory", params: { id: scope.row.id }, })
|
||||
this.$router.push({ name: "inventory", params: { id: scope.row.id } });
|
||||
},
|
||||
handleFilter() {
|
||||
this.listQuery.page = 1;
|
||||
|
@ -189,7 +191,7 @@ export default {
|
|||
this.listQuery = {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
}
|
||||
};
|
||||
this.getList();
|
||||
},
|
||||
handleCreate() {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<div slot="header" class="clearfix">
|
||||
<span style="font-size: 16px;
|
||||
font-weight: 700;
|
||||
">过程记录表</span>
|
||||
">物料检验记录表</span>
|
||||
</div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
|
||||
>新增</el-button>
|
||||
|
@ -187,7 +187,7 @@
|
|||
<el-table-column label="是否判定">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.need_judge==true">是</el-tag>
|
||||
<el-tag v-else>是</el-tag>
|
||||
<el-tag v-else>否</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
@ -251,10 +251,10 @@
|
|||
<el-switch v-model="field.need_judge"></el-switch>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="上限值" prop="high_limit">
|
||||
<el-form-item label="上限值" v-if="field.need_judge==true" prop="high_limit">
|
||||
<el-input-number v-model="field.high_limit" :precision="2" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="上限规则" prop="high_rule">
|
||||
<el-form-item label="上限规则" v-if="field.need_judge==true" prop="high_rule">
|
||||
<el-select style="width: 100%" v-model="field.high_rule" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in highoptions"
|
||||
|
@ -264,10 +264,10 @@
|
|||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="下限值" prop="low_limit">
|
||||
<el-form-item label="下限值" v-if="field.need_judge==true" prop="low_limit">
|
||||
<el-input-number v-model="field.low_limit" :precision="2" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="下限规则" prop="low_rule">
|
||||
<el-form-item label="下限规则" v-if="field.need_judge==true" prop="low_rule">
|
||||
<el-select style="width: 100%" v-model="field.low_rule" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in lowoptions"
|
||||
|
@ -429,7 +429,7 @@
|
|||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
this.step.process = this.$route.params.id;
|
||||
this.material = this.$route.params.id;
|
||||
this.recordformLists();
|
||||
|
||||
},
|
||||
|
@ -461,7 +461,7 @@
|
|||
},
|
||||
recordformLists()
|
||||
{
|
||||
this.listQueryrecordform.step=this.stepid;
|
||||
this.listQueryrecordform.material=this.material;
|
||||
this.listQueryrecordform.type=2;
|
||||
getrecordformList(this.listQueryrecordform).then((response) => {
|
||||
if (response.data) {
|
||||
|
@ -476,8 +476,7 @@
|
|||
getrffieldList(this.listQueryfield).then((response) => {
|
||||
if (response.data) {
|
||||
this.fieldList = response.data;
|
||||
debugger;
|
||||
console.log(this.fieldList)
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -33,6 +33,11 @@
|
|||
:value="item.number">{{item.name}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="子工序类型">
|
||||
<template slot-scope="scope"> {{ type_[scope.row.type] }}</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="排序">
|
||||
<template slot-scope="scope">{{ scope.row.sort }}</template>
|
||||
</el-table-column>
|
||||
|
@ -88,6 +93,18 @@
|
|||
<el-input type="textarea" :rows="3" v-model="step.instruction_content" placeholder="指导书内容" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="子工序类型" prop="type">
|
||||
<el-select style="width: 100%" v-model="step.type" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in typeoption"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number
|
||||
v-model="step.sort"
|
||||
|
@ -428,6 +445,12 @@
|
|||
page: 1,
|
||||
page_size: 20,
|
||||
},
|
||||
type_: {
|
||||
1:'普通',
|
||||
2:'分割',
|
||||
3:'结合',
|
||||
|
||||
},
|
||||
options_: {
|
||||
'string':'文本',
|
||||
'int':'整数',
|
||||
|
@ -437,6 +460,18 @@
|
|||
'select': '单选',
|
||||
'selects': '多选',
|
||||
},
|
||||
typeoption: [{
|
||||
value: '1',
|
||||
label: '普通'
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '分割'
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '结合'
|
||||
}],
|
||||
fieldtypeoptions: [{
|
||||
value: 'string',
|
||||
label: '文本'
|
||||
|
|
|
@ -12,13 +12,16 @@
|
|||
fit
|
||||
stripe
|
||||
style="width: 100%"
|
||||
max-height="400"
|
||||
max-height="700"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
|
||||
|
||||
<el-table-column label="分解产品名称">
|
||||
<template slot-scope="scope">{{ scope.row.subproduction_.name }}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="生产子计划名">
|
||||
<el-table-column label="生产车间">
|
||||
<template slot-scope="scope">{{ scope.row.workshop_.name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工序名">
|
||||
|
@ -36,6 +39,9 @@
|
|||
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="生产个数">
|
||||
<template slot-scope="scope">{{ scope.row.main_count }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开工时间">
|
||||
<template slot-scope="scope">{{ scope.row.start_date }}</template>
|
||||
|
|
|
@ -52,19 +52,16 @@
|
|||
<template slot-scope="scope">{{ scope.row.standard_.name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="标准编号">
|
||||
<template slot-scope="scope">{{ scope.row.standard_.number }}</template>
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.standard_.number
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="创建时间">
|
||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="操作"
|
||||
width="220px"
|
||||
>
|
||||
<el-table-column align="center" label="操作" width="220px">
|
||||
<template slot-scope="scope">
|
||||
|
||||
<el-link
|
||||
v-if="checkPermission(['warehouse_update'])"
|
||||
@click="handleEdit(scope)"
|
||||
|
@ -105,17 +102,20 @@
|
|||
<el-input v-model="testitem.term_number" placeholder="条款号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标准" prop="standard">
|
||||
<el-select style="width: 100%" v-model="testitem.standard" placeholder="请选择">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="testitem.standard"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
</el-form>
|
||||
<div style="text-align: right">
|
||||
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
||||
|
@ -125,14 +125,18 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getTestitemList, createTestitem,updateTestitem,deleteTestitem,getStandardList } from "@/api/qm";
|
||||
import {
|
||||
getTestitemList,
|
||||
createTestitem,
|
||||
updateTestitem,
|
||||
deleteTestitem,
|
||||
getStandardList,
|
||||
} from "@/api/qm";
|
||||
import checkPermission from "@/utils/permission";
|
||||
|
||||
|
||||
import { genTree } from "@/utils";
|
||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||
const defaultetestitem = {
|
||||
};
|
||||
const defaultetestitem = {};
|
||||
export default {
|
||||
components: { Pagination },
|
||||
data() {
|
||||
|
@ -159,7 +163,7 @@ export default {
|
|||
watch: {},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getLists()
|
||||
this.getLists();
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
|
@ -175,11 +179,8 @@ export default {
|
|||
},
|
||||
|
||||
getLists() {
|
||||
|
||||
getStandardList({ pageoff: true }).then((response) => {
|
||||
|
||||
this.options = genTree(response.data);
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -191,7 +192,7 @@ export default {
|
|||
this.listQuery = {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
}
|
||||
};
|
||||
this.getList();
|
||||
},
|
||||
handleCreate() {
|
||||
|
|
|
@ -1,45 +1,57 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick" type="border-card">
|
||||
<el-tab-pane :key="item.name" v-for="item in processOption"
|
||||
<el-tab-pane
|
||||
:key="item.name"
|
||||
v-for="item in processOption"
|
||||
:label="item.name"
|
||||
|
||||
:name="item.id"
|
||||
|
||||
:closable="item.close">
|
||||
|
||||
|
||||
:closable="item.close"
|
||||
>
|
||||
<el-table
|
||||
:data="subproductionplanList.results"
|
||||
border
|
||||
fit
|
||||
stripe
|
||||
style="width: 100%"
|
||||
max-height="400"
|
||||
height="300"
|
||||
highlight-current-row
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
|
||||
|
||||
|
||||
<el-table-column label="生产子计划名">
|
||||
<template slot-scope="scope">{{ scope.row.workshop_.name }}</template>
|
||||
<el-table-column label="分解产品名称">
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.subproduction_.name
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="生产车间">
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.workshop_.name
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="工序名">
|
||||
<template slot-scope="scope">{{ scope.row.process_.name }}</template>
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.process_.name
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工序编号">
|
||||
<template slot-scope="scope">{{ scope.row.process_.number }}</template>
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.process_.number
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="子工序">
|
||||
<template slot-scope="scope" v-if="scope.row.steps">
|
||||
<el-tag v-for="item in scope.row.steps"
|
||||
<el-tag
|
||||
v-for="item in scope.row.steps"
|
||||
:key="item.number"
|
||||
:label="item.name"
|
||||
:value="item.number">{{item.name}}</el-tag>
|
||||
|
||||
|
||||
:value="item.number"
|
||||
>{{ item.name }}</el-tag
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开工时间">
|
||||
|
@ -49,7 +61,9 @@
|
|||
<template slot-scope="scope">{{ scope.row.end_date }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态">
|
||||
<template slot-scope="scope">{{ state_[scope.row.state] }}</template>
|
||||
<template slot-scope="scope">{{
|
||||
state_[scope.row.state]
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="领料状态">
|
||||
<template slot-scope="scope">
|
||||
|
@ -61,19 +75,11 @@
|
|||
<el-table-column label="创建时间">
|
||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="操作"
|
||||
width="220px"
|
||||
>
|
||||
<el-table-column align="center" label="操作" width="220px">
|
||||
<template slot-scope="scope">
|
||||
|
||||
<el-link
|
||||
v-if="checkPermission(['warehouse_update'])"
|
||||
@click="handleNeed(scope)"
|
||||
<el-link v-if="scope.row.state == 1" @click="handleNeed(scope)"
|
||||
>领料</el-link
|
||||
>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -82,10 +88,70 @@
|
|||
:total="subproductionplanList.count"
|
||||
:page.sync="listQuery.page"
|
||||
:limit.sync="listQuery.page_size"
|
||||
@pagination="getspList"
|
||||
@pagination="subproductionplanList"
|
||||
/>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>车间操作</span>
|
||||
</div>
|
||||
<el-button
|
||||
type="primary"
|
||||
style="margin-left: 50px"
|
||||
v-for="item in steps"
|
||||
:key="item.number"
|
||||
:label="item.name"
|
||||
:value="item.number"
|
||||
@click="handlework(item)"
|
||||
>{{ item.name }}</el-button
|
||||
>
|
||||
</el-card>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>半成品</span>
|
||||
</div>
|
||||
<el-table
|
||||
:data="wproductData"
|
||||
@selection-change="handleSelectionChange"
|
||||
border
|
||||
fit
|
||||
stripe
|
||||
style="width: 100%"
|
||||
max-height="300"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column type="index" width="50" />
|
||||
|
||||
|
||||
<el-table-column label="半成品编号">
|
||||
<template slot-scope="scope">{{ scope.row.number }}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="半成品状态">
|
||||
<template slot-scope="scope">{{ scope.row.m_state_.name }}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="所在子工序">
|
||||
<template slot-scope="scope">{{ scope.row.p_state_.name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="所在子工序执行状态">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.is_executed" >已执行</el-tag>
|
||||
<el-tag v-else >待执行</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="更新时间">
|
||||
<template slot-scope="scope">{{ scope.row.update_time }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>车间物料</span>
|
||||
|
@ -98,16 +164,17 @@
|
|||
style="width: 100%"
|
||||
max-height="400"
|
||||
>
|
||||
|
||||
<el-table-column type="index" width="50" />
|
||||
|
||||
|
||||
|
||||
<el-table-column label="物料名称">
|
||||
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.material_.name
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料单位">
|
||||
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.material_.unit
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料批次">
|
||||
<template slot-scope="scope">{{ scope.row.batch }}</template>
|
||||
|
@ -115,16 +182,13 @@
|
|||
<el-table-column label="物料数量">
|
||||
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-dialog
|
||||
:visible.sync="dialogVisible"
|
||||
:title="dialogType === 'edit' ? '编辑领料' : '选择仓库领料'"
|
||||
|
@ -134,98 +198,288 @@
|
|||
:model="need"
|
||||
label-width="80px"
|
||||
label-position="right"
|
||||
|
||||
>
|
||||
|
||||
<el-form-item label="仓库" prop="warehouse">
|
||||
<el-select style="width: 100%" v-model="need.warehouse" placeholder="请选择">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="need.warehouse"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in warehouseoptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
</el-form>
|
||||
<div style="text-align: right">
|
||||
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="confirm('Form')">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:visible.sync="dialogVisiblenw"
|
||||
title="领料"
|
||||
>
|
||||
<el-dialog :visible.sync="dialogVisiblenw" title="领料">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>生产所需领料表</span>
|
||||
|
||||
</div>
|
||||
<template>
|
||||
|
||||
<el-table :data="needwl" style="width: 100%">
|
||||
<el-table-column prop="material_.name" label="物料名称" > </el-table-column>
|
||||
<el-table-column prop="material_.number" label="物料编号"> </el-table-column>
|
||||
<el-table-column prop="material_.specification" label="物料规格" > </el-table-column>
|
||||
<el-table-column prop="material_.unit" label="物料单位" > </el-table-column>
|
||||
<el-table-column prop="count" label="所需物料数量" > </el-table-column>
|
||||
<el-table-column prop="count_real" label="已领物料数量" > </el-table-column>
|
||||
|
||||
<el-table-column prop="material_.name" label="物料名称">
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_.number" label="物料编号">
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_.specification" label="物料规格">
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_.unit" label="物料单位">
|
||||
</el-table-column>
|
||||
<el-table-column prop="count" label="所需物料数量">
|
||||
</el-table-column>
|
||||
<el-table-column prop="count_real" label="已领物料数量">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</template>
|
||||
</el-card>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>当前仓库物料表</span>
|
||||
<el-button style="float: right; padding: 3px 0" @click="handlePick" type="text">确认领料</el-button>
|
||||
<el-button
|
||||
style="float: right; padding: 3px 0"
|
||||
@click="handlePick"
|
||||
type="text"
|
||||
>确认领料</el-button
|
||||
>
|
||||
</div>
|
||||
<template>
|
||||
|
||||
<el-table :data="havewl" style="width: 100%" ref="multipleTable">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column type="selection" width="55"> </el-table-column>
|
||||
<el-table-column prop="batch" label="物料批次"> </el-table-column>
|
||||
<el-table-column prop="material_.name" label="物料名称"> </el-table-column>
|
||||
<el-table-column prop="warehouse_.name" label="物料所在仓库" > </el-table-column>\
|
||||
<el-table-column prop="material_.name" label="物料名称">
|
||||
</el-table-column>
|
||||
<el-table-column prop="warehouse_.name" label="物料所在仓库">
|
||||
</el-table-column
|
||||
>\
|
||||
<el-table-column prop="count" label="物料总数量"> </el-table-column>
|
||||
<el-table-column label="输入领料数量" width="140px">
|
||||
<template slot-scope="scope">
|
||||
<el-form :model="scope.row" widht="100px">
|
||||
<el-form-item size="mini">
|
||||
<el-input-number v-model="scope.row.pick_count" :min="0" :precision="2" :controls="false" :value="0"></el-input-number>
|
||||
<el-input-number
|
||||
v-model="scope.row.pick_count"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:controls="false"
|
||||
:value="0"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="count_real" label="已领物料数量" > </el-table-column>
|
||||
<el-table-column prop="material_.specification" label="物料规格" > </el-table-column>
|
||||
<el-table-column prop="material_.unit" label="物料单位" > </el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="count_real" label="已领物料数量">
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_.specification" label="物料规格">
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_.unit" label="物料单位">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</template>
|
||||
</el-card>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:visible.sync="dialogVisiblework"
|
||||
:fullscreen="true"
|
||||
title="填写记录"
|
||||
>
|
||||
<el-steps
|
||||
:active="values"
|
||||
spac="400px"
|
||||
align-center=""
|
||||
finish-status="success"
|
||||
style="padding-top: 20px"
|
||||
>
|
||||
<el-step
|
||||
:title="item.name"
|
||||
v-for="(item, index) in forms"
|
||||
:key="index"
|
||||
@click.native="stepclick(item.id)"
|
||||
>
|
||||
</el-step>
|
||||
</el-steps>
|
||||
|
||||
<el-card class="box-card" v-if="values === 0">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>消耗物料表</span>
|
||||
</div>
|
||||
<el-table :data="input" border style="width: 100%">
|
||||
|
||||
|
||||
<el-table-column prop="material__name" label="物料名称" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="material__batch" label="物料批次" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="count" label="可用数量" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="count_input" label="使用数量" width="180">
|
||||
<template slot-scope="scope" >
|
||||
<el-form :model="scope.row">
|
||||
<el-form-item size="mini">
|
||||
<el-input-number v-model="scope.row.count_input" :min="0" :value="0"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-card class="box-card" v-if="values === 0">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>产出物料表</span>
|
||||
</div>
|
||||
<el-table :data="output" border style="width: 100%">
|
||||
|
||||
<el-table-column prop="material__name" label="物料名称" width="180">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="count_output" label="产出数量" width="180">
|
||||
<template slot-scope="scope" >
|
||||
<el-form :model="scope.row">
|
||||
<el-form-item size="mini">
|
||||
<el-input-number v-model="scope.row.count_output" :min="0" :value="0"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" v-for="(itemf,$index) in otherforms" :key="$index" >
|
||||
<el-form label-width="80px" label-position="right" v-if="values === $index+1">
|
||||
<el-row v-for="(item, $index) in itemf.form_fields" :key="$index">
|
||||
<el-form-item
|
||||
v-if="item.field_type === 'string'"
|
||||
:label="item.field_name"
|
||||
>
|
||||
<el-input placeholder="请输入" v-model="item.sort" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-else-if="item.field_type === 'int'"
|
||||
:label="item.field_name"
|
||||
>
|
||||
<el-input
|
||||
type="number"
|
||||
placeholder="请输入"
|
||||
v-model="item.sort"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-else-if="item.field_type === 'float'"
|
||||
:label="item.field_name"
|
||||
>
|
||||
<el-input
|
||||
type="number"
|
||||
placeholder="请输入"
|
||||
v-model="item.sort"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-else-if="item.field_type === 'date'"
|
||||
:label="item.field_name"
|
||||
>
|
||||
<el-date-picker
|
||||
v-model="item.create_time"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 100%"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-else-if="item.field_type === 'datetime'"
|
||||
:label="item.field_name"
|
||||
>
|
||||
<el-date-picker
|
||||
v-model="item.create_time"
|
||||
type="datetime"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
style="width: 100%"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-else-if="item.field_type === 'select'"
|
||||
:label="item.field_name"
|
||||
>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="item.sort"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item1 in item.field_choice"
|
||||
:key="item1"
|
||||
:label="item1"
|
||||
:value="item1"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-else-if="item.field_type === 'selects'"
|
||||
:label="item.field_name"
|
||||
>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="optio"
|
||||
multiple
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item1 in item.field_choice"
|
||||
:key="item1"
|
||||
:label="item1"
|
||||
:value="item1"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-button
|
||||
style="margin-top: 12px"
|
||||
@click="next"
|
||||
v-if="values == 0 || values == 1 || values == 2"
|
||||
>下一步</el-button
|
||||
>
|
||||
<el-button
|
||||
style="margin-top: 12px"
|
||||
@click="prev"
|
||||
v-if="values == 1 || values == 2 || values == 3"
|
||||
>上一步</el-button
|
||||
>
|
||||
<div style="text-align: right">
|
||||
<el-button type="danger" @click="dialogVisiblework = false"
|
||||
>取消</el-button
|
||||
>
|
||||
<el-button type="primary" @click="submint()">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getsubproductionplanList, createPick_need } from "@/api/pm";
|
||||
import checkPermission from "@/utils/permission";
|
||||
import { getProcessList } from "@/api/mtm";
|
||||
import { createPick,getwmaterialList } from "@/api/wpm";
|
||||
import { createPick, getwmaterialList,submitWork,getwproductList} from "@/api/wpm";
|
||||
import { getWarehouseList } from "@/api/inm";
|
||||
import { createWork } from "@/api/wpm";
|
||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||
const defaulteneed = {
|
||||
};
|
||||
const defaulteneed = {};
|
||||
export default {
|
||||
components: { Pagination },
|
||||
|
||||
|
@ -240,27 +494,53 @@ export default {
|
|||
page: 1,
|
||||
page_size: 20,
|
||||
},
|
||||
activeName:'0',
|
||||
values: 0,
|
||||
active: 0,
|
||||
activeName: "1",
|
||||
havewl: "",
|
||||
needwl: "",
|
||||
state_: {
|
||||
0:'制定中',
|
||||
1:'已下达',
|
||||
2:'已接受',
|
||||
3:'生产中',
|
||||
4:'已完成'},
|
||||
0: "制定中",
|
||||
1: "已下达",
|
||||
2: "已接受",
|
||||
3: "生产中",
|
||||
4: "已完成",
|
||||
},
|
||||
listLoading: true,
|
||||
listLoading: true,
|
||||
id: "",
|
||||
warehouseoptions: [],
|
||||
dialogVisible: false,
|
||||
dialogType: "new",
|
||||
dialogVisiblework: false,
|
||||
dialogVisiblenw: false,
|
||||
dialogTypenw: "new",
|
||||
picks: [],
|
||||
pickData: {},
|
||||
steps: [],
|
||||
step:null,
|
||||
processOption:"",
|
||||
subproduction_plan: "",
|
||||
form1: [],
|
||||
form2: [],
|
||||
form3: [],
|
||||
input: [],
|
||||
output: [],
|
||||
forms:[],
|
||||
inputData:[],
|
||||
outputData:[],
|
||||
field1:[],
|
||||
field2:[],
|
||||
fromData:[],
|
||||
wproductData:"",
|
||||
wpID:[],
|
||||
multipleSelection: [],
|
||||
wproducts:[],
|
||||
otherforms:[],
|
||||
from:[],
|
||||
};
|
||||
},
|
||||
process: "",
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
|
@ -269,25 +549,44 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
//选项卡切换
|
||||
handleClick(tab)
|
||||
{
|
||||
|
||||
//选项卡切换
|
||||
handleClick(tab) {
|
||||
this.process = tab.name;
|
||||
this.listQuery.process = tab.name;
|
||||
this.steps = [];
|
||||
getsubproductionplanList(this.listQuery).then((response) => {
|
||||
if (response.data) {
|
||||
this.subproductionplanList = response.data;
|
||||
}
|
||||
this.listLoading = false;
|
||||
});
|
||||
getwmaterialList({process:tab.name,page:0}).then((response) => {
|
||||
getwmaterialList({
|
||||
subproduction_plan__process: this.process,
|
||||
page: 0,
|
||||
}).then((response) => {
|
||||
if (response.data) {
|
||||
this.wmaterialList = response.data;
|
||||
}
|
||||
this.listLoading = false;
|
||||
});
|
||||
},
|
||||
|
||||
//工序对应的子计划,弹出对应的车间物料
|
||||
handleCurrentChange(row) {
|
||||
this.steps = row.steps; //调出子工序
|
||||
this.subproduction_plan = row.id; //子计划Id
|
||||
getwmaterialList({
|
||||
subproduction_plan__process: this.process,
|
||||
subproduction_plan: row.id,
|
||||
page: 0,
|
||||
}).then((response) => {
|
||||
if (response.data) {
|
||||
this.wmaterialList = response.data;
|
||||
}
|
||||
this.listLoading = false;
|
||||
});
|
||||
this.getwproductLists();
|
||||
},
|
||||
//工序渲染
|
||||
getProcessList() {
|
||||
getProcessList({ page: 0 }).then((response) => {
|
||||
|
@ -316,49 +615,134 @@ export default {
|
|||
});
|
||||
},
|
||||
async confirm(form) {
|
||||
|
||||
createPick_need(this.id, this.need).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.dialogVisible = false;
|
||||
this.dialogVisiblenw = true;
|
||||
this.havewl = res.data.have;
|
||||
this.needwl = res.data.need;
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
//确认领料
|
||||
handlePick()
|
||||
{
|
||||
|
||||
let _this=this
|
||||
_this.picks=[]//所需物料
|
||||
handlePick() {
|
||||
let _this = this;
|
||||
_this.picks = []; //所需物料
|
||||
this.$refs.multipleTable.selection.forEach((item) => {
|
||||
_this.picks.push({
|
||||
"material":item.material,
|
||||
"batch": item.batch,
|
||||
"pick_count":item.pick_count
|
||||
material: item.material,
|
||||
batch: item.batch,
|
||||
pick_count: item.pick_count,
|
||||
});
|
||||
|
||||
});
|
||||
this.pickData.subproduction_plan = this.id;
|
||||
this.pickData.warehouse = this.need.warehouse;
|
||||
this.pickData.picks = this.picks;
|
||||
|
||||
console.log(this.pickData)
|
||||
// console.log(this.pickData);
|
||||
|
||||
createPick(this.pickData).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.$message.success("领料成功!");
|
||||
}
|
||||
});
|
||||
},
|
||||
prev() {
|
||||
--this.values;
|
||||
if (this.values < 0) this.values = 0;
|
||||
},
|
||||
next() {
|
||||
if (this.values++ > this.forms.length) this.values = 0;
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
let _this = this;
|
||||
_this.wpID = [];
|
||||
val.forEach((item) => {
|
||||
_this.wpID.push(item.id);
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
//车间操作
|
||||
handlework(item) {
|
||||
|
||||
this.step=item.id;
|
||||
// console.log(this.wpID);
|
||||
createWork({
|
||||
step: item.id,
|
||||
wproducts:this.wpID,
|
||||
subproduction_plan: this.subproduction_plan,
|
||||
}).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.dialogVisiblework = true;
|
||||
this.forms=res.data.forms;
|
||||
this.otherforms=res.data.forms.slice(0);//渲染生产表
|
||||
this.otherforms.shift();
|
||||
//console.log(this.otherforms)
|
||||
this.input = res.data.forms[0].input; //消耗
|
||||
this.output = res.data.forms[0].output; //产出
|
||||
this.wproducts=res.data.forms[0].wproducts;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
//提交
|
||||
submint(){
|
||||
this.form = [];
|
||||
this.otherforms.forEach((item) => {
|
||||
let _this = this;
|
||||
_this.field1 = [];
|
||||
item.form_fields.forEach((items) => {
|
||||
_this.field1.push({
|
||||
form_field:items.id,
|
||||
field_value:items.sort
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
this.form.push({
|
||||
form:item.id,
|
||||
record_data:_this.field1
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
|
||||
console.log( this.form);
|
||||
|
||||
|
||||
submitWork({
|
||||
step:this.step,
|
||||
subproduction_plan:this.subproduction_plan,
|
||||
wproducts:this.wproducts,
|
||||
input: this.input,
|
||||
output: this.output,
|
||||
forms: this.from
|
||||
}).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.dialogVisiblework = false;
|
||||
this.$message.success("成功!");
|
||||
this.getwproductLists();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
//大工序下子工序产出的半成品
|
||||
getwproductLists(){
|
||||
getwproductList({page:0, subproduction_plan:this.subproduction_plan, p_state__process:this.process}).then((response) => {
|
||||
if (response.data) {
|
||||
this.wproductData = response.data;
|
||||
//console.log( this.wproductData)
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue