cording0324

This commit is contained in:
shijing 2022-03-24 14:01:21 +08:00
parent c0d96cb735
commit b02dc30eb3
4 changed files with 751 additions and 674 deletions

View File

@ -218,7 +218,7 @@
:height="cardTabelHeight"
style="border-top: 1px solid #f5f5f5;"
>
<el-table-column label="id" prop="id" width="50">
<el-table-column type="index" width="50">
</el-table-column>
<el-table-column label="人员名称" prop="name" show-overflow-tooltip>
</el-table-column>
@ -233,7 +233,7 @@
</template>
</el-table-column>
<el-table-column label="部门" prop="dept_">
<template slot-scope="scope">{{scope.row.dept_.name}}</template>
<template slot-scope="scope" v-if="scope.row.dept_">{{scope.row.dept_.name}}</template>
</el-table-column>
</el-table>
</div>
@ -585,7 +585,7 @@
let that = this;
that.listLoadingUser = true;
that.userPage = 1;
getEmployee({page: that.userPage, page_size: that.userPageSize}).then((response) => {
getEmployee({page: that.userPage, page_size: that.userPageSize,show_atwork:true}).then((response) => {
if (response.data) {
that.userList = response.data.results;
that.userTotal = response.data.count;
@ -602,6 +602,7 @@
that.userPage = val;
getEmployee({
page: val,
show_atwork:true,
page_size: that.userPageSize,
fields: 'id,name,dept_name,is_atwork'
}).then((response) => {

View File

@ -6,8 +6,9 @@
type="primary"
icon="el-icon-plus"
@click="handlecgxCreate"
>新增采购项入库</el-button
>
新增采购项入库
</el-button>
<el-table
v-loading="listLoading"
:data="fifodetailList.results"
@ -18,7 +19,7 @@
height="100"
v-el-height-adaptive-table="{ bottomOffset: 42 }"
>
<el-table-column type="index" width="50" />
<el-table-column type="index" width="50"/>
<el-table-column label="物料名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
@ -27,19 +28,14 @@
<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>
@ -70,24 +66,25 @@
<div v-for="item in scope.row.files_" v-bind:key="item.id">
<el-link :href="item.path" target="_blank" type="primary">{{
item.name
}}</el-link>
}}
</el-link>
</div>
</template>
</el-table-column>
<el-table-column
v-if="this.$route.params.pu_order != null"
align="center"
label="操作"
width="220px"
v-if="this.$route.params.pu_order != null"
>
<template slot-scope="scope">
<el-link
v-if="scope.row.need_test"
type="primary"
@click="handleMaterial(scope)"
v-if="scope.row.need_test"
>复验</el-link
>
复验
</el-link>
<el-link type="primary" @click="handleEdit(scope)">上传</el-link>
</template>
</el-table-column>
@ -113,8 +110,8 @@
:rules="rule1"
>
<el-row :gutter="24">
<el-col :span="12"
><div class="grid-content bg-purple">
<el-col :span="12">
<div class="grid-content bg-purple">
<el-form-item label="采购订单项目" :prop="pu_order_item">
<el-select v-model="inpur.pu_order_item" @change="showmessage">
<el-option
@ -125,39 +122,42 @@
>
</el-option>
</el-select>
</el-form-item></div
></el-col>
<el-col :span="12"
><div class="grid-content bg-purple">
</el-form-item>
</div>
</el-col>
<el-col :span="12">
<div class="grid-content bg-purple">
<el-form-item label="采购数量">
<el-input v-model="puorderItemdetial.count" :disabled="true">
</el-input>
</el-form-item></div
></el-col>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12"
><div class="grid-content bg-purple">
<el-col :span="12">
<div class="grid-content bg-purple">
<el-form-item label="到货时间">
<el-input
v-model="puorderItemdetial.delivery_date"
:disabled="true"
>
</el-input>
</el-form-item></div
></el-col>
<el-col :span="12"
><div class="grid-content bg-purple">
</el-form-item>
</div>
</el-col>
<el-col :span="12">
<div class="grid-content bg-purple">
<el-form-item label="到货数量">
<el-input
v-model="puorderItemdetial.delivered_count"
:disabled="true"
>
</el-input>
</el-form-item></div
></el-col>
</el-form-item>
</div>
</el-col>
</el-row>
<el-form-item label="仓库" :prop="warehouse">
<el-select v-model="inpur.warehouse">
<el-option
@ -188,14 +188,13 @@
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisibles = false"
>取消</el-button
>
>取消
</el-button>
<el-button type="primary" @click="confirminpur('Form1')"
>确认</el-button
>
>确认
</el-button>
</div>
</el-dialog>
<el-dialog
:close-on-click-modal="false"
:visible.sync="dialogVisible"
@ -210,7 +209,6 @@
<el-form-item label="是否需要复验" prop="need_test">
<el-switch v-model="FIFOItem.need_test"></el-switch>
</el-form-item>
<el-form-item label="文件列表">
<el-upload
ref="upload"
@ -239,7 +237,8 @@
></i>
<el-link :href="item.path" target="_blank" type="primary">{{
item.name
}}</el-link>
}}
</el-link>
</div>
</el-form>
<div style="text-align: right">
@ -275,16 +274,16 @@
v-if="item.field_type === 'string'"
:label="item.field_name"
>
<el-input placeholder="请输入" v-model="item.sort" />
<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
v-model="item.sort"
type="number"
placeholder="请输入"
v-model="item.sort"
/>
</el-form-item>
<el-form-item
@ -292,9 +291,9 @@
:label="item.field_name"
>
<el-input
v-model="item.sort"
type="number"
placeholder="请输入"
v-model="item.sort"
/>
</el-form-item>
<el-form-item
@ -371,270 +370,272 @@
<div slot="footer" class="dialog-footer">
<el-button @click="innerVisible = false"> </el-button>
<el-button type="primary" @click="submitfield"
>提交检查项目</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
>
<el-button type="primary" @click="submitrecordform">
填写检查项目
</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
getfifodetailList,
itemfiles,
createfifoitem,
getWarehouseList,
} from "@/api/inm";
import checkPermission from "@/utils/permission";
import { getPuorderItemList, getpuorder } from "@/api/pum";
import { getMaterialList, getrecordformList, getrffieldList } from "@/api/mtm";
import { createTestrecord } from "@/api/inm";
import {
getfifodetailList,
itemfiles,
createfifoitem,
getWarehouseList,
} from "@/api/inm";
import checkPermission from "@/utils/permission";
import {getPuorderItemList, getpuorder} from "@/api/pum";
import {getMaterialList, getrecordformList, getrffieldList} from "@/api/mtm";
import {createTestrecord} from "@/api/inm";
import { upUrl, upHeaders } from "@/api/file";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultfile = {
files: [],
need_test: false,
};
export default {
components: { Pagination },
data() {
return {
InventoryList: {
count: 0,
},
fifodetailList: {
count: 0,
},
inpur: {},
dialogVisibles: false,
upHeaders: upHeaders(),
upUrl: upUrl(),
fileList: [],
FIFOItem: defaultfile,
listQuery: {
page: 1,
page_size: 20,
},
fieldList: {
count: 0,
},
warehouseData: [],
is_testok: "true",
field: [],
recordformList: [],
recordform: "",
fifo_detail: "",
listQueryrecordform: {
page: 0,
},
fileData: {},
outerVisible: false,
innerVisible: false,
dialogVisible: false,
dialogVisibles: false,
dialogType: "new",
testrecord: {},
puorderItemdetial: [],
puorderTtemoptions: [],
rule1: {
name: [{ required: true, message: "请输入", trigger: "blur" }],
},
fileList: [],
item: "",
};
},
computed: {},
watch: {},
created() {
this.getList();
},
mounted() {},
methods: {
checkPermission,
import {upUrl, upHeaders} from "@/api/file";
import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultfile = {
files: [],
need_test: false,
};
export default {
components: {Pagination},
data() {
return {
InventoryList: {
count: 0,
},
fifodetailList: {
count: 0,
},
inpur: {},
dialogVisibles: false,
upHeaders: upHeaders(),
upUrl: upUrl(),
fileList: [],
FIFOItem: defaultfile,
listQuery: {
page: 1,
page_size: 20,
},
fieldList: {
count: 0,
},
warehouseData: [],
is_testok: "true",
field: [],
recordformList: [],
recordform: "",
fifo_detail: "",
listQueryrecordform: {
page: 0,
},
fileData: {},
outerVisible: false,
innerVisible: false,
dialogVisible: false,
dialogVisibles: false,
dialogType: "new",
testrecord: {},
puorderItemdetial: [],
puorderTtemoptions: [],
rule1: {
name: [{required: true, message: "请输入", trigger: "blur"}],
},
fileList: [],
item: "",
};
},
computed: {},
watch: {},
created() {
this.getList();
},
mounted() {
},
methods: {
checkPermission,
getList() {
this.listLoading = true;
getList() {
this.listLoading = true;
this.listQuery.fifo = this.$route.params.id;
getfifodetailList(this.listQuery).then((response) => {
if (response.data) {
this.fifodetailList = response.data;
}
this.listLoading = false;
});
},
showmessage(value) {
getpuorder(value).then((response) => {
if (response.data) {
this.puorderItemdetial = response.data;
}
});
},
//采购订单项入库
confirminpur() {
console.log(this.inpur);
this.inpur.material = this.puorderItemdetial.material_.id; //物料类型
this.inpur.fifo = this.$route.params.id; //出入库记录
createfifoitem(this.inpur).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisibles = false;
this.$message.success("成功");
}
});
},
handlecgxCreate() {
this.$nextTick(() => {
this.$refs["Form1"].clearValidate();
});
if (this.$route.params.pu_order != null) {
this.dialogVisibles = true;
this.getpuorderitemList();
this.getlists();
}
},
//仓库
getlists() {
getWarehouseList({ page: 0 }).then((response) => {
if (response.data) {
this.warehouseData = genTree(response.data);
}
this.listLoading = false;
});
},
//采购顶单项列表
getpuorderitemList() {
getPuorderItemList({
pu_order: this.$route.params.pu_order,
page: 0,
}).then((response) => {
if (response.data) {
this.puorderTtemoptions = response.data;
}
});
},
handleUpSuccess(res, file, filelist) {
this.fileList.push({
id: res.data.id,
name: res.data.name,
path: res.data.path,
});
this.handleRemove(file);
},
handleRemove(file) {
// 实现删除文件
let fileList = this.$refs.upload.uploadFiles;
let index = fileList.findIndex((fileItem) => {
return fileItem.uid === file.uid;
});
fileList.splice(index, 1);
},
beforeUpload(file) {
const isLt2M = file.size / 1024 / 1024 < 50;
if (!isLt2M) {
this.$message.error("单文件不能超过50MB!");
}
return isLt2M;
},
deleteFile(index) {
this.$confirm("确定删除该文件, 是否继续?", { type: "error" })
.then(() => {
this.fileList.splice(index, 1);
})
.catch((e) => {});
},
yeschange(val) {
if (!val) {
this.fileList = [];
}
},
handleEdit(scope) {
this.FIFOItem = Object.assign({}, scope.row); // copy obj
(this.fileList = []), (this.dialogVisible = true);
for (var i = 0; i < this.FIFOItem.files_.length; i++) {
this.fileList.push({
id: this.FIFOItem.files_[i].id,
name: this.FIFOItem.files_[i].name,
path: this.FIFOItem.files_[i].path,
});
}
},
confirm() {
var files = [];
for (var i = 0; i < this.fileList.length; i++) {
files.push(this.fileList[i].id);
}
this.fileData.files = files;
this.fileData.need_test = this.FIFOItem.need_test;
console.log(this.fileData);
itemfiles(this.FIFOItem.id, this.fileData).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
},
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) => {
this.listQuery.fifo = this.$route.params.id;
getfifodetailList(this.listQuery).then((response) => {
if (response.data) {
this.fieldList = response.data;
this.innerVisible = true;
this.fifodetailList = response.data;
}
this.listLoading = false;
});
},
showmessage(value) {
getpuorder(value).then((response) => {
if (response.data) {
this.puorderItemdetial = response.data;
}
});
} 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,
},
//采购订单项入库
confirminpur() {
console.log(this.inpur);
this.inpur.material = this.puorderItemdetial.material_.id; //物料类型
this.inpur.fifo = this.$route.params.id; //出入库记录
createfifoitem(this.inpur).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisibles = false;
this.$message.success("成功");
}
});
});
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();
},
handlecgxCreate() {
this.$nextTick(() => {
this.$refs["Form1"].clearValidate();
});
if (this.$route.params.pu_order != null) {
this.dialogVisibles = true;
this.getpuorderitemList();
this.getlists();
}
});
},
//仓库
getlists() {
getWarehouseList({page: 0}).then((response) => {
if (response.data) {
this.warehouseData = genTree(response.data);
}
this.listLoading = false;
});
},
//采购顶单项列表
getpuorderitemList() {
getPuorderItemList({
pu_order: this.$route.params.pu_order,
page: 0,
}).then((response) => {
if (response.data) {
this.puorderTtemoptions = response.data;
}
});
},
handleUpSuccess(res, file, filelist) {
this.fileList.push({
id: res.data.id,
name: res.data.name,
path: res.data.path,
});
this.handleRemove(file);
},
handleRemove(file) {
// 实现删除文件
let fileList = this.$refs.upload.uploadFiles;
let index = fileList.findIndex((fileItem) => {
return fileItem.uid === file.uid;
});
fileList.splice(index, 1);
},
beforeUpload(file) {
const isLt2M = file.size / 1024 / 1024 < 50;
if (!isLt2M) {
this.$message.error("单文件不能超过50MB!");
}
return isLt2M;
},
deleteFile(index) {
this.$confirm("确定删除该文件, 是否继续?", {type: "error"})
.then(() => {
this.fileList.splice(index, 1);
})
.catch((e) => {
});
},
yeschange(val) {
if (!val) {
this.fileList = [];
}
},
handleEdit(scope) {
this.FIFOItem = Object.assign({}, scope.row); // copy obj
(this.fileList = []), (this.dialogVisible = true);
for (var i = 0; i < this.FIFOItem.files_.length; i++) {
this.fileList.push({
id: this.FIFOItem.files_[i].id,
name: this.FIFOItem.files_[i].name,
path: this.FIFOItem.files_[i].path,
});
}
},
confirm() {
var files = [];
for (var i = 0; i < this.fileList.length; i++) {
files.push(this.fileList[i].id);
}
this.fileData.files = files;
this.fileData.need_test = this.FIFOItem.need_test;
console.log(this.fileData);
itemfiles(this.FIFOItem.id, this.fileData).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
},
handleMaterial(scope) {
//调该物料对应的检查表
this.outerVisible = true;
this.fifo_detail = scope.row.id;
this.listQueryrecordform.material = scope.row.material;
this.listQueryrecordform.type = 30;
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>

View File

@ -1,323 +1,392 @@
<template>
<div class="app-container">
<el-card style="margin-top: 2px">
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane label="总览" name="1" >
<el-table
v-loading="listLoading"
:data="fifodetailList1.results"
border
fit
stripe
highlight-current-row
height="620"
v-el-height-adaptive-table="{bottomOffset: 40}"
>
<el-table-column type="index" width="50" />
<el-table-column label="物料批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
</el-table-column>
<el-table-column label="物料名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="规格型号">
<template slot-scope="scope">{{
scope.row.material_.specification
}}</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.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 label="创建时间">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column>
</el-table>
<pagination
v-show="fifodetailList1.count > 0"
:total="fifodetailList1.count"
:page.sync="listQuery1.page"
:limit.sync="listQuery1.page_size"
@pagination="getList1"
/>
</el-tab-pane>
<el-tab-pane label="待检物料" name="2">
<el-table
v-loading="listLoading"
:data="fifodetailList2.results"
border
fit
stripe
highlight-current-row
height="620"
v-el-height-adaptive-table="{bottomOffset: 40}"
>
<el-table-column type="index" width="50" />
<el-table-column label="物料批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
</el-table-column>
<el-table-column label="物料名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="规格型号">
<template slot-scope="scope">{{
scope.row.material_.specification
}}</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.count }}</template>
</el-table-column>
<el-table-column label="创建时间">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column>
</el-table>
<pagination
v-show="fifodetailList2.count > 0"
:total="fifodetailList2.count"
:page.sync="listQuery2.page"
:limit.sync="listQuery2.page_size"
@pagination="getList2"
/>
</el-tab-pane>
<el-tab-pane label="合格物料" name="3">
<el-table
v-loading="listLoading"
:data="fifodetailList3.results"
border
fit
stripe
highlight-current-row
height="620"
v-el-height-adaptive-table="{bottomOffset: 40}"
>
<el-table-column type="index" width="50" />
<el-table-column label="物料批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
</el-table-column>
<el-table-column label="物料名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="规格型号">
<template slot-scope="scope">{{
scope.row.material_.specification
}}</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.warehouse_.name }}</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">{{ scope.row.create_time }}</template>
</el-table-column>
</el-table>
<pagination
v-show="fifodetailList3.count > 0"
:total="fifodetailList3.count"
:page.sync="listQuery3.page"
:limit.sync="listQuery3.page_size"
@pagination="getList3"
/>
</el-tab-pane>
<el-tab-pane label="不合格物料" name="4">
<el-table
v-loading="listLoading"
:data="fifodetailList4.results"
border
fit
stripe
highlight-current-row
height="620"
v-el-height-adaptive-table="{bottomOffset: 40}"
>
<el-table-column type="index" width="50" />
<el-table-column label="物料批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
</el-table-column>
<el-table-column label="物料名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="规格型号">
<template slot-scope="scope">{{
scope.row.material_.specification
}}</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.create_time }}</template>
</el-table-column>
</el-table>
<pagination
v-show="fifodetailList4.count > 0"
:total="fifodetailList4.count"
:page.sync="listQuery4.page"
:limit.sync="listQuery4.page_size"
@pagination="getList4"
/>
</el-tab-pane>
</el-tabs>
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane label="总览" name="1">
<el-table
v-loading="listLoading"
:data="fifodetailList1.results"
border
fit
stripe
highlight-current-row
height="620"
v-el-height-adaptive-table="{bottomOffset: 40}"
>
<el-table-column type="index" width="50"/>
<el-table-column label="物料批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
</el-table-column>
<el-table-column label="物料名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="规格型号">
<template slot-scope="scope">{{scope.row.material_.specification}}</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.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">
<el-tag v-if="scope.row.is_testok == false">不合格</el-tag>
<el-tag v-else>合格</el-tag>
</template>
</el-table-column>
<el-table-column label="是否需要复验">
<template slot-scope="scope">
<el-tag v-if="scope.row.need_test"></el-tag>
<el-tag v-else></el-tag>
</template>
</el-table-column>
<el-table-column label="文件">
<template slot-scope="scope" v-if="scope.row.files">
<div v-for="item in scope.row.files_" v-bind:key="item.id">
<el-link :href="item.path" target="_blank" type="primary">{{item.name}}</el-link>
</div>
</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="操作"
>
<template slot-scope="scope">
<el-link
type="primary"
@click="handleRecord(scope)"
>
复验记录
</el-link>
</template>
</el-table-column>
</el-table>
<pagination
v-show="fifodetailList1.count > 0"
:total="fifodetailList1.count"
:page.sync="listQuery1.page"
:limit.sync="listQuery1.page_size"
@pagination="getList1"
/>
</el-tab-pane>
<el-tab-pane label="待检物料" name="2">
<el-table
v-loading="listLoading"
:data="fifodetailList2.results"
border
fit
stripe
highlight-current-row
height="620"
v-el-height-adaptive-table="{bottomOffset: 40}"
>
<el-table-column type="index" width="50"/>
<el-table-column label="物料批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
</el-table-column>
<el-table-column label="物料名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="规格型号">
<template slot-scope="scope">{{scope.row.material_.specification}}</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.count }}</template>
</el-table-column>
<el-table-column label="创建时间">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column>
</el-table>
<pagination
v-show="fifodetailList2.count > 0"
:total="fifodetailList2.count"
:page.sync="listQuery2.page"
:limit.sync="listQuery2.page_size"
@pagination="getList2"
/>
</el-tab-pane>
<el-tab-pane label="合格物料" name="3">
<el-table
v-loading="listLoading"
:data="fifodetailList3.results"
border
fit
stripe
highlight-current-row
height="620"
v-el-height-adaptive-table="{bottomOffset: 40}"
>
<el-table-column type="index" width="50"/>
<el-table-column label="物料批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
</el-table-column>
<el-table-column label="物料名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="规格型号">
<template slot-scope="scope">{{scope.row.material_.specification}}</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.warehouse_.name }}</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.need_test"></el-tag>
<el-tag v-else></el-tag>
</template>
</el-table-column>
<el-table-column label="文件">
<template slot-scope="scope" v-if="scope.row.files">
<div v-for="item in scope.row.files_" v-bind:key="item.id">
<el-link :href="item.path" target="_blank" type="primary">{{item.name}}</el-link>
</div>
</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="操作"
>
<template slot-scope="scope">
<el-link
v-if="scope.row.need_test"
type="primary"
@click="handleRecord(scope)"
>
复验记录
</el-link>
<el-link
v-else
type="info"
:disabled="!scope.row.need_test"
@click="handleRecord(scope)"
>
复验记录
</el-link>
</template>
</el-table-column>
</el-table>
<pagination
v-show="fifodetailList3.count > 0"
:total="fifodetailList3.count"
:page.sync="listQuery3.page"
:limit.sync="listQuery3.page_size"
@pagination="getList3"
/>
</el-tab-pane>
<el-tab-pane label="不合格物料" name="4">
<el-table
v-loading="listLoading"
:data="fifodetailList4.results"
border
fit
stripe
highlight-current-row
height="620"
v-el-height-adaptive-table="{bottomOffset: 40}"
>
<el-table-column type="index" width="50"/>
<el-table-column label="物料批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
</el-table-column>
<el-table-column label="物料名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="规格型号">
<template slot-scope="scope">{{scope.row.material_.specification}}</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" v-if="scope.row.files">
<div v-for="item in scope.row.files_" v-bind:key="item.id">
<el-link :href="item.file" target="_blank" type="primary">{{item.name}}</el-link>
</div>
</template>
</el-table-column>
<el-table-column label="是否需要复验">
<template slot-scope="scope">
<el-tag v-if="scope.row.need_test"></el-tag>
<el-tag v-else></el-tag>
</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="操作"
>
<template slot-scope="scope">
<el-link
v-if="scope.row.need_test"
type="primary"
@click="handleRecord(scope)"
>
复验记录
</el-link>
<el-link
v-else
type="info"
:disabled="!scope.row.need_test"
@click="handleRecord(scope)"
>
复验记录
</el-link>
</template>
</el-table-column>
</el-table>
<pagination
v-show="fifodetailList4.count > 0"
:total="fifodetailList4.count"
:page.sync="listQuery4.page"
:limit.sync="listQuery4.page_size"
@pagination="getList4"
/>
</el-tab-pane>
</el-tabs>
</el-card>
</div>
</template>
<script>
import { getfifodetailList } from "@/api/inm";
import checkPermission from "@/utils/permission";
import { createTestrecord } from "@/api/inm";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import {getfifodetailList} from "@/api/inm";
import checkPermission from "@/utils/permission";
import {createTestrecord} from "@/api/inm";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
export default {
components: { Pagination },
data() {
return {
InventoryList: {
count: 0,
},
fifodetailList1: {
count: 0,
},
listQuery1: {
page: 1,
page_size: 20,
},
listQuery2: {
page: 1,
page_size: 20,
},
listQuery3: {
page: 1,
page_size: 20,
},
listQuery4: {
page: 1,
page_size: 20,
},
is_testok: "true",
fifodetailList2:{
count: 0,
},
fifodetailList3:{
count: 0,
},
fifodetailList4:{
count: 0,
},
activeName:"1"
};
},
computed: {},
watch: {},
created() {
this.getList1();
},
methods: {
checkPermission,
getList1() {
this.listLoading = true;
this.listQuery1.fifo__type = 3;
getfifodetailList(this.listQuery1).then((response) => {
if (response.data) {
this.fifodetailList1 = response.data;
}
this.listLoading = false;
});
export default {
components: {Pagination},
data() {
return {
InventoryList: {
count: 0,
},
fifodetailList1: {
count: 0,
},
listQuery1: {
page: 1,
page_size: 20,
},
listQuery2: {
page: 1,
page_size: 20,
},
listQuery3: {
page: 1,
page_size: 20,
},
listQuery4: {
page: 1,
page_size: 20,
},
is_testok: "true",
fifodetailList2: {
count: 0,
},
fifodetailList3: {
count: 0,
},
fifodetailList4: {
count: 0,
},
activeName: "1"
};
},
//待检
computed: {},
watch: {},
created() {
this.getList1();
},
methods: {
checkPermission,
getList1() {
this.listLoading = true;
this.listQuery1.fifo__type = 3;
getfifodetailList(this.listQuery1).then((response) => {
if (response.data) {
this.fifodetailList1 = response.data;
}
this.listLoading = false;
});
},
//待检
getList2() {
this.listLoading = true;
this.listQuery2.fifo__type = 3;
this.listQuery2.is_tested = false;
getfifodetailList(this.listQuery2).then((response) => {
if (response.data) {
this.fifodetailList2 = response.data;
}
this.listLoading = false;
});
},
//合格物料
this.listLoading = true;
this.listQuery2.fifo__type = 3;
this.listQuery2.is_tested = false;
getfifodetailList(this.listQuery2).then((response) => {
if (response.data) {
this.fifodetailList2 = response.data;
}
this.listLoading = false;
});
},
//合格物料
getList3() {
this.listLoading = true;
this.listQuery3.fifo__type = 3;
this.listQuery3.is_testok = true;
getfifodetailList(this.listQuery3).then((response) => {
if (response.data) {
this.fifodetailList3 = response.data;
}
this.listLoading = false;
});
},
//不合格物料
this.listLoading = true;
this.listQuery3.fifo__type = 3;
this.listQuery3.is_testok = true;
getfifodetailList(this.listQuery3).then((response) => {
if (response.data) {
this.fifodetailList3 = response.data;
}
this.listLoading = false;
});
},
//不合格物料
getList4() {
this.listLoading = true;
this.listQuery4.fifo__type = 3;
this.listQuery4.is_testok = false;
this.listQuery4.is_tested = true;
getfifodetailList(this.listQuery4).then((response) => {
if (response.data) {
this.fifodetailList4 = response.data;
}
this.listLoading = false;
});
},
//选项卡切换
handleClick(tab) {
if(tab.name==1)
{
this.listLoading = true;
this.listQuery4.fifo__type = 3;
this.listQuery4.is_testok = false;
this.listQuery4.is_tested = true;
getfifodetailList(this.listQuery4).then((response) => {
if (response.data) {
this.fifodetailList4 = response.data;
}
this.listLoading = false;
});
},
//选项卡切换
handleClick(tab) {
if (tab.name == 1) {
this.getList1()
}
else if(tab.name==2)
{
} else if (tab.name == 2) {
this.getList2()
}
else if(tab.name==3)
{
} else if (tab.name == 3) {
this.getList3()
}
else
{
} else {
this.getList4()
}
}
},
//检验记录
handleRecord(){
},
},
},
};
};
</script>

View File

@ -1,81 +1,87 @@
<template>
<div class="app-container">
<el-card>
<el-table
:data="iproductData2.results"
border
fit
stripe
highlight-current-row
max-height="700"
height="100"
v-el-height-adaptive-table="{bottomOffset: 42}"
>
<el-table-column type="index" width="50"/>
<el-table-column label="成品编号" prop="number">
</el-table-column>
<el-table-column label="成品批次" prop="batch">
</el-table-column>
<el-table-column label="成品名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="所在仓库">
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template>
</el-table-column>
<el-table-column label="订单">
<template slot-scope="scope">
<span v-if="scope.row.to_order_">{{scope.row.to_order_.number}}</span>
<el-tag v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true">
需要确定订单
</el-tag>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="合同">
<template slot-scope="scope">
<span v-if="scope.row.to_order_">{{scope.row.to_order_.contract_.name}}</span>
<span v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="客户">
<template slot-scope="scope">
<span v-if="scope.row.to_order_">{{scope.row.to_order_.customer_.name}}</span>
<span v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="军检">
<template slot-scope="scope">
<el-tag v-if="scope.row.is_mtestok == false">不合格</el-tag>
<el-tag v-else-if="scope.row.is_mtestok == true">合格</el-tag>
<span v-else></span>
</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
width="220px"
<el-table
:data="iproductData2.results"
border
fit
stripe
highlight-current-row
max-height="700"
height="100"
v-el-height-adaptive-table="{bottomOffset: 42}"
>
<el-table-column type="index" width="50"/>
<el-table-column label="成品编号" prop="number">
</el-table-column>
<el-table-column label="成品批次" prop="batch">
</el-table-column>
<el-table-column label="成品名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="所在仓库">
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template>
</el-table-column>
<el-table-column label="订单">
<template slot-scope="scope">
<span v-if="scope.row.to_order_">{{scope.row.to_order_.number}}</span>
<el-tag v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true">
需要确定订单
</el-tag>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="合同">
<template slot-scope="scope">
<span v-if="scope.row.to_order_">{{scope.row.to_order_.contract_.name}}</span>
<!--<span v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true"></span>
<span v-else></span>-->
</template>
</el-table-column>
<el-table-column label="监管协议号">
<template slot-scope="scope">
<span v-if="scope.row.to_order_">{{scope.row.to_order_.contract_.watch_num}}</span>
<!--<span v-else>{{scope.row.order_.contract_.watch_num}}</span>-->
</template>
</el-table-column>
<el-table-column label="客户">
<template slot-scope="scope">
<span v-if="scope.row.to_order_">{{scope.row.to_order_.customer_.name}}</span>
<!--<span v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true"></span>-->
<!--<span v-else></span>-->
</template>
</el-table-column>
<el-table-column label="军检">
<template slot-scope="scope">
<el-tag v-if="scope.row.is_mtestok == false">不合格</el-tag>
<el-tag v-else-if="scope.row.is_mtestok == true">合格</el-tag>
<span v-else></span>
</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
width="220px"
>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['wp_mtest'])&&scope.row.is_mtestok==null"
@click="handleMtest(scope)"
>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['wp_mtest'])&&scope.row.is_mtestok==null"
@click="handleMtest(scope)"
>
军检
</el-link>
</template>
</el-table-column>
</el-table>
<pagination
v-show="iproductData2.count > 0"
:total="iproductData2.count"
:page.sync="listQuery2.page"
:limit.sync="listQuery2.page_size"
@pagination="getList2"
/>
军检
</el-link>
</template>
</el-table-column>
</el-table>
<pagination
v-show="iproductData2.count > 0"
:total="iproductData2.count"
:page.sync="listQuery2.page"
:limit.sync="listQuery2.page_size"
@pagination="getList2"
/>
<el-dialog
:visible.sync="dialogVisible"
:close-on-click-modal="false"
@ -115,7 +121,7 @@
components: {Pagination},
data() {
return {
iproductData2: {
count: 0,
},
@ -137,10 +143,10 @@
methods: {
checkPermission,
getList2() {
this.listQuery2.material__type = 1;
this.listQuery2.to_order_need_mtest = true;
this.listQuery2.to_order_need_mtest = true;
getiproductList(this.listQuery2).then((response) => {
if (response.data) {
this.iproductData2 = response.data;