更新:单价审核后,写回报表
This commit is contained in:
parent
3d8d48c06b
commit
9a30368b74
|
@ -81,12 +81,12 @@ export function cancelPrice(priceId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核单价
|
// 审核单价
|
||||||
export function verifyPrice(priceIds, pass) {
|
export function verifyPrice(priceList, pass) {
|
||||||
return request({
|
return request({
|
||||||
url: `/yh/price/verify`,
|
url: `/yh/price/verify`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: {
|
data: {
|
||||||
priceIds,
|
priceList,
|
||||||
pass
|
pass
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -16,7 +16,10 @@
|
||||||
:label="label(item)"
|
:label="label(item)"
|
||||||
:value="item.priceId"
|
:value="item.priceId"
|
||||||
>
|
>
|
||||||
<span style="float: left">{{ item.name | dv}}</span>
|
<span style="float: left">
|
||||||
|
{{ item.name | dv}}
|
||||||
|
<dict-tag :value="item.status" :options="dict.type.price_status" size="mini"/>
|
||||||
|
</span>
|
||||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.code | dv}}</span>
|
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.code | dv}}</span>
|
||||||
</el-option>
|
</el-option>
|
||||||
<el-option v-if="options.length === 0 && !loading" style="height: 0px" disabled label="" :value="null"/>
|
<el-option v-if="options.length === 0 && !loading" style="height: 0px" disabled label="" :value="null"/>
|
||||||
|
@ -30,6 +33,7 @@
|
||||||
import { listPrice } from '@/api/yh/price'
|
import { listPrice } from '@/api/yh/price'
|
||||||
export default {
|
export default {
|
||||||
name: 'PriceSelect',
|
name: 'PriceSelect',
|
||||||
|
dicts: ['price_status'],
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -43,6 +47,10 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
status: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
query: {
|
query: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({}),
|
default: () => ({}),
|
||||||
|
@ -81,13 +89,15 @@ export default {
|
||||||
value(nv, ov ) {
|
value(nv, ov ) {
|
||||||
let obj = this.options.find(item => item.priceId == nv);
|
let obj = this.options.find(item => item.priceId == nv);
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
this.options.push({priceId: nv, name: this.name, code: this.code});
|
this.options.push({priceId: nv, name: this.name, code: this.code, status: this.status});
|
||||||
|
this.total ++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.value != null) {
|
if (this.value != null) {
|
||||||
this.options = [{priceId: this.value, name: this.name, code: this.code}]
|
this.options = [{priceId: this.value, name: this.name, code: this.code, status: this.status}]
|
||||||
|
this.total = 1;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="dict-tag">
|
||||||
<template v-for="(item, index) in options">
|
<template v-for="(item, index) in options">
|
||||||
<template v-if="values.includes(item.value)">
|
<template v-if="values.includes(item.value)">
|
||||||
<span
|
<span
|
||||||
|
@ -91,4 +91,7 @@ export default {
|
||||||
.el-tag + .el-tag {
|
.el-tag + .el-tag {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
.dict-tag {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// 视图
|
// 视图
|
||||||
import {getLastDate, getLastDateTimeEnd, getLastDateTimeStart, getLastMonth, getLastMonthTimeEnd} from "@/utils/index";
|
import { getLastDate, getLastDateTimeEnd, getLastDateTimeStart, getLastMonth, getLastMonthTimeEnd } from "@/utils/index";
|
||||||
|
|
||||||
export const views = {
|
export const views = {
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,10 @@ export const PriceStatus = {
|
||||||
// 允许删除
|
// 允许删除
|
||||||
canDel(status) {
|
canDel(status) {
|
||||||
return [this.WAIT_SUBMIT, this.REJECT].includes(status);
|
return [this.WAIT_SUBMIT, this.REJECT].includes(status);
|
||||||
|
},
|
||||||
|
// 允许使用
|
||||||
|
canUse() {
|
||||||
|
return [this.WAIT_VERIFY, this.PASS];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,14 @@
|
||||||
<el-descriptions-item label="备注" span="3">{{detail.remark | dv}}</el-descriptions-item>
|
<el-descriptions-item label="备注" span="3">{{detail.remark | dv}}</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<el-form :model="detail" ref="form" label-width="4em" style="margin-top: 1em;">
|
||||||
|
<el-form-item label="单价" prop="price">
|
||||||
|
<el-input v-model="detail.price" placeholder="请输入单价" type="number">
|
||||||
|
<template slot="append">元</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button type="success" plain icon="el-icon-check" @click="submitVerify(true)" :loading="submitLoading">通过</el-button>
|
<el-button type="success" plain icon="el-icon-check" @click="submitVerify(true)" :loading="submitLoading">通过</el-button>
|
||||||
<el-button type="danger" plain icon="el-icon-close" @click="submitVerify(false)" :loading="submitLoading">驳回</el-button>
|
<el-button type="danger" plain icon="el-icon-close" @click="submitVerify(false)" :loading="submitLoading">驳回</el-button>
|
||||||
|
@ -77,20 +85,22 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
formatFraction,
|
formatFraction,
|
||||||
submitVerify(pass) {
|
submitVerify(pass) {
|
||||||
this.$confirm(`确定要${pass ? '通过' : '驳回'}吗?`, '提示', {
|
this.$refs.form.validate().then(() => {
|
||||||
confirmButtonText: '确定',
|
this.$confirm(`确定要${pass ? '通过' : '驳回'}吗?`, '提示', {
|
||||||
cancelButtonText: '取消',
|
confirmButtonText: '确定',
|
||||||
type: 'warning'
|
cancelButtonText: '取消',
|
||||||
}).then(() => {
|
type: 'warning'
|
||||||
this.submitLoading = true;
|
}).then(() => {
|
||||||
verifyPrice([this.priceId], pass).then(res => {
|
this.submitLoading = true;
|
||||||
if (res.code === 200) {
|
verifyPrice([{priceId: this.priceId, price: this.detail.price}], pass).then(res => {
|
||||||
this.$message.success(pass ? '通过成功' : '驳回成功');
|
if (res.code === 200) {
|
||||||
this.show = false;
|
this.$message.success(pass ? '通过成功' : '驳回成功');
|
||||||
this.$emit('success');
|
this.show = false;
|
||||||
}
|
this.$emit('success');
|
||||||
}).finally(() => {
|
}
|
||||||
this.submitLoading = false;
|
}).finally(() => {
|
||||||
|
this.submitLoading = false;
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
@ -482,13 +482,7 @@ export default {
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
deptId: [
|
deptId: [
|
||||||
{ required: true, message: "部门ID不能为空", trigger: "blur" }
|
{ required: true, message: "部门不能为空", trigger: "blur" }
|
||||||
],
|
|
||||||
status: [
|
|
||||||
{ required: true, message: "状态不能为空", trigger: "change" }
|
|
||||||
],
|
|
||||||
price: [
|
|
||||||
{ required: true, message: "单价不能为空", trigger: "blur" }
|
|
||||||
],
|
],
|
||||||
unit: [
|
unit: [
|
||||||
{ required: true, message: "单位不能为空", trigger: "blur" }
|
{ required: true, message: "单位不能为空", trigger: "blur" }
|
||||||
|
@ -498,6 +492,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
currentRow: null, // 新增:当前选中行
|
currentRow: null, // 新增:当前选中行
|
||||||
|
rows: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -516,8 +511,14 @@ export default {
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
verifyPrice(this.ids, pass).then(res => {
|
let data = this.rows.map(item => ({
|
||||||
this.$message.success(pass ? '通过成功' : '驳回成功');
|
priceId: item.priceId,
|
||||||
|
price: item.price
|
||||||
|
}));
|
||||||
|
verifyPrice(data, pass).then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message.success(pass ? `通过成功${res.data}条数据` : `驳回成功${res.data}条数据`);
|
||||||
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
})
|
})
|
||||||
|
@ -596,6 +597,7 @@ export default {
|
||||||
this.ids = selection.map(item => item.priceId)
|
this.ids = selection.map(item => item.priceId)
|
||||||
this.single = selection.length!==1
|
this.single = selection.length!==1
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
|
this.rows = selection;
|
||||||
// 更新当前选中行
|
// 更新当前选中行
|
||||||
this.currentRow = selection.length === 1 ? selection[0] : null;
|
this.currentRow = selection.length === 1 ? selection[0] : null;
|
||||||
},
|
},
|
||||||
|
|
|
@ -39,8 +39,10 @@
|
||||||
v-model="d.row.priceId"
|
v-model="d.row.priceId"
|
||||||
:name="d.row.priceName"
|
:name="d.row.priceName"
|
||||||
:code="d.row.priceCode"
|
:code="d.row.priceCode"
|
||||||
|
:status="d.row.priceStatus"
|
||||||
:query="priceQuery"
|
:query="priceQuery"
|
||||||
@change="(val) => handlePriceChange(d.row, val)"
|
@change="(val) => handlePriceChange(d.row, val)"
|
||||||
|
style="width: 100%;"
|
||||||
/>
|
/>
|
||||||
</table-form-col>
|
</table-form-col>
|
||||||
<table-form-col label="成品" prop-prefix="productList" prop="isEnd" :rules="rules.productList.isEnd" required width="60">
|
<table-form-col label="成品" prop-prefix="productList" prop="isEnd" :rules="rules.productList.isEnd" required width="60">
|
||||||
|
@ -50,12 +52,12 @@
|
||||||
<el-input-number slot-scope="d" v-model="d.row.defectNum" placeholder="请输入数量" :min="0" :precision="0" controls-position="right" style="width: 100%"/>
|
<el-input-number slot-scope="d" v-model="d.row.defectNum" placeholder="请输入数量" :min="0" :precision="0" controls-position="right" style="width: 100%"/>
|
||||||
</table-form-col> -->
|
</table-form-col> -->
|
||||||
<table-form-col label="表面处理" prop-prefix="productList" prop="surface" :rules="rules.productList.surface" header-icon="el-icon-edit" @click-header="handleBatchEdit('surface')">
|
<table-form-col label="表面处理" prop-prefix="productList" prop="surface" :rules="rules.productList.surface" header-icon="el-icon-edit" @click-header="handleBatchEdit('surface')">
|
||||||
<el-select slot-scope="d" v-model="d.row.surface" placeholder="请选择表面处理" filterable clearable allow-create>
|
<el-select slot-scope="d" v-model="d.row.surface" placeholder="请选择表面处理" filterable clearable allow-create style="width: 100%;">
|
||||||
<el-option v-for="item in dict.type.surface" :key="item.value" :label="item.label" :value="item.value"/>
|
<el-option v-for="item in dict.type.surface" :key="item.value" :label="item.label" :value="item.value"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</table-form-col>
|
</table-form-col>
|
||||||
<table-form-col label="颜色" prop-prefix="productList" prop="color" :rules="rules.productList.color" header-icon="el-icon-edit" @click-header="handleBatchEdit('color')">
|
<table-form-col label="颜色" prop-prefix="productList" prop="color" :rules="rules.productList.color" header-icon="el-icon-edit" @click-header="handleBatchEdit('color')">
|
||||||
<el-select slot-scope="d" v-model="d.row.color" placeholder="请选择颜色" filterable clearable allow-create>
|
<el-select slot-scope="d" v-model="d.row.color" placeholder="请选择颜色" filterable clearable allow-create style="width: 100%;">
|
||||||
<el-option v-for="item in dict.type.color_code" :key="item.value" :label="item.label" :value="item.value"/>
|
<el-option v-for="item in dict.type.color_code" :key="item.value" :label="item.label" :value="item.value"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</table-form-col>
|
</table-form-col>
|
||||||
|
@ -198,7 +200,7 @@ export default {
|
||||||
priceQuery() {
|
priceQuery() {
|
||||||
return {
|
return {
|
||||||
deptId: this.form.deptId,
|
deptId: this.form.deptId,
|
||||||
status: PriceStatus.PASS, // 已审核
|
statusList: PriceStatus.canUse(),
|
||||||
disabled: false,
|
disabled: false,
|
||||||
excludePriceIds: this.form.productList.map(item => item.priceId)
|
excludePriceIds: this.form.productList.map(item => item.priceId)
|
||||||
}
|
}
|
||||||
|
@ -228,6 +230,7 @@ export default {
|
||||||
row.priceQuantityNumerator = val.quantityNumerator;
|
row.priceQuantityNumerator = val.quantityNumerator;
|
||||||
row.priceQuantityDenominator = val.quantityDenominator;
|
row.priceQuantityDenominator = val.quantityDenominator;
|
||||||
row.priceCode = val.code;
|
row.priceCode = val.code;
|
||||||
|
row.priceStatus = val.status;
|
||||||
},
|
},
|
||||||
// 当用户数量发生变化时,自动汇总良品
|
// 当用户数量发生变化时,自动汇总良品
|
||||||
handleChangeUserNum(row) {
|
handleChangeUserNum(row) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container" v-loading="loading">
|
<div class="app-container" v-loading="loading">
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :md="showVerify ? 19 : 24">
|
<el-col :lg="showVerify ? 18 : 24">
|
||||||
<el-card header="基本信息" class="card-box">
|
<el-card header="基本信息" class="card-box">
|
||||||
<el-descriptions :column="4">
|
<el-descriptions :column="4">
|
||||||
<el-descriptions-item label="报表编号">{{detail.reportId | dv}}</el-descriptions-item>
|
<el-descriptions-item label="报表编号">{{detail.reportId | dv}}</el-descriptions-item>
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
}"/>
|
}"/>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="5" v-if="showVerify">
|
<el-col :lg="6" v-if="showVerify">
|
||||||
<el-card header="审核">
|
<el-card header="审核">
|
||||||
<el-form :model="detail">
|
<el-form :model="detail">
|
||||||
<el-form-item label="审核意见" prop="verifyRemark">
|
<el-form-item label="审核意见" prop="verifyRemark">
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
size="mini"
|
size="mini"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" align="center" v-if="listConfig.showSelection"/>
|
<el-table-column type="selection" width="55" align="center" v-if="listConfig.showSelection"/>
|
||||||
<el-table-column type="expand" width="55" align="left" fixed="left">
|
<el-table-column type="expand" width="20" align="left" fixed="left">
|
||||||
<template slot-scope="d">
|
<template slot-scope="d">
|
||||||
<div class="expand-container">
|
<div class="expand-container">
|
||||||
<el-descriptions border>
|
<el-descriptions border>
|
||||||
|
@ -119,6 +119,9 @@
|
||||||
<template v-else-if="column.key === 'reportStatus'">
|
<template v-else-if="column.key === 'reportStatus'">
|
||||||
<dict-tag :value="d.row.reportStatus" :options="dict.type.report_status"/>
|
<dict-tag :value="d.row.reportStatus" :options="dict.type.report_status"/>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-else-if="column.key === 'priceStatus'">
|
||||||
|
<dict-tag :value="d.row.priceStatus" :options="dict.type.price_status"/>
|
||||||
|
</template>
|
||||||
<template v-else-if="['totalAmount', 'pricePrice'].includes(column.key)">
|
<template v-else-if="['totalAmount', 'pricePrice'].includes(column.key)">
|
||||||
{{d.row[column.key] | dv}} 元
|
{{d.row[column.key] | dv}} 元
|
||||||
</template>
|
</template>
|
||||||
|
@ -239,7 +242,7 @@ const defaultSort = {
|
||||||
export default {
|
export default {
|
||||||
name: "ReportProd",
|
name: "ReportProd",
|
||||||
mixins: [$showColumns, $listConfig, $showSearch],
|
mixins: [$showColumns, $listConfig, $showSearch],
|
||||||
dicts: ['price_type', 'report_status'],
|
dicts: ['price_type', 'report_status', 'price_status'],
|
||||||
components: {ReportOrderProdDescriptions, ReportUserProdDescriptions, ReportUserProd, SearchFormItem, FormCol, BooleanTag},
|
components: {ReportOrderProdDescriptions, ReportUserProdDescriptions, ReportUserProd, SearchFormItem, FormCol, BooleanTag},
|
||||||
props: {
|
props: {
|
||||||
query: {
|
query: {
|
||||||
|
@ -282,6 +285,7 @@ export default {
|
||||||
{key: 'reportStatus', visible: true, label: '报表状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
{key: 'reportStatus', visible: true, label: '报表状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||||
{key: 'priceDeptName', visible: true, label: '车间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'priceDeptName', visible: true, label: '车间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'priceName', visible: true, label: '工序', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'priceName', visible: true, label: '工序', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
|
{key: 'priceStatus', visible: true, label: '单价状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||||
{key: 'priceSubName', visible: true, label: '子工序', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
{key: 'priceSubName', visible: true, label: '子工序', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||||
{key: 'priceType', visible: false, label: '类型', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'priceType', visible: false, label: '类型', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'isEnd', visible: true, label: '成品', minWidth: null, sortable: true, overflow: false, align: 'center', width: "80"},
|
{key: 'isEnd', visible: true, label: '成品', minWidth: null, sortable: true, overflow: false, align: 'center', width: "80"},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user