project
This commit is contained in:
parent
fcd9576fd9
commit
80796fd241
13
package-lock.json
generated
13
package-lock.json
generated
@ -15117,6 +15117,11 @@
|
||||
"is-plain-obj": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"sortablejs": {
|
||||
"version": "1.10.2",
|
||||
"resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.10.2.tgz",
|
||||
"integrity": "sha512-YkPGufevysvfwn5rfdlGyrGjt7/CRHwvRPogD/lC+TnvcN29jDpCifKP+rBqf+LRldfXSTh+0CGLcSg0VIxq3A=="
|
||||
},
|
||||
"source-list-map": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npm.taobao.org/source-list-map/download/source-list-map-2.0.1.tgz",
|
||||
@ -16828,6 +16833,14 @@
|
||||
"integrity": "sha1-HuO8mhbsv1EYvjNLsV+cRvgvWCU=",
|
||||
"dev": true
|
||||
},
|
||||
"vuedraggable": {
|
||||
"version": "2.24.3",
|
||||
"resolved": "https://registry.npmmirror.com/vuedraggable/-/vuedraggable-2.24.3.tgz",
|
||||
"integrity": "sha512-6/HDXi92GzB+Hcs9fC6PAAozK1RLt1ewPTLjK0anTYguXLAeySDmcnqE8IC0xa7shvSzRjQXq3/+dsZ7ETGF3g==",
|
||||
"requires": {
|
||||
"sortablejs": "1.10.2"
|
||||
}
|
||||
},
|
||||
"vuex": {
|
||||
"version": "3.5.1",
|
||||
"resolved": "https://registry.npm.taobao.org/vuex/download/vuex-3.5.1.tgz",
|
||||
|
@ -33,6 +33,7 @@
|
||||
"vue-cron": "^1.0.9",
|
||||
"vue-i18n": "^8.18.2",
|
||||
"vue-router": "3.0.7",
|
||||
"vuedraggable": "^2.24.3",
|
||||
"vuex": "^3.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -389,6 +389,9 @@ t.supplier.evaluationPeriod = '评估时间段'
|
||||
t.supplier.evaluationType = '评估类型'
|
||||
t.supplier.reminder = '提醒人'
|
||||
t.supplier.title = '标题'
|
||||
t.supplier.projectTypeName = '评估项类型'
|
||||
t.supplier.weight = '权重'
|
||||
t.supplier.projectName = '评估项目'
|
||||
|
||||
t.gage = {}
|
||||
t.gage.name = '名称'
|
||||
|
474
src/views/modules/supplier/components/evaluationTemplate-add.vue
Normal file
474
src/views/modules/supplier/components/evaluationTemplate-add.vue
Normal file
@ -0,0 +1,474 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-06-19 14:59:34
|
||||
* @LastEditTime: 2023-06-27 15:00:33
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div v-if="show">
|
||||
<h1>模板编辑</h1>
|
||||
<div class="addDiv">
|
||||
<div style="width: 300px">
|
||||
<el-steps direction="vertical" :active="activeStep" space="70px">
|
||||
<el-step title="定义"></el-step>
|
||||
<el-step title="项目"></el-step>
|
||||
<el-step title="排序"></el-step>
|
||||
<el-step title="权重&公式"></el-step>
|
||||
<el-step title="完成"></el-step>
|
||||
</el-steps>
|
||||
</div>
|
||||
<div style="width: 80vw">
|
||||
<el-button v-show="visibleList[0] === false && visibleList[4] !== true" style="margin: -20px 0 10px 0" @click="lastStep">上一步</el-button>
|
||||
<div v-if="visibleList[0]" style="width: 60%; border: 1px solid grey; padding: 20px">
|
||||
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px" class="demo-ruleForm">
|
||||
<el-form-item label="编码" prop="code">
|
||||
<el-input v-model="ruleForm.code"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="ruleForm.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="ruleForm.remark"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitForm('ruleForm')">下一步</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div v-if="visibleList[1]">
|
||||
<el-form :inline="true" :model="formInline" class="demo-form-inline" >
|
||||
<el-form-item>
|
||||
<el-input v-model="formInline.title" size="small" placeholder="标题"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="formInline.requirement" size="small" placeholder="要求"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="formInline.projectTypeId" clearable size="small" placeholder="请选择类型">
|
||||
<el-option v-for="(item, index) in typeList" :key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="small" @click="getEvaList">查询</el-button>
|
||||
<el-button type="primary" size="small" @click="saveData">保存</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="5">
|
||||
<el-col :span="18">
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
tooltip-effect="dark"
|
||||
style="width: 80%; min-height: 26vh; overflow-y: auto"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column prop="title" label="标题" width="120" />
|
||||
<el-table-column prop="projectTypeName" label="类型" width="120" />
|
||||
<el-table-column prop="requirement" label="要求" />
|
||||
<el-table-column prop="label" label="标签" />
|
||||
<el-table-column type="selection" label="全选" width="55" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div style="margin-top: -30px">
|
||||
<p style="font-size: 18px">已选</p>
|
||||
<div class="chooseDiv">
|
||||
<div v-for="(item, index) in multipleSelection" :key="index" style="padding: 10px">
|
||||
<span>{{ item.title }}</span>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" icon="el-icon-delete" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div v-if="visibleList[2]">
|
||||
<div style="min-height: 26vh; overflow: auto">
|
||||
<draggable v-model="paramsList" group="projectTypeName" animation="1000" @start="onStart" @end="onEnd1">
|
||||
<transition-group>
|
||||
<!-- <div v-for="item in paramsList" :key="item.id">
|
||||
{{ item.projectTypeName }}
|
||||
</div> -->
|
||||
<div class="typeDiv" v-for="element in paramsList" :key="element.projectTypeId">
|
||||
<div slot="header" class="clearfix">
|
||||
<el-card>
|
||||
<span>{{ element.projectTypeName }}</span>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" @click="unfold(element)">子项</el-button>
|
||||
</el-card>
|
||||
</div>
|
||||
<draggable v-show="element.dragVisible" v-model="element.list" group="title" animation="1000" @start="onStart" @end="onEnd2">
|
||||
<transition-group>
|
||||
<div v-for="item in element.list" :key="item.id" style="margin: 5px 15px; border-bottom: 1px solid grey">
|
||||
<p>{{ item.title }}</p>
|
||||
</div>
|
||||
</transition-group>
|
||||
</draggable>
|
||||
</div>
|
||||
</transition-group>
|
||||
</draggable>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" @click="updateData">更新</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="visibleList[3]">
|
||||
<el-button type="primary" size="small" @click="finishData">完成</el-button>
|
||||
<div>
|
||||
<div v-for="(item, index) in paramsList" :key="index" class="projectDiv">
|
||||
<p style="width: 100px">{{ item.projectTypeName }}</p>
|
||||
<el-input type="number" style="width: 100px" v-model="item.weight" placeholder="权重"></el-input>
|
||||
<div class="smallDiv">
|
||||
<div v-for="(it, keyValue) in item.list" :key="keyValue" class="contentDiv">
|
||||
<p style="border: 1px solid grey; width: 80px; text-align: center">{{ it.title }}</p>
|
||||
<el-input type="number" style="width: 100px" v-model="it.benchmarkScore" placeholder="基准分"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<el-input style="width: 200px; margin-right: 20px" v-model="item.calculationScoreFormula" placeholder="计算得分公式"></el-input>
|
||||
<el-button @click="updateButton">更新</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="visibleList[4]">
|
||||
<el-result icon="success" title="操作成功">
|
||||
<template slot="extra">
|
||||
<el-button type="primary" size="medium" @click="newModel">新模板</el-button>
|
||||
<el-button size="medium" @click="closeModel">关闭</el-button>
|
||||
</template>
|
||||
</el-result>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import draggable from 'vuedraggable'
|
||||
|
||||
export default {
|
||||
components: { draggable },
|
||||
props: {
|
||||
show: Boolean
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
addtURL: "/supplier/qmsEvaluationTemplate",
|
||||
getEvaluationListURL: '/supplier/qmsEvaluationItemList/page',
|
||||
getTypeListURL: '/supplier/qmsProjectType/page',
|
||||
saveDataURL: '/supplier/qmsEvaluationTemplateProjectType/saveAll'
|
||||
},
|
||||
visibleList: [true, false, false, false, false],
|
||||
activeStep: 0,
|
||||
ruleForm: {
|
||||
code: '',
|
||||
name: '',
|
||||
remark: ''
|
||||
},
|
||||
tableData: [],
|
||||
typeList: [],
|
||||
formInline: {
|
||||
page: 1,
|
||||
limit: 100,
|
||||
title: undefined,
|
||||
requirement: undefined,
|
||||
projectTypeId: undefined
|
||||
},
|
||||
multipleSelection: [],
|
||||
paramsList: [],
|
||||
dragVisible: false,
|
||||
unfoldId: '',
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: '请输入code', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.ruleForm = {
|
||||
code: '',
|
||||
name: '',
|
||||
remark: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTypeList()
|
||||
},
|
||||
methods: {
|
||||
closeModel() {
|
||||
this.show = false
|
||||
this.$emit('info', false)
|
||||
},
|
||||
newModel() {
|
||||
this.activeStep = 0
|
||||
// this.visibleList[4] = false
|
||||
// this.visibleList[0] = true
|
||||
this.$set(this.visibleList, 4, false)
|
||||
this.$set(this.visibleList, 0, true)
|
||||
},
|
||||
updateButton() {
|
||||
console.log('啦啦啦', this.paramsList)
|
||||
},
|
||||
finishData() {
|
||||
// 保存数据
|
||||
this.$http["post"](this.urlOptions.saveDataURL, this.paramsList)
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t("prompt.success"),
|
||||
type: "success",
|
||||
duration: 500
|
||||
})
|
||||
this.activeStep = 4
|
||||
// this.visibleList[3] = false
|
||||
// this.visibleList[4] = true
|
||||
this.$set(this.visibleList, 3, false)
|
||||
this.$set(this.visibleList, 4, true)
|
||||
})
|
||||
},
|
||||
lastStep() {
|
||||
console.log('thi', this.activeStep)
|
||||
this.paramsList = []
|
||||
this.activeStep --
|
||||
for (let i = 0; i < this.visibleList.length; i ++) {
|
||||
if (i === this.activeStep) {
|
||||
this.visibleList[i] = true
|
||||
} else {
|
||||
this.visibleList[i] = false
|
||||
}
|
||||
}
|
||||
console.log('wokjkj11', this.visibleList)
|
||||
},
|
||||
updateData() {
|
||||
console.log('更新')
|
||||
this.$set(this.visibleList, 2, false)
|
||||
this.$set(this.visibleList, 3, true)
|
||||
console.log('wokjkj', this.visibleList)
|
||||
},
|
||||
unfold(item) {
|
||||
item.dragVisible = !item.dragVisible
|
||||
this.unfoldId = item.projectTypeId //项目类型id
|
||||
this.paramsList.forEach(it => {
|
||||
if (it.projectTypeId === this.unfoldId) {
|
||||
this.$set(it, 'draggable', true)
|
||||
} else {
|
||||
this.$set(it, 'draggable', false)
|
||||
}
|
||||
})
|
||||
},
|
||||
onEnd1(event) {
|
||||
let oldIndex = event.oldIndex //移动初始位置
|
||||
let newIndex = event.newIndex //运动终止位置
|
||||
let diff = Math.abs(newIndex - oldIndex) //差值绝对值
|
||||
if (eval(oldIndex) > eval(newIndex)) {
|
||||
for (let i = 0; i < diff; i ++) {
|
||||
this.paramsList[oldIndex - i].sort = oldIndex - i - 1
|
||||
}
|
||||
this.paramsList[newIndex].sort = oldIndex
|
||||
} else {
|
||||
for (let i = 0; i < diff; i ++) {
|
||||
this.paramsList[oldIndex + i].sort = oldIndex + i + 1
|
||||
}
|
||||
this.paramsList[newIndex].sort = oldIndex
|
||||
}
|
||||
console.log('打印一 下', event)
|
||||
},
|
||||
onEnd2(event) {
|
||||
let oldIndex = event.oldIndex //移动初始位置
|
||||
let newIndex = event.newIndex //运动终止位置
|
||||
let diff = Math.abs(newIndex - oldIndex) //差值绝对值
|
||||
let list = []
|
||||
this.paramsList.forEach(item => {
|
||||
if (item.projectTypeId === this.unfoldId) {
|
||||
list = item.list
|
||||
}
|
||||
})
|
||||
if (eval(oldIndex) > eval(newIndex)) {
|
||||
for (let i = 0; i < diff; i ++) {
|
||||
list[oldIndex - i].sort = oldIndex - i - 1
|
||||
}
|
||||
list[newIndex].sort = oldIndex
|
||||
} else {
|
||||
for (let i = 0; i < diff; i ++) {
|
||||
list[oldIndex + i].sort = oldIndex + i + 1
|
||||
}
|
||||
list[newIndex].sort = oldIndex
|
||||
}
|
||||
console.log('打印一 11111下', this.paramsList)
|
||||
},
|
||||
onStart() {},
|
||||
saveData() {
|
||||
console.log('保存,到步骤三', this.multipleSelection)
|
||||
if (this.multipleSelection.length === 0) {
|
||||
this.$message.error('请选择项目!')
|
||||
} else {
|
||||
const temp = []
|
||||
for (let item of this.multipleSelection) {
|
||||
temp.push(item.projectTypeName)
|
||||
}
|
||||
const typeList = Array.from(new Set(temp))
|
||||
console.log('aaaaaaa', typeList)
|
||||
for (let type of typeList) {
|
||||
let obj = {}
|
||||
obj.projectTypeName = type
|
||||
obj.dragVisible = false
|
||||
obj.list = this.multipleSelection.filter(ele => {
|
||||
if (ele.projectTypeName === type) {
|
||||
obj.projectTypeId = ele.projectTypeId
|
||||
return ele
|
||||
}
|
||||
})
|
||||
this.paramsList.push(obj)
|
||||
}
|
||||
console.log('kjkj', this.paramsList)
|
||||
this.activeStep = 2
|
||||
// this.visibleList[1] = false
|
||||
// this.visibleList[2] = true
|
||||
this.$set(this.visibleList, 1, false)
|
||||
this.$set(this.visibleList, 2, true)
|
||||
}
|
||||
},
|
||||
toggleSelection(rows) {
|
||||
if (rows) {
|
||||
rows.forEach(row => {
|
||||
this.$refs.multipleTable.toggleRowSelection(row);
|
||||
});
|
||||
} else {
|
||||
this.$refs.multipleTable.clearSelection();
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
console.log('你好', this.multipleSelection)
|
||||
},
|
||||
getTypeList() {
|
||||
this.paramsList = []
|
||||
this.$http
|
||||
.get(this.urlOptions.getTypeListURL, {
|
||||
params: {
|
||||
'limit': 999,
|
||||
'page': 1
|
||||
},
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
this.dataListLoading = false;
|
||||
if (res.code !== 0) {
|
||||
this.typeList = [];
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.typeList = res.data.list;
|
||||
})
|
||||
.catch(() => {
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
getEvaList() {
|
||||
this.formInline.title = this.formInline.title=== '' ? undefined : this.formInline.title
|
||||
this.formInline.requirement = this.formInline.requirement=== '' ? undefined : this.formInline.requirement
|
||||
this.formInline.projectTypeId = this.formInline.projectTypeId=== '' ? undefined : this.formInline.projectTypeId
|
||||
this.$http
|
||||
.get(this.urlOptions.getEvaluationListURL, {
|
||||
params: this.formInline
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
this.dataListLoading = false;
|
||||
if (res.code !== 0) {
|
||||
this.tableData = [];
|
||||
this.listQuery.total = 0;
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.tableData = res.data.list;
|
||||
this.tableData.map((item) => {
|
||||
item.label = ''
|
||||
if (item.list.length !== 0) {
|
||||
for (it in item.list) {
|
||||
item.label += it + ' '
|
||||
}
|
||||
}
|
||||
})
|
||||
this.listQuery.total = res.data.total;
|
||||
})
|
||||
.catch(() => {
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
submitForm(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http["post"](this.urlOptions.addtURL, this.ruleForm)
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t("prompt.success"),
|
||||
type: "success",
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
console.log(1111);
|
||||
this.$emit("refreshDataList");
|
||||
},
|
||||
})
|
||||
this.activeStep ++
|
||||
// this.visibleList[0] = false
|
||||
// this.visibleList[1] = true
|
||||
this.$set(this.visibleList, 0, false)
|
||||
this.$set(this.visibleList, 1, true)
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.addDiv {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
min-height: 20vh;
|
||||
}
|
||||
.chooseDiv {
|
||||
border: 1px solid grey;
|
||||
font-size: 16px;
|
||||
/* min-height: 30vh; */
|
||||
min-height: 100px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.typeDiv {
|
||||
width: 40%;
|
||||
border: 1px solid grey;
|
||||
padding: 25px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.projectDiv {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 10px 40px 0 0;
|
||||
}
|
||||
.smallDiv {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
/* text-align: center; */
|
||||
/* width: 200px; */
|
||||
}
|
||||
.contentDiv {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
width: 200px;
|
||||
justify-content: space-between;
|
||||
margin-left: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
340
src/views/modules/supplier/qmsEvaluationItemListLabel.vue
Normal file
340
src/views/modules/supplier/qmsEvaluationItemListLabel.vue
Normal file
@ -0,0 +1,340 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-04-17 14:23:17
|
||||
* @LastEditTime: 2023-06-19 10:25:26
|
||||
* @LastEditors: DY
|
||||
* @Description: 标签设定
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<!-- <div class="mod-sys__user"> -->
|
||||
<el-input v-model="name" :placeholder="$t('supplier.title')" style="width:300px" @blur="throttle(handleAdd())" @keyup.enter.native="throttle(handleAdd())">
|
||||
</el-input>
|
||||
<!-- </div> -->
|
||||
<el-card v-for="(item, index) in tableData" :key="index" class="box-card" style="width:80%; margin-top: 15px">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{ item.name }}</span>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" icon="el-icon-edit" />
|
||||
<el-button style="float: right; padding: 3px 0" type="text" icon="el-icon-delete" @click="deleteHandle(item.id, item.name)" />
|
||||
</div>
|
||||
<!-- <span v-for="(item, index) in tableData" :key="index" class="text item">
|
||||
{{'列表内容'}} {{ item.name}}
|
||||
</span> -->
|
||||
<el-tag
|
||||
:key="keyValue"
|
||||
v-for="(tag, keyValue) in item.list"
|
||||
closable
|
||||
:disable-transitions="false"
|
||||
@close="handleClose(tag)">
|
||||
{{ tag.name }}
|
||||
<!-- <el-input disabled v-model="tag.name"></el-input> -->
|
||||
</el-tag>
|
||||
<el-input
|
||||
class="input-new-tag"
|
||||
v-model="inputValue[index]"
|
||||
:ref="'saveTagInput'+index"
|
||||
size="small"
|
||||
@keyup.enter.native="handleInputConfirm(index)"
|
||||
@blur="handleInputConfirm(index)"
|
||||
>
|
||||
</el-input>
|
||||
<!-- <el-button v-else class="button-new-tag" size="small" @click="showInput(index)">+ New Tag</el-button> -->
|
||||
</el-card>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import basicPage from "@/mixins/basic-page"
|
||||
// import basicSearch from "@/mixins/basic-search"
|
||||
// import supplierProductSearch from "./components/supplierProductSearch.vue"
|
||||
// import evaluationTaskAdd from "./components/evaluationTask-add.vue"
|
||||
// import { timeFormatter } from '@/filters'
|
||||
import i18n from "@/i18n"
|
||||
// import i18n from "@/i18n";
|
||||
export default {
|
||||
// mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/supplier/qmsEvaluationItemListLabel/page",
|
||||
deleteURL: "/supplier/qmsEvaluationItemListLabel",
|
||||
exportURL: '/supplier/qmsEvaluationTask/export',
|
||||
getSupplierListURL: '/supplier/qmsSupplier/page',
|
||||
getTemplateListURL: '/supplier/qmsEvaluationTask/page',
|
||||
submitURL: '/supplier/qmsEvaluationItemListLabel',
|
||||
addLabelInfoURL: '/supplier/qmsEvaluationItemListLabelInfo'
|
||||
},
|
||||
name: '',
|
||||
tableData: [],
|
||||
listQuery: {
|
||||
limit: 999,
|
||||
page: 1,
|
||||
total: 0,
|
||||
},
|
||||
dynamicTags: ['标签一', '标签二', '标签三'],
|
||||
inputVisible: false,
|
||||
inputValue: [],
|
||||
searchOrEditTitle: "",
|
||||
searchOrUpdateVisible: false,
|
||||
productOrEditTitle: "",
|
||||
addOrEditTitle: '',
|
||||
addOrUpdateVisible: false
|
||||
};
|
||||
},
|
||||
components: {
|
||||
},
|
||||
activated() {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
//search-bar点击
|
||||
// handleSearchCancel() {
|
||||
// this.searchOrEditTitle = "";
|
||||
// this.searchOrUpdateVisible = false;
|
||||
// },
|
||||
handleClose(tag) {
|
||||
console.log('你好', tag)
|
||||
this.$confirm(`确定对[名称=${tag.name}]进行删除操作?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(()=> {
|
||||
this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1)
|
||||
})
|
||||
},
|
||||
|
||||
// showInput(index) {
|
||||
// this.inputVisible = true;
|
||||
// const ref = 'saveTagInput' + index
|
||||
// console.log('nihc ', ref)
|
||||
// this.$nextTick(_ => {
|
||||
// this.$refs['saveTagInput' + index].$refs.input.focus();
|
||||
// });
|
||||
// },
|
||||
deleteHandle(id, name) {
|
||||
this.$confirm(`确定对[名称=${name}]进行删除操作?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$http.delete(this.urlOptions.deleteURL, { data: [id] }).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
handleInputConfirm(index) {
|
||||
let inputValue = this.inputValue[index];
|
||||
if (inputValue) {
|
||||
// this.dynamicTags.push(inputValue);
|
||||
this.$http["post"](this.urlOptions.addLabelInfoURL, {
|
||||
'name': inputValue
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t("prompt.success"),
|
||||
type: "success",
|
||||
duration: 500
|
||||
// onClose: () => {
|
||||
// this.visible = false
|
||||
// this.$emit("successSubmit")
|
||||
// },
|
||||
})
|
||||
console.log('打印出来结果', res.data)
|
||||
this.tableData[index].list.push({
|
||||
'id': res.data,
|
||||
'name': inputValue
|
||||
})
|
||||
})
|
||||
}
|
||||
// this.inputVisible = false;
|
||||
this.inputValue = [];
|
||||
},
|
||||
throttle(fun, delay = 10000) {
|
||||
console.log('sssssssss')
|
||||
let last, now
|
||||
return function () {
|
||||
now = Date.now()
|
||||
if (last && now - last < delay) {
|
||||
last = now
|
||||
} else {
|
||||
last = now
|
||||
fun.call(this, ...arguments)
|
||||
}
|
||||
}
|
||||
},
|
||||
handleAdd() {
|
||||
const data = {
|
||||
name: this.name
|
||||
}
|
||||
this.$http["post"](this.urlOptions.submitURL, data)
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t("prompt.success"),
|
||||
type: "success",
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit("successSubmit")
|
||||
},
|
||||
})
|
||||
})
|
||||
},
|
||||
conditionSearch() {
|
||||
this.searchOrEditTitle = "搜索";
|
||||
this.searchOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchOrUpdate.init();
|
||||
});
|
||||
},
|
||||
exportHandle() {
|
||||
this.$http.get(this.urlOptions.exportURL, { responseType: 'blob' }, {
|
||||
...this.dataForm
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
// if (res !== 0) {
|
||||
// return this.$message.error(res.msg)
|
||||
// }
|
||||
let fileName = ''
|
||||
const contentDisposition = res.headers['content-disposition']
|
||||
if (contentDisposition) {
|
||||
const temp = res.headers['content-disposition']
|
||||
.split(';')[1]
|
||||
.split('=')[1]
|
||||
// 对文件名乱码转义--【Node.js】使用iconv-lite解决中文乱码
|
||||
fileName = decodeURI(temp)
|
||||
console.log(temp)
|
||||
}
|
||||
const blob = new Blob([res.data])
|
||||
const reader = new FileReader()
|
||||
reader.readAsDataURL(blob)
|
||||
reader.onload = (e) => {
|
||||
const a = document.createElement('a')
|
||||
a.download = fileName
|
||||
a.href = e.target.result
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
document.body.removeChild(a)
|
||||
}
|
||||
}).catch(() => { })
|
||||
},
|
||||
// handleConfirm() {
|
||||
// this.$refs.addOrUpdate.dataFormSubmitHandle();
|
||||
// },
|
||||
// conditionSearchSubmit() {},
|
||||
conditionSearchSubmit(dataForm) {
|
||||
// console.log(key);
|
||||
// console.log(key);
|
||||
this.listQuery.supplierName = dataForm.supplierName
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
this.searchOrUpdateVisible = false;
|
||||
// console.log(11111);
|
||||
// this.conditionSearchSubmit();
|
||||
},
|
||||
handleClick(val) {
|
||||
if (val.type === "delete") {
|
||||
this.$confirm(`确定对[名称=${val.data.customerTypeName}]进行删除操作?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$http.delete(this.urlOptions.deleteURL, { data: [val.data.id] }).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
} else if (val.type === 'edit') {
|
||||
this.addOrEditTitle = '修改'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id);
|
||||
});
|
||||
}
|
||||
},
|
||||
buttonClick(val) {
|
||||
console.log(val)
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
}
|
||||
},
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.$http
|
||||
.get(this.urlOptions.getDataListURL, {
|
||||
params: this.listQuery,
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
this.dataListLoading = false;
|
||||
if (res.code !== 0) {
|
||||
this.tableData = [];
|
||||
this.listQuery.total = 0;
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.tableData = res.data.list;
|
||||
this.listQuery.total = res.data.total;
|
||||
})
|
||||
.catch(() => {
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-tag + .el-tag {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.button-new-tag {
|
||||
margin-left: 10px;
|
||||
height: 32px;
|
||||
line-height: 30px;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.input-new-tag {
|
||||
width: 90px;
|
||||
margin-left: 10px;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
</style>
|
@ -1,40 +1,40 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-04-17 14:23:17
|
||||
* @LastEditTime: 2023-04-24 14:27:08
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
* @LastEditTime: 2023-06-19 10:28:48
|
||||
* @LastEditors: DY
|
||||
* @Description: 标签设定
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<header>评估向列表标签关联表</header>
|
||||
<!-- <div class="mod-sys__user"> -->
|
||||
<el-input v-model="name" :placeholder="$t('supplier.title')" style="width:300px" @blur="handleAdd"
|
||||
@keyup.enter.native="handleAdd">
|
||||
</el-input>
|
||||
<!-- <el-input v-model="name" :placeholder="$t('supplier.title')" style="width:300px" @blur="throttle(handleAdd())" @keyup.enter.native="throttle(handleAdd())">
|
||||
</el-input> -->
|
||||
<!-- </div> -->
|
||||
<el-card class="box-card" style="width:600px">
|
||||
<!-- <el-card v-for="(item, index) in tableData" :key="index" class="box-card" style="width:80%; margin-top: 15px">
|
||||
<div slot="header" class="clearfix">
|
||||
<span> </span>
|
||||
<span>{{ item.name }}</span>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" icon="el-icon-edit" />
|
||||
<el-button style="float: right; padding: 3px 0" type="text" icon="el-icon-delete" />
|
||||
</div>
|
||||
<span v-for="o in 4" :key="o" class="text item">
|
||||
{{'列表内容 ' + o }}
|
||||
<span v-for="(item, index) in tableData" :key="index" class="text item">
|
||||
{{'列表内容'}} {{ item.name}}
|
||||
</span>
|
||||
</el-card>
|
||||
</el-card> -->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page"
|
||||
import basicSearch from "@/mixins/basic-search"
|
||||
// import basicPage from "@/mixins/basic-page"
|
||||
// import basicSearch from "@/mixins/basic-search"
|
||||
// import supplierProductSearch from "./components/supplierProductSearch.vue"
|
||||
// import evaluationTaskAdd from "./components/evaluationTask-add.vue"
|
||||
import { timeFormatter } from '@/filters'
|
||||
import i18n from "@/i18n"
|
||||
// import i18n from "@/i18n";
|
||||
export default {
|
||||
mixins: [basicPage, basicSearch],
|
||||
// mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
@ -42,10 +42,16 @@ export default {
|
||||
deleteURL: "/supplier/qmsEvaluationTask",
|
||||
exportURL: '/supplier/qmsEvaluationTask/export',
|
||||
getSupplierListURL: '/supplier/qmsSupplier/page',
|
||||
getTemplateListURL: '/supplier/qmsEvaluationTask/page'
|
||||
// submitURL: '/supplier/qmsSupplierType'
|
||||
getTemplateListURL: '/supplier/qmsEvaluationTask/page',
|
||||
submitURL: '/supplier/qmsEvaluationItemListLabel'
|
||||
},
|
||||
name: '',
|
||||
tableData: [],
|
||||
listQuery: {
|
||||
limit: 10,
|
||||
page: 1,
|
||||
total: 1,
|
||||
},
|
||||
searchOrEditTitle: "",
|
||||
searchOrUpdateVisible: false,
|
||||
productOrEditTitle: "",
|
||||
@ -111,22 +117,38 @@ export default {
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
}
|
||||
],
|
||||
]
|
||||
};
|
||||
},
|
||||
components: {
|
||||
},
|
||||
activated() {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
//search-bar点击
|
||||
// handleSearchCancel() {
|
||||
// this.searchOrEditTitle = "";
|
||||
// this.searchOrUpdateVisible = false;
|
||||
// },
|
||||
throttle(fun, delay = 10000) {
|
||||
console.log('sssssssss')
|
||||
let last, now
|
||||
return function () {
|
||||
now = Date.now()
|
||||
if (last && now - last < delay) {
|
||||
last = now
|
||||
} else {
|
||||
last = now
|
||||
fun.call(this, ...arguments)
|
||||
}
|
||||
}
|
||||
},
|
||||
handleAdd() {
|
||||
const data = {
|
||||
name: this.name
|
||||
}
|
||||
this.$http[!this.dataForm.id ? "post" : "put"](this.urlOptions.submitURL, data)
|
||||
this.$http["post"](this.urlOptions.submitURL, data)
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
@ -241,6 +263,26 @@ export default {
|
||||
default:
|
||||
}
|
||||
},
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.$http
|
||||
.get(this.urlOptions.getDataListURL, {
|
||||
params: this.listQuery,
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
this.dataListLoading = false;
|
||||
if (res.code !== 0) {
|
||||
this.tableData = [];
|
||||
this.listQuery.total = 0;
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.tableData = res.data.list;
|
||||
this.listQuery.total = res.data.total;
|
||||
})
|
||||
.catch(() => {
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
208
src/views/modules/supplier/qmsEvaluationPlan.vue
Normal file
208
src/views/modules/supplier/qmsEvaluationPlan.vue
Normal file
@ -0,0 +1,208 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-06-20 11:16:51
|
||||
* @LastEditTime: 2023-06-28 13:54:25
|
||||
* @LastEditors: DY
|
||||
* @Description: 评估计划
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div>
|
||||
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
||||
<el-form-item label="供应商名称">
|
||||
<el-input v-model="formInline.supplierName" placeholder="供应商"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="评估模板">
|
||||
<el-select v-model="formInline.evaluationTemplateId" filterable clearable placeholder="评估模板">
|
||||
<el-option
|
||||
v-for="item in modalOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="评估类型">
|
||||
<el-select v-model="formInline.evaluationType" clearable placeholder="评估类型">
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="评估类型">
|
||||
<el-select v-model="formInline.evaluationType" filterable placeholder="评估类型">
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
v-loading="dataListLoading"
|
||||
style="width: 100%">
|
||||
<el-table-column type="expand">
|
||||
<template slot-scope="props">
|
||||
<el-form label-position="left" inline class="demo-table-expand">
|
||||
<el-form-item label="供应商列表">
|
||||
<span>{{ props.row.name }}</span>
|
||||
</el-form-item>
|
||||
<br>
|
||||
<el-form-item label="负责人列表">
|
||||
<span>{{ props.row.shop }}</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="评估类型"
|
||||
prop="evaluationType">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="标题"
|
||||
prop="title">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="评估模板"
|
||||
prop="evaluationTemplateName">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="说明"
|
||||
prop="description">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="上次启动时间"
|
||||
prop="lastStartTime">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="上次启动评估时间段"
|
||||
prop="lastStartEvaluationPeriod">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="预计下次启动时间"
|
||||
prop="estimatedNextStartTime">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="提醒人"
|
||||
prop="reminder">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="状态"
|
||||
prop="desc">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
addURL: '/supplier/qmsEvaluationPlan',
|
||||
getDataListURL: "/supplier/qmsEvaluationPlan/page",
|
||||
getTemplateListURL: '/supplier/qmsEvaluationTemplate/page'
|
||||
// deleteURL: '/supplier/qmsEvaluationTemplate'
|
||||
},
|
||||
dataListLoading: false,
|
||||
typeOptions: [
|
||||
{
|
||||
name: '年度',
|
||||
id: 0
|
||||
},
|
||||
{
|
||||
name: '季度',
|
||||
id: 1
|
||||
},
|
||||
{
|
||||
name: '月度',
|
||||
id: 2
|
||||
}
|
||||
],
|
||||
modalOptions: [],
|
||||
formInline: {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
evaluationTemplateId: undefined,
|
||||
evaluationType: undefined,
|
||||
supplierName: '',
|
||||
total: 0
|
||||
},
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTemplate()
|
||||
},
|
||||
methods: {
|
||||
getTemplate() {
|
||||
this.$http
|
||||
.get(this.urlOptions.getTemplateListURL, {
|
||||
params: {
|
||||
limit: 999,
|
||||
page: 1
|
||||
},
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
this.dataListLoading = false;
|
||||
if (res.code !== 0) {
|
||||
this.modalOptions = [];
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.modalOptions = res.data.list;
|
||||
})
|
||||
.catch(() => {
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
onSubmit() {
|
||||
this.dataListLoading = true
|
||||
this.$http
|
||||
.get(this.urlOptions.getDataListURL, {
|
||||
params: this.formInline,
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
this.dataListLoading = false;
|
||||
if (res.code !== 0) {
|
||||
this.tableData = [];
|
||||
this.formInline.total = 0;
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.tableData = res.data.list;
|
||||
this.formInline.total = res.data.total;
|
||||
})
|
||||
.catch(() => {
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.demo-table-expand {
|
||||
font-size: 0;
|
||||
}
|
||||
.demo-table-expand label {
|
||||
width: 90px;
|
||||
color: #99a9bf;
|
||||
}
|
||||
.demo-table-expand .el-form-item {
|
||||
margin-right: 0;
|
||||
margin-bottom: 0;
|
||||
width: 50%;
|
||||
}
|
||||
</style>
|
||||
|
201
src/views/modules/supplier/qmsEvaluationTemplate.vue
Normal file
201
src/views/modules/supplier/qmsEvaluationTemplate.vue
Normal file
@ -0,0 +1,201 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-06-19 10:38:41
|
||||
* @LastEditTime: 2023-06-26 16:05:18
|
||||
* @LastEditors: DY
|
||||
* @Description: 评估模板
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<h1>绩效评估模板</h1>
|
||||
<div class="bigDiv">
|
||||
<div v-for="(item, index) in dataList" :key="index" class="smallDiv">
|
||||
<p style="font-size: 18px">{{ item.name }}</p>
|
||||
<div style="margin-top: 30px;">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20">
|
||||
<span style="font-size: 18px;">综合评估表</span>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<i class="el-icon-view" @click="seeeValuationList(item.id)"></i>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4" :offset="20">
|
||||
<i class="el-icon-delete" @click="deleteEvaluation(item.id, item.name)"></i>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<el-button class="carcleButton" @click="addTemplate">+</el-button>
|
||||
</div>
|
||||
<div v-if="editModelVisible" style="border: 1px solid grey; padding: 10px">
|
||||
<evaluation-template-add @refreshDataList="getDataList" :show="editModelVisible" @info="getInfo"></evaluation-template-add>
|
||||
</div>
|
||||
<el-dialog
|
||||
title="预览"
|
||||
:visible.sync="dialogVisible"
|
||||
:close-on-click-modal="false"
|
||||
width="40%"
|
||||
:before-close="handleClose">
|
||||
<base-table id="palletTable" :table-props="tableProps" :page="1" :limit="listQuery.limit" :table-data="projectsList" />
|
||||
</el-dialog>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import evaluationTemplateAdd from "./components/evaluationTemplate-add.vue"
|
||||
import i18n from "@/i18n";
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "projectTypeName",
|
||||
label: i18n.t("supplier.projectTypeName")
|
||||
},
|
||||
{
|
||||
prop: "weight",
|
||||
label: i18n.t("supplier.weight")
|
||||
},
|
||||
{
|
||||
prop: "name",
|
||||
label: i18n.t("supplier.projectName")
|
||||
}
|
||||
];
|
||||
|
||||
export default ({
|
||||
components: { evaluationTemplateAdd },
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/supplier/qmsEvaluationTemplate/page",
|
||||
getProjectTypeURL: '/supplier/qmsEvaluationTemplateProjectType/page',
|
||||
deleteURL: '/supplier/qmsEvaluationTemplate'
|
||||
},
|
||||
dataList: [],
|
||||
listQuery: {
|
||||
limit: 999,
|
||||
page: 1,
|
||||
total: 0,
|
||||
},
|
||||
tableProps,
|
||||
projectsList: [],
|
||||
addTemplateVisible: false,
|
||||
activeStep: 0,
|
||||
editModelVisible: false,
|
||||
dataListLoading: false,
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
deleteEvaluation(id, name) {
|
||||
this.$confirm(`确定对[名称=${name}]进行删除操作?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$http.delete(this.urlOptions.deleteURL, { data: [id] }).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
getInfo(value) {
|
||||
this.editModelVisible = value
|
||||
},
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done();
|
||||
})
|
||||
.catch(_ => {});
|
||||
},
|
||||
seeeValuationList(id) {
|
||||
console.log('啊啊啊啊', id)
|
||||
this.dialogVisible = true
|
||||
this.$http
|
||||
.get(this.urlOptions.getProjectTypeURL, {
|
||||
params: {
|
||||
'limit': 999,
|
||||
'page': 1,
|
||||
'evaluationTemplateId': id
|
||||
},
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
this.dataListLoading = false;
|
||||
if (res.code !== 0) {
|
||||
this.projectsList = [];
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.projectsList = res.data.list;
|
||||
})
|
||||
.catch(() => {
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
addTemplate() {
|
||||
this.editModelVisible = true
|
||||
},
|
||||
getDataList() {
|
||||
// this.dataListLoading = true;
|
||||
this.$http
|
||||
.get(this.urlOptions.getDataListURL, {
|
||||
params: this.listQuery,
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
this.dataListLoading = false;
|
||||
if (res.code !== 0) {
|
||||
this.tableData = [];
|
||||
this.listQuery.total = 0;
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.dataList = res.data.list;
|
||||
this.listQuery.total = res.data.total;
|
||||
})
|
||||
.catch(() => {
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.bigDiv {
|
||||
border: 1px solid grey;
|
||||
padding: 20px 5vw;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.smallDiv {
|
||||
border: 1px solid grey;
|
||||
padding: 0px 20px;
|
||||
width: 40%;
|
||||
height: 150px;
|
||||
margin: 10px;
|
||||
}
|
||||
.carcleButton {
|
||||
border-radius: 50%;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
margin: 5px;
|
||||
background-color: rgb(196, 193, 193);
|
||||
}
|
||||
</style>
|
30
src/views/modules/supplier/qmsSupplierProjectList.vue
Normal file
30
src/views/modules/supplier/qmsSupplierProjectList.vue
Normal file
@ -0,0 +1,30 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-06-20 11:16:51
|
||||
* @LastEditTime: 2023-06-26 16:30:07
|
||||
* @LastEditors: DY
|
||||
* @Description: 项目清单
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div>
|
||||
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
||||
<el-form-item label="标题">
|
||||
<el-input v-model="formInline.title" placeholder="标题"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
239
src/views/modules/supplier/qmsSupplierRequirementList.vue
Normal file
239
src/views/modules/supplier/qmsSupplierRequirementList.vue
Normal file
@ -0,0 +1,239 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-06-20 11:16:51
|
||||
* @LastEditTime: 2023-06-27 14:46:10
|
||||
* @LastEditors: DY
|
||||
* @Description: 要求清单
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div style="padding: 20px 30px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<h2>要求分组</h2>
|
||||
<div v-for="(item, index) in groupList" :key="index">
|
||||
<el-button style="width: 100px; text-align: left" @click="searchByGroup(item)">{{ item.name }}</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
||||
<el-form-item>
|
||||
<el-input v-model="formInline.requirementName" placeholder="标题"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="bigDiv">
|
||||
<div class="detailDiv" v-for="(item, index) in dataList" :key="index">
|
||||
<p>{{ item.title }}</p>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4" :offset="20">
|
||||
<i class="el-icon-delete" @click="deleteRequire(item.id, item.title)"></i>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<el-button class="carcleButton" @click="addRequire">+</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div v-if="addtModelVisible" style="height: 400px; width: 40%; margin: 20px auto; border: 1px solid grey; padding: 20px">
|
||||
<h2>要求编辑</h2>
|
||||
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px" class="demo-ruleForm">
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="ruleForm.title"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input type="textarea" v-model="ruleForm.description"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属分组" prop="requirementListGroupId">
|
||||
<el-select v-model="ruleForm.requirementListGroupId" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in groupList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<!-- <el-button type="primary" @click="submitForm('ruleForm')">保存</el-button> -->
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="saveRequirement">保 存</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
addtURL: "/supplier/qmsSupplierRequirementList",
|
||||
getGourpListRUL: '/supplier/qmsSupplierRequirementListGroup/page',
|
||||
getRequirementListURL: '/supplier/qmsSupplierRequirementList/page',
|
||||
deleteURL: 'supplier/qmsSupplierRequirementList'
|
||||
},
|
||||
formInline: {
|
||||
groupId: '',
|
||||
limit: 999,
|
||||
page: 1,
|
||||
requirementName: ''
|
||||
},
|
||||
addtModelVisible: false,
|
||||
dataListLoading: false,
|
||||
dataList: [],
|
||||
ruleForm: {
|
||||
title: '',
|
||||
description: '',
|
||||
requirementListGroupId: ''
|
||||
},
|
||||
options: [],
|
||||
groupList: [],
|
||||
rules: {
|
||||
title: [
|
||||
{ required: true, message: '请输入code', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getGroup()
|
||||
},
|
||||
methods: {
|
||||
deleteRequire(id, name) {
|
||||
this.$confirm(`确定对[标题=${name}]进行删除操作?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$http.delete(this.urlOptions.deleteURL, { data: [id] }).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.onSubmit();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
saveRequirement() {
|
||||
this.$refs['ruleForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http["post"](this.urlOptions.addtURL, this.ruleForm)
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t("prompt.success"),
|
||||
type: "success",
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
console.log(1111);
|
||||
this.formInline.groupId = this.ruleForm.requirementListGroupId
|
||||
this.addtModelVisible = false
|
||||
this.onSubmit()
|
||||
},
|
||||
})
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
searchByGroup(group) {
|
||||
console.log('查询', group)
|
||||
this.formInline.groupId = group.id
|
||||
},
|
||||
getGroup() {
|
||||
this.$http
|
||||
.get(this.urlOptions.getGourpListRUL, {
|
||||
params: {
|
||||
limit: 999,
|
||||
page: 1
|
||||
}
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
this.dataListLoading = false;
|
||||
if (res.code !== 0) {
|
||||
this.groupList = [];
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.groupList = res.data.list;
|
||||
})
|
||||
.catch(() => {
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
addRequire() {
|
||||
this.addtModelVisible = true
|
||||
this.ruleForm = {
|
||||
title: '',
|
||||
description: '',
|
||||
requirementListGroupId: ''
|
||||
}
|
||||
},
|
||||
onSubmit() {
|
||||
console.log('submit!');
|
||||
if (this.formInline.groupId === '') {
|
||||
this.$message.error('请选择要求分组')
|
||||
} else {
|
||||
this.$http
|
||||
.get(this.urlOptions.getRequirementListURL, {
|
||||
params: this.formInline
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
this.dataListLoading = false;
|
||||
if (res.code !== 0) {
|
||||
this.dataList = [];
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.dataList = res.data.list;
|
||||
})
|
||||
.catch(() => {
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.bigDiv {
|
||||
border: 1px solid grey;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.detailDiv {
|
||||
border: 1px solid grey;
|
||||
padding: 30px;
|
||||
width: 40%;
|
||||
height: 120px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.carcleButton {
|
||||
border-radius: 50%;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
margin: 5px;
|
||||
background-color: rgb(196, 193, 193);
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user