修改半成品的分为单价和总价格
This commit is contained in:
@ -465,7 +465,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<div class="divider-text">成本核算 (单件)</div>
|
||||
<div class="divider-text">成本核算</div>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="原材料成本">
|
||||
@ -473,13 +473,13 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="手动/工时">
|
||||
<el-form-item label="单件总成本">
|
||||
<el-input-number v-model="form.manual_cost" :precision="2" :controls="false" style="width:100%" placeholder="请输入"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单件总成本">
|
||||
<el-input-number v-model="form.unit_total_cost" :precision="2" :controls="false" style="width:100%" placeholder="请输入"/>
|
||||
<el-form-item label="总成本">
|
||||
<el-input-number v-model="form.unit_total_cost" :precision="2" :controls="false" style="width:100%" placeholder="自动计算" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -527,7 +527,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref, reactive, onMounted} from 'vue'
|
||||
import {ref, reactive, onMounted, watch} from 'vue'
|
||||
import {Plus, Setting, Refresh, Search, Lock, Box, House, InfoFilled, Link, Printer, Camera, Picture} from '@element-plus/icons-vue'
|
||||
import {ElMessage, ElLoading} from 'element-plus'
|
||||
import dayjs from 'dayjs'
|
||||
@ -642,8 +642,8 @@ const stockColumns = [
|
||||
{prop: 'bom_version', label: 'BOM版本', minWidth: '90'},
|
||||
{prop: 'work_order_code', label: '工单号', minWidth: '120'},
|
||||
{prop: 'raw_material_cost', label: '原料成本', minWidth: '100'},
|
||||
{prop: 'manual_cost', label: '人工成本', minWidth: '100'},
|
||||
{prop: 'unit_total_cost', label: '单件总本', minWidth: '100'},
|
||||
{prop: 'manual_cost', label: '单件成本', minWidth: '100'}, // 原人工成本,现为单件成本
|
||||
{prop: 'unit_total_cost', label: '总成本', minWidth: '100'}, // 原单件总本,现为总成本
|
||||
{prop: 'production_manager', label: '生产负责人', minWidth: '100'},
|
||||
{prop: 'production_start_time', label: '生产开始', minWidth: '160'},
|
||||
{prop: 'production_end_time', label: '生产结束', minWidth: '160'},
|
||||
@ -731,6 +731,15 @@ const form = reactive({
|
||||
production_manager: '', production_time_range: [] as string[], arrival_photo: [] as string[], quality_report_link: [] as string[], detail_link: ''
|
||||
})
|
||||
|
||||
// === 新增:监听计算总成本 ===
|
||||
watch([() => form.in_quantity, () => form.manual_cost], ([qty, manual_cost]) => {
|
||||
if (manual_cost !== undefined && manual_cost !== null) {
|
||||
form.unit_total_cost = Number((qty * manual_cost).toFixed(2))
|
||||
} else {
|
||||
form.unit_total_cost = undefined
|
||||
}
|
||||
})
|
||||
|
||||
// ------------------------------------
|
||||
// BOM Search Logic
|
||||
// ------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user