Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop
This commit is contained in:
commit
0e178f2f92
|
@ -36,6 +36,16 @@ export function getInventoryList(query) {
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//其他入库
|
||||||
|
|
||||||
|
export function createInother(data) {
|
||||||
|
return request({
|
||||||
|
url: '/inm/fifo/in_other/',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//采购入库
|
||||||
export function createInventory(data) {
|
export function createInventory(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/inm/fifo/in_pur/',
|
url: '/inm/fifo/in_pur/',
|
||||||
|
@ -43,6 +53,15 @@ export function createInventory(data) {
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//采购订单项入库
|
||||||
|
export function createfifoitem(data) {
|
||||||
|
return request({
|
||||||
|
url: '/inm/fifoitem/',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
//仓库对应的物料
|
//仓库对应的物料
|
||||||
export function getfifodetailList(query) {
|
export function getfifodetailList(query) {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
@ -59,3 +59,12 @@ export function deletePuorderItem(id, data) {
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//采购订单项目详情
|
||||||
|
|
||||||
|
export function getpuorder(id) {
|
||||||
|
return request({
|
||||||
|
url: `/pum/pu_order_item/${id}/`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -2,8 +2,11 @@
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card>
|
<el-card>
|
||||||
<div>
|
<div>
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="handlecgCreate"
|
||||||
|
>新增采购入库</el-button
|
||||||
|
>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
|
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
|
||||||
>新增出入库记录</el-button
|
>新增其他入库</el-button
|
||||||
>
|
>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="listQuery.search"
|
v-model="listQuery.search"
|
||||||
|
@ -41,13 +44,14 @@
|
||||||
height="100"
|
height="100"
|
||||||
v-el-height-adaptive-table="{bottomOffset: 42}"
|
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="出入记录ID">
|
|
||||||
|
<el-table-column label="记录编号">
|
||||||
<template slot-scope="scope">{{
|
<template slot-scope="scope">{{
|
||||||
scope.row.id
|
scope.row.number
|
||||||
}}</template>
|
}}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="操作人员">
|
<el-table-column label="操作人员">
|
||||||
<template slot-scope="scope" v-if="scope.row.create_by">{{
|
<template slot-scope="scope" v-if="scope.row.create_by">{{
|
||||||
scope.row.create_by_.name
|
scope.row.create_by_.name
|
||||||
|
@ -65,7 +69,9 @@
|
||||||
<el-tag v-else>已审核</el-tag>
|
<el-tag v-else>已审核</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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">
|
<template slot-scope="scope">
|
||||||
<el-link
|
<el-link
|
||||||
|
@ -97,6 +103,42 @@
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="dialogVisibles"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
|
||||||
|
title="新增采购入库"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="Form1"
|
||||||
|
:model="inpur"
|
||||||
|
label-width="80px"
|
||||||
|
label-position="right"
|
||||||
|
:rules="rule1"
|
||||||
|
>
|
||||||
|
<el-form-item
|
||||||
|
|
||||||
|
label="采购订单"
|
||||||
|
:prop="pu_order"
|
||||||
|
>
|
||||||
|
<el-select v-model="inpur.pu_order" size="small">
|
||||||
|
<el-option
|
||||||
|
v-for="item in puorderoptions"
|
||||||
|
:key="item.id"
|
||||||
|
:value="item.id"
|
||||||
|
:label="item.number"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div style="text-align: right">
|
||||||
|
<el-button type="danger" @click="dialogVisibles = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="confirminpur('Form1')">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisible"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
|
@ -110,9 +152,22 @@
|
||||||
label-position="right"
|
label-position="right"
|
||||||
:rules="rule1"
|
:rules="rule1"
|
||||||
>
|
>
|
||||||
|
<el-form-item
|
||||||
|
class="warehouse"
|
||||||
|
label="供应商"
|
||||||
|
:prop="vendor"
|
||||||
|
>
|
||||||
|
<el-select v-model="inventory.vendor" size="small">
|
||||||
|
<el-option
|
||||||
|
v-for="item in vendoroptions"
|
||||||
|
:key="item.id"
|
||||||
|
:value="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<div v-for="(item, index) in inventory.details" :key="index">
|
<div v-for="(item, index) in inventory.details" :key="index">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="5" style="margin-right: 10px">
|
<el-col :span="5" style="margin-right: 10px">
|
||||||
|
@ -232,17 +287,24 @@
|
||||||
import {
|
import {
|
||||||
getfifoList,
|
getfifoList,
|
||||||
createInventory,
|
createInventory,
|
||||||
|
createInother,
|
||||||
getWarehouseList,
|
getWarehouseList,
|
||||||
deleteFifoitem,
|
deleteFifoitem,
|
||||||
deleteFifo,
|
deleteFifo,
|
||||||
audit,
|
audit,
|
||||||
} from "@/api/inm";
|
} from "@/api/inm";
|
||||||
|
import {
|
||||||
|
getPuorderList,
|
||||||
|
|
||||||
|
} from "@/api/pum";
|
||||||
import checkPermission from "@/utils/permission";
|
import checkPermission from "@/utils/permission";
|
||||||
|
import { getpVendorList } from "@/api/vendor";
|
||||||
import { getMaterialList } from "@/api/mtm";
|
import { getMaterialList } from "@/api/mtm";
|
||||||
import { getUserList } from "@/api/user";
|
import { getUserList } from "@/api/user";
|
||||||
import { genTree } from "@/utils";
|
import { genTree } from "@/utils";
|
||||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||||
const defaulteinventory = {
|
const defaulteinventory = {
|
||||||
|
vendor:null,
|
||||||
details: [
|
details: [
|
||||||
{
|
{
|
||||||
warehouse:"",//仓库
|
warehouse:"",//仓库
|
||||||
|
@ -265,17 +327,21 @@ export default {
|
||||||
2: "销售提货",
|
2: "销售提货",
|
||||||
3: "采购入库",
|
3: "采购入库",
|
||||||
4: "生产入库",
|
4: "生产入库",
|
||||||
|
5: "其他入库",
|
||||||
},
|
},
|
||||||
|
inpur:{pu_order:null},
|
||||||
listQuery: {
|
listQuery: {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
},
|
},
|
||||||
|
puorderoptions:[],
|
||||||
warehouseData: [],
|
warehouseData: [],
|
||||||
materialoptions: [],
|
materialoptions: [],
|
||||||
|
vendoroptions:[],
|
||||||
listLoading: true,
|
listLoading: true,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
dialogType: "new",
|
dialogType: "new",
|
||||||
|
dialogVisibles: false,
|
||||||
rule1: {
|
rule1: {
|
||||||
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
},
|
},
|
||||||
|
@ -286,8 +352,9 @@ export default {
|
||||||
created() {
|
created() {
|
||||||
this.getlists();
|
this.getlists();
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.getListgys();
|
||||||
this.getmaterialList();
|
this.getmaterialList();
|
||||||
|
this.getpuorderList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
checkPermission,
|
checkPermission,
|
||||||
|
@ -304,9 +371,40 @@ export default {
|
||||||
},
|
},
|
||||||
//出入库详情
|
//出入库详情
|
||||||
handleDetail(scope) {
|
handleDetail(scope) {
|
||||||
this.$router.push({ name: "fifodetail", params: { id: scope.row.id } });
|
this.$router.push({ name: "fifodetail", params: { id: scope.row.id,pu_order:scope.row.pu_order, } });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//供应商列表
|
||||||
|
getListgys() {
|
||||||
|
|
||||||
|
getpVendorList({page:0}).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.vendoroptions = response.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//采购订单
|
||||||
|
getpuorderList() {
|
||||||
|
|
||||||
|
getPuorderList({page:0}).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.puorderoptions = response.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//采购入库提交
|
||||||
|
confirminpur(){
|
||||||
|
createInventory(this.inpur).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.getList();
|
||||||
|
this.dialogVisibles = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//仓库
|
||||||
getlists() {
|
getlists() {
|
||||||
getWarehouseList({ page: 0 }).then((response) => {
|
getWarehouseList({ page: 0 }).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
|
@ -315,7 +413,9 @@ export default {
|
||||||
this.listLoading = false;
|
this.listLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
handlecgCreate(){
|
||||||
|
this.dialogVisibles=true;
|
||||||
|
},
|
||||||
addConditions() {
|
addConditions() {
|
||||||
if (this.inventory.details.length <= 10) {
|
if (this.inventory.details.length <= 10) {
|
||||||
this.inventory.details.push({
|
this.inventory.details.push({
|
||||||
|
@ -388,7 +488,7 @@ export default {
|
||||||
async confirm(form) {
|
async confirm(form) {
|
||||||
console.log(this.inventory);
|
console.log(this.inventory);
|
||||||
|
|
||||||
createInventory(this.inventory).then((res) => {
|
createInother(this.inventory).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card style="margin-top: 2px">
|
<el-card style="margin-top: 2px">
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="handlecgxCreate"
|
||||||
|
>新增采购项入库</el-button
|
||||||
|
>
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
v-loading="listLoading"
|
||||||
:data="fifodetailList.results"
|
:data="fifodetailList.results"
|
||||||
|
@ -8,7 +11,8 @@
|
||||||
fit
|
fit
|
||||||
stripe
|
stripe
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
max-height="600"
|
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="物料名称">
|
<el-table-column label="物料名称">
|
||||||
|
@ -50,7 +54,6 @@
|
||||||
|
|
||||||
<el-table-column label="文件">
|
<el-table-column label="文件">
|
||||||
<template slot-scope="scope" v-if="scope.row.files">
|
<template slot-scope="scope" v-if="scope.row.files">
|
||||||
|
|
||||||
<div v-for="item in scope.row.files_" v-bind:key="item.id">
|
<div v-for="item in scope.row.files_" v-bind:key="item.id">
|
||||||
<el-link :href="item.path" target="_blank" type="primary">{{
|
<el-link :href="item.path" target="_blank" type="primary">{{
|
||||||
item.name
|
item.name
|
||||||
|
@ -60,12 +63,14 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="操作" width="220px">
|
<el-table-column align="center" label="操作" width="220px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-link type="primary" @click="handleMaterial(scope)" v-if="scope.row.need_test"
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="handleMaterial(scope)"
|
||||||
|
v-if="scope.row.need_test"
|
||||||
>复验</el-link
|
>复验</el-link
|
||||||
>
|
>
|
||||||
|
|
||||||
<el-link type="primary" @click="handleEdit(scope)">上传</el-link>
|
<el-link type="primary" @click="handleEdit(scope)">上传</el-link>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -77,54 +82,137 @@
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="dialogVisibles"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
title="新增采购项入库"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="Form1"
|
||||||
|
:model="inpur"
|
||||||
|
label-width="100px"
|
||||||
|
label-position="right"
|
||||||
|
:rules="rule1"
|
||||||
|
>
|
||||||
|
<el-row :gutter="24">
|
||||||
|
<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
|
||||||
|
v-for="item in puorderTtemoptions"
|
||||||
|
:key="item.id"
|
||||||
|
:value="item.id"
|
||||||
|
:label="item.material_.name"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</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-row>
|
||||||
|
<el-row :gutter="24">
|
||||||
|
<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 label="到货数量">
|
||||||
|
<el-input
|
||||||
|
v-model="puorderItemdetial.delivered_count"
|
||||||
|
:disabled="true"
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item></div
|
||||||
|
></el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-form-item label="仓库" :prop="warehouse">
|
||||||
|
<el-select v-model="inpur.warehouse">
|
||||||
|
<el-option
|
||||||
|
v-for="item in warehouseData"
|
||||||
|
:key="item.id"
|
||||||
|
:value="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="批次" :prop="batch">
|
||||||
|
<el-input v-model="inpur.batch" placeholder="批次号"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="入库数量" :prop="count">
|
||||||
|
<el-input-number v-model="inpur.count" :min="0"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div style="text-align: right">
|
||||||
|
<el-button type="danger" @click="dialogVisibles = false"
|
||||||
|
>取消</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" @click="confirminpur('Form1')"
|
||||||
|
>确认</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisible"
|
||||||
title="上传文件"
|
title="上传文件"
|
||||||
>
|
>
|
||||||
<el-form
|
<el-form
|
||||||
ref="Form"
|
ref="Form"
|
||||||
:model="FIFOItem"
|
:model="FIFOItem"
|
||||||
label-width="100px"
|
label-width="100px"
|
||||||
label-position="right"
|
label-position="right"
|
||||||
|
|
||||||
>
|
>
|
||||||
<el-form-item label="是否需要复验" prop="need_test">
|
<el-form-item label="是否需要复验" prop="need_test">
|
||||||
<el-switch v-model="FIFOItem.need_test"></el-switch>
|
<el-switch v-model="FIFOItem.need_test"></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="文件列表">
|
<el-form-item label="文件列表">
|
||||||
<el-upload
|
<el-upload
|
||||||
|
ref="upload"
|
||||||
ref="upload"
|
:action="upUrl"
|
||||||
:action="upUrl"
|
:before-upload="beforeUpload"
|
||||||
:before-upload="beforeUpload"
|
:on-success="handleUpSuccess"
|
||||||
:on-success="handleUpSuccess"
|
:headers="upHeaders"
|
||||||
:headers="upHeaders"
|
multiple
|
||||||
multiple
|
accept="image/*,.ppt,.pdf,.doc,.docx,.xls,.xlsx"
|
||||||
accept="image/*,.ppt,.pdf,.doc,.docx,.xls,.xlsx"
|
>
|
||||||
>
|
<el-button size="small" type="primary">上传文件</el-button>
|
||||||
<el-button size="small" type="primary">上传文件</el-button>
|
|
||||||
<span class="el-upload__tip">
|
<span class="el-upload__tip">
|
||||||
可上传多个pdf,word,ppt,excel,图片文件,单文件大小不超过50M
|
可上传多个pdf,word,ppt,excel,图片文件,单文件大小不超过50M
|
||||||
</span>
|
</span>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div
|
<div
|
||||||
v-for="(item, index) in fileList"
|
v-for="(item, index) in fileList"
|
||||||
v-bind:key="item.id"
|
v-bind:key="item.id"
|
||||||
style="margin-top: 2px;"
|
style="margin-top: 2px"
|
||||||
>
|
>
|
||||||
<i
|
<i
|
||||||
class="el-icon-delete"
|
class="el-icon-delete"
|
||||||
@click="deleteFile(index)"
|
@click="deleteFile(index)"
|
||||||
style="color: red"
|
style="color: red"
|
||||||
|
></i>
|
||||||
></i>
|
<el-link :href="item.path" target="_blank" type="primary">{{
|
||||||
<el-link :href="item.path" target="_blank" type="primary">{{
|
item.name
|
||||||
item.name
|
}}</el-link>
|
||||||
}}</el-link>
|
</div>
|
||||||
</div>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<div style="text-align: right">
|
<div style="text-align: right">
|
||||||
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
||||||
|
@ -270,8 +358,14 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getfifodetailList,itemfiles } from "@/api/inm";
|
import {
|
||||||
|
getfifodetailList,
|
||||||
|
itemfiles,
|
||||||
|
createfifoitem,
|
||||||
|
getWarehouseList,
|
||||||
|
} from "@/api/inm";
|
||||||
import checkPermission from "@/utils/permission";
|
import checkPermission from "@/utils/permission";
|
||||||
|
import { getPuorderItemList, getpuorder } from "@/api/pum";
|
||||||
import { getMaterialList, getrecordformList, getrffieldList } from "@/api/mtm";
|
import { getMaterialList, getrecordformList, getrffieldList } from "@/api/mtm";
|
||||||
import { createTestrecord } from "@/api/inm";
|
import { createTestrecord } from "@/api/inm";
|
||||||
|
|
||||||
|
@ -279,8 +373,8 @@ import { upUrl, upHeaders } from "@/api/file";
|
||||||
import { genTree } from "@/utils";
|
import { genTree } from "@/utils";
|
||||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||||
const defaultfile = {
|
const defaultfile = {
|
||||||
files:[],
|
files: [],
|
||||||
need_test:false,
|
need_test: false,
|
||||||
};
|
};
|
||||||
export default {
|
export default {
|
||||||
components: { Pagination },
|
components: { Pagination },
|
||||||
|
@ -292,10 +386,12 @@ export default {
|
||||||
fifodetailList: {
|
fifodetailList: {
|
||||||
count: 0,
|
count: 0,
|
||||||
},
|
},
|
||||||
|
inpur: {},
|
||||||
|
dialogVisibles: false,
|
||||||
upHeaders: upHeaders(),
|
upHeaders: upHeaders(),
|
||||||
upUrl: upUrl(),
|
upUrl: upUrl(),
|
||||||
fileList: [],
|
fileList: [],
|
||||||
FIFOItem:defaultfile,
|
FIFOItem: defaultfile,
|
||||||
listQuery: {
|
listQuery: {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
|
@ -303,6 +399,7 @@ export default {
|
||||||
fieldList: {
|
fieldList: {
|
||||||
count: 0,
|
count: 0,
|
||||||
},
|
},
|
||||||
|
warehouseData: [],
|
||||||
is_testok: "true",
|
is_testok: "true",
|
||||||
field: [],
|
field: [],
|
||||||
recordformList: [],
|
recordformList: [],
|
||||||
|
@ -311,27 +408,28 @@ export default {
|
||||||
listQueryrecordform: {
|
listQueryrecordform: {
|
||||||
page: 0,
|
page: 0,
|
||||||
},
|
},
|
||||||
fileData:{},
|
fileData: {},
|
||||||
outerVisible: false,
|
outerVisible: false,
|
||||||
innerVisible: false,
|
innerVisible: false,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
dialogType: "new",
|
dialogVisibles: false,
|
||||||
|
dialogType: "new",
|
||||||
testrecord: {},
|
testrecord: {},
|
||||||
|
puorderItemdetial: [],
|
||||||
|
puorderTtemoptions: [],
|
||||||
rule1: {
|
rule1: {
|
||||||
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
},
|
},
|
||||||
fileList: [],
|
fileList: [],
|
||||||
|
item: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
watch: {},
|
watch: {},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
mounted() {},
|
||||||
methods: {
|
methods: {
|
||||||
checkPermission,
|
checkPermission,
|
||||||
|
|
||||||
|
@ -346,9 +444,58 @@ export default {
|
||||||
this.listLoading = false;
|
this.listLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
showmessage(value) {
|
||||||
|
getpuorder(value).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.puorderItemdetial = response.data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//采购订单项入库
|
||||||
|
|
||||||
|
confirminpur() {
|
||||||
handleUpSuccess(res, file, filelist) {
|
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({
|
this.fileList.push({
|
||||||
id: res.data.id,
|
id: res.data.id,
|
||||||
name: res.data.name,
|
name: res.data.name,
|
||||||
|
@ -385,8 +532,7 @@ export default {
|
||||||
},
|
},
|
||||||
handleEdit(scope) {
|
handleEdit(scope) {
|
||||||
this.FIFOItem = Object.assign({}, scope.row); // copy obj
|
this.FIFOItem = Object.assign({}, scope.row); // copy obj
|
||||||
this.fileList=[],
|
(this.fileList = []), (this.dialogVisible = true);
|
||||||
this.dialogVisible = true;
|
|
||||||
for (var i = 0; i < this.FIFOItem.files_.length; i++) {
|
for (var i = 0; i < this.FIFOItem.files_.length; i++) {
|
||||||
this.fileList.push({
|
this.fileList.push({
|
||||||
id: this.FIFOItem.files_[i].id,
|
id: this.FIFOItem.files_[i].id,
|
||||||
|
@ -396,23 +542,21 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
confirm() {
|
confirm() {
|
||||||
var files = [];
|
var files = [];
|
||||||
for (var i = 0; i < this.fileList.length; i++) {
|
for (var i = 0; i < this.fileList.length; i++) {
|
||||||
files.push(this.fileList[i].id);
|
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("成功");
|
||||||
}
|
}
|
||||||
|
});
|
||||||
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) {
|
handleMaterial(scope) {
|
||||||
|
|
|
@ -257,7 +257,7 @@ export default {
|
||||||
_this.mtmId.push(item.material_.id);
|
_this.mtmId.push(item.material_.id);
|
||||||
_this.materialshow.push(item);
|
_this.materialshow.push(item);
|
||||||
});
|
});
|
||||||
this.ordershow = _this.materialshow[0].number;
|
this.ordershow = _this.materialshow[0].to_order_.number;
|
||||||
this.customershow=_this.materialshow[0].order_.customer_.name;
|
this.customershow=_this.materialshow[0].order_.customer_.name;
|
||||||
this.contractshow=_this.materialshow[0].order_.contract_.name;
|
this.contractshow=_this.materialshow[0].order_.contract_.name;
|
||||||
getOrderList({ page: 0, material: _this.mtmId[0], tag:'not_done' }).then(
|
getOrderList({ page: 0, material: _this.mtmId[0], tag:'not_done' }).then(
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
type="month"
|
type="month"
|
||||||
placeholder="选择年月">
|
placeholder="选择年月">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
<el-button type="primary" @click="submit">主要按钮</el-button>
|
<el-button type="primary" @click="submit">查询</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
|
|
|
@ -56,7 +56,9 @@
|
||||||
<el-tag v-else-if="scope.row.is_audited == true">已审核</el-tag>
|
<el-tag v-else-if="scope.row.is_audited == true">已审核</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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">
|
<template slot-scope="scope">
|
||||||
<el-link
|
<el-link
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
|
|
||||||
<el-table-column label="任务编号">
|
<el-table-column label="子计划编号" width="100">
|
||||||
<template slot-scope="scope">{{ scope.row.number }}</template>
|
<template slot-scope="scope">{{ scope.row.number }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="产品名称">
|
<el-table-column label="产品名称">
|
||||||
|
@ -158,7 +158,7 @@
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55"> </el-table-column>
|
<el-table-column type="selection" width="55"> </el-table-column>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column label="任务编号">
|
<el-table-column label="子计划编号" width="100">
|
||||||
<template slot-scope="scope">{{
|
<template slot-scope="scope">{{
|
||||||
scope.row.subproduction_plan_.number
|
scope.row.subproduction_plan_.number
|
||||||
}}</template>
|
}}</template>
|
||||||
|
@ -215,7 +215,7 @@
|
||||||
max-height="300"
|
max-height="300"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column label="任务编号">
|
<el-table-column label="子计划编号" width="100">
|
||||||
<template slot-scope="scope">{{
|
<template slot-scope="scope">{{
|
||||||
scope.row.subproduction_plan_.number
|
scope.row.subproduction_plan_.number
|
||||||
}}</template>
|
}}</template>
|
||||||
|
|
|
@ -84,6 +84,8 @@ class FIFOItemCreateSerializer(serializers.ModelSerializer):
|
||||||
|
|
||||||
def create(self, validated_data):
|
def create(self, validated_data):
|
||||||
fifo = validated_data['fifo']
|
fifo = validated_data['fifo']
|
||||||
|
if fifo.is_audited:
|
||||||
|
raise ValidationError('该出入库记录已审核')
|
||||||
pu_order_item = validated_data.get('pu_order_item', None)
|
pu_order_item = validated_data.get('pu_order_item', None)
|
||||||
if pu_order_item:
|
if pu_order_item:
|
||||||
if fifo.pu_order != pu_order_item.pu_order:
|
if fifo.pu_order != pu_order_item.pu_order:
|
||||||
|
@ -140,12 +142,12 @@ class FIFOInOtherSerializer(serializers.ModelSerializer):
|
||||||
def create(self, validated_data):
|
def create(self, validated_data):
|
||||||
details = validated_data.pop('details')
|
details = validated_data.pop('details')
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
validated_data['type'] = FIFO.FIFO_TYPE_PUR_IN
|
validated_data['type'] = FIFO.FIFO_TYPE_OTHER_IN
|
||||||
|
validated_data['number'] = 'RK' + ranstr(7)
|
||||||
obj = FIFO(**validated_data)
|
obj = FIFO(**validated_data)
|
||||||
obj.save()
|
obj.save()
|
||||||
for i in details:
|
for i in details:
|
||||||
if 'details' in i:
|
if 'details' in i:
|
||||||
i['number'] = 'RK' + ranstr(7)
|
|
||||||
p_details = i.pop('details')
|
p_details = i.pop('details')
|
||||||
if len(p_details) != i['count']:
|
if len(p_details) != i['count']:
|
||||||
raise serializers.ValidationError('数目对不上')
|
raise serializers.ValidationError('数目对不上')
|
||||||
|
@ -160,7 +162,6 @@ class FIFOInOtherSerializer(serializers.ModelSerializer):
|
||||||
FIFOItemProduct.objects.bulk_create(p_list0)
|
FIFOItemProduct.objects.bulk_create(p_list0)
|
||||||
else:
|
else:
|
||||||
i['fifo'] = obj
|
i['fifo'] = obj
|
||||||
i['number'] = 'RK' + ranstr(7)
|
|
||||||
FIFOItem.objects.create(**i)
|
FIFOItem.objects.create(**i)
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
@ -179,6 +180,7 @@ class FIFOInPurSerializer(serializers.ModelSerializer):
|
||||||
pu_order = validated_data['pu_order']
|
pu_order = validated_data['pu_order']
|
||||||
validated_data['vendor'] = pu_order.vendor
|
validated_data['vendor'] = pu_order.vendor
|
||||||
validated_data['number'] = 'RK' + ranstr(7)
|
validated_data['number'] = 'RK' + ranstr(7)
|
||||||
|
validated_data['type'] = FIFO.FIFO_TYPE_PUR_IN
|
||||||
obj = FIFO.objects.create(**validated_data)
|
obj = FIFO.objects.create(**validated_data)
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
|
|
@ -38,12 +38,12 @@ class InmService:
|
||||||
|
|
||||||
# 如果是采购入库更新采购订单表
|
# 如果是采购入库更新采购订单表
|
||||||
if instance.type == FIFO.FIFO_TYPE_PUR_IN:
|
if instance.type == FIFO.FIFO_TYPE_PUR_IN:
|
||||||
pur_order_item = i.pur_order_item
|
pu_order_item = i.pu_order_item
|
||||||
delivered_count = pur_order_item.delivered_count + i.count
|
delivered_count = pu_order_item.delivered_count + i.count
|
||||||
if delivered_count > pur_order_item.count:
|
if delivered_count > pu_order_item.count:
|
||||||
raise ValidationError('超出采购订单所需量')
|
raise ValidationError('超出采购订单所需量')
|
||||||
pur_order_item.delivered_count = delivered_count
|
pu_order_item.delivered_count = delivered_count
|
||||||
pur_order_item.save()
|
pu_order_item.save()
|
||||||
|
|
||||||
elif instance.type in [FIFO.FIFO_TYPE_DO_OUT, FIFO.FIFO_TYPE_SALE_OUT]: # 生产领料 销售出库
|
elif instance.type in [FIFO.FIFO_TYPE_DO_OUT, FIFO.FIFO_TYPE_SALE_OUT]: # 生产领料 销售出库
|
||||||
# 更新相关表
|
# 更新相关表
|
||||||
|
|
|
@ -99,12 +99,6 @@ class FIFOItemViewSet(ListModelMixin, CreateModelMixin, DestroyModelMixin, Updat
|
||||||
return FIFOItemCreateSerializer
|
return FIFOItemCreateSerializer
|
||||||
return super().get_serializer_class()
|
return super().get_serializer_class()
|
||||||
|
|
||||||
def create(self, request, *args, **kwargs):
|
|
||||||
obj = self.get_object()
|
|
||||||
if obj.fifo.is_audited:
|
|
||||||
raise ValidationError('该出入库记录已审核')
|
|
||||||
return super().create(request, *args, **kwargs)
|
|
||||||
|
|
||||||
def update(self, request, *args, **kwargs):
|
def update(self, request, *args, **kwargs):
|
||||||
obj = self.get_object()
|
obj = self.get_object()
|
||||||
if obj.fifo.is_audited:
|
if obj.fifo.is_audited:
|
||||||
|
|
|
@ -42,6 +42,7 @@ class ProcessSimpleSerializer(serializers.ModelSerializer):
|
||||||
model = Process
|
model = Process
|
||||||
fields = ['id', 'name', 'number', 'type']
|
fields = ['id', 'name', 'number', 'type']
|
||||||
|
|
||||||
|
|
||||||
class StepSerializer(serializers.ModelSerializer):
|
class StepSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Step
|
model = Step
|
||||||
|
@ -138,7 +139,7 @@ class UsedStepCreateSerializer(serializers.ModelSerializer):
|
||||||
"""
|
"""
|
||||||
class Meta:
|
class Meta:
|
||||||
model = UsedStep
|
model = UsedStep
|
||||||
fields = ['step', 'subproduction', 'remark']
|
fields = ['step', 'subproduction', 'remark', 'need_test']
|
||||||
|
|
||||||
class UsedStepUpdateSerializer(serializers.ModelSerializer):
|
class UsedStepUpdateSerializer(serializers.ModelSerializer):
|
||||||
"""
|
"""
|
||||||
|
@ -146,7 +147,7 @@ class UsedStepUpdateSerializer(serializers.ModelSerializer):
|
||||||
"""
|
"""
|
||||||
class Meta:
|
class Meta:
|
||||||
model = UsedStep
|
model = UsedStep
|
||||||
fields = ['remark']
|
fields = ['remark', 'need_test']
|
||||||
|
|
||||||
class UsedStepListSerializer(serializers.ModelSerializer):
|
class UsedStepListSerializer(serializers.ModelSerializer):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -58,7 +58,8 @@ class StepViewSet(OptimizationMixin, CreateUpdateModelAMixin, ModelViewSet):
|
||||||
"""
|
"""
|
||||||
子工序-增删改查
|
子工序-增删改查
|
||||||
"""
|
"""
|
||||||
perms_map = {'*':'*'}
|
perms_map = {'get':'*', 'post':'step_create',
|
||||||
|
'put':'step_update', 'delete':'step_delete'}
|
||||||
queryset = Step.objects.all()
|
queryset = Step.objects.all()
|
||||||
serializer_class = StepSerializer
|
serializer_class = StepSerializer
|
||||||
search_fields = ['name', 'number']
|
search_fields = ['name', 'number']
|
||||||
|
@ -74,7 +75,8 @@ class SubProductionViewSet(CreateUpdateModelAMixin, ModelViewSet):
|
||||||
"""
|
"""
|
||||||
产品生产分解增删改查
|
产品生产分解增删改查
|
||||||
"""
|
"""
|
||||||
perms_map={'*':'*'}
|
perms_map={'get':'*', 'post':'subproduction_create',
|
||||||
|
'put':'subproduction_update', 'delete':'subproduction_delete'}
|
||||||
queryset = SubProduction.objects.select_related('process').all()
|
queryset = SubProduction.objects.select_related('process').all()
|
||||||
filterset_fields = ['product', 'process']
|
filterset_fields = ['product', 'process']
|
||||||
search_fields = ['name']
|
search_fields = ['name']
|
||||||
|
@ -89,7 +91,8 @@ class InputMaterialViewSet(CreateUpdateModelAMixin, ModelViewSet):
|
||||||
"""
|
"""
|
||||||
输入物料-增删改查
|
输入物料-增删改查
|
||||||
"""
|
"""
|
||||||
perms_map = {'*':'*'}
|
perms_map = {'get':'*', 'post':'subproduction_update',
|
||||||
|
'put':'subproduction_update', 'delete':'subproduction_update'}
|
||||||
queryset = SubprodctionMaterial.objects.select_related('material').filter(type=SubprodctionMaterial.SUB_MA_TYPE_IN)
|
queryset = SubprodctionMaterial.objects.select_related('material').filter(type=SubprodctionMaterial.SUB_MA_TYPE_IN)
|
||||||
serializer_class = InputMaterialSerializer
|
serializer_class = InputMaterialSerializer
|
||||||
filterset_fields = ['subproduction']
|
filterset_fields = ['subproduction']
|
||||||
|
@ -106,7 +109,8 @@ class OutputMaterialViewSet(CreateUpdateModelAMixin, ModelViewSet):
|
||||||
"""
|
"""
|
||||||
输出物料-增删改查
|
输出物料-增删改查
|
||||||
"""
|
"""
|
||||||
perms_map = {'*':'*'}
|
perms_map = {'get':'*', 'post':'subproduction_update',
|
||||||
|
'put':'subproduction_update', 'delete':'subproduction_update'}
|
||||||
queryset = SubprodctionMaterial.objects.select_related('material').filter(type=SubprodctionMaterial.SUB_MA_TYPE_OUT)
|
queryset = SubprodctionMaterial.objects.select_related('material').filter(type=SubprodctionMaterial.SUB_MA_TYPE_OUT)
|
||||||
serializer_class = OutputMaterialSerializer
|
serializer_class = OutputMaterialSerializer
|
||||||
filterset_fields = ['subproduction']
|
filterset_fields = ['subproduction']
|
||||||
|
@ -123,7 +127,8 @@ class OtherMaterialViewSet(CreateUpdateModelAMixin, ListModelMixin, DestroyModel
|
||||||
"""
|
"""
|
||||||
其他物料-增删改查
|
其他物料-增删改查
|
||||||
"""
|
"""
|
||||||
perms_map = {'*':'*'}
|
perms_map = {'get':'*', 'post':'subproduction_update',
|
||||||
|
'put':'subproduction_update', 'delete':'subproduction_update'}
|
||||||
queryset = SubprodctionMaterial.objects.select_related('material').filter(type=SubprodctionMaterial.SUB_MA_TYPE_TOOL)
|
queryset = SubprodctionMaterial.objects.select_related('material').filter(type=SubprodctionMaterial.SUB_MA_TYPE_TOOL)
|
||||||
serializer_class = OutputMaterialSerializer
|
serializer_class = OutputMaterialSerializer
|
||||||
filterset_fields = ['subproduction']
|
filterset_fields = ['subproduction']
|
||||||
|
@ -138,7 +143,8 @@ class UsedStepViewSet(OptimizationMixin, CreateModelMixin, DestroyModelMixin, Li
|
||||||
"""
|
"""
|
||||||
产品生产子工序表
|
产品生产子工序表
|
||||||
"""
|
"""
|
||||||
perms_map = {'*':'*'}
|
perms_map = {'get':'*', 'post':'subproduction_update',
|
||||||
|
'put':'subproduction_update', 'delete':'subproduction_update'}
|
||||||
queryset = UsedStep.objects.all()
|
queryset = UsedStep.objects.all()
|
||||||
filterset_fields = ['subproduction', 'step']
|
filterset_fields = ['subproduction', 'step']
|
||||||
ordering = ['step__sort', '-step__create_time']
|
ordering = ['step__sort', '-step__create_time']
|
||||||
|
@ -154,7 +160,8 @@ class RecordFormViewSet(OptimizationMixin, CreateUpdateModelAMixin, ModelViewSet
|
||||||
"""
|
"""
|
||||||
记录表格增删改查
|
记录表格增删改查
|
||||||
"""
|
"""
|
||||||
perms_map = {'*':'*'}
|
perms_map = {'get':'*', 'post':'recordform_create',
|
||||||
|
'put':'recordform_update', 'delete':'recordform_delete'}
|
||||||
queryset = RecordForm.objects.all()
|
queryset = RecordForm.objects.all()
|
||||||
filterset_fields = ['step', 'type', 'material', 'number', 'enabled']
|
filterset_fields = ['step', 'type', 'material', 'number', 'enabled']
|
||||||
search_fields = ['name']
|
search_fields = ['name']
|
||||||
|
@ -186,7 +193,8 @@ class RecordFormFieldViewSet(OptimizationMixin, CreateUpdateModelAMixin, ModelVi
|
||||||
"""
|
"""
|
||||||
表格字段表 增删改查
|
表格字段表 增删改查
|
||||||
"""
|
"""
|
||||||
perms_map = {'*':'*'}
|
perms_map = {'get':'*', 'post':'recordform_update',
|
||||||
|
'put':'recordform_update', 'delete':'recordform_update'}
|
||||||
queryset = RecordFormField.objects.all()
|
queryset = RecordFormField.objects.all()
|
||||||
filterset_fields = ['field_type', 'form']
|
filterset_fields = ['field_type', 'form']
|
||||||
search_fields = ['field_name', 'field_key']
|
search_fields = ['field_name', 'field_key']
|
||||||
|
@ -204,7 +212,8 @@ class TechDocViewSet(OptimizationMixin, CreateUpdateModelAMixin, ModelViewSet):
|
||||||
"""
|
"""
|
||||||
技术文件增删改查
|
技术文件增删改查
|
||||||
"""
|
"""
|
||||||
perms_map = {'*':'*'}
|
perms_map = {'get':'*', 'post':'subproduction_update',
|
||||||
|
'put':'subproduction_update', 'delete':'subproduction_update'}
|
||||||
queryset = TechDoc.objects.select_related('file').all()
|
queryset = TechDoc.objects.select_related('file').all()
|
||||||
filterset_class = TechDocFilterset
|
filterset_class = TechDocFilterset
|
||||||
search_fields = ['name']
|
search_fields = ['name']
|
||||||
|
|
|
@ -39,7 +39,7 @@ class ProductionPlanViewSet(CreateUpdateModelAMixin, ListModelMixin, CreateModel
|
||||||
"""
|
"""
|
||||||
生产计划
|
生产计划
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*', 'post':'plan_create'}
|
||||||
queryset = ProductionPlan.objects.select_related('order', 'order__contract', 'product')
|
queryset = ProductionPlan.objects.select_related('order', 'order__contract', 'product')
|
||||||
serializer_class = ProductionPlanSerializer
|
serializer_class = ProductionPlanSerializer
|
||||||
search_fields = ['number', 'order__number', 'order__contract__number', 'product__number']
|
search_fields = ['number', 'order__number', 'order__contract__number', 'product__number']
|
||||||
|
@ -69,7 +69,7 @@ class ProductionPlanViewSet(CreateUpdateModelAMixin, ListModelMixin, CreateModel
|
||||||
updateOrderPlanedCount(instance.order)
|
updateOrderPlanedCount(instance.order)
|
||||||
return Response()
|
return Response()
|
||||||
|
|
||||||
@action(methods=['post'], detail=False, perms_map={'post':'*'}, serializer_class=PlanDestorySerializer)
|
@action(methods=['post'], detail=False, perms_map={'post':'plan_delete'}, serializer_class=PlanDestorySerializer)
|
||||||
def deletes(self, request, pk=None):
|
def deletes(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
批量物理删除
|
批量物理删除
|
||||||
|
@ -77,7 +77,7 @@ class ProductionPlanViewSet(CreateUpdateModelAMixin, ListModelMixin, CreateModel
|
||||||
ProductionPlan.objects.filter(id__in=request.data.get('ids', [])).delete(soft=False)
|
ProductionPlan.objects.filter(id__in=request.data.get('ids', [])).delete(soft=False)
|
||||||
return Response()
|
return Response()
|
||||||
|
|
||||||
@action(methods=['post'], detail=True, perms_map={'post':'*'}, serializer_class=GenSubPlanSerializer)
|
@action(methods=['post'], detail=True, perms_map={'post':'gen_subplan'}, serializer_class=GenSubPlanSerializer)
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def gen_subplan(self, request, pk=None):
|
def gen_subplan(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
|
@ -109,7 +109,7 @@ class SubProductionPlanViewSet(CreateUpdateModelAMixin, ListModelMixin, UpdateMo
|
||||||
"""
|
"""
|
||||||
子生产计划-列表/修改
|
子生产计划-列表/修改
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*', 'put':'subplan_update'}
|
||||||
queryset = SubProductionPlan.objects.select_related('process', 'workshop', 'subproduction', 'product', 'production_plan__product')
|
queryset = SubProductionPlan.objects.select_related('process', 'workshop', 'subproduction', 'product', 'production_plan__product')
|
||||||
search_fields = []
|
search_fields = []
|
||||||
serializer_class = SubProductionPlanListSerializer
|
serializer_class = SubProductionPlanListSerializer
|
||||||
|
@ -133,7 +133,7 @@ class SubProductionPlanViewSet(CreateUpdateModelAMixin, ListModelMixin, UpdateMo
|
||||||
serializer = SubProductionProgressSerializer(instance=obj.progress_subplan, many=True)
|
serializer = SubProductionProgressSerializer(instance=obj.progress_subplan, many=True)
|
||||||
return Response(serializer.data)
|
return Response(serializer.data)
|
||||||
|
|
||||||
@action(methods=['post'], detail=True, perms_map={'post':'*'}, serializer_class=serializers.Serializer)
|
@action(methods=['post'], detail=True, perms_map={'post':'subplan_issue'}, serializer_class=serializers.Serializer)
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def issue(self, request, pk=None):
|
def issue(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
|
@ -150,7 +150,7 @@ class SubProductionPlanViewSet(CreateUpdateModelAMixin, ListModelMixin, UpdateMo
|
||||||
return Response()
|
return Response()
|
||||||
raise APIException('计划状态有误')
|
raise APIException('计划状态有误')
|
||||||
|
|
||||||
@action(methods=['post'], detail=True, perms_map={'post':'*'}, serializer_class=serializers.Serializer)
|
@action(methods=['post'], detail=True, perms_map={'post':'subplan_start'}, serializer_class=serializers.Serializer)
|
||||||
def start(self, request, pk=None):
|
def start(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
开始生产
|
开始生产
|
||||||
|
@ -197,7 +197,7 @@ class SubProductionProgressViewSet(ListModelMixin, GenericViewSet):
|
||||||
"""
|
"""
|
||||||
生产进度
|
生产进度
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*'}
|
||||||
queryset = SubProductionProgress.objects.select_related('material', 'subproduction_plan')
|
queryset = SubProductionProgress.objects.select_related('material', 'subproduction_plan')
|
||||||
search_fields = []
|
search_fields = []
|
||||||
serializer_class = SubProductionProgressSerializer
|
serializer_class = SubProductionProgressSerializer
|
||||||
|
@ -208,7 +208,7 @@ class SubProductionProgressViewSet(ListModelMixin, GenericViewSet):
|
||||||
class ResourceViewSet(GenericViewSet):
|
class ResourceViewSet(GenericViewSet):
|
||||||
|
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'*': '*'}
|
||||||
@action(methods=['post'], detail=False, perms_map={'post':'*'}, serializer_class=ResourceCalListSerializer)
|
@action(methods=['post'], detail=False, perms_map={'post':'resource_cal'}, serializer_class=ResourceCalListSerializer)
|
||||||
def cal(self, request, pk=None):
|
def cal(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
物料消耗计算
|
物料消耗计算
|
||||||
|
@ -240,7 +240,7 @@ class ResourceViewSet(GenericViewSet):
|
||||||
'count_safe':m['material__count_safe']})
|
'count_safe':m['material__count_safe']})
|
||||||
return Response(res)
|
return Response(res)
|
||||||
|
|
||||||
@action(methods=['post'], detail=False, perms_map={'post':'*'}, serializer_class=ResourceCalListSerializer)
|
@action(methods=['post'], detail=False, perms_map={'post':'resource_cal_equip'}, serializer_class=ResourceCalListSerializer)
|
||||||
def cal_equip(self, request, pk=None):
|
def cal_equip(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
设备状态查看
|
设备状态查看
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from numpy import delete
|
from numpy import delete
|
||||||
from rest_framework.viewsets import ModelViewSet
|
from rest_framework.viewsets import ModelViewSet
|
||||||
from rest_framework.mixins import CreateModelMixin, DestroyModelMixin, ListModelMixin
|
from rest_framework.mixins import CreateModelMixin, DestroyModelMixin, ListModelMixin, RetrieveModelMixin
|
||||||
from rest_framework.viewsets import GenericViewSet
|
from rest_framework.viewsets import GenericViewSet
|
||||||
from apps.pum.models import PuOrder, PuOrderItem, Vendor
|
from apps.pum.models import PuOrder, PuOrderItem, Vendor
|
||||||
from apps.pum.serializers import PuOrderCreateUpdateSerializer, PuOrderItemCreateSerializer, PuOrderItemSerializer, PuOrderItemUpdateSerializer, PuOrderSerializer, VendorSerializer
|
from apps.pum.serializers import PuOrderCreateUpdateSerializer, PuOrderItemCreateSerializer, PuOrderItemSerializer, PuOrderItemUpdateSerializer, PuOrderSerializer, VendorSerializer
|
||||||
|
@ -31,8 +31,8 @@ class PuOrderViewSet(CreateUpdateModelAMixin, ModelViewSet):
|
||||||
"""
|
"""
|
||||||
采购订单-增删改查
|
采购订单-增删改查
|
||||||
"""
|
"""
|
||||||
perms_map = {'get': '*', 'post': '*',
|
perms_map = {'get': '*', 'post': 'puorder_create',
|
||||||
'put': '*', 'delete': '*'}
|
'put': 'puorder_update', 'delete': 'puorder_delete'}
|
||||||
queryset = PuOrder.objects.select_related('vendor').\
|
queryset = PuOrder.objects.select_related('vendor').\
|
||||||
prefetch_related('item_pu_order').all()
|
prefetch_related('item_pu_order').all()
|
||||||
serializer_class = PuOrderSerializer
|
serializer_class = PuOrderSerializer
|
||||||
|
@ -57,7 +57,7 @@ class PuOrderViewSet(CreateUpdateModelAMixin, ModelViewSet):
|
||||||
raise ValidationError('该采购订单已审核')
|
raise ValidationError('该采购订单已审核')
|
||||||
return super().destroy(request, *args, **kwargs)
|
return super().destroy(request, *args, **kwargs)
|
||||||
|
|
||||||
@action(methods=['post'], detail=True, perms_map={'post':'*'},
|
@action(methods=['post'], detail=True, perms_map={'post':'puorder_audit'},
|
||||||
serializer_class=serializers.Serializer)
|
serializer_class=serializers.Serializer)
|
||||||
def audit(self, request, pk=None):
|
def audit(self, request, pk=None):
|
||||||
obj = self.get_object()
|
obj = self.get_object()
|
||||||
|
@ -68,12 +68,12 @@ class PuOrderViewSet(CreateUpdateModelAMixin, ModelViewSet):
|
||||||
return Response()
|
return Response()
|
||||||
return Response('订单状态有误', status=status.HTTP_400_BAD_REQUEST)
|
return Response('订单状态有误', status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
class PuOrderItemViewSet(CreateModelMixin, ListModelMixin, DestroyModelMixin, GenericViewSet):
|
class PuOrderItemViewSet(CreateModelMixin, ListModelMixin, DestroyModelMixin, RetrieveModelMixin, GenericViewSet):
|
||||||
"""
|
"""
|
||||||
采购订单条目
|
采购订单条目
|
||||||
"""
|
"""
|
||||||
perms_map = {'get': '*', 'post': '*',
|
perms_map = {'get': '*', 'post': 'puorder_update',
|
||||||
'put': '*', 'delete': '*'}
|
'put': 'puorder_update', 'delete': 'puorder_update'}
|
||||||
queryset = PuOrderItem.objects.select_related('material').all()
|
queryset = PuOrderItem.objects.select_related('material').all()
|
||||||
serializer_class = PuOrderItemSerializer
|
serializer_class = PuOrderItemSerializer
|
||||||
filterset_fields = ['pu_order', 'material']
|
filterset_fields = ['pu_order', 'material']
|
||||||
|
|
|
@ -129,13 +129,14 @@ class TestRecordUpdateSerializer(serializers.ModelSerializer):
|
||||||
record_data = validated_data.pop('record_data')
|
record_data = validated_data.pop('record_data')
|
||||||
for attr, value in validated_data.items():
|
for attr, value in validated_data.items():
|
||||||
setattr(instance, attr, value)
|
setattr(instance, attr, value)
|
||||||
instance.save(update_by=update_by)
|
instance.update_by = update_by
|
||||||
|
instance.save()
|
||||||
for i in record_data:
|
for i in record_data:
|
||||||
tri = i['id']
|
tri = i['id']
|
||||||
|
tri.is_testok = i['is_testok']
|
||||||
|
tri.is_hidden = i['is_hidden']
|
||||||
|
tri.field_value = i['field_value']
|
||||||
if i['field_value'] != tri.field_value:
|
if i['field_value'] != tri.field_value:
|
||||||
tri.field_value = i['field_value']
|
|
||||||
tri.update_by = update_by
|
tri.update_by = update_by
|
||||||
tri.is_testok = i['is_testok']
|
tri.save()
|
||||||
tri.is_hidden = i['is_hidden']
|
|
||||||
tri.save()
|
|
||||||
return instance
|
return instance
|
||||||
|
|
|
@ -52,7 +52,7 @@ class TestRecordViewSet(ListModelMixin, UpdateModelMixin, RetrieveModelMixin, De
|
||||||
"""
|
"""
|
||||||
检验记录
|
检验记录
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*', 'post':'testrecord_update', 'delete':'testrecord_delete'}
|
||||||
queryset = TestRecord.objects.select_related('fifo_item', 'form').prefetch_related('item_test_record').all()
|
queryset = TestRecord.objects.select_related('fifo_item', 'form').prefetch_related('item_test_record').all()
|
||||||
serializer_class = TestRecordListSerializer
|
serializer_class = TestRecordListSerializer
|
||||||
filterset_fields = ['wproduct', 'material', 'step', 'subproduction_plan', 'fifo_item', 'origin_test', 'type']
|
filterset_fields = ['wproduct', 'material', 'step', 'subproduction_plan', 'fifo_item', 'origin_test', 'type']
|
||||||
|
@ -80,15 +80,16 @@ class TestRecordViewSet(ListModelMixin, UpdateModelMixin, RetrieveModelMixin, De
|
||||||
WpmService.add_wproduct_flow_log(obj.wproduct, 'test_delete')
|
WpmService.add_wproduct_flow_log(obj.wproduct, 'test_delete')
|
||||||
return super().destroy(request, *args, **kwargs)
|
return super().destroy(request, *args, **kwargs)
|
||||||
|
|
||||||
@action(methods=['post'], detail=True, perms_map={'post':'*'}, serializer_class=TestRecordUpdateSerializer)
|
@action(methods=['post'], detail=True, perms_map={'post':'testrecord_submit'}, serializer_class=serializers.Serializer)
|
||||||
def submit(self, request, pk=None):
|
def submit(self, request, pk=None):
|
||||||
obj = self.get_object()
|
obj = self.get_object()
|
||||||
if obj.is_submited and obj.is_midtesting is False:
|
if obj.is_submited and obj.is_midtesting is False:
|
||||||
raise exceptions.APIException('该记录已提交')
|
raise exceptions.APIException('该记录已提交')
|
||||||
# 校验是否有未填项目
|
# 校验是否有未填项目
|
||||||
if obj.type != TestRecord.TEST_PROCESS_RE and obj.is_midtesting is False:
|
if obj.type != TestRecord.TEST_PROCESS_RE and obj.is_midtesting is False:
|
||||||
if TestRecordItem.objects.filter(field_value__isnull=True, is_hidden=False, test_record=obj).exists():
|
items_not = TestRecordItem.objects.filter(field_value__isnull=True, is_hidden=False, test_record=obj)
|
||||||
raise exceptions.APIException('存在未填写项目')
|
if items_not.exists():
|
||||||
|
raise exceptions.APIException('存在未填写项目:'+ ','.join(list(items_not.values_list('form_field__field_name', flat=True))))
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
obj.is_submited=True
|
obj.is_submited=True
|
||||||
obj.save()
|
obj.save()
|
||||||
|
|
|
@ -12,7 +12,8 @@ class CustomerViewSet(CreateUpdateCustomMixin, ModelViewSet):
|
||||||
"""
|
"""
|
||||||
客户-增删改查
|
客户-增删改查
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*', 'post':'customer_create',
|
||||||
|
'put':'customer_update', 'delete':'customer_delete'}
|
||||||
queryset = Customer.objects.all()
|
queryset = Customer.objects.all()
|
||||||
serializer_class = CustomerSerializer
|
serializer_class = CustomerSerializer
|
||||||
search_fields = ['name', 'contact']
|
search_fields = ['name', 'contact']
|
||||||
|
@ -30,7 +31,8 @@ class ContractViewSet(CreateUpdateCustomMixin, ModelViewSet):
|
||||||
"""
|
"""
|
||||||
合同-增删改查
|
合同-增删改查
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*', 'post':'contract_create',
|
||||||
|
'put':'contract_update', 'delete':'contract_delete'}
|
||||||
queryset = Contract.objects.select_related('customer').all()
|
queryset = Contract.objects.select_related('customer').all()
|
||||||
serializer_class = ContractSerializer
|
serializer_class = ContractSerializer
|
||||||
search_fields = ['name']
|
search_fields = ['name']
|
||||||
|
@ -47,7 +49,8 @@ class OrderViewSet(CreateUpdateCustomMixin, ModelViewSet):
|
||||||
"""
|
"""
|
||||||
订单-增删改查
|
订单-增删改查
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*', 'post':'order_create',
|
||||||
|
'put':'order_update', 'delete':'order_delete'}
|
||||||
queryset = Order.objects.select_related('contract', 'customer').all()
|
queryset = Order.objects.select_related('contract', 'customer').all()
|
||||||
serializer_class = OrderSerializer
|
serializer_class = OrderSerializer
|
||||||
search_fields = ['number', 'product']
|
search_fields = ['number', 'product']
|
||||||
|
@ -60,7 +63,7 @@ class OrderViewSet(CreateUpdateCustomMixin, ModelViewSet):
|
||||||
return OrderCreateUpdateSerializer
|
return OrderCreateUpdateSerializer
|
||||||
return super().get_serializer_class()
|
return super().get_serializer_class()
|
||||||
|
|
||||||
@action(methods=['get'], detail=False, perms_map={'get':'*'})
|
@action(methods=['get'], detail=False, perms_map={'get':'order_toplan'})
|
||||||
def toplan(self, request, pk=None):
|
def toplan(self, request, pk=None):
|
||||||
queryset = Order.objects.filter(count__gt=F('planed_count')).order_by('-id')
|
queryset = Order.objects.filter(count__gt=F('planed_count')).order_by('-id')
|
||||||
page = self.paginate_queryset(queryset)
|
page = self.paginate_queryset(queryset)
|
||||||
|
|
|
@ -21,7 +21,7 @@ class SaleViewSet(CreateUpdateModelAMixin, ListModelMixin, RetrieveModelMixin, C
|
||||||
"""
|
"""
|
||||||
销售记录
|
销售记录
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*', 'post':'sale_create', 'delete':'sale_delete'}
|
||||||
queryset = Sale.objects.select_related('customer', 'order', 'product', 'order__contract').all()
|
queryset = Sale.objects.select_related('customer', 'order', 'product', 'order__contract').all()
|
||||||
serializer_class = SaleListSerializer
|
serializer_class = SaleListSerializer
|
||||||
search_fields = ['customer__name', 'order__number']
|
search_fields = ['customer__name', 'order__number']
|
||||||
|
@ -57,7 +57,7 @@ class SaleViewSet(CreateUpdateModelAMixin, ListModelMixin, RetrieveModelMixin, C
|
||||||
SaleProduct.objects.bulk_create(i_l)
|
SaleProduct.objects.bulk_create(i_l)
|
||||||
return Response()
|
return Response()
|
||||||
|
|
||||||
@action(methods=['post'], detail=True, perms_map={'post':'*'}, serializer_class=serializers.Serializer)
|
@action(methods=['post'], detail=True, perms_map={'post':'sale_audit'}, serializer_class=serializers.Serializer)
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def audit(self, request, pk=None):
|
def audit(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
|
@ -124,7 +124,7 @@ class SaleProductViewSet(ListModelMixin, DestroyModelMixin, CreateModelMixin, Ge
|
||||||
"""
|
"""
|
||||||
销售记录关联产品
|
销售记录关联产品
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*', 'post':'sale_update', 'delete':'sale_delete'}
|
||||||
queryset = SaleProduct.objects.select_related('iproduct', 'iproduct__material', 'iproduct__warehouse').all()
|
queryset = SaleProduct.objects.select_related('iproduct', 'iproduct__material', 'iproduct__warehouse').all()
|
||||||
serializer_class = SaleProductListSerializer
|
serializer_class = SaleProductListSerializer
|
||||||
search_fields = []
|
search_fields = []
|
||||||
|
|
|
@ -24,6 +24,7 @@ from .scripts import GetParticipants, HandleScripts
|
||||||
|
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
class FromCodeListView(APIView):
|
class FromCodeListView(APIView):
|
||||||
|
perms_map = {'*':'*'}
|
||||||
def get(self, request, format=None):
|
def get(self, request, format=None):
|
||||||
"""
|
"""
|
||||||
获取处理人代码列表
|
获取处理人代码列表
|
||||||
|
@ -88,7 +89,8 @@ class WorkflowViewSet(CreateUpdateModelAMixin, ModelViewSet):
|
||||||
return Response(ret)
|
return Response(ret)
|
||||||
|
|
||||||
class StateViewSet(CreateModelMixin, UpdateModelMixin, RetrieveModelMixin, DestroyModelMixin, GenericViewSet):
|
class StateViewSet(CreateModelMixin, UpdateModelMixin, RetrieveModelMixin, DestroyModelMixin, GenericViewSet):
|
||||||
perms_map = {'*':'*'}
|
perms_map = {'get':'*', 'post':'workflow_update',
|
||||||
|
'put':'workflow_update', 'delete':'workflow_delete'}
|
||||||
queryset = State.objects.all()
|
queryset = State.objects.all()
|
||||||
serializer_class = StateSerializer
|
serializer_class = StateSerializer
|
||||||
search_fields = ['name']
|
search_fields = ['name']
|
||||||
|
@ -96,7 +98,8 @@ class StateViewSet(CreateModelMixin, UpdateModelMixin, RetrieveModelMixin, Destr
|
||||||
ordering = ['sort']
|
ordering = ['sort']
|
||||||
|
|
||||||
class TransitionViewSet(CreateModelMixin, UpdateModelMixin, RetrieveModelMixin, DestroyModelMixin, GenericViewSet):
|
class TransitionViewSet(CreateModelMixin, UpdateModelMixin, RetrieveModelMixin, DestroyModelMixin, GenericViewSet):
|
||||||
perms_map = {'*':'*'}
|
perms_map = {'get':'*', 'post':'workflow_update',
|
||||||
|
'put':'workflow_update', 'delete':'workflow_delete'}
|
||||||
queryset = Transition.objects.all()
|
queryset = Transition.objects.all()
|
||||||
serializer_class = TransitionSerializer
|
serializer_class = TransitionSerializer
|
||||||
search_fields = ['name']
|
search_fields = ['name']
|
||||||
|
@ -104,7 +107,8 @@ class TransitionViewSet(CreateModelMixin, UpdateModelMixin, RetrieveModelMixin,
|
||||||
ordering = ['id']
|
ordering = ['id']
|
||||||
|
|
||||||
class CustomFieldViewSet(CreateModelMixin, UpdateModelMixin, RetrieveModelMixin, DestroyModelMixin, GenericViewSet):
|
class CustomFieldViewSet(CreateModelMixin, UpdateModelMixin, RetrieveModelMixin, DestroyModelMixin, GenericViewSet):
|
||||||
perms_map = {'*':'*'}
|
perms_map = {'get':'*', 'post':'workflow_update',
|
||||||
|
'put':'workflow_update', 'delete':'workflow_delete'}
|
||||||
queryset = CustomField.objects.all()
|
queryset = CustomField.objects.all()
|
||||||
serializer_class = CustomFieldSerializer
|
serializer_class = CustomFieldSerializer
|
||||||
search_fields = ['field_name']
|
search_fields = ['field_name']
|
||||||
|
@ -117,7 +121,7 @@ class CustomFieldViewSet(CreateModelMixin, UpdateModelMixin, RetrieveModelMixin,
|
||||||
return super().get_serializer_class()
|
return super().get_serializer_class()
|
||||||
|
|
||||||
class TicketViewSet(OptimizationMixin, CreateUpdateCustomMixin, CreateModelMixin, ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
class TicketViewSet(OptimizationMixin, CreateUpdateCustomMixin, CreateModelMixin, ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
||||||
perms_map = {'*':'*'}
|
perms_map = {'get':'*', 'post':'ticket_create'}
|
||||||
queryset = Ticket.objects.all()
|
queryset = Ticket.objects.all()
|
||||||
serializer_class = TicketSerializer
|
serializer_class = TicketSerializer
|
||||||
search_fields = ['title']
|
search_fields = ['title']
|
||||||
|
@ -348,7 +352,7 @@ class TicketViewSet(OptimizationMixin, CreateUpdateCustomMixin, CreateModelMixin
|
||||||
else:
|
else:
|
||||||
return Response('工单不可关闭', status=status.HTTP_400_BAD_REQUEST)
|
return Response('工单不可关闭', status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
@action(methods=['post'], detail=False, perms_map={'post':'*'}, serializer_class=TicketDestorySerializer)
|
@action(methods=['post'], detail=False, perms_map={'post':'ticket_deletes'}, serializer_class=TicketDestorySerializer)
|
||||||
def destory(self, request, pk=None):
|
def destory(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
批量物理删除
|
批量物理删除
|
||||||
|
@ -362,7 +366,7 @@ class TicketFlowViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
||||||
"""
|
"""
|
||||||
工单日志
|
工单日志
|
||||||
"""
|
"""
|
||||||
perms_map = {'*':'*'}
|
perms_map = {'get':'*'}
|
||||||
queryset = TicketFlow.objects.all()
|
queryset = TicketFlow.objects.all()
|
||||||
serializer_class = TicketFlowSerializer
|
serializer_class = TicketFlowSerializer
|
||||||
search_fields = ['suggestion']
|
search_fields = ['suggestion']
|
||||||
|
|
|
@ -55,7 +55,7 @@ class WpmService(object):
|
||||||
wproduct.act_state = WProduct.WPR_ACT_STATE_DOWAIT
|
wproduct.act_state = WProduct.WPR_ACT_STATE_DOWAIT
|
||||||
|
|
||||||
elif wproduct.act_state == WProduct.WPR_ACT_STATE_TOTEST and \
|
elif wproduct.act_state == WProduct.WPR_ACT_STATE_TOTEST and \
|
||||||
test.is_midtesing is True:
|
test.is_midtesting is True:
|
||||||
wproduct.act_state = WProduct.WPR_ACT_STATE_DOWAIT
|
wproduct.act_state = WProduct.WPR_ACT_STATE_DOWAIT
|
||||||
test_i = test
|
test_i = test
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ class WPlanViewSet(ListModelMixin, GenericViewSet):
|
||||||
"""
|
"""
|
||||||
车间生产计划
|
车间生产计划
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*'}
|
||||||
queryset = SubProductionPlan.objects.select_related(
|
queryset = SubProductionPlan.objects.select_related(
|
||||||
'process', 'workshop', 'subproduction', 'product').exclude(state=0)
|
'process', 'workshop', 'subproduction', 'product').exclude(state=0)
|
||||||
search_fields = []
|
search_fields = []
|
||||||
|
@ -57,7 +57,7 @@ class WPlanViewSet(ListModelMixin, GenericViewSet):
|
||||||
ordering_fields = []
|
ordering_fields = []
|
||||||
ordering = ['-update_time']
|
ordering = ['-update_time']
|
||||||
|
|
||||||
@action(methods=['post', 'get'], detail=True, perms_map={'post': '*', 'get': '*'}, serializer_class=PickHalfsSerializer)
|
@action(methods=['post', 'get'], detail=True, perms_map={'post': 'pick_half', 'get': '*'}, serializer_class=PickHalfsSerializer)
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def pick_half(self, request, pk=None):
|
def pick_half(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
|
@ -124,7 +124,7 @@ class WMaterialViewSet(CreateUpdateModelAMixin, ListModelMixin, GenericViewSet):
|
||||||
"""
|
"""
|
||||||
车间物料表
|
车间物料表
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*'}
|
||||||
queryset = WMaterial.objects.select_related(
|
queryset = WMaterial.objects.select_related(
|
||||||
'material', 'subproduction_plan').filter(count__gt=0)
|
'material', 'subproduction_plan').filter(count__gt=0)
|
||||||
serializer_class = WMaterialListSerializer
|
serializer_class = WMaterialListSerializer
|
||||||
|
@ -132,7 +132,7 @@ class WMaterialViewSet(CreateUpdateModelAMixin, ListModelMixin, GenericViewSet):
|
||||||
ordering_fields = ['material__number']
|
ordering_fields = ['material__number']
|
||||||
ordering = ['material__number']
|
ordering = ['material__number']
|
||||||
|
|
||||||
@action(methods=['post'], detail=False, perms_map={'post': '*'}, serializer_class=PickSerializer)
|
@action(methods=['post'], detail=False, perms_map={'post': 'pick'}, serializer_class=PickSerializer)
|
||||||
def pick(self, request, pk=None):
|
def pick(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
领料
|
领料
|
||||||
|
@ -148,7 +148,7 @@ class WProductViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
||||||
"""
|
"""
|
||||||
半成品
|
半成品
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*'}
|
||||||
queryset = WProduct.objects.select_related('step', 'material',
|
queryset = WProduct.objects.select_related('step', 'material',
|
||||||
'subproduction_plan', 'warehouse', 'subproduction_plan__production_plan__order',
|
'subproduction_plan', 'warehouse', 'subproduction_plan__production_plan__order',
|
||||||
'to_order').prefetch_related('wp_child')
|
'to_order').prefetch_related('wp_child')
|
||||||
|
@ -169,7 +169,7 @@ class WProductViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
||||||
queryset = queryset.filter(is_hidden=False)
|
queryset = queryset.filter(is_hidden=False)
|
||||||
return queryset
|
return queryset
|
||||||
|
|
||||||
@action(methods=['post'], detail=False, perms_map={'post': '*'}, serializer_class=WpmTestFormInitSerializer)
|
@action(methods=['post'], detail=False, perms_map={'post': 'wp_test_init'}, serializer_class=WpmTestFormInitSerializer)
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def test_init(self, request, pk=None):
|
def test_init(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
|
@ -228,7 +228,7 @@ class WProductViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
||||||
return Response(TestRecordDetailSerializer(instance=tr).data)
|
return Response(TestRecordDetailSerializer(instance=tr).data)
|
||||||
|
|
||||||
|
|
||||||
@action(methods=['post'], detail=False, perms_map={'post': '*'}, serializer_class=WproductPutInsSerializer)
|
@action(methods=['post'], detail=False, perms_map={'post': 'wp_putins'}, serializer_class=WproductPutInsSerializer)
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def putins(self, request, pk=None):
|
def putins(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
|
@ -287,7 +287,7 @@ class WProductViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
||||||
WpmService.add_wproduct_flow_log(i, 'putins')
|
WpmService.add_wproduct_flow_log(i, 'putins')
|
||||||
return Response()
|
return Response()
|
||||||
|
|
||||||
@action(methods=['post'], detail=True, perms_map={'post': '*'}, serializer_class=WproductPutInSerializer)
|
@action(methods=['post'], detail=True, perms_map={'post': 'wp_putin'}, serializer_class=WproductPutInSerializer)
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def putin(self, request, pk=None):
|
def putin(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
|
@ -334,7 +334,7 @@ class WProductViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
||||||
WpmService.add_wproduct_flow_log(wproduct, 'putin')
|
WpmService.add_wproduct_flow_log(wproduct, 'putin')
|
||||||
return Response()
|
return Response()
|
||||||
|
|
||||||
@action(methods=['post'], detail=True, perms_map={'post': '*'}, serializer_class=ScrapSerializer)
|
@action(methods=['post'], detail=True, perms_map={'post': 'wp_scrap'}, serializer_class=ScrapSerializer)
|
||||||
def scrap(self, request, pk=None):
|
def scrap(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
报废操作
|
报废操作
|
||||||
|
@ -399,7 +399,7 @@ class WProductViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
||||||
else:
|
else:
|
||||||
raise exceptions.APIException('未找到对应审批流程')
|
raise exceptions.APIException('未找到对应审批流程')
|
||||||
|
|
||||||
@action(methods=['post'], detail=True, perms_map={'post': '*'}, serializer_class=WproductMtestSerializer)
|
@action(methods=['post'], detail=True, perms_map={'post': 'wp_mtest'}, serializer_class=WproductMtestSerializer)
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def mtest(self, request, pk=None):
|
def mtest(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
|
@ -424,7 +424,7 @@ class WProductViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
||||||
WpmService.add_wproduct_flow_log(instance=obj, change_str=change_str)
|
WpmService.add_wproduct_flow_log(instance=obj, change_str=change_str)
|
||||||
return Response()
|
return Response()
|
||||||
|
|
||||||
@action(methods=['get'], detail=True, perms_map={'get': '*'})
|
@action(methods=['get'], detail=True, perms_map={'get': 'wp_card'})
|
||||||
def card(self, request, pk=None):
|
def card(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
流程卡
|
流程卡
|
||||||
|
@ -449,7 +449,7 @@ class WProductViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
||||||
ret.append([str(index + 1), item['step_name'], item['actions']])
|
ret.append([str(index + 1), item['step_name'], item['actions']])
|
||||||
return Response(ret)
|
return Response(ret)
|
||||||
|
|
||||||
@action(methods=['post'], detail=False, perms_map={'post': '*'}, serializer_class=WproductNeedToOrderSerializer)
|
@action(methods=['post'], detail=False, perms_map={'post': 'wp_need_to_order'}, serializer_class=WproductNeedToOrderSerializer)
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def need_to_order(self, request, pk=None):
|
def need_to_order(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
|
@ -467,7 +467,7 @@ class WProductViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
||||||
WpmService.add_wproduct_flow_log(i, change_str='need_to_order')
|
WpmService.add_wproduct_flow_log(i, change_str='need_to_order')
|
||||||
return Response()
|
return Response()
|
||||||
|
|
||||||
@action(methods=['post'], detail=False, perms_map={'post': '*'}, serializer_class=WproductToOrderSerializer)
|
@action(methods=['post'], detail=False, perms_map={'post': 'wp_to_order'}, serializer_class=WproductToOrderSerializer)
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def to_order(self, request, pk=None):
|
def to_order(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
|
@ -496,7 +496,7 @@ class WproductTicketViewSet(ListModelMixin, GenericViewSet):
|
||||||
"""
|
"""
|
||||||
玻璃审批工单
|
玻璃审批工单
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*'}
|
||||||
queryset = WprouctTicket.objects.select_related('step', 'material', 'subproduction_plan',
|
queryset = WprouctTicket.objects.select_related('step', 'material', 'subproduction_plan',
|
||||||
'resp_process', 'subproduction_plan__production_plan__order',
|
'resp_process', 'subproduction_plan__production_plan__order',
|
||||||
'subproduction_plan__production_plan')
|
'subproduction_plan__production_plan')
|
||||||
|
@ -512,7 +512,8 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd
|
||||||
"""
|
"""
|
||||||
生产操作记录
|
生产操作记录
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*', 'post':'operation_create',
|
||||||
|
'put':'operation_update', 'delete':'operation_delete'}
|
||||||
queryset = Operation.objects.select_related('step').prefetch_related(
|
queryset = Operation.objects.select_related('step').prefetch_related(
|
||||||
'ow_operation', 'oe_operation', 'or_operation').all()
|
'ow_operation', 'oe_operation', 'or_operation').all()
|
||||||
serializer_class = OperationListSerializer
|
serializer_class = OperationListSerializer
|
||||||
|
@ -622,7 +623,7 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd
|
||||||
opm.save()
|
opm.save()
|
||||||
return Response()
|
return Response()
|
||||||
|
|
||||||
@action(methods=['post'], detail=True, perms_map={'post': '*'}, serializer_class=serializers.Serializer)
|
@action(methods=['post'], detail=True, perms_map={'post': 'operation_submit'}, serializer_class=serializers.Serializer)
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def submit(self, request, pk=None):
|
def submit(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
|
@ -775,7 +776,8 @@ class OperationWproductViewSet(ListModelMixin, DestroyModelMixin, UpdateModelMix
|
||||||
"""
|
"""
|
||||||
操作使用的半成品
|
操作使用的半成品
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*', 'post':'operation_update',
|
||||||
|
'put':'operation_update', 'delete':'operation_delete'}
|
||||||
queryset = OperationWproduct.objects.select_related(
|
queryset = OperationWproduct.objects.select_related(
|
||||||
'subproduction_plan', 'material').all()
|
'subproduction_plan', 'material').all()
|
||||||
serializer_class = OperationWproductListSerializer
|
serializer_class = OperationWproductListSerializer
|
||||||
|
@ -804,7 +806,8 @@ class OperationEquipViewSet(ListModelMixin, DestroyModelMixin, UpdateModelMixin,
|
||||||
"""
|
"""
|
||||||
操作使用的设备
|
操作使用的设备
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*', 'post':'operation_update',
|
||||||
|
'put':'operation_update', 'delete':'operation_delete'}
|
||||||
queryset = OperationEquip.objects.select_related(
|
queryset = OperationEquip.objects.select_related(
|
||||||
'operation', 'equip').all()
|
'operation', 'equip').all()
|
||||||
serializer_class = OperationEquipListSerializer
|
serializer_class = OperationEquipListSerializer
|
||||||
|
@ -836,7 +839,8 @@ class OperationRecordViewSet(ListModelMixin, DestroyModelMixin, UpdateModelMixin
|
||||||
"""
|
"""
|
||||||
操作使用的自定义表格
|
操作使用的自定义表格
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*', 'post':'operation_update',
|
||||||
|
'put':'operation_update', 'delete':'operation_delete'}
|
||||||
queryset = OperationRecord.objects.select_related(
|
queryset = OperationRecord.objects.select_related(
|
||||||
'operation', 'form').all()
|
'operation', 'form').all()
|
||||||
serializer_class = OperationRecordListSerializer
|
serializer_class = OperationRecordListSerializer
|
||||||
|
@ -880,7 +884,7 @@ class OperationMaterialInputViewSet(ListModelMixin, CreateModelMixin, DestroyMod
|
||||||
"""
|
"""
|
||||||
消耗物料
|
消耗物料
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*', 'post':'operation_update', 'delete':'operation_delete'}
|
||||||
queryset = OperationMaterial.objects.select_related(
|
queryset = OperationMaterial.objects.select_related(
|
||||||
'operation', 'subproduction_plan').filter(type=SubprodctionMaterial.SUB_MA_TYPE_IN)
|
'operation', 'subproduction_plan').filter(type=SubprodctionMaterial.SUB_MA_TYPE_IN)
|
||||||
serializer_class = OperationMaterialListSerializer
|
serializer_class = OperationMaterialListSerializer
|
||||||
|
@ -893,7 +897,7 @@ class OperationMaterialInputViewSet(ListModelMixin, CreateModelMixin, DestroyMod
|
||||||
return OperationMaterialCreate1Serailizer
|
return OperationMaterialCreate1Serailizer
|
||||||
return super().get_serializer_class()
|
return super().get_serializer_class()
|
||||||
|
|
||||||
@action(methods=['post'], detail=False, perms_map={'post': '*'},
|
@action(methods=['post'], detail=False, perms_map={'post': 'operation_update'},
|
||||||
serializer_class=OperationMaterialCreate1ListSerailizer)
|
serializer_class=OperationMaterialCreate1ListSerailizer)
|
||||||
def creates(self, request, pk=None):
|
def creates(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
|
@ -917,7 +921,7 @@ class CuttingListViewSet(ListModelMixin, GenericViewSet):
|
||||||
"""
|
"""
|
||||||
下料清单
|
下料清单
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*'}
|
||||||
queryset = OperationMaterial.objects.select_related('operation',
|
queryset = OperationMaterial.objects.select_related('operation',
|
||||||
'subproduction_plan', 'material',
|
'subproduction_plan', 'material',
|
||||||
'operation__create_by').filter(operation__step__id=1,
|
'operation__create_by').filter(operation__step__id=1,
|
||||||
|
@ -932,7 +936,7 @@ class OperationMaterialOutputViewSet(ListModelMixin, CreateModelMixin, DestroyMo
|
||||||
"""
|
"""
|
||||||
产出物料
|
产出物料
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*', 'post':'operation_update', 'delete':'operation_delete'}
|
||||||
queryset = OperationMaterial.objects.select_related(
|
queryset = OperationMaterial.objects.select_related(
|
||||||
'operation', 'subproduction_plan').filter(type=SubprodctionMaterial.SUB_MA_TYPE_OUT)
|
'operation', 'subproduction_plan').filter(type=SubprodctionMaterial.SUB_MA_TYPE_OUT)
|
||||||
serializer_class = OperationMaterialListSerializer
|
serializer_class = OperationMaterialListSerializer
|
||||||
|
@ -945,7 +949,7 @@ class OperationMaterialOutputViewSet(ListModelMixin, CreateModelMixin, DestroyMo
|
||||||
return OperationMaterialCreate2Serailizer
|
return OperationMaterialCreate2Serailizer
|
||||||
return super().get_serializer_class()
|
return super().get_serializer_class()
|
||||||
|
|
||||||
@action(methods=['post'], detail=False, perms_map={'post': '*'},
|
@action(methods=['post'], detail=False, perms_map={'post': 'operation_update'},
|
||||||
serializer_class=OperationMaterialCreate2ListSerailizer)
|
serializer_class=OperationMaterialCreate2ListSerailizer)
|
||||||
def creates(self, request, pk=None):
|
def creates(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
|
@ -969,7 +973,7 @@ class OperationMaterialToolViewSet(ListModelMixin, CreateModelMixin, DestroyMode
|
||||||
"""
|
"""
|
||||||
工具工装
|
工具工装
|
||||||
"""
|
"""
|
||||||
perms_map = {'*': '*'}
|
perms_map = {'get': '*', 'post':'operation_update', 'delete':'operation_delete'}
|
||||||
queryset = OperationMaterial.objects.select_related(
|
queryset = OperationMaterial.objects.select_related(
|
||||||
'operation', 'subproduction_plan').filter(type=SubprodctionMaterial.SUB_MA_TYPE_TOOL)
|
'operation', 'subproduction_plan').filter(type=SubprodctionMaterial.SUB_MA_TYPE_TOOL)
|
||||||
serializer_class = OperationMaterialListSerializer
|
serializer_class = OperationMaterialListSerializer
|
||||||
|
|
Loading…
Reference in New Issue