Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop
This commit is contained in:
commit
a9fac3f3d0
|
|
@ -65,13 +65,13 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="状态" width="120">
|
<el-table-column label="状态" width="120">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-if="scope.row.state===0" type="success">
|
<el-tag v-if="scope.row.state===10" type="success">
|
||||||
{{ state_[scope.row.state] }}
|
{{ state_[scope.row.state] }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<el-tag v-else-if="scope.row.state===1" type="warning">
|
<el-tag v-else-if="scope.row.state===20" type="warning">
|
||||||
{{ state_[scope.row.state] }}
|
{{ state_[scope.row.state] }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<el-tag v-else-if="scope.row.state===2" >
|
<el-tag v-else-if="scope.row.state===30" >
|
||||||
{{ state_[scope.row.state] }}
|
{{ state_[scope.row.state] }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<el-tag v-else type="danger">
|
<el-tag v-else type="danger">
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,16 @@
|
||||||
<template slot-scope="scope">{{ usetype_[scope.row.way] }}</template>
|
<template slot-scope="scope">{{ usetype_[scope.row.way] }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="校/检状态" width="100">
|
<el-table-column label="校/检状态" width="100">
|
||||||
<template slot-scope="scope">{{ state_[scope.row.state] }}</template>
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.state===10" type="success">
|
||||||
|
{{ state_[scope.row.state] }}
|
||||||
|
</el-tag>
|
||||||
|
|
||||||
|
<el-tag v-else type="danger">
|
||||||
|
{{ state_[scope.row.state] }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="保管人">
|
<el-table-column label="保管人">
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,16 @@
|
||||||
<template slot-scope="scope">{{ scope.row.equipment_.model }}</template>
|
<template slot-scope="scope">{{ scope.row.equipment_.model }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="设备状态">
|
<el-table-column label="设备状态">
|
||||||
<template slot-scope="scope">{{ state_[scope.row.equipment_.state] }}</template>
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.equipment_.state===10" type="success">
|
||||||
|
{{ state_[scope.row.equipment_.state] }}
|
||||||
|
</el-tag>
|
||||||
|
|
||||||
|
<el-tag v-else type="danger">
|
||||||
|
{{ state_[scope.row.equipment_.state] }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="校准检查日期">
|
<el-table-column label="校准检查日期">
|
||||||
<template slot-scope="scope">{{ scope.row.check_date }}</template>
|
<template slot-scope="scope">{{ scope.row.check_date }}</template>
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisible"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
width="90%"
|
width="90%"
|
||||||
:title="dialogType === 'edit' ? '编辑出/如库记录' : '新增出/如库记录'"
|
:title="dialogType === 'edit' ? '编辑入库记录' : '新增入库记录'"
|
||||||
>
|
>
|
||||||
<el-form
|
<el-form
|
||||||
ref="Form"
|
ref="Form"
|
||||||
|
|
@ -220,6 +220,24 @@
|
||||||
<el-input v-model="item.batch" placeholder="批次号"></el-input>
|
<el-input v-model="item.batch" placeholder="批次号"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="5" style="margin-right: 10px">
|
||||||
|
<el-form-item
|
||||||
|
class="expiration_date"
|
||||||
|
label="有效期"
|
||||||
|
:prop="'details.' + index + '.expiration_date'"
|
||||||
|
>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="item.expiration_date"
|
||||||
|
type="date"
|
||||||
|
placeholder="选择日期"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
style="width:100%"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<!-- 删除按钮 -->
|
<!-- 删除按钮 -->
|
||||||
<el-col :span="1">
|
<el-col :span="1">
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card style="margin-top: 2px">
|
<el-card style="margin-top: 2px">
|
||||||
<el-button v-if="this.$route.params.pu_order!=null" type="primary" icon="el-icon-plus" @click="handlecgxCreate"
|
<el-button
|
||||||
|
v-if="this.$route.params.pu_order != null"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
@click="handlecgxCreate"
|
||||||
>新增采购项入库</el-button
|
>新增采购项入库</el-button
|
||||||
>
|
>
|
||||||
<el-table
|
<el-table
|
||||||
|
|
@ -39,20 +43,29 @@
|
||||||
<el-table-column label="出入库数量">
|
<el-table-column label="出入库数量">
|
||||||
<template slot-scope="scope">{{ scope.row.count }}</template>
|
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="是否需要复验" v-if="this.$route.params.pu_order!=null">
|
<el-table-column
|
||||||
|
label="是否需要复验"
|
||||||
|
v-if="this.$route.params.pu_order != null"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-if="scope.row.need_test == false">否</el-tag>
|
<el-tag v-if="scope.row.need_test == false">否</el-tag>
|
||||||
<el-tag v-else>是</el-tag>
|
<el-tag v-else>是</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="复验是否合格" v-if="this.$route.params.pu_order!=null">
|
<el-table-column
|
||||||
|
label="复验是否合格"
|
||||||
|
v-if="this.$route.params.pu_order != null"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-if="scope.row.is_testok == false">不合格</el-tag>
|
<el-tag v-if="scope.row.is_testok == false">不合格</el-tag>
|
||||||
<el-tag v-else>合格</el-tag>
|
<el-tag v-else>合格</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="文件" v-if="this.$route.params.pu_order!=null">
|
<el-table-column
|
||||||
|
label="文件"
|
||||||
|
v-if="this.$route.params.pu_order != null"
|
||||||
|
>
|
||||||
<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">{{
|
||||||
|
|
@ -61,7 +74,12 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="操作" width="220px" v-if="this.$route.params.pu_order!=null">
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="操作"
|
||||||
|
width="220px"
|
||||||
|
v-if="this.$route.params.pu_order != null"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-link
|
<el-link
|
||||||
type="primary"
|
type="primary"
|
||||||
|
|
@ -116,8 +134,8 @@
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item></div
|
</el-form-item></div
|
||||||
></el-col>
|
></el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="12"
|
<el-col :span="12"
|
||||||
><div class="grid-content bg-purple">
|
><div class="grid-content bg-purple">
|
||||||
<el-form-item label="到货时间">
|
<el-form-item label="到货时间">
|
||||||
|
|
@ -154,6 +172,16 @@
|
||||||
<el-form-item label="批次" :prop="batch">
|
<el-form-item label="批次" :prop="batch">
|
||||||
<el-input v-model="inpur.batch" placeholder="批次号"></el-input>
|
<el-input v-model="inpur.batch" placeholder="批次号"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="有效期" :prop="expiration_date">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="inpur.expiration_date"
|
||||||
|
type="date"
|
||||||
|
placeholder="选择日期"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="入库数量" :prop="count">
|
<el-form-item label="入库数量" :prop="count">
|
||||||
<el-input-number v-model="inpur.count" :min="0"></el-input-number>
|
<el-input-number v-model="inpur.count" :min="0"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,9 @@
|
||||||
<el-table-column label="规格型号">
|
<el-table-column label="规格型号">
|
||||||
<template slot-scope="scope">{{ scope.row.material_.specification }}</template>
|
<template slot-scope="scope">{{ scope.row.material_.specification }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="有效期">
|
||||||
|
<template slot-scope="scope">{{ scope.row.expiration_date }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="物料编号">
|
<el-table-column label="物料编号">
|
||||||
<template slot-scope="scope">{{
|
<template slot-scope="scope">{{
|
||||||
|
|
|
||||||
|
|
@ -578,7 +578,7 @@
|
||||||
:headers="upHeaders"
|
:headers="upHeaders"
|
||||||
:file-list="fileList"
|
:file-list="fileList"
|
||||||
:limit="1"
|
:limit="1"
|
||||||
accept=".doc,.docx,.pdf,.jpg,.png,.tif,.gif,.apng"
|
accept=".pdf,.jpg,.png,.tif,.gif,.apng"
|
||||||
>
|
>
|
||||||
<el-button size="small" type="primary">上传文件</el-button>
|
<el-button size="small" type="primary">上传文件</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,38 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-tabs type="border-card">
|
<el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
|
||||||
<el-tab-pane label="待检半成品">
|
<el-tab-pane label="待检半成品" name="1">
|
||||||
<el-card style="margin-top: 2px">
|
<el-card style="margin-top: 2px">
|
||||||
|
<el-input
|
||||||
|
v-model="listQuery.search"
|
||||||
|
placeholder="半成品名称/编号/子计划编号/工序"
|
||||||
|
style="width: 300px"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="handleFilter1"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleFilter1"
|
||||||
|
>搜索
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-refresh-left"
|
||||||
|
@click="resetFilter"
|
||||||
|
>重置
|
||||||
|
</el-button>
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
v-loading="listLoading"
|
||||||
:data="wproductList.results"
|
:data="wproductList.results"
|
||||||
border
|
border
|
||||||
fit
|
fit
|
||||||
stripe
|
stripe
|
||||||
highlight-current-row
|
height="100"
|
||||||
max-height="700"
|
highlight-current-row
|
||||||
|
v-el-height-adaptive-table="{bottomOffset: 50}"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50"/>
|
<el-table-column type="index" width="50"/>
|
||||||
<el-table-column label="半成品名称">
|
<el-table-column label="半成品名称">
|
||||||
|
|
@ -23,7 +45,8 @@
|
||||||
<template slot-scope="scope">{{ scope.row.material_.specification }}</template>
|
<template slot-scope="scope">{{ scope.row.material_.specification }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="检测状态">
|
<el-table-column label="检测状态"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ actstate_[scope.row.act_state] }}
|
{{ actstate_[scope.row.act_state] }}
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -31,7 +54,12 @@
|
||||||
<el-table-column label="子计划编号">
|
<el-table-column label="子计划编号">
|
||||||
<template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template>
|
<template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="所在子工序">
|
<el-table-column label="所在子工序" :filters="[{ text: '切割', value: '切割' },{ text: '磨边', value: '磨边' },
|
||||||
|
{ text: '清洗', value: '清洗' }, { text: '热弯成型', value: '热弯成型' },{ text: '化学钢化', value: '化学钢化' },
|
||||||
|
{ text: '镀膜', value: '镀膜' }, { text: '断膜', value: '断膜' },{ text: '汇流条制备', value: '汇流条制备' },
|
||||||
|
{ text: '夹层', value: '夹层' }, { text: '包边', value: '包边' }]"
|
||||||
|
:filter-method="filterTag"
|
||||||
|
filter-placement="bottom-end">
|
||||||
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="操作" width="220px">
|
<el-table-column align="center" label="操作" width="220px">
|
||||||
|
|
@ -88,16 +116,39 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="复检半成品">
|
<el-tab-pane label="复检半成品" name="2">
|
||||||
<el-card style="margin-top: 2px">
|
<el-card style="margin-top: 2px">
|
||||||
|
<el-input
|
||||||
|
v-model="listQuery2.search"
|
||||||
|
placeholder="半成品名称/编号/子计划编号/工序"
|
||||||
|
style="width: 300px"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="handleFilter2"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleFilter2"
|
||||||
|
>搜索
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-refresh-left"
|
||||||
|
@click="resetFilter2"
|
||||||
|
>重置
|
||||||
|
</el-button>
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
|
||||||
:data="wproductList2.results"
|
:data="wproductList2.results"
|
||||||
border
|
border
|
||||||
fit
|
fit
|
||||||
stripe
|
stripe
|
||||||
highlight-current-row
|
|
||||||
max-height="600"
|
height="100"
|
||||||
|
highlight-current-row
|
||||||
|
v-el-height-adaptive-table="{bottomOffset: 50}"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50"/>
|
<el-table-column type="index" width="50"/>
|
||||||
<el-table-column label="半成品名称">
|
<el-table-column label="半成品名称">
|
||||||
|
|
@ -118,7 +169,12 @@
|
||||||
<el-table-column label="子计划编号">
|
<el-table-column label="子计划编号">
|
||||||
<template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template>
|
<template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="所在子工序">
|
<el-table-column label="所在子工序"
|
||||||
|
:filters="[{ text: '切割', value: '切割' },{ text: '磨边', value: '磨边' },
|
||||||
|
{ text: '清洗', value: '清洗' }, { text: '热弯成型', value: '热弯成型' },{ text: '化学钢化', value: '化学钢化' },
|
||||||
|
{ text: '镀膜', value: '镀膜' }, { text: '断膜', value: '断膜' },{ text: '汇流条制备', value: '汇流条制备' },
|
||||||
|
{ text: '夹层', value: '夹层' }, { text: '包边', value: '包边' }]"
|
||||||
|
:filter-method="filterTag">
|
||||||
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="操作" width="220px">
|
<el-table-column align="center" label="操作" width="220px">
|
||||||
|
|
@ -145,20 +201,42 @@
|
||||||
/>
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="已合格半成品">
|
<el-tab-pane label="已合格半成品" name="3">
|
||||||
<el-card style="margin-top: 2px">
|
<el-card style="margin-top: 2px">
|
||||||
<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
|
||||||
|
v-model="listQuery1.search"
|
||||||
|
placeholder="半成品名称/编号/子计划编号/工序"
|
||||||
|
style="width: 300px"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="handleFilter3"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleFilter3"
|
||||||
|
>搜索
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-refresh-left"
|
||||||
|
@click="resetFilter3"
|
||||||
|
>重置
|
||||||
|
</el-button>
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
|
||||||
:data="wproductList1.results"
|
:data="wproductList1.results"
|
||||||
ref="multipleTable"
|
ref="multipleTable"
|
||||||
border
|
border
|
||||||
fit
|
fit
|
||||||
stripe
|
stripe
|
||||||
highlight-current-row
|
height="100"
|
||||||
max-height="600"
|
highlight-current-row
|
||||||
|
v-el-height-adaptive-table="{bottomOffset: 50}"
|
||||||
|
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
@ -184,7 +262,12 @@
|
||||||
<el-table-column label="子计划编号">
|
<el-table-column label="子计划编号">
|
||||||
<template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template>
|
<template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="所在子工序">
|
<el-table-column label="所在子工序"
|
||||||
|
:filters="[{ text: '切割', value: '切割' },{ text: '磨边', value: '磨边' },
|
||||||
|
{ text: '清洗', value: '清洗' }, { text: '热弯成型', value: '热弯成型' },{ text: '化学钢化', value: '化学钢化' },
|
||||||
|
{ text: '镀膜', value: '镀膜' }, { text: '断膜', value: '断膜' },{ text: '汇流条制备', value: '汇流条制备' },
|
||||||
|
{ text: '夹层', value: '夹层' }, { text: '包边', value: '包边' }]"
|
||||||
|
:filter-method="filterTag">
|
||||||
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
|
@ -212,16 +295,38 @@
|
||||||
/>
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="不合格半成品">
|
<el-tab-pane label="不合格半成品" name="4">
|
||||||
<el-card style="margin-top: 2px">
|
<el-card style="margin-top: 2px">
|
||||||
|
<el-input
|
||||||
|
v-model="listQuery4.search"
|
||||||
|
placeholder="半成品名称/编号/子计划编号/工序"
|
||||||
|
style="width: 300px"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="handleFilter4"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleFilter4"
|
||||||
|
>搜索
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-refresh-left"
|
||||||
|
@click="resetFilter4"
|
||||||
|
>重置
|
||||||
|
</el-button>
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
|
||||||
:data="wproductList4.results"
|
:data="wproductList4.results"
|
||||||
border
|
border
|
||||||
fit
|
fit
|
||||||
stripe
|
stripe
|
||||||
highlight-current-row
|
height="100"
|
||||||
max-height="600"
|
highlight-current-row
|
||||||
|
v-el-height-adaptive-table="{bottomOffset: 50}"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50"/>
|
<el-table-column type="index" width="50"/>
|
||||||
<el-table-column label="半成品名称">
|
<el-table-column label="半成品名称">
|
||||||
|
|
@ -239,7 +344,11 @@
|
||||||
<el-table-column label="规格型号">
|
<el-table-column label="规格型号">
|
||||||
<template slot-scope="scope">{{ scope.row.material_.specification }}</template>
|
<template slot-scope="scope">{{ scope.row.material_.specification }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="所在子工序">
|
<el-table-column label="所在子工序" :filters="[{ text: '切割', value: '切割' },{ text: '磨边', value: '磨边' },
|
||||||
|
{ text: '清洗', value: '清洗' }, { text: '热弯成型', value: '热弯成型' },{ text: '化学钢化', value: '化学钢化' },
|
||||||
|
{ text: '镀膜', value: '镀膜' }, { text: '断膜', value: '断膜' },{ text: '汇流条制备', value: '汇流条制备' },
|
||||||
|
{ text: '夹层', value: '夹层' }, { text: '包边', value: '包边' }]"
|
||||||
|
:filter-method="filterTag">
|
||||||
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="不合格标记">
|
<el-table-column label="不合格标记">
|
||||||
|
|
@ -270,24 +379,25 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination
|
<pagination
|
||||||
v-show="wproductList1.count > 0"
|
v-show="wproductList4.count > 0"
|
||||||
:total="wproductList1.count"
|
:total="wproductList4.count"
|
||||||
:page.sync="listQuery1.page"
|
:page.sync="listQuery4.page"
|
||||||
:limit.sync="listQuery1.page_size"
|
:limit.sync="listQuery4.page_size"
|
||||||
@pagination="getList1"
|
@pagination="getList4"
|
||||||
/>
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="夹层半成品">
|
<el-tab-pane label="夹层半成品" name="5">
|
||||||
<el-card style="margin-top: 2px">
|
<el-card style="margin-top: 2px">
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
|
||||||
:data="wproductList3.results"
|
:data="wproductList3.results"
|
||||||
border
|
border
|
||||||
fit
|
fit
|
||||||
stripe
|
stripe
|
||||||
highlight-current-row
|
height="100"
|
||||||
max-height="600"
|
highlight-current-row
|
||||||
|
v-el-height-adaptive-table="{bottomOffset: 50}"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50"/>
|
<el-table-column type="index" width="50"/>
|
||||||
|
|
||||||
|
|
@ -310,7 +420,11 @@
|
||||||
<el-table-column label="子计划编号">
|
<el-table-column label="子计划编号">
|
||||||
<template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template>
|
<template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="所在子工序">
|
<el-table-column label="所在子工序" :filters="[{ text: '切割', value: '切割' },{ text: '磨边', value: '磨边' },
|
||||||
|
{ text: '清洗', value: '清洗' }, { text: '热弯成型', value: '热弯成型' },{ text: '化学钢化', value: '化学钢化' },
|
||||||
|
{ text: '镀膜', value: '镀膜' }, { text: '断膜', value: '断膜' },{ text: '汇流条制备', value: '汇流条制备' },
|
||||||
|
{ text: '夹层', value: '夹层' }, { text: '包边', value: '包边' }]"
|
||||||
|
:filter-method="filterTag">
|
||||||
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="操作" width="220px">
|
<el-table-column align="center" label="操作" width="220px">
|
||||||
|
|
@ -715,6 +829,7 @@
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
},
|
},
|
||||||
|
activeName: "1",
|
||||||
create_by_: '',
|
create_by_: '',
|
||||||
update_time: '',
|
update_time: '',
|
||||||
formLabelWidth: '',
|
formLabelWidth: '',
|
||||||
|
|
@ -819,15 +934,40 @@
|
||||||
computed: {},
|
computed: {},
|
||||||
watch: {},
|
watch: {},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();//待检
|
||||||
this.getList2();
|
this.getList2();//复检
|
||||||
this.getList1();
|
this.getList1();//已合格
|
||||||
this.getList3();
|
this.getList3();//夹层
|
||||||
this.getList4();
|
this.getList4();//不合格
|
||||||
// this.getLists();
|
// this.getLists();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
checkPermission,
|
checkPermission,
|
||||||
|
handleClick(tab) {
|
||||||
|
this.listLoading = true;
|
||||||
|
this.listQuery.type = tab.name;
|
||||||
|
if(tab.name==1)
|
||||||
|
{
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
else if(tab.name==2)
|
||||||
|
{
|
||||||
|
this.getList2();
|
||||||
|
}
|
||||||
|
else if(tab.name==3)
|
||||||
|
{
|
||||||
|
this.getList1();
|
||||||
|
}
|
||||||
|
else if(tab.name==4)
|
||||||
|
{
|
||||||
|
this.getList4();
|
||||||
|
}
|
||||||
|
else if(tab.name==5)
|
||||||
|
{
|
||||||
|
this.getList3();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
//待检半成品列表
|
//待检半成品列表
|
||||||
getList() {
|
getList() {
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
|
|
@ -838,6 +978,18 @@
|
||||||
}
|
}
|
||||||
this.listLoading = false;
|
this.listLoading = false;
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
handleFilter1() {
|
||||||
|
this.listQuery.page = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
resetFilter1() {
|
||||||
|
|
||||||
|
this.listQuery = {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
};
|
||||||
|
this.getList();
|
||||||
},
|
},
|
||||||
//待检半成品报废
|
//待检半成品报废
|
||||||
handleScrapbcp(scope) {
|
handleScrapbcp(scope) {
|
||||||
|
|
@ -850,7 +1002,7 @@
|
||||||
|
|
||||||
console.log(this.formbcp);
|
console.log(this.formbcp);
|
||||||
scrap(this.bcpbf, this.formbcp).then((response) => {
|
scrap(this.bcpbf, this.formbcp).then((response) => {
|
||||||
if (response.data) {
|
if (response.code >= 200) {
|
||||||
this.$message.success("该半成品已报废!");
|
this.$message.success("该半成品已报废!");
|
||||||
this.dialogFormVisiblebcp = false;
|
this.dialogFormVisiblebcp = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
|
@ -866,6 +1018,18 @@
|
||||||
this.wproductList2 = response.data;
|
this.wproductList2 = response.data;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
handleFilter2() {
|
||||||
|
this.listQuery2.page = 1;
|
||||||
|
this.getList2();
|
||||||
|
},
|
||||||
|
resetFilter2() {
|
||||||
|
|
||||||
|
this.listQuery2 = {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
};
|
||||||
|
this.getList2();
|
||||||
},
|
},
|
||||||
//已合格半成品
|
//已合格半成品
|
||||||
getList1() {
|
getList1() {
|
||||||
|
|
@ -877,6 +1041,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
handleFilter3() {
|
||||||
|
this.listQuery1.page = 1;
|
||||||
|
this.getList1();
|
||||||
|
},
|
||||||
|
resetFilter3() {
|
||||||
|
|
||||||
|
this.listQuery1 = {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
};
|
||||||
|
this.getList1();
|
||||||
},
|
},
|
||||||
//不合格半成品
|
//不合格半成品
|
||||||
getList4() {
|
getList4() {
|
||||||
|
|
@ -888,6 +1064,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
handleFilter4() {
|
||||||
|
this.listQuery4.page = 1;
|
||||||
|
this.getList4();
|
||||||
|
},
|
||||||
|
resetFilter4() {
|
||||||
|
|
||||||
|
this.listQuery4 = {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
};
|
||||||
|
this.getList4();
|
||||||
},
|
},
|
||||||
//不合格半成品报废
|
//不合格半成品报废
|
||||||
handleScrap(scope) {
|
handleScrap(scope) {
|
||||||
|
|
@ -963,6 +1151,10 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
//筛选
|
||||||
|
filterTag(value, row) {
|
||||||
|
return row.step_.name === value;
|
||||||
|
},
|
||||||
//夹层半成品列表
|
//夹层半成品列表
|
||||||
getList3() {
|
getList3() {
|
||||||
this.listQuery3.act_state = 26;
|
this.listQuery3.act_state = 26;
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
height="100"
|
height="100"
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
v-el-height-adaptive-table="{bottomOffset: 30}"
|
v-el-height-adaptive-table="{bottomOffset: 50}"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,22 +98,26 @@
|
||||||
stripe
|
stripe
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
height="230"
|
height="230"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
>
|
>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="subproduction_plan_.number"
|
prop="subproduction_plan_.number"
|
||||||
label="子计划编号"
|
label="子计划编号"
|
||||||
|
width="100"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="number" label="玻璃编号">
|
<el-table-column prop="number" label="玻璃编号" width="100">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="material_.name" label="玻璃状态">
|
<el-table-column
|
||||||
|
prop="material_.name"
|
||||||
|
label="玻璃状态"
|
||||||
|
width="170"
|
||||||
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="place" label="摆放位置">
|
<el-table-column prop="place" label="摆放位置"> </el-table-column>
|
||||||
</el-table-column>
|
<el-table-column align="center" label="操作" width="100px" fixed="right">
|
||||||
<el-table-column align="center" label="操作" width="100px">
|
<template slot-scope="scope" >
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-link type="primary" @click="handleupdatewproduct(scope)"
|
<el-link type="primary" @click="handleupdatewproduct(scope)"
|
||||||
>编辑</el-link
|
>编辑</el-link
|
||||||
>
|
>
|
||||||
|
|
@ -812,35 +816,41 @@ export default {
|
||||||
handleClick(tab) {
|
handleClick(tab) {
|
||||||
console.log(tab.name);
|
console.log(tab.name);
|
||||||
var str = tab.label.substr(tab.label.length - 1, 1);
|
var str = tab.label.substr(tab.label.length - 1, 1);
|
||||||
if (str == "x") {
|
// if (str == "x") {
|
||||||
const xhr = new XMLHttpRequest();
|
// const xhr = new XMLHttpRequest();
|
||||||
|
|
||||||
xhr.open("get", tab.name, true);
|
// xhr.open("get", tab.name, true);
|
||||||
|
|
||||||
xhr.responseType = "arraybuffer";
|
// xhr.responseType = "arraybuffer";
|
||||||
|
|
||||||
xhr.onload = () => {
|
// xhr.onload = () => {
|
||||||
if (xhr.status == 200) {
|
// if (xhr.status == 200) {
|
||||||
mammoth
|
// mammoth
|
||||||
.convertToHtml({ arrayBuffer: new Uint8Array(xhr.response) })
|
// .convertToHtml({ arrayBuffer: new Uint8Array(xhr.response) })
|
||||||
.then((resultObject) => {
|
// .then((resultObject) => {
|
||||||
this.$nextTick(() => {
|
// this.$nextTick(() => {
|
||||||
this.wordText = resultObject.value;
|
// this.wordText = resultObject.value;
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
}
|
// };
|
||||||
};
|
// xhr.send();
|
||||||
xhr.send();
|
// var filediv = document.getElementById("file");
|
||||||
var filediv = document.getElementById("file");
|
// filediv.innerHTML =
|
||||||
filediv.innerHTML =
|
// ' <div id="wordView" v-html=' + this.wordText + " />";
|
||||||
' <div id="wordView" v-html=' + this.wordText + " />";
|
// }
|
||||||
} else if (str == "f") {
|
if (str == "f") {
|
||||||
this.pdf = tab.name;
|
this.pdf = tab.name;
|
||||||
var filediv = document.getElementById("file");
|
var filediv = document.getElementById("file");
|
||||||
filediv.innerHTML =
|
filediv.innerHTML =
|
||||||
" <iframe width=1000 height=900 frameborder=0 scrolling=auto src=" +
|
" <iframe width=1000 height=900 frameborder=0 scrolling=auto src=" +
|
||||||
tab.name +
|
tab.name +
|
||||||
"></iframe>";
|
"></iframe>";
|
||||||
|
} else if (str == "g") {
|
||||||
|
var filediv = document.getElementById("file");
|
||||||
|
filediv.innerHTML =
|
||||||
|
" <img width=1000 height=900 frameborder=0 scrolling=auto src=" +
|
||||||
|
tab.name +
|
||||||
|
"></img>";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getWordText() {
|
getWordText() {
|
||||||
|
|
@ -889,10 +899,9 @@ export default {
|
||||||
//半成品摆放的位置
|
//半成品摆放的位置
|
||||||
handleupdatewproduct(scope) {
|
handleupdatewproduct(scope) {
|
||||||
this.dialogwproductplace = true;
|
this.dialogwproductplace = true;
|
||||||
this.wproductplaceID=scope.row.id;
|
this.wproductplaceID = scope.row.id;
|
||||||
},
|
},
|
||||||
submitwproductplace() {
|
submitwproductplace() {
|
||||||
|
|
||||||
wproductPlace(this.wproductplaceID, this.wproductplace).then((res) => {
|
wproductPlace(this.wproductplaceID, this.wproductplace).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.getpwpList();
|
this.getpwpList();
|
||||||
|
|
@ -1135,12 +1144,33 @@ export default {
|
||||||
|
|
||||||
//提交本次操作
|
//提交本次操作
|
||||||
handlesubmit() {
|
handlesubmit() {
|
||||||
submitOperation(this.id).then((res) => {
|
|
||||||
|
|
||||||
|
if(this.inputData=="")
|
||||||
|
{
|
||||||
|
this.$confirm("没有消耗物料确定提交吗?", "提示", {
|
||||||
|
confirmButtonText: "确认",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "error",
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
await submitOperation(this.id);
|
||||||
|
this.$router.push({ name: "operation" });
|
||||||
|
this.$message.success("操作提交成功!");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
submitOperation(this.id).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.$router.push({ name: "operation" });
|
this.$router.push({ name: "operation" });
|
||||||
this.$message.success("操作提交成功!");
|
this.$message.success("操作提交成功!");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -421,6 +421,7 @@
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-link
|
<el-link
|
||||||
v-if="scope.row.material_.type == 2"
|
v-if="scope.row.material_.type == 2"
|
||||||
|
type="primary"
|
||||||
@click="handlewproduct(scope)"
|
@click="handlewproduct(scope)"
|
||||||
>
|
>
|
||||||
选择半成品
|
选择半成品
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
venv/
|
venv/
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.pyc
|
*.pyc
|
||||||
|
sh/*
|
||||||
media/*
|
media/*
|
||||||
static/*
|
static/*
|
||||||
vuedist/*
|
vuedist/*
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ from rest_framework.response import Response
|
||||||
from celery import shared_task
|
from celery import shared_task
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from server.settings_pro import DATABASES, BACKUP_DATABASE_PATH
|
||||||
|
|
||||||
@shared_task
|
@shared_task
|
||||||
def backup_database():
|
def backup_database():
|
||||||
|
|
@ -12,15 +13,18 @@ def backup_database():
|
||||||
"""
|
"""
|
||||||
import datetime
|
import datetime
|
||||||
name = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
|
name = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
|
||||||
command = '''pg_dump "user=postgres password=zcDsj2021 dbname=hberp" >
|
command = 'pg_dump "user={} password={} dbname={}" > {}/hberp_{}.sql'.format(
|
||||||
/home/lighthouse/backup/hberp_{}.sql'''.format(name)
|
DATABASES['default']['USER'],
|
||||||
|
DATABASES['default']['PASSWORD'],
|
||||||
|
DATABASES['default']['NAME'],
|
||||||
|
BACKUP_DATABASE_PATH,
|
||||||
|
name)
|
||||||
completed = subprocess.run(command, shell=True, capture_output=True, text=True)
|
completed = subprocess.run(command, shell=True, capture_output=True, text=True)
|
||||||
return completed
|
return completed
|
||||||
|
|
||||||
@shared_task
|
@shared_task
|
||||||
def reload_server():
|
def reload_server():
|
||||||
os.chdir('/home/lighthouse/hberp')
|
command = 'bash /home/lighthouse/hberp/hb_server/sh/git.sh'
|
||||||
command = 'sudo git pull && sudo service supervisor reload'
|
|
||||||
completed = subprocess.run(command, shell=True, capture_output=True, text=True)
|
completed = subprocess.run(command, shell=True, capture_output=True, text=True)
|
||||||
return completed
|
return completed
|
||||||
|
|
||||||
|
|
@ -32,7 +36,7 @@ def reload_server_only():
|
||||||
|
|
||||||
@shared_task
|
@shared_task
|
||||||
def backup_media():
|
def backup_media():
|
||||||
command = 'rsync -avu /home/lighthouse/hberp/hb_server/media/ /home/lighthouse/backup/media/'
|
command = 'bash /home/lighthouse/hberp/hb_server/sh/backup_media.sh'
|
||||||
completed = subprocess.run(command, shell=True, capture_output=True, text=True)
|
completed = subprocess.run(command, shell=True, capture_output=True, text=True)
|
||||||
return completed
|
return completed
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ from django.db import transaction
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from rest_framework.decorators import permission_classes
|
from rest_framework.decorators import permission_classes
|
||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
from rest_framework.permissions import IsAdminUser
|
from rest_framework.permissions import IsAdminUser, AllowAny
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
from apps.develop.tasks import backup_database, backup_media, reload_server, reload_server_only
|
from apps.develop.tasks import backup_database, backup_media, reload_server, reload_server_only
|
||||||
from apps.inm.models import FIFO, FIFOItem, Inventory, MaterialBatch
|
from apps.inm.models import FIFO, FIFOItem, Inventory, MaterialBatch
|
||||||
|
|
@ -121,8 +121,11 @@ class UpdateFIFONumber(APIView):
|
||||||
i.save()
|
i.save()
|
||||||
return Response()
|
return Response()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ReloadServer(APIView):
|
class ReloadServer(APIView):
|
||||||
permission_classes = [IsAdminUser]
|
authentication_classes = []
|
||||||
|
permission_classes = []
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
"""
|
"""
|
||||||
拉取代码并重启服务
|
拉取代码并重启服务
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ class ProductionPlanViewSet(CreateUpdateModelAMixin, ListModelMixin, CreateModel
|
||||||
for index, i in enumerate(subps):
|
for index, i in enumerate(subps):
|
||||||
steps = Step.objects.filter(usedstep__subproduction=i, usedstep__subproduction__is_deleted=False,
|
steps = Step.objects.filter(usedstep__subproduction=i, usedstep__subproduction__is_deleted=False,
|
||||||
usedstep__is_deleted=False, is_deleted=False
|
usedstep__is_deleted=False, is_deleted=False
|
||||||
).values('id', 'number', 'name', 'usedstep__remark', need_test=F('usedstep__need_test'))
|
).order_by('number').values('id', 'number', 'name', 'usedstep__remark', need_test=F('usedstep__need_test'))
|
||||||
instance = SubProductionPlan.objects.create(production_plan=production_plan, subproduction=i,
|
instance = SubProductionPlan.objects.create(production_plan=production_plan, subproduction=i,
|
||||||
start_date=production_plan.start_date, end_date=production_plan.end_date,
|
start_date=production_plan.start_date, end_date=production_plan.end_date,
|
||||||
workshop=i.process.workshop, process=i.process, create_by=request.user,
|
workshop=i.process.workshop, process=i.process, create_by=request.user,
|
||||||
|
|
|
||||||
|
|
@ -200,9 +200,9 @@ class PermissionViewSet(ModelViewSet):
|
||||||
queryset = Permission.objects.all()
|
queryset = Permission.objects.all()
|
||||||
serializer_class = PermissionSerializer
|
serializer_class = PermissionSerializer
|
||||||
pagination_class = None
|
pagination_class = None
|
||||||
search_fields = ['name']
|
search_fields = ['name', 'method']
|
||||||
ordering_fields = ['sort']
|
ordering_fields = ['sort', 'id', 'method']
|
||||||
ordering = ['pk']
|
ordering = ['sort']
|
||||||
|
|
||||||
|
|
||||||
class OrganizationViewSet(ModelViewSet):
|
class OrganizationViewSet(ModelViewSet):
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,8 @@ class PickSerializer(serializers.Serializer):
|
||||||
fifo = FIFO.objects.create(type=FIFO.FIFO_TYPE_DO_OUT,
|
fifo = FIFO.objects.create(type=FIFO.FIFO_TYPE_DO_OUT,
|
||||||
inout_date=timezone.now(), create_by=self.context['request'].user,
|
inout_date=timezone.now(), create_by=self.context['request'].user,
|
||||||
number = 'CK' + ranstr(7))
|
number = 'CK' + ranstr(7))
|
||||||
|
if len(picks)<=0:
|
||||||
|
raise exceptions.APIException('没有领料项目')
|
||||||
for i in picks:
|
for i in picks:
|
||||||
isLowLevel = False
|
isLowLevel = False
|
||||||
# 更新出库详情
|
# 更新出库详情
|
||||||
|
|
@ -116,8 +118,9 @@ class PickSerializer(serializers.Serializer):
|
||||||
subproduction_plan=sp)
|
subproduction_plan=sp)
|
||||||
sp.is_picked=True
|
sp.is_picked=True
|
||||||
sp.state = SubProductionPlan.SUBPLAN_STATE_WORKING #生产中
|
sp.state = SubProductionPlan.SUBPLAN_STATE_WORKING #生产中
|
||||||
sp.state_date_real = timezone.now() #实际开工日期
|
if sp.start_date_real is None:
|
||||||
sp.save()
|
sp.start_date_real = timezone.now()#实际开工日期
|
||||||
|
sp.save()
|
||||||
# 创建领料记录
|
# 创建领料记录
|
||||||
pick = Pick()
|
pick = Pick()
|
||||||
pick.subproduction_plan = sp
|
pick.subproduction_plan = sp
|
||||||
|
|
|
||||||
|
|
@ -76,8 +76,9 @@ class WpmService(object):
|
||||||
if wt.step.process == test.step.process:
|
if wt.step.process == test.step.process:
|
||||||
wproduct.ng_sign = None
|
wproduct.ng_sign = None
|
||||||
ticket = wt.ticket
|
ticket = wt.ticket
|
||||||
ticket_data = wt.ticket_data
|
ticket_data = ticket.ticket_data
|
||||||
ticket_data['retest_result'] = 1
|
ticket_data['retest_result'] = 1
|
||||||
|
ticket.ticket_data = ticket_data
|
||||||
ticket.update_by = user
|
ticket.update_by = user
|
||||||
ticket.save()
|
ticket.save()
|
||||||
# 创建处理日志
|
# 创建处理日志
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,10 @@ def handleTicket(sender, instance, created, **kwargs):
|
||||||
|
|
||||||
elif decision in [WProduct.NG_ACCEPT, WProduct.NG_PERMIT]:
|
elif decision in [WProduct.NG_ACCEPT, WProduct.NG_PERMIT]:
|
||||||
wp.act_state = WProduct.WPR_ACT_STATE_OK
|
wp.act_state = WProduct.WPR_ACT_STATE_OK
|
||||||
|
# 获取最后一次检验
|
||||||
|
test= wp.test_wproduct.filter(is_submited=True).order_by('-id').last()
|
||||||
|
if test.type == TestRecord.TEST_PROCESS_RE or test.is_midtesting:
|
||||||
|
wp.act_state = WProduct.WPR_ACT_STATE_DOWAIT
|
||||||
wp.ng_sign = decision
|
wp.ng_sign = decision
|
||||||
wt.save()
|
wt.save()
|
||||||
wp.ticket = None # 解除当前工单
|
wp.ticket = None # 解除当前工单
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ class WProductViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
||||||
'to_order').prefetch_related('wp_child')
|
'to_order').prefetch_related('wp_child')
|
||||||
serializer_class = WProductListSerializer
|
serializer_class = WProductListSerializer
|
||||||
filterset_class = WProductFilterSet
|
filterset_class = WProductFilterSet
|
||||||
search_fields = ['number']
|
search_fields = ['number', 'material__name', 'subproduction_plan__number']
|
||||||
ordering_fields = ['id']
|
ordering_fields = ['id']
|
||||||
ordering = ['id']
|
ordering = ['id']
|
||||||
|
|
||||||
|
|
@ -315,7 +315,7 @@ class WProductViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
||||||
remark = vdata.get('remark', '')
|
remark = vdata.get('remark', '')
|
||||||
fifo = FIFO.objects.create(type=FIFO.FIFO_TYPE_DO_IN,
|
fifo = FIFO.objects.create(type=FIFO.FIFO_TYPE_DO_IN,
|
||||||
is_audited=True, auditor=request.user, inout_date=timezone.now(),
|
is_audited=True, auditor=request.user, inout_date=timezone.now(),
|
||||||
create_by=request.user, remark=remark)
|
create_by=request.user, remark=remark, number='RK'+ranstr(7))
|
||||||
# 创建入库明细
|
# 创建入库明细
|
||||||
fifoitem = FIFOItem()
|
fifoitem = FIFOItem()
|
||||||
fifoitem.warehouse = warehouse
|
fifoitem.warehouse = warehouse
|
||||||
|
|
@ -331,6 +331,8 @@ class WProductViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
||||||
ip = {}
|
ip = {}
|
||||||
ip['fifoitem'] = fifoitem
|
ip['fifoitem'] = fifoitem
|
||||||
ip['wproduct'] = i
|
ip['wproduct'] = i
|
||||||
|
if i.number is None:
|
||||||
|
raise exceptions.APIException('缺少编号')
|
||||||
ip['number'] = i.number
|
ip['number'] = i.number
|
||||||
ip['material'] = material
|
ip['material'] = material
|
||||||
ips.append(FIFOItemProduct(**ip))
|
ips.append(FIFOItemProduct(**ip))
|
||||||
|
|
@ -658,8 +660,9 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd
|
||||||
if set(list(sps_omi_l)) != set(list(sps_omo_l)):
|
if set(list(sps_omi_l)) != set(list(sps_omo_l)):
|
||||||
raise exceptions.APIException('消耗与产出不一致')
|
raise exceptions.APIException('消耗与产出不一致')
|
||||||
else:
|
else:
|
||||||
if not omis.exists() and processId !=1: # 不是冷加工
|
pass
|
||||||
raise exceptions.APIException('请选择消耗物料')
|
# if omis.exists() and processId !=1: # 不是冷加工
|
||||||
|
# raise exceptions.APIException('请选择消耗物料')
|
||||||
|
|
||||||
# 检查自定义表单填写
|
# 检查自定义表单填写
|
||||||
if OperationRecord.objects.filter(operation=op, is_filled=False).exists():
|
if OperationRecord.objects.filter(operation=op, is_filled=False).exists():
|
||||||
|
|
@ -710,6 +713,9 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd
|
||||||
wp.act_state = WProduct.WPR_ACT_STATE_DOWAIT
|
wp.act_state = WProduct.WPR_ACT_STATE_DOWAIT
|
||||||
if needTest:
|
if needTest:
|
||||||
wp.act_state = WProduct.WPR_ACT_STATE_TOTEST
|
wp.act_state = WProduct.WPR_ACT_STATE_TOTEST
|
||||||
|
if wp.test:# 如果有正在进行的工序中检验
|
||||||
|
wp.test.is_submited = False
|
||||||
|
wp.test.save()
|
||||||
|
|
||||||
wp.operation = None
|
wp.operation = None
|
||||||
wp.update_by = request.user
|
wp.update_by = request.user
|
||||||
|
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
cd /home/lighthouse/hberp/hb_server
|
|
||||||
source venv/bin/activate
|
|
||||||
exec celery -A server beat -l info
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
cd /home/lighthouse/hberp/hb_server
|
|
||||||
source venv/bin/activate
|
|
||||||
exec celery -A server worker -l info
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
cd /home/lighthouse/hberp/hb_server
|
|
||||||
source venv/bin/activate
|
|
||||||
exec gunicorn -w 5 -b 0.0.0.0:2223 server.wsgi
|
|
||||||
|
|
@ -24,7 +24,7 @@ from drf_yasg.views import get_schema_view
|
||||||
from rest_framework import routers
|
from rest_framework import routers
|
||||||
from rest_framework.documentation import include_docs_urls
|
from rest_framework.documentation import include_docs_urls
|
||||||
from django.views.generic import TemplateView
|
from django.views.generic import TemplateView
|
||||||
from utils.view import GenSignature, UpdateDevelop
|
from utils.view import GenSignature
|
||||||
import os
|
import os
|
||||||
router = routers.DefaultRouter()
|
router = routers.DefaultRouter()
|
||||||
router.register('', FileViewSet, basename="file")
|
router.register('', FileViewSet, basename="file")
|
||||||
|
|
@ -75,7 +75,6 @@ urlpatterns = [
|
||||||
|
|
||||||
# 工具
|
# 工具
|
||||||
path('api/utils/signature/', GenSignature.as_view()),
|
path('api/utils/signature/', GenSignature.as_view()),
|
||||||
path('api/utils/develop/', UpdateDevelop.as_view()),
|
|
||||||
|
|
||||||
# 前端页面入口
|
# 前端页面入口
|
||||||
path('',TemplateView.as_view(template_name="index.html"))
|
path('',TemplateView.as_view(template_name="index.html"))
|
||||||
|
|
|
||||||
|
|
@ -65,30 +65,3 @@ class GenSignature(APIView):
|
||||||
except:
|
except:
|
||||||
return Response('签名照处理失败,请重新上传',
|
return Response('签名照处理失败,请重新上传',
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
|
||||||
import time
|
|
||||||
class UpdateDevelop(APIView):
|
|
||||||
"""
|
|
||||||
更新开发服务器
|
|
||||||
"""
|
|
||||||
authentication_classes = ()
|
|
||||||
permission_classes = ()
|
|
||||||
|
|
||||||
def post(self, request, *args, **kwargs):
|
|
||||||
import os
|
|
||||||
# 更新后端
|
|
||||||
os.chdir('/home/lighthouse/hberp')
|
|
||||||
ret = os.popen('sudo git pull && sudo service supervisor reload')
|
|
||||||
# 奇怪的处理
|
|
||||||
# os.chdir('/home/hberp/hb_server/vuedist')
|
|
||||||
# os.popen('cp index.html indexbak')
|
|
||||||
# time.sleep(1000)
|
|
||||||
# os.popen('rm -rf index.html')
|
|
||||||
# time.sleep(1000)
|
|
||||||
# os.popen('mv -f indexbak index.html')
|
|
||||||
# 打包前端
|
|
||||||
# os.chdir('/home/hberp/hb_client')
|
|
||||||
# os.system('npm run build:prod')
|
|
||||||
# os.system('\cp -rf /home/hberp/hb_client/dist/* /home/hberp/hb_server/vuedist')
|
|
||||||
return Response(ret.read())
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue