This commit is contained in:
shijing 2023-12-22 17:46:14 +08:00
commit 0ecd78bf40
9 changed files with 159 additions and 90 deletions

View File

@ -28,8 +28,7 @@
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="params" hidePagination hideDo> <scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="params" hidePagination hideDo>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="物料" prop="material" show-overflow-tooltip> <el-table-column label="物料" prop="material" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">{{ scope.row.material_name }}
<span v-if="scope.row.material_"> {{ scope.row.material_.name }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="批次号" prop="batch"> <el-table-column label="批次号" prop="batch">
@ -45,15 +44,15 @@
<el-table-column label="操作" fixed="right" align="center" width="100px"> <el-table-column label="操作" fixed="right" align="center" width="100px">
<template #default="scope"> <template #default="scope">
<!-- <el-link type="primary" @click="table_check(scope.row)" v-if="mioObj.state==20&&mioObj.type=='do_in'"> --> <!-- <el-link type="primary" @click="table_check(scope.row)" v-if="mioObj.state==20&&mioObj.type=='do_in'"> -->
<el-link type="primary" @click="table_check(scope.row)" v-if="scope.row.test_date==null" v-auth="'mioitem.test'"> <el-button link type="primary" @click="table_check(scope.row)" v-if="scope.row.test_date==null" v-auth="'mioitem.test'">
检验 检验
</el-link> </el-button>
<el-link type="primary" @click="check_Show(scope.row)" v-else> <el-button link type="primary" @click="check_Show(scope.row)" v-else>
查看 查看
</el-link> </el-button>
<el-link type="danger" @click="table_del(scope.row)" v-if="scope.row.test_date==null"> <el-button link type="danger" @click="table_del(scope.row)" v-if="scope.row.test_date==null">
删除 删除
</el-link> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>

View File

@ -1,75 +1,134 @@
<template> <template>
<el-dialog :title="titleMap[form.type]" v-model="visible" :size="1000" destroy-on-close @closed="$emit('closed')"> <el-dialog
<el-form ref="dialogForm" :model="form" :rules="rules" label-width="120px"> :title="titleMap[form.type]"
<el-form-item label="物料"> v-model="visible"
<el-select v-model="selectMaterial" value-key="id" clearable style="width: 100%;" :size="1000"
@change="selectMaterialChange"> destroy-on-close
<el-option v-for="item in materialOptions" :key="item.id" :label="item.number" :value="item"> @closed="$emit('closed')"
<span style="float: left">{{ item.full_name }}</span> >
</el-option> <el-form ref="dialogForm" :model="form" :rules="rules" label-width="120px">
</el-select> <el-form-item label="物料">
</el-form-item> <el-select
<el-form-item label="批次号"> v-model="selectMaterial"
<!-- <el-input v-model="form.batch" placeholder="手动输入批次号" :disabled="inputBatchDisable" /> --> value-key="id"
<el-select v-model="form.batch" value-key="id" filterable allow-create clearable style="width: 100%;" :disabled="inputBatchDisable"> clearable
<el-option filterable
v-for="item in wbatchOptions" style="width: 100%"
:key="item" @change="selectMaterialChange"
:label="item" >
:value="item"> <el-option
</el-option> v-for="item in materialOptions"
</el-select> :key="item.id"
</el-form-item> :label="item.full_name"
<el-form-item label="仓库已有批次"> :value="item"
<el-select v-model="selectBatch" value-key="id" clearable style="width: 100%;" @change="selectBatchChange" >
@clear="selectBatchClear" :disabled="selectBatchDisable"> <span style="float: left">{{ item.full_name }}</span>
<el-option v-for="item in batchOptions" :key="item.id" :label="item.batch" :value="item"> </el-option>
<span style="float: left">{{ item.batch }}</span> </el-select>
<span style=" </el-form-item>
float: right; <el-form-item label="批次号">
color: var(--el-text-color-secondary); <!-- <el-input v-model="form.batch" placeholder="手动输入批次号" :disabled="inputBatchDisable" /> -->
font-size: 13px; <el-select
">{{ item.count }} -- {{ item.warehouse_name }}</span> v-model="form.batch"
</el-option> value-key="id"
</el-select> filterable
</el-form-item> allow-create
<el-form-item label="仓库"> clearable
<el-select v-model="form.warehouse" clearable style="width: 100%;" :disabled="warehouseDisable"> style="width: 100%"
<el-option v-for="item in warehouseOptions" :key="item.id" :label="item.name" :disabled="inputBatchDisable"
:value="item.id"></el-option> >
</el-select> <el-option
</el-form-item> v-for="item in wbatchOptions"
<el-form-item label="数量"> :key="item"
<el-input-number v-model="form.count" :min="1" style="width: 100%;" /> :label="item"
</el-form-item> :value="item"
<div v-if="assembShow"> >
<el-row v-for="item in components" v-bind:key="item" style="margin-bottom:8px"> </el-option>
<el-col :span="12"> </el-select>
{{ item.number }} - {{ item.name }} </el-form-item>
</el-col> <el-form-item label="仓库已有批次">
<el-col :span="12"> <el-select
<el-select v-model="item.batch" clearable style="width: 100%;"> v-model="selectBatch"
<el-option v-for="itemx in item.batchOptions" :key="itemx.id" :label="itemx.batch" value-key="id"
:value="itemx.batch"> clearable
<span style="float: left">{{ itemx.batch }}</span> style="width: 100%"
<span style=" @change="selectBatchChange"
float: right; @clear="selectBatchClear"
color: var(--el-text-color-secondary); :disabled="selectBatchDisable"
font-size: 13px; >
">{{ itemx.count }}</span> <el-option
</el-option> v-for="item in batchOptions"
</el-select> :key="item.id"
</el-col> :label="item.batch"
</el-row> :value="item"
</div> >
</el-form> <span style="float: left">{{ item.batch }}</span>
<template #footer> <span
<el-button type="primary" :loading="isSaveing" @click="submit"> style="
保存 float: right;
</el-button> color: var(--el-text-color-secondary);
<el-button @click="dialogVisible = false">取消</el-button> font-size: 13px;
</template> "
</el-dialog> >{{ item.count }} -- {{ item.warehouse_name }}</span
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="仓库">
<el-select
v-model="form.warehouse"
clearable
style="width: 100%"
:disabled="warehouseDisable"
>
<el-option
v-for="item in warehouseOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="数量">
<el-input-number v-model="form.count" :min="1" style="width: 100%" />
</el-form-item>
<div v-if="assembShow">
<el-row
v-for="item in components"
v-bind:key="item"
style="margin-bottom: 8px"
>
<el-col :span="12"> {{ item.number }} - {{ item.name }} </el-col>
<el-col :span="12">
<el-select v-model="item.batch" clearable style="width: 100%">
<el-option
v-for="itemx in item.batchOptions"
:key="itemx.id"
:label="itemx.batch"
:value="itemx.batch"
>
<span style="float: left">{{ itemx.batch }}</span>
<span
style="
float: right;
color: var(--el-text-color-secondary);
font-size: 13px;
"
>{{ itemx.count }}</span
>
</el-option>
</el-select>
</el-col>
</el-row>
</div>
</el-form>
<template #footer>
<el-button type="primary" :loading="isSaveing" @click="submit">
保存
</el-button>
<el-button @click="dialogVisible = false">取消</el-button>
</template>
</el-dialog>
</template> </template>
<script> <script>
const defaultForm = { const defaultForm = {
@ -132,10 +191,21 @@ export default {
}, },
// //
getBatchs(){ getBatchs(){
let that = this; let wbatchs = []
this.$API.wpm.wmaterial.batchs.req({belong_dept_name:this.belongDeptName}).then(res=>{ if(this.belongDeptName !=null && this.belongDeptName != undefined && this.belongDeptName != ''){
that.wbatchOptions = res; this.$API.wpm.wmaterial.list.req({
}); "belong_dept__name": this.belongDeptName,
"count__gte": 1,
"page": 0
}).then(res=>{
res.forEach(item => {
if (!wbatchs.includes(item.batch)) {
wbatchs.push(item.batch);
}
});
this.wbatchOptions = wbatchs
})
}
}, },
getMaterialOptions() { getMaterialOptions() {
var type = this.form.type; var type = this.form.type;

View File

@ -2,7 +2,7 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button> <el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_plan.create'">新增</el-button>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-input v-model="query.search" placeholder="计划编号" clearable style="margin-right: 5px;"></el-input> <el-input v-model="query.search" placeholder="计划编号" clearable style="margin-right: 5px;"></el-input>

View File

@ -2,7 +2,7 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button> <el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'supplier.create'">新增</el-button>
</div> </div>
<div class="right-panel"> <div class="right-panel">

View File

@ -2,7 +2,7 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button> <el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'customer.create'">新增</el-button>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-input <el-input

View File

@ -2,7 +2,7 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'order.delete'">新增</el-button> <el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'order.create'">新增</el-button>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input> <el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input>

View File

@ -24,7 +24,7 @@
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.material_out_">{{ <span v-if="scope.row.material_out_">{{
scope.row.material_out_.specification scope.row.material_out_.specification
}}-{{ scope.row.material_out_.model }}</span> }}|{{ scope.row.material_out_.model }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="任务编号" prop="number" width="140" show-overflow-tooltip> <el-table-column label="任务编号" prop="number" width="140" show-overflow-tooltip>

View File

@ -24,7 +24,7 @@
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.material_out_">{{ <span v-if="scope.row.material_out_">{{
scope.row.material_out_.specification scope.row.material_out_.specification
}}-{{ scope.row.material_out_.model }}</span> }}|{{ scope.row.material_out_.model }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="任务编号" prop="number" width="140" show-overflow-tooltip> <el-table-column label="任务编号" prop="number" width="140" show-overflow-tooltip>

View File

@ -225,7 +225,7 @@
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.material_out_">{{ <span v-if="scope.row.material_out_">{{
scope.row.material_out_.specification scope.row.material_out_.specification
}}</span> }}|{{ scope.row.material_out_.model }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="计划量" prop="count"> </el-table-column> <el-table-column label="计划量" prop="count"> </el-table-column>