Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop
This commit is contained in:
commit
999ad65320
|
@ -32,7 +32,7 @@
|
|||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="equipmentList.results"
|
||||
:cell-style="tableRowClassName"
|
||||
|
||||
border
|
||||
fit
|
||||
stripe
|
||||
|
@ -325,6 +325,7 @@ import Pagination from "@/components/Pagination"; // secondary package based on
|
|||
const defaultequipment = {
|
||||
name: "",
|
||||
number: "",
|
||||
type:null,
|
||||
};
|
||||
export default {
|
||||
components: { Pagination },
|
||||
|
@ -399,6 +400,7 @@ export default {
|
|||
listQuery: {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
type:null,
|
||||
},
|
||||
keeperOptions: [],
|
||||
depOptions: [],
|
||||
|
@ -408,7 +410,7 @@ export default {
|
|||
rule1: {
|
||||
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
number: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
type: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
|
||||
model: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
state: [{ required: true, message: "请选择", trigger: "blur" }],
|
||||
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
<div class="app-container">
|
||||
<el-card>
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handlecgCreate"
|
||||
<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-input
|
||||
|
@ -31,8 +31,7 @@
|
|||
>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card >
|
||||
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="fifoList.results"
|
||||
|
@ -40,17 +39,13 @@
|
|||
fit
|
||||
stripe
|
||||
highlight-current-row
|
||||
|
||||
height="100"
|
||||
v-el-height-adaptive-table="{bottomOffset: 42}"
|
||||
height="100"
|
||||
v-el-height-adaptive-table="{ bottomOffset: 42 }"
|
||||
>
|
||||
|
||||
<el-table-column type="index" width="50" />
|
||||
|
||||
<el-table-column label="记录编号">
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.number
|
||||
}}</template>
|
||||
|
||||
<el-table-column label="记录编号">
|
||||
<template slot-scope="scope">{{ scope.row.number }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作人员">
|
||||
<template slot-scope="scope" v-if="scope.row.create_by">{{
|
||||
|
@ -69,20 +64,20 @@
|
|||
<el-tag v-else>已审核</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间">
|
||||
<el-table-column label="创建时间">
|
||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="220px">
|
||||
<template slot-scope="scope">
|
||||
<el-link
|
||||
v-if="checkPermission(['warehouse_update'])"
|
||||
type="primary"
|
||||
type="primary"
|
||||
@click="handleDetail(scope)"
|
||||
>查看</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="scope.row.is_audited == false"
|
||||
type="primary"
|
||||
type="primary"
|
||||
@click="handleAudit(scope)"
|
||||
>审核</el-link
|
||||
>
|
||||
|
@ -103,10 +98,9 @@
|
|||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
<el-dialog
|
||||
<el-dialog
|
||||
:visible.sync="dialogVisibles"
|
||||
:close-on-click-modal="false"
|
||||
|
||||
title="新增采购入库"
|
||||
>
|
||||
<el-form
|
||||
|
@ -116,27 +110,25 @@
|
|||
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-item label="采购订单" >
|
||||
<el-select v-model="inpur.pu_order">
|
||||
<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>
|
||||
<el-button type="danger" @click="dialogVisibles = false"
|
||||
>取消</el-button
|
||||
>
|
||||
<el-button type="primary" @click="confirminpur('Form1')"
|
||||
>确认</el-button
|
||||
>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
|
@ -152,25 +144,20 @@
|
|||
label-position="right"
|
||||
:rules="rule1"
|
||||
>
|
||||
<el-form-item
|
||||
class="warehouse"
|
||||
label="供应商"
|
||||
:prop="vendor"
|
||||
>
|
||||
<el-form-item class="warehouse" label="供应商" >
|
||||
<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>
|
||||
<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">
|
||||
<el-row>
|
||||
<el-col :span="5" style="margin-right: 10px">
|
||||
<el-col :span="5" style="margin-right: 10px">
|
||||
<el-form-item
|
||||
class="warehouse"
|
||||
label="仓库:"
|
||||
|
@ -187,7 +174,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="5" style="margin-right: 10px">
|
||||
<el-form-item
|
||||
class="material"
|
||||
|
@ -293,10 +280,7 @@ import {
|
|||
deleteFifo,
|
||||
audit,
|
||||
} from "@/api/inm";
|
||||
import {
|
||||
getPuorderList,
|
||||
|
||||
} from "@/api/pum";
|
||||
import { getPuorderList } from "@/api/pum";
|
||||
import checkPermission from "@/utils/permission";
|
||||
import { getpVendorList } from "@/api/vendor";
|
||||
import { getMaterialList } from "@/api/mtm";
|
||||
|
@ -304,10 +288,10 @@ import { getUserList } from "@/api/user";
|
|||
import { genTree } from "@/utils";
|
||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||
const defaulteinventory = {
|
||||
vendor:null,
|
||||
vendor: null,
|
||||
details: [
|
||||
{
|
||||
warehouse:"",//仓库
|
||||
warehouse: "", //仓库
|
||||
material: "", // 物料
|
||||
count: "", //数量
|
||||
batch: "", //批次
|
||||
|
@ -329,19 +313,19 @@ export default {
|
|||
4: "生产入库",
|
||||
5: "其他入库",
|
||||
},
|
||||
inpur:{pu_order:null},
|
||||
inpur: [],
|
||||
listQuery: {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
},
|
||||
puorderoptions:[],
|
||||
puorderoptions: [],
|
||||
warehouseData: [],
|
||||
materialoptions: [],
|
||||
vendoroptions:[],
|
||||
vendoroptions: [],
|
||||
listLoading: true,
|
||||
dialogVisible: false,
|
||||
dialogType: "new",
|
||||
dialogVisibles: false,
|
||||
dialogVisibles: false,
|
||||
rule1: {
|
||||
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
},
|
||||
|
@ -371,32 +355,31 @@ export default {
|
|||
},
|
||||
//出入库详情
|
||||
handleDetail(scope) {
|
||||
this.$router.push({ name: "fifodetail", params: { id: scope.row.id,pu_order:scope.row.pu_order, } });
|
||||
this.$router.push({
|
||||
name: "fifodetail",
|
||||
params: { id: scope.row.id, pu_order: scope.row.pu_order },
|
||||
});
|
||||
},
|
||||
|
||||
//供应商列表
|
||||
|
||||
//供应商列表
|
||||
getListgys() {
|
||||
|
||||
getpVendorList({page:0}).then((response) => {
|
||||
getpVendorList({ page: 0 }).then((response) => {
|
||||
if (response.data) {
|
||||
this.vendoroptions = response.data;
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
//采购订单
|
||||
getpuorderList() {
|
||||
|
||||
getPuorderList({page:0}).then((response) => {
|
||||
getPuorderList({ page: 0 }).then((response) => {
|
||||
if (response.data) {
|
||||
this.puorderoptions = response.data;
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
//采购入库提交
|
||||
confirminpur(){
|
||||
createInventory(this.inpur).then((res) => {
|
||||
confirminpur() {
|
||||
createInventory(this.inpur).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.getList();
|
||||
this.dialogVisibles = false;
|
||||
|
@ -404,7 +387,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
//仓库
|
||||
//仓库
|
||||
getlists() {
|
||||
getWarehouseList({ page: 0 }).then((response) => {
|
||||
if (response.data) {
|
||||
|
@ -413,13 +396,13 @@ export default {
|
|||
this.listLoading = false;
|
||||
});
|
||||
},
|
||||
handlecgCreate(){
|
||||
this.dialogVisibles=true;
|
||||
},
|
||||
handlecgCreate() {
|
||||
this.dialogVisibles = true;
|
||||
},
|
||||
addConditions() {
|
||||
if (this.inventory.details.length <= 10) {
|
||||
this.inventory.details.push({
|
||||
warehouse:"",//仓库
|
||||
warehouse: "", //仓库
|
||||
material: "", // 物料
|
||||
count: "", //数量
|
||||
batch: "", // 批次
|
||||
|
@ -444,7 +427,7 @@ export default {
|
|||
handleCreate() {
|
||||
this.inventory.details = [
|
||||
{
|
||||
warehouse:"", // 仓库
|
||||
warehouse: "", // 仓库
|
||||
material: "", // 物料
|
||||
count: "", //数量
|
||||
batch: "", //批次
|
||||
|
@ -462,7 +445,7 @@ export default {
|
|||
this.$confirm("是否通过?", "提示", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "取消",
|
||||
type: 'success',
|
||||
type: "success",
|
||||
})
|
||||
.then(async () => {
|
||||
await audit(scope.row.id);
|
||||
|
@ -496,7 +479,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
handleDelete(scope) {
|
||||
handleDelete(scope) {
|
||||
this.$confirm("确认删除?", "警告", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "取消",
|
||||
|
@ -511,7 +494,6 @@ export default {
|
|||
console.error(err);
|
||||
});
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -36,9 +36,9 @@
|
|||
|
||||
<el-table-column label="订单">
|
||||
<template slot-scope="scope">
|
||||
<el-span v-if="scope.row.to_order_">{{
|
||||
<span v-if="scope.row.to_order_">{{
|
||||
scope.row.to_order_.number
|
||||
}}</el-span>
|
||||
}}</span>
|
||||
<el-tag
|
||||
v-else-if="
|
||||
scope.row.to_order_ == null && scope.row.need_to_order == true
|
||||
|
@ -46,35 +46,35 @@
|
|||
>
|
||||
需要确定订单
|
||||
</el-tag>
|
||||
<el-span v-else></el-span>
|
||||
<span v-else></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合同">
|
||||
<template slot-scope="scope">
|
||||
<el-span v-if="scope.row.to_order_">{{
|
||||
<span v-if="scope.row.to_order_">{{
|
||||
scope.row.to_order_.contract_.name
|
||||
}}</el-span>
|
||||
<el-span
|
||||
}}</span>
|
||||
<span
|
||||
v-else-if="
|
||||
scope.row.to_order_ == null && scope.row.need_to_order == true
|
||||
"
|
||||
>
|
||||
</el-span>
|
||||
<el-span v-else></el-span>
|
||||
</span>
|
||||
<span v-else></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户">
|
||||
<template slot-scope="scope">
|
||||
<el-span v-if="scope.row.to_order_">{{
|
||||
<span v-if="scope.row.to_order_">{{
|
||||
scope.row.to_order_.customer_.name
|
||||
}}</el-span>
|
||||
<el-span
|
||||
}}</span>
|
||||
<span
|
||||
v-else-if="
|
||||
scope.row.to_order_ == null && scope.row.need_to_order == true
|
||||
"
|
||||
>
|
||||
</el-span>
|
||||
<el-span v-else></el-span>
|
||||
</span>
|
||||
<span v-else></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
@ -82,7 +82,7 @@
|
|||
<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>
|
||||
<el-span v-else></el-span
|
||||
<span v-else></span
|
||||
></template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column align="center" label="操作" width="220px">
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<el-tab-pane label="批次" name="3">
|
||||
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
|
||||
:data="InventoryList"
|
||||
border
|
||||
fit
|
||||
|
@ -63,7 +63,7 @@
|
|||
|
||||
<el-tab-pane label="关联的订单" name="1">
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
|
||||
:data="orderlist"
|
||||
border
|
||||
fit
|
||||
|
@ -212,10 +212,10 @@
|
|||
data() {
|
||||
return {
|
||||
materialdetail:"",
|
||||
orderlist:"",
|
||||
wproductList:"",
|
||||
productionplanList:"",
|
||||
InventoryList:"",
|
||||
orderlist:[],
|
||||
wproductList:[],
|
||||
productionplanList:[],
|
||||
InventoryList:[],
|
||||
activeName:'3',
|
||||
actstate_: {
|
||||
6: "待复检",
|
||||
|
|
|
@ -653,8 +653,8 @@
|
|||
data() {
|
||||
return {
|
||||
materialoptions: [],
|
||||
subproducationData: "",
|
||||
inputtableData: "",
|
||||
subproducationData: [],
|
||||
inputtableData: [],
|
||||
editorOption: {},
|
||||
processOptions: [],
|
||||
is_main: false,
|
||||
|
@ -662,11 +662,11 @@
|
|||
techdoc: defaulttechdoc,
|
||||
subproducation: defaultsubproducation,
|
||||
inputmaterial: defaultinputmaterial,
|
||||
techdoctableData: "",
|
||||
outputtableData: "",
|
||||
othertableData: "",
|
||||
techdoctableData: [],
|
||||
outputtableData: [],
|
||||
othertableData: [],
|
||||
outputmaterial: defaultoutputmaterial,
|
||||
usedsteptableData: "",
|
||||
usedsteptableData: [],
|
||||
usedstep: defaultusedstep,
|
||||
materialList: {
|
||||
count: 0,
|
||||
|
|
|
@ -81,6 +81,10 @@
|
|||
<el-table-column align="center" label="出勤天数">
|
||||
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="应到天数">
|
||||
<template slot-scope="scope">{{ scope.row.count_workday }}</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
</el-table>
|
||||
|
||||
|
@ -131,7 +135,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
userList: { count: 0 },
|
||||
atworkList: "",
|
||||
atworkList: [],
|
||||
value3:null,
|
||||
value2:null,
|
||||
listLoading: true,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
>申请
|
||||
</el-button>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
|
||||
:data="iproductData.results"
|
||||
ref="multipleTable"
|
||||
border
|
||||
|
@ -50,7 +50,7 @@
|
|||
</el-tab-pane>
|
||||
<el-tab-pane label="军检列表" name="second">
|
||||
<el-table
|
||||
v-loading="listLoading2"
|
||||
|
||||
:data="iproductData2.results"
|
||||
border
|
||||
fit
|
||||
|
@ -78,9 +78,9 @@
|
|||
|
||||
<el-table-column label="订单">
|
||||
<template slot-scope="scope">
|
||||
<el-span v-if="scope.row.to_order_">{{
|
||||
<span v-if="scope.row.to_order_">{{
|
||||
scope.row.to_order_.number
|
||||
}}</el-span>
|
||||
}}</span>
|
||||
<el-tag
|
||||
v-else-if="
|
||||
scope.row.to_order_ == null && scope.row.need_to_order == true
|
||||
|
@ -88,35 +88,35 @@
|
|||
>
|
||||
需要确定订单
|
||||
</el-tag>
|
||||
<el-span v-else></el-span>
|
||||
<span v-else></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合同">
|
||||
<template slot-scope="scope">
|
||||
<el-span v-if="scope.row.to_order_">{{
|
||||
<span v-if="scope.row.to_order_">{{
|
||||
scope.row.to_order_.contract_.name
|
||||
}}</el-span>
|
||||
<el-span
|
||||
}}</span>
|
||||
<span
|
||||
v-else-if="
|
||||
scope.row.to_order_ == null && scope.row.need_to_order == true
|
||||
"
|
||||
>
|
||||
</el-span>
|
||||
<el-span v-else></el-span>
|
||||
</span>
|
||||
<span v-else></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户">
|
||||
<template slot-scope="scope">
|
||||
<el-span v-if="scope.row.to_order_">{{
|
||||
<span v-if="scope.row.to_order_">{{
|
||||
scope.row.to_order_.customer_.name
|
||||
}}</el-span>
|
||||
<el-span
|
||||
}}</span>
|
||||
<span
|
||||
v-else-if="
|
||||
scope.row.to_order_ == null && scope.row.need_to_order == true
|
||||
"
|
||||
>
|
||||
</el-span>
|
||||
<el-span v-else></el-span>
|
||||
</span>
|
||||
<span v-else></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="军检">
|
||||
|
@ -125,7 +125,7 @@
|
|||
|
||||
<el-tag v-if="scope.row.is_mtestok == false">不合格</el-tag>
|
||||
<el-tag v-else-if="scope.row.is_mtestok == true">合格</el-tag>
|
||||
<el-span v-else></el-span></template>
|
||||
<span v-else></span></template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
</el-card>
|
||||
<el-card >
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
|
||||
:data="saleList.results"
|
||||
border
|
||||
fit
|
||||
|
@ -108,7 +108,7 @@
|
|||
label-width="80px"
|
||||
label-position="right"
|
||||
|
||||
:rules="rule1"
|
||||
|
||||
>
|
||||
<el-form-item label="关联订单" prop="name">
|
||||
<el-select style="width: 100%" v-model="sale.order" @change="selectorder" placeholder="请选择">
|
||||
|
@ -146,7 +146,7 @@
|
|||
<el-form-item label="选择产品" prop="iproducts">
|
||||
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
|
||||
:data="iproductoptions"
|
||||
border
|
||||
fit
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="box-card">
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick" type="border-card">
|
||||
<el-tabs @tab-click="handleClick" type="border-card">
|
||||
<el-tab-pane
|
||||
:key="item.name"
|
||||
v-for="item in processOption"
|
||||
|
@ -16,7 +16,7 @@
|
|||
fit
|
||||
stripe
|
||||
style="width: 100%"
|
||||
max-height="670"
|
||||
height="100"
|
||||
highlight-current-row
|
||||
v-el-height-adaptive-table="{bottomOffset: 30}"
|
||||
>
|
||||
|
|
|
@ -806,7 +806,7 @@ filediv.innerHTML=' <div id="wordView" v-html='+this.wordText+' />';
|
|||
{
|
||||
this.pdf=tab.name;
|
||||
var filediv = document.getElementById('file');
|
||||
filediv.innerHTML=' <iframe width=420 height=330 frameborder=0 scrolling=auto src='+tab.name+'></iframe>';
|
||||
filediv.innerHTML=' <frame width=800 height=900 frameborder=0 scrolling=auto src='+tab.name+'></frame>';
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -248,7 +248,7 @@
|
|||
:visible.sync="dialogFormVisiblebcp"
|
||||
>
|
||||
<el-form :model="formbcp">
|
||||
<el-form-item label="甩片原因" :label-width="formLabelWidth">
|
||||
<el-form-item label="甩片原因" >
|
||||
<el-select
|
||||
style="width: 80%"
|
||||
v-model="formbcp.scrap_reason"
|
||||
|
@ -751,12 +751,12 @@ export default {
|
|||
subproductionplanList: {
|
||||
count: 0,
|
||||
},
|
||||
wmaterialList: "",
|
||||
wmaterialList: [],
|
||||
listQuery: {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
},
|
||||
iproductData: "",
|
||||
iproductData: [],
|
||||
remark: "",
|
||||
values: 0,
|
||||
active: 0,
|
||||
|
@ -810,7 +810,7 @@ export default {
|
|||
pickData: {},
|
||||
steps: [],
|
||||
step: null,
|
||||
processOption: "",
|
||||
processOption: [],
|
||||
subproduction_plan: "",
|
||||
form1: [],
|
||||
form2: [],
|
||||
|
@ -823,7 +823,7 @@ export default {
|
|||
field1: [],
|
||||
field2: [],
|
||||
fromData: [],
|
||||
wproductData: "",
|
||||
wproductData: [],
|
||||
wpID: [],
|
||||
multipleSelection: [],
|
||||
wproducts: [],
|
||||
|
@ -832,8 +832,8 @@ export default {
|
|||
Operation: {},
|
||||
wproductdata: {},
|
||||
workData: {},
|
||||
bcplist: "",
|
||||
wproductslist: "",
|
||||
bcplist: [],
|
||||
wproductslist: [],
|
||||
formbcp: {},
|
||||
dialogFormVisiblebcp: false,
|
||||
scrapreason: [
|
||||
|
|
|
@ -22,6 +22,13 @@ class ResourceCalSerializer(serializers.Serializer):
|
|||
id = serializers.IntegerField(label='产品ID')
|
||||
count = serializers.IntegerField(label='生产数量')
|
||||
|
||||
class ResourceConvertSerializer(serializers.Serializer):
|
||||
id = serializers.IntegerField(label='半成品ID')
|
||||
count = serializers.IntegerField(label='折合数量')
|
||||
|
||||
class ResourceConvertListSerializer(serializers.ListSerializer):
|
||||
child = ResourceConvertSerializer()
|
||||
|
||||
class ResourceCalListSerializer(serializers.ListSerializer):
|
||||
child = ResourceCalSerializer()
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ from apps.inm.serializers import MaterialBatchSerializer
|
|||
from apps.mtm.models import Material, Step, SubProduction, SubprodctionMaterial
|
||||
from apps.pm.filters import PlanFilterSet, SubproductionProgressFilterSet
|
||||
from apps.system.mixins import CreateUpdateModelAMixin
|
||||
from apps.pm.serializers import GenSubPlanSerializer, PickNeedSerializer, PlanDestorySerializer, ProductionPlanCreateFromOrderSerializer, ProductionPlanSerializer, ResourceCalListSerializer, ResourceCalSerializer, SubProductionPlanListSerializer, SubProductionPlanUpdateSerializer, SubProductionProgressSerializer
|
||||
from apps.pm.serializers import GenSubPlanSerializer, PickNeedSerializer, PlanDestorySerializer, ProductionPlanCreateFromOrderSerializer, ProductionPlanSerializer, ResourceCalListSerializer, ResourceCalSerializer, ResourceConvertListSerializer, ResourceConvertSerializer, SubProductionPlanListSerializer, SubProductionPlanUpdateSerializer, SubProductionProgressSerializer
|
||||
from rest_framework.mixins import CreateModelMixin, ListModelMixin, RetrieveModelMixin, UpdateModelMixin
|
||||
from apps.pm.models import ProductionPlan, SubProductionProgress, SubProductionPlan
|
||||
from rest_framework.viewsets import GenericViewSet, ModelViewSet
|
||||
|
@ -216,30 +216,90 @@ class ResourceViewSet(GenericViewSet):
|
|||
rdata = request.data
|
||||
serializer = self.get_serializer(data=rdata)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
productIdList = []
|
||||
productList = []
|
||||
for i in rdata:
|
||||
if i['id'] not in productIdList:
|
||||
productIdList.append(i['id'])
|
||||
productList.append(i)
|
||||
else:
|
||||
index = productIdList.index(i['id'])
|
||||
productList[index]['count'] = productList[index]['count'] + i['count']
|
||||
|
||||
res_d_list = []
|
||||
res = []
|
||||
for i in rdata:
|
||||
for i in productList:
|
||||
# 计算输入物料
|
||||
materials = SubprodctionMaterial.objects.filter(subproduction__product__id=i['id'],
|
||||
subproduction__is_deleted=False, is_deleted=False,
|
||||
material__type__in=[Material.MA_TYPE_MAINSO,
|
||||
Material.MA_TYPE_HELPSO], type= SubprodctionMaterial.SUB_MA_TYPE_IN).order_by('material__number')\
|
||||
type= SubprodctionMaterial.SUB_MA_TYPE_IN).order_by('material__number')\
|
||||
.values('material__id', 'material__name',
|
||||
'material__number', 'material__type',
|
||||
'count', 'material__count', 'material__count_safe')
|
||||
l_m = list(materials)
|
||||
for m in l_m:
|
||||
if m['material__id'] in res_d_list:
|
||||
index = res_d_list.index(m['material__id'])
|
||||
res[index]['count'] = res[index]['count'] + m['count']*i['count']
|
||||
if m['material__type'] in [Material.MA_TYPE_MAINSO, Material.MA_TYPE_HELPSO]:
|
||||
index = res_d_list.index(m['material__id'])
|
||||
res[index]['count'] = res[index]['count'] + m['count']*i['count']
|
||||
else:
|
||||
res_d_list.append(m['material__id'])
|
||||
res.append({'id':m['material__id'], 'name':m['material__name'],
|
||||
item = {'id':m['material__id'], 'name':m['material__name'],
|
||||
'type':m['material__type'], 'number':m['material__number'],
|
||||
'count':m['count']*i['count'], 'inv_count':m['material__count'],
|
||||
'count_safe':m['material__count_safe']})
|
||||
'count': None,'inv_count':m['material__count'],
|
||||
'count_safe':m['material__count_safe']}
|
||||
if item['type'] in [Material.MA_TYPE_MAINSO, Material.MA_TYPE_HELPSO]:
|
||||
item['count'] = m['count']*i['count']
|
||||
res.append(item)
|
||||
return Response(res)
|
||||
|
||||
@action(methods=['post'], detail=False, perms_map={'post':'resource_cal'}, serializer_class=ResourceConvertListSerializer)
|
||||
def convert(self, request, pk=None):
|
||||
rdata = request.data
|
||||
serializer = self.get_serializer(data=rdata)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
res_d_list = []
|
||||
res = []
|
||||
half_list = rdata
|
||||
while half_list:
|
||||
fitem = half_list[0]
|
||||
sm = SubprodctionMaterial.objects.filter(
|
||||
type= SubprodctionMaterial.SUB_MA_TYPE_OUT,
|
||||
is_deleted = False,
|
||||
material__id = fitem['id']
|
||||
).first()
|
||||
if sm:
|
||||
spn = sm.subproduction
|
||||
sm_left_l = list(SubprodctionMaterial.objects.filter(
|
||||
subproduction = spn,
|
||||
type= SubprodctionMaterial.SUB_MA_TYPE_IN,
|
||||
is_deleted = False,
|
||||
).order_by('material__number')\
|
||||
.values('material__id', 'material__name',
|
||||
'material__number', 'material__type',
|
||||
'count', 'material__count', 'material__count_safe'))
|
||||
|
||||
for i in sm_left_l:
|
||||
if i['material__type'] == Material.MA_TYPE_HALFGOOD:
|
||||
item = {
|
||||
'id':i['material__id'],
|
||||
'count':(i['count']*fitem['count'])/(sm.count)
|
||||
}
|
||||
half_list.append(item)
|
||||
else:
|
||||
if i['material__id'] in res_d_list:
|
||||
index = res_d_list.index(i['material__id'])
|
||||
res[index]['count'] = res[index]['count'] + \
|
||||
(i['count']*fitem['count'])/(sm.count)
|
||||
else:
|
||||
res_d_list.append(i['material__id'])
|
||||
item = {
|
||||
'id': i['material__id'],
|
||||
'count':(i['count']*fitem['count'])/(sm.count)
|
||||
}
|
||||
res.append(item)
|
||||
del(half_list[0])
|
||||
return Response(res)
|
||||
|
||||
@action(methods=['post'], detail=False, perms_map={'post':'resource_cal_equip'}, serializer_class=ResourceCalListSerializer)
|
||||
def cal_equip(self, request, pk=None):
|
||||
|
@ -256,4 +316,4 @@ class ResourceViewSet(GenericViewSet):
|
|||
steps = Step.objects.filter(usedstep__is_deleted=False, usedstep__subproduction__in=subproductions)
|
||||
equips = Equipment.objects.filter(step_equips__in=steps, is_deleted=False).distinct()
|
||||
serializer = EquipmentSimpleSerializer(instance=equips, many=True)
|
||||
return Response(serializer.data)
|
||||
return Response(serializer.data)
|
Loading…
Reference in New Issue