init project
This commit is contained in:
225
mes/qd/src/views/wms/pa/itempoint/index.vue
Normal file
225
mes/qd/src/views/wms/pa/itempoint/index.vue
Normal file
@@ -0,0 +1,225 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="项点类别">
|
||||
<el-select
|
||||
v-model="query.item_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 230px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QC_INSPECTION_ITEM_TYPE"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="项点">
|
||||
<el-input
|
||||
v-model="query.item_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输项点编码或名称"
|
||||
style="width: 230px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<rrOperation />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0 || crud.status.view" :title="crud.status.title" width="800px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="90px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项点编码:" prop="item_code">
|
||||
<el-input v-model="form.item_code" :disabled="true" placeholder="自动生成" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项点名称:" prop="item_name">
|
||||
<el-input v-model="form.item_name" style="width: 250px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项点类别:" prop="item_type">
|
||||
<el-select
|
||||
v-model="form.item_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 250px;"
|
||||
:disabled="crud.status.view > 0"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QC_INSPECTION_ITEM_TYPE"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单项分值:" prop="single_score">
|
||||
<el-input-number
|
||||
size="mini"
|
||||
v-model="form.single_score"
|
||||
:controls="false"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
:disabled="crud.status.view > 0"
|
||||
style="width: 250px"
|
||||
/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工时定额:" prop="time_quota">
|
||||
<el-input v-model="form.time_quota" style="width: 250px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位:" prop="unit_name">
|
||||
<el-input v-model="form.unit_name" style="width: 250px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="积分标准:">
|
||||
<el-input v-model="form.describes" type="textarea" :rows="2" style="width: 630px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注:">
|
||||
<el-input v-model="form.remark" type="textarea" :rows="2" style="width: 630px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" :disabled="crud.status.view > 0" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="item_id" label="项点标识" />
|
||||
<el-table-column prop="item_code" label="项点编码" min-width="120" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.item_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="item_name" label="项点名称" />
|
||||
<el-table-column prop="unit_name" label="单位" />
|
||||
<el-table-column prop="item_type_name" label="项点类别" />
|
||||
<el-table-column prop="single_score" label="单项分值" />
|
||||
<el-table-column prop="time_quota" label="工时定额" />
|
||||
<el-table-column prop="describes" label="积分标准" min-width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudItempoint from '@/api/wms/pa/itempoint'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = { item_id: null, item_code: null, item_name: null, item_type: null, single_score: null, time_quota: null, unit_name: null, describes: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null }
|
||||
export default {
|
||||
name: 'Itempoint',
|
||||
dicts: ['QC_INSPECTION_ITEM_TYPE'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '考核项点维护',
|
||||
url: 'api/itempoint',
|
||||
idField: 'item_id',
|
||||
sort: 'item_id,desc',
|
||||
crudMethod: { ...crudItempoint },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
item_name: [
|
||||
{ required: true, message: '项点名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
item_type: [
|
||||
{ required: true, message: '项点类别不能为空', trigger: 'blur' }
|
||||
],
|
||||
single_score: [
|
||||
{ required: true, message: '单项分值不能为空', trigger: 'blur' }
|
||||
]
|
||||
}}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
268
mes/qd/src/views/wms/pa/performance/AddDialog.vue
Normal file
268
mes/qd/src/views/wms/pa/performance/AddDialog.vue
Normal file
@@ -0,0 +1,268 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="crud.status.title"
|
||||
append-to-body
|
||||
fullscreen
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||
>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form
|
||||
:inline="true"
|
||||
:model="form"
|
||||
ref="form"
|
||||
:rules="rules"
|
||||
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
|
||||
class="demo-form-inline"
|
||||
size="mini"
|
||||
label-width="auto"
|
||||
label-position="right"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item prop="assessor_date">
|
||||
<label slot="label">日 期:</label>
|
||||
<el-date-picker v-model="form.assessor_date" type="date" placeholder="选择日期" style="width: 210px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="明细项数" prop="num">
|
||||
<el-input v-model="form.num" :disabled="true" style="width: 210px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总分" prop="total_score">
|
||||
<label slot="label">总 分:</label>
|
||||
<el-input v-model="form.total_score" :disabled="true" placeholder="自动计算" style="width: 210px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="total_score">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model="form.remark" style="width: 210px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<div class="crud-opts2" style="margin-bottom: 5px;">
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
:disabled="crud.status.view > 0"
|
||||
@click="choosePoint"
|
||||
>
|
||||
选择项点
|
||||
</el-button>
|
||||
</span>
|
||||
</div>
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form.tableData"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column prop="item_code" label="项点编码" align="center" />
|
||||
<el-table-column prop="item_name" label="项点名称" align="center" />
|
||||
<el-table-column prop="unit_name" label="单位" align="center" />
|
||||
<el-table-column prop="item_type" label="项点分类" align="center" :formatter="formatItemTypeName" />
|
||||
<el-table-column prop="single_score" label="单项分值" align="center" />
|
||||
<el-table-column prop="workload" label="工作量" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
size="mini"
|
||||
v-model="form.tableData[scope.$index].workload"
|
||||
:controls="false"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
:disabled="crud.status.view > 0"
|
||||
@change="change"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="time_quota" label="工时定额" align="center" />
|
||||
<el-table-column prop="describes" label="积分标准" align="center" />
|
||||
<el-table-column v-permission="['admin','productbom:edit','productbom:del']" label="操作" width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="crud.status.view > 0"
|
||||
@click.native.prevent="delOne(scope.$index,form.tableData)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<ItemPointDialog :dialog-show.sync="addPointShow" :open-param="openParam" @tableChanged="tableChanged" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const defaultForm = {
|
||||
assessor_date: null,
|
||||
num: null,
|
||||
total_score: 0,
|
||||
tableData: []
|
||||
}
|
||||
import ItemPointDialog from '@/views/wms/pa/performance/ItemPointDialog'
|
||||
import crudPerformancemst from '@/api/wms/pa/performancemst'
|
||||
import CRUD, { form, crud } from '@crud/crud'
|
||||
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { ItemPointDialog },
|
||||
mixins: [form(defaultForm), crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
addPointShow: false,
|
||||
ItemTypeList: [],
|
||||
rules: {
|
||||
assessor_date: [
|
||||
{ required: true, message: '日期不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
// this.form = this.openParam.optRow
|
||||
}
|
||||
},
|
||||
addPointShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.addPointShow = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudPerformancemst.getItemType().then(res => {
|
||||
this.ItemTypeList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.afterToEdit]() {
|
||||
crudPerformancemst.getDtl({ 'performance_id': this.form.performance_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
this.form.num = res.length
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.afterToView]() {
|
||||
crudPerformancemst.getDtl({ 'performance_id': this.form.performance_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
this.form.num = res.length
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.beforeSubmit](v) {
|
||||
if (this.form.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条项点明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
},
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
choosePoint() {
|
||||
this.addPointShow = true
|
||||
},
|
||||
tableChanged(rows) {
|
||||
rows.forEach((item) => {
|
||||
let same_mater = true
|
||||
this.form.tableData.forEach((row) => {
|
||||
// 对新增的行进行校验不能存在相同项点
|
||||
if (row.item_id === item.item_id) {
|
||||
same_mater = false
|
||||
return this.crud.notify('此项点已经添加', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
}
|
||||
})
|
||||
if (same_mater) {
|
||||
this.form.tableData.splice(-1, 0, item)
|
||||
}
|
||||
})
|
||||
this.form.num = this.form.tableData.length
|
||||
},
|
||||
delOne(index, rows) {
|
||||
// 将总分值减去每行的总分
|
||||
var num = parseFloat(this.form.total_score) - parseFloat(rows[index].single_score) * parseFloat(rows[index].workload)
|
||||
this.form.total_score = num.toFixed(2)
|
||||
rows.splice(index, 1)
|
||||
this.form.num = this.form.tableData.length
|
||||
},
|
||||
change(val, row, index) {
|
||||
// 将每行的算出来的分值相加
|
||||
let all = 0
|
||||
this.form.tableData.forEach((item) => {
|
||||
all = all + parseFloat(item.workload) * parseFloat(item.single_score)
|
||||
})
|
||||
this.form.total_score = all.toFixed(2)
|
||||
},
|
||||
formatItemTypeName(row, column) {
|
||||
for (const item of this.ItemTypeList) {
|
||||
if (item.code === row.item_type) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.crud-opts2 {
|
||||
padding: 4px 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
150
mes/qd/src/views/wms/pa/performance/ItemPointDialog.vue
Normal file
150
mes/qd/src/views/wms/pa/performance/ItemPointDialog.vue
Normal file
@@ -0,0 +1,150 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="项点选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input
|
||||
v-model="query.item_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入编码、名称"
|
||||
style="width: 250px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<el-select
|
||||
v-model="query.item_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择项点类别"
|
||||
class="filter-item"
|
||||
style="width: 230px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QC_INSPECTION_ITEM_TYPE"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<rrOperation />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation />
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="ItemPointTable"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column show-overflow-tooltip prop="item_code" label="项点编码" />
|
||||
<el-table-column show-overflow-tooltip prop="item_name" label="项点名称" />
|
||||
<el-table-column show-overflow-tooltip prop="unit_name" label="单位" />
|
||||
<el-table-column show-overflow-tooltip prop="item_type_name" label="项点分类" />
|
||||
<el-table-column show-overflow-tooltip prop="single_score" label="单项分值" />
|
||||
<el-table-column show-overflow-tooltip prop="time_quota" label="工时定额" />
|
||||
<el-table-column show-overflow-tooltip prop="describes" label="积分标准" />
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="备注" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="sure">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import crudItempoint from '@/api/wms/pa/itempoint'
|
||||
import CRUD, { presenter, header } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
export default {
|
||||
name: 'ItemPointDialog',
|
||||
dicts: ['QC_INSPECTION_ITEM_TYPE'],
|
||||
components: { rrOperation, crudOperation, udOperation, pagination },
|
||||
mixins: [presenter(), header()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
url: 'api/itempoint',
|
||||
idField: 'item_id',
|
||||
sort: 'item_id,desc',
|
||||
crudMethod: { ... crudItempoint },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: false
|
||||
}
|
||||
})
|
||||
},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
open() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
sure() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
// 将当前表单中的数据传回父页面
|
||||
this.rows = this.$refs.ItemPointTable.selection
|
||||
this.$emit('tableChanged', this.rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
125
mes/qd/src/views/wms/pa/performance/index.vue
Normal file
125
mes/qd/src/views/wms/pa/performance/index.vue
Normal file
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="人员">
|
||||
<el-input
|
||||
v-model="query.assessor_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输人员姓名"
|
||||
style="width: 230px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="日期">
|
||||
<el-date-picker v-model="query.assessor_date" type="date" placeholder="选择日期" style="width: 230px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="performance_id" label="绩效考核单据标识" />
|
||||
<el-table-column v-if="false" prop="performance_code" label="绩效考核单据编码" />
|
||||
<el-table-column prop="assessor_name" label="考核人">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.assessor_name }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="assessor_date" label="考核日期" />
|
||||
<el-table-column prop="total_score" label="总分值" :formatter="crud.formatNum2"/>
|
||||
<el-table-column prop="status" label="状态" :formatter="formatName" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-edit="scope.row.status === '30'"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPerformancemst from '@/api/wms/pa/performancemst'
|
||||
import AddDialog from '@/views/wms/pa/performance/AddDialog'
|
||||
import CRUD, { presenter, header, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
export default {
|
||||
name: 'Performancemst',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, AddDialog },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '工作量汇报',
|
||||
url: 'api/performancemst',
|
||||
idField: 'performance_id',
|
||||
sort: 'performance_id,desc',
|
||||
crudMethod: { ...crudPerformancemst },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
StatusList: [],
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
}}
|
||||
},
|
||||
created() {
|
||||
crudPerformancemst.getStatus().then(res => {
|
||||
this.StatusList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
formatName(row, column) {
|
||||
for (const item of this.StatusList) {
|
||||
if (item.code === row.status) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
269
mes/qd/src/views/wms/pa/workloadreview/AddDialog.vue
Normal file
269
mes/qd/src/views/wms/pa/workloadreview/AddDialog.vue
Normal file
@@ -0,0 +1,269 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="crud.status.title"
|
||||
append-to-body
|
||||
fullscreen
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||
>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form
|
||||
:inline="true"
|
||||
:model="form"
|
||||
ref="form"
|
||||
:rules="rules"
|
||||
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
|
||||
class="demo-form-inline"
|
||||
size="mini"
|
||||
label-width="auto"
|
||||
label-position="right"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item prop="assessor_date">
|
||||
<label slot="label">日 期:</label>
|
||||
<el-date-picker v-model="form.assessor_date" type="date" placeholder="选择日期" style="width: 210px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="明细项数" prop="num">
|
||||
<el-input v-model="form.num" :disabled="true" style="width: 210px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总分" prop="total_score">
|
||||
<label slot="label">总 分:</label>
|
||||
<el-input v-model="form.total_score" :disabled="true" placeholder="自动计算" style="width: 210px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="total_score">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model="form.remark" style="width: 210px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<div class="crud-opts2" style="margin-bottom: 5px;">
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
:disabled="crud.status.view > 0"
|
||||
@click="choosePoint"
|
||||
>
|
||||
选择项点
|
||||
</el-button>
|
||||
</span>
|
||||
</div>
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form.tableData"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column prop="item_code" label="项点编码" align="center" />
|
||||
<el-table-column prop="item_name" label="项点名称" align="center" />
|
||||
<el-table-column prop="unit_name" label="单位" align="center" />
|
||||
<el-table-column prop="item_type" label="项点分类" align="center" :formatter="formatItemTypeName" />
|
||||
<el-table-column prop="single_score" label="单项分值" align="center" />
|
||||
<el-table-column prop="workload" label="工作量" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="form.tableData[scope.$index].workload" size="mini" class="edit-input" :disabled="crud.status.view > 0" @input="change($event,form.tableData[scope.$index],scope.$index)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="time_quota" label="工时定额" align="center" />
|
||||
<el-table-column prop="describes" label="积分标准" align="center" />
|
||||
<el-table-column v-permission="['admin','productbom:edit','productbom:del']" label="操作" width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="crud.status.view > 0"
|
||||
@click.native.prevent="delOne(scope.$index,form.tableData)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<ItemPointDialog :dialog-show.sync="addPointShow" :open-param="openParam" @tableChanged="tableChanged" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const defaultForm = {
|
||||
assessor_date: null,
|
||||
num: null,
|
||||
total_score: 0,
|
||||
tableData: []
|
||||
}
|
||||
import ItemPointDialog from '@/views/wms/pa/workloadreview/ItemPointDialog'
|
||||
import crudPerformancemst from '@/api/wms/pa/performancemst'
|
||||
import CRUD, { form, crud } from '@crud/crud'
|
||||
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { ItemPointDialog },
|
||||
mixins: [form(defaultForm), crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
addPointShow: false,
|
||||
ItemTypeList: [],
|
||||
rules: {
|
||||
assessor_date: [
|
||||
{ required: true, message: '日期不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
// this.form = this.openParam.optRow
|
||||
}
|
||||
},
|
||||
addPointShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.addPointShow = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudPerformancemst.getItemType().then(res => {
|
||||
this.ItemTypeList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.afterToEdit]() {
|
||||
crudPerformancemst.getDtl({ 'performance_id': this.form.performance_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
this.form.num = res.length
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.afterToView]() {
|
||||
crudPerformancemst.getDtl({ 'performance_id': this.form.performance_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
this.form.num = res.length
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
if (this.form.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条项点明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
},
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
choosePoint() {
|
||||
this.addPointShow = true
|
||||
},
|
||||
tableChanged(rows) {
|
||||
rows.forEach((item) => {
|
||||
let same_mater = true
|
||||
this.form.tableData.forEach((row) => {
|
||||
// 对新增的行进行校验不能存在相同项点
|
||||
if (row.item_id === item.item_id) {
|
||||
same_mater = false
|
||||
return this.crud.notify('此项点已经添加', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
}
|
||||
})
|
||||
if (same_mater) {
|
||||
this.form.tableData.splice(-1, 0, item)
|
||||
}
|
||||
})
|
||||
this.form.num = this.form.tableData.length
|
||||
},
|
||||
delOne(index, rows) {
|
||||
// 将总分值减去每行的总分
|
||||
var num = parseFloat(this.form.total_score) - parseFloat(rows[index].single_score) * parseFloat(rows[index].workload)
|
||||
this.form.total_score = num.toFixed(2)
|
||||
rows.splice(index, 1)
|
||||
this.form.num = this.form.tableData.length
|
||||
},
|
||||
change(val, row, index) {
|
||||
// 对工作量进行校验
|
||||
const numReg = /^[0-9]*$/
|
||||
const numRe = new RegExp(numReg)
|
||||
if (!numRe.test(val)) {
|
||||
this.crud.notify('请输入不小于0的数字', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
row.workload = 0
|
||||
} else {
|
||||
if (row.workload === '') {
|
||||
row.workload = 0
|
||||
}
|
||||
}
|
||||
this.form.tableData.splice(index, 1, row)
|
||||
// 将每行的算出来的分值相加
|
||||
let all = 0
|
||||
this.form.tableData.forEach((item) => {
|
||||
all = all + parseFloat(item.workload) * parseFloat(item.single_score)
|
||||
})
|
||||
this.form.total_score = all.toFixed(2)
|
||||
},
|
||||
formatItemTypeName(row, column) {
|
||||
for (const item of this.ItemTypeList) {
|
||||
if (item.code === row.item_type) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.crud-opts2 {
|
||||
padding: 4px 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
}
|
||||
</style>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
150
mes/qd/src/views/wms/pa/workloadreview/ItemPointDialog.vue
Normal file
150
mes/qd/src/views/wms/pa/workloadreview/ItemPointDialog.vue
Normal file
@@ -0,0 +1,150 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="项点选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input
|
||||
v-model="query.item_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入编码、名称"
|
||||
style="width: 250px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<el-select
|
||||
v-model="query.item_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择项点类别"
|
||||
class="filter-item"
|
||||
style="width: 230px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QC_INSPECTION_ITEM_TYPE"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<rrOperation />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation />
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="ItemPointTable"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column show-overflow-tooltip prop="item_code" label="项点编码" />
|
||||
<el-table-column show-overflow-tooltip prop="item_name" label="项点名称" />
|
||||
<el-table-column show-overflow-tooltip prop="unit_name" label="单位" />
|
||||
<el-table-column show-overflow-tooltip prop="item_type_name" label="项点分类" />
|
||||
<el-table-column show-overflow-tooltip prop="single_score" label="单项分值" />
|
||||
<el-table-column show-overflow-tooltip prop="time_quota" label="工时定额" />
|
||||
<el-table-column show-overflow-tooltip prop="describes" label="积分标准" />
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="备注" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="sure">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import crudItempoint from '@/api/wms/pa/itempoint'
|
||||
import CRUD, { presenter, header } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
export default {
|
||||
name: 'ItemPointDialog',
|
||||
dicts: ['QC_INSPECTION_ITEM_TYPE'],
|
||||
components: { rrOperation, crudOperation, udOperation, pagination },
|
||||
mixins: [presenter(), header()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
url: 'api/itempoint',
|
||||
idField: 'item_id',
|
||||
sort: 'item_id,desc',
|
||||
crudMethod: { ... crudItempoint },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: false
|
||||
}
|
||||
})
|
||||
},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
open() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
sure() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
// 将当前表单中的数据传回父页面
|
||||
this.rows = this.$refs.ItemPointTable.selection
|
||||
this.$emit('tableChanged', this.rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
147
mes/qd/src/views/wms/pa/workloadreview/index.vue
Normal file
147
mes/qd/src/views/wms/pa/workloadreview/index.vue
Normal file
@@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="人员">
|
||||
<el-input
|
||||
v-model="query.assessor_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输人员姓名"
|
||||
style="width: 230px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="日期">
|
||||
<el-date-picker v-model="query.assessor_date" type="date" placeholder="选择日期" style="width: 230px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="audit"
|
||||
>
|
||||
审核
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="performance_id" label="绩效考核单据标识" />
|
||||
<el-table-column v-if="false" prop="performance_code" label="绩效考核单据编码" />
|
||||
<el-table-column prop="assessor_name" label="考核人">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.assessor_name }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="assessor_date" label="考核日期" />
|
||||
<el-table-column prop="total_score" label="总分值" :formatter="crud.formatNum2"/>
|
||||
<el-table-column prop="status" label="状态" :formatter="formatName" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-edit="scope.row.status === '30'"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPerformancemst from '@/api/wms/pa/performancemst'
|
||||
import AddDialog from '@/views/wms/pa/workloadreview/AddDialog'
|
||||
import CRUD, { presenter, header, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
export default {
|
||||
name: 'Performancemst',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, AddDialog },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '工作量汇报',
|
||||
url: 'api/performancemst',
|
||||
idField: 'performance_id',
|
||||
sort: 'performance_id,desc',
|
||||
crudMethod: { ...crudPerformancemst },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
StatusList: [],
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
}}
|
||||
},
|
||||
created() {
|
||||
crudPerformancemst.getStatus().then(res => {
|
||||
this.StatusList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
formatName(row, column) {
|
||||
for (const item of this.StatusList) {
|
||||
if (item.code === row.status) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
audit() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (_selectData.length > 1 || _selectData.length === 0) {
|
||||
this.crud.notify('请选择一条数据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
crudPerformancemst.audit(_selectData[0]).then(res => {
|
||||
this.crud.toQuery()
|
||||
return this.crud.notify('审核完成', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
116
mes/qd/src/views/wms/pa/workloadstat/index.vue
Normal file
116
mes/qd/src/views/wms/pa/workloadstat/index.vue
Normal file
@@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="日期">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="人员">
|
||||
<el-input
|
||||
v-model="query.assessor_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输人员姓名"
|
||||
style="width: 230px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
:show-summary="true"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="100" align="center" />
|
||||
<template v-for="(col,index) in cols">
|
||||
<el-table-column v-if="col" :prop="col.prop" :label="col.label" />
|
||||
</template>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPerformancemst from '@/api/wms/pa/performancemst'
|
||||
import CRUD, { presenter, header, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
|
||||
export default {
|
||||
name: 'Performancemst',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, DateRangePicker },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '工作量汇报',
|
||||
url: 'api/performancemst/workloadstat',
|
||||
idField: 'performance_id',
|
||||
sort: 'performance_id,desc',
|
||||
crudMethod: { ...crudPerformancemst },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cols: [],
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
}}
|
||||
},
|
||||
created() {
|
||||
crudPerformancemst.getHeader().then(res => {
|
||||
this.cols = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user