Commit c4c7c925 by wenyi.chen

綫上

parent 19792d42
...@@ -7,5 +7,7 @@ VITE_OPEN = false ...@@ -7,5 +7,7 @@ VITE_OPEN = false
# public path 配置线上环境路径(打包)、本地通过 http-server 访问时,请置空即可 # public path 配置线上环境路径(打包)、本地通过 http-server 访问时,请置空即可
VITE_PUBLIC_PATH = ./ VITE_PUBLIC_PATH = ./
Upload ='/dev/api/upload/picture'
# X-OPENAPI-TOKEN # X-OPENAPI-TOKEN
VITE_X_OPENAPI_TOKEN = 098f6bcd4621d373cade4e832627b4f6 VITE_X_OPENAPI_TOKEN = 098f6bcd4621d373cade4e832627b4f6
\ No newline at end of file
...@@ -37,7 +37,14 @@ export function claimTasksApi() { ...@@ -37,7 +37,14 @@ export function claimTasksApi() {
}, },
normReceivesDetail: (data) => { normReceivesDetail: (data) => {
return request({ return request({
url: '/api/normReceives/detail', url: '/api/normCollects/detail',
method: 'post',
data,
});
},
normReceivesModify: (data) => {
return request({
url: '/api/normCollects/modify',
method: 'post', method: 'post',
data, data,
}); });
......
...@@ -4,4 +4,11 @@ export function getHost() { ...@@ -4,4 +4,11 @@ export function getHost() {
} else { } else {
return '/data-collect-api' return '/data-collect-api'
} }
}
export function getUploadUrl() {
if (process.env.NODE_ENV === 'development') {
return '/dev/api/upload/picture'
} else {
return '/data-collect-api/api/upload/picture'
}
} }
\ No newline at end of file
...@@ -98,6 +98,7 @@ const state = reactive({ ...@@ -98,6 +98,7 @@ const state = reactive({
name: '', name: '',
status:'2,3', status:'2,3',
task_id:'', task_id:'',
admin:1,
}, },
// 任务领取参数 // 任务领取参数
apiAuditingParam: { apiAuditingParam: {
......
...@@ -36,25 +36,22 @@ ...@@ -36,25 +36,22 @@
<el-form-item label="标题" :prop="'userFilled.' + index+ '.name'" v-for="(item, index) in state.formItem.userFilled" :key="index"> <el-form-item label="标题" :prop="'userFilled.' + index+ '.name'" v-for="(item, index) in state.formItem.userFilled" :key="index">
<el-row style="width: 100% !important;"> <el-row style="width: 100% !important;">
<el-col :span="12"> <el-col :span="7">
<el-input v-model="item.name" placeholder="请输入标题" clearabl :disabled="true"></el-input> <el-input v-model="item.name" placeholder="请输入标题" clearabl :disabled="true"></el-input>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="2">
<div>是否必填:</div> 内容:
</el-col> </el-col>
<el-col :span="6"> <el-col :span="15">
<div> <el-input v-model="item.value" placeholder="请填写内容" required :disabled="true"></el-input>
<el-radio v-model="item.radio" label="1" :disabled="true"></el-radio>
<el-radio v-model="item.radio" label="0" :disabled="true"></el-radio>
</div>
</el-col> </el-col>
</el-row> </el-row>
<el-row style="width: 100% !important; margin-left: -8%; margin-top: 10 !important;"> <el-row style="width: 100% !important; margin-left: -8%; margin-top: 10 !important;">
<el-col :span="2"> <el-col :span="2">
<div>备注:</div> <div>备注:</div>
</el-col> </el-col>
<el-col :span="18"> <el-col :span="22">
<el-input v-model="item.remarks" placeholder="请输入备注(选填)" clearabl :disabled="true"></el-input> <el-input v-model="item.remarks" placeholder="请输入备注(选填)" clearabl :disabled="true" ></el-input>
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
......
...@@ -102,6 +102,7 @@ const state = reactive({ ...@@ -102,6 +102,7 @@ const state = reactive({
name: '', name: '',
status:1, status:1,
task_id:'', task_id:'',
admin:1,
}, },
// 任务领取参数 // 任务领取参数
apiAuditingParam: { apiAuditingParam: {
......
...@@ -67,6 +67,7 @@ import '@wangeditor/editor/dist/css/style.css' // 引入 css ...@@ -67,6 +67,7 @@ import '@wangeditor/editor/dist/css/style.css' // 引入 css
import { Editor, Toolbar } from '@wangeditor/editor-for-vue' import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
import { claimTasksApi } from '/@/api/claimTasks' import { claimTasksApi } from '/@/api/claimTasks'
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { getUploadUrl } from "/@/utils/getHost.js";
// 定义子组件向父组件传值/事件 // 定义子组件向父组件传值/事件
const emit = defineEmits(['refresh']); const emit = defineEmits(['refresh']);
...@@ -245,7 +246,7 @@ editorConfig.MENU_CONF['uploadImage'] = { ...@@ -245,7 +246,7 @@ editorConfig.MENU_CONF['uploadImage'] = {
// 小于该值就插入 base64 格式(而不上传),默认为 0 // 小于该值就插入 base64 格式(而不上传),默认为 0
base64LimitSize: 5 * 1024, // 5kb base64LimitSize: 5 * 1024, // 5kb
server: "dev/api/upload/picture", server: getUploadUrl(),
fieldName: 'file', fieldName: 'file',
// 单个文件上传成功之后 // 单个文件上传成功之后
onSuccess(file, res) { // JS 语法 onSuccess(file, res) { // JS 语法
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<script setup name="systemRoleDialog"> <script setup name="systemRoleDialog">
import '@wangeditor/editor/dist/css/style.css' // 引入 css import '@wangeditor/editor/dist/css/style.css' // 引入 css
import { Editor, Toolbar } from '@wangeditor/editor-for-vue' import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
import { getUploadUrl } from "/@/utils/getHost.js";
import { claimTasksApi } from '/@/api/claimTasks' import { claimTasksApi } from '/@/api/claimTasks'
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
// 定义子组件向父组件传值/事件 // 定义子组件向父组件传值/事件
...@@ -129,7 +129,7 @@ editorConfig.MENU_CONF['uploadImage'] = { ...@@ -129,7 +129,7 @@ editorConfig.MENU_CONF['uploadImage'] = {
// 小于该值就插入 base64 格式(而不上传),默认为 0 // 小于该值就插入 base64 格式(而不上传),默认为 0
base64LimitSize: 5 * 1024, // 5kb base64LimitSize: 5 * 1024, // 5kb
server: "dev/api/upload/picture", server: getUploadUrl(),
fieldName: 'file', fieldName: 'file',
// 单个文件上传成功之后 // 单个文件上传成功之后
onSuccess(file, res) { // JS 语法 onSuccess(file, res) { // JS 语法
......
...@@ -78,7 +78,7 @@ import { ElMessageBox, ElMessage } from 'element-plus'; ...@@ -78,7 +78,7 @@ import { ElMessageBox, ElMessage } from 'element-plus';
import { Session } from '/@/utils/storage'; import { Session } from '/@/utils/storage';
// 引入组件 // 引入组件
const Breadcrumb = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/breadcrumb.vue')); const Breadcrumb = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/breadcrumb.vue'));
const DetailDialog = defineAsyncComponent(() => import('/@/views/claimTasks/user/incomplete/details.vue')); const DetailDialog = defineAsyncComponent(() => import('../../../claimTasks/user/incomplete/details-.vue'));
// 定义变量内容 // 定义变量内容
const DetailDialogRef = ref() const DetailDialogRef = ref()
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<el-input v-model="item.name" placeholder="请输入标题" clearabl :disabled="true"></el-input> <el-input v-model="item.name" placeholder="请输入标题" clearabl :disabled="true"></el-input>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
备注: 内容:
</el-col> </el-col>
<el-col :span="15"> <el-col :span="15">
<el-input v-model="item.value" placeholder="请填写内容" required :disabled="true"></el-input> <el-input v-model="item.value" placeholder="请填写内容" required :disabled="true"></el-input>
...@@ -90,6 +90,7 @@ import '@wangeditor/editor/dist/css/style.css' // 引入 css ...@@ -90,6 +90,7 @@ import '@wangeditor/editor/dist/css/style.css' // 引入 css
import { Editor, Toolbar } from '@wangeditor/editor-for-vue' import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
import { claimTasksApi } from '/@/api/claimTasks' import { claimTasksApi } from '/@/api/claimTasks'
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { getUploadUrl } from "/@/utils/getHost.js";
// 定义子组件向父组件传值/事件 // 定义子组件向父组件传值/事件
const emit = defineEmits(['refresh']); const emit = defineEmits(['refresh']);
...@@ -269,7 +270,7 @@ editorConfig.MENU_CONF['uploadImage'] = { ...@@ -269,7 +270,7 @@ editorConfig.MENU_CONF['uploadImage'] = {
// 小于该值就插入 base64 格式(而不上传),默认为 0 // 小于该值就插入 base64 格式(而不上传),默认为 0
base64LimitSize: 5 * 1024, // 5kb base64LimitSize: 5 * 1024, // 5kb
server: "dev/api/upload/picture", server: getUploadUrl(),
fieldName: 'file', fieldName: 'file',
// 单个文件上传成功之后 // 单个文件上传成功之后
onSuccess(file, res) { // JS 语法 onSuccess(file, res) { // JS 语法
......
...@@ -101,6 +101,7 @@ const state = reactive({ ...@@ -101,6 +101,7 @@ const state = reactive({
name: '', name: '',
status:'1,2,3', status:'1,2,3',
task_id:'', task_id:'',
order:'asc'
}, },
// 任务领取参数 // 任务领取参数
apiReceiveParam: { apiReceiveParam: {
......
...@@ -67,6 +67,7 @@ import '@wangeditor/editor/dist/css/style.css' // 引入 css ...@@ -67,6 +67,7 @@ import '@wangeditor/editor/dist/css/style.css' // 引入 css
import { Editor, Toolbar } from '@wangeditor/editor-for-vue' import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
import { claimTasksApi } from '/@/api/claimTasks' import { claimTasksApi } from '/@/api/claimTasks'
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { getUploadUrl } from "/@/utils/getHost.js";
// 定义子组件向父组件传值/事件 // 定义子组件向父组件传值/事件
const emit = defineEmits(['refresh']); const emit = defineEmits(['refresh']);
...@@ -192,12 +193,14 @@ const onSubmit = () => { ...@@ -192,12 +193,14 @@ const onSubmit = () => {
ElMessage.error('只允许上传两张图片!'); ElMessage.error('只允许上传两张图片!');
} }
if(apiIndex==1&&valid){ if(apiIndex==1&&valid){
claimTasksApi().normCollectsAdd(JSON.stringify(state.formItem)).then(res => { claimTasksApi().normReceivesModify(JSON.stringify(state.formItem)).then(res => {
editor.clear()
state.btnLoading = false state.btnLoading = false
ElMessage.success('操作成功'); ElMessage.success('操作成功');
closeDialog(); closeDialog();
emit('refresh'); emit('refresh');
}).catch(() => { }).catch(() => {
editor.clear()
state.btnLoading = false state.btnLoading = false
closeDialog(); closeDialog();
emit('refresh'); emit('refresh');
...@@ -247,7 +250,7 @@ editorConfig.MENU_CONF['uploadImage'] = { ...@@ -247,7 +250,7 @@ editorConfig.MENU_CONF['uploadImage'] = {
// 小于该值就插入 base64 格式(而不上传),默认为 0 // 小于该值就插入 base64 格式(而不上传),默认为 0
base64LimitSize: 5 * 1024, // 5kb base64LimitSize: 5 * 1024, // 5kb
server: "dev/api/upload/picture", server: getUploadUrl(),
fieldName: 'file', fieldName: 'file',
// 单个文件上传成功之后 // 单个文件上传成功之后
onSuccess(file, res) { // JS 语法 onSuccess(file, res) { // JS 语法
......
...@@ -29,26 +29,9 @@ ...@@ -29,26 +29,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="标题" :prop="'userFilled.' + index+ '.name'" v-for="(item, index) in state.formItem.userFilled" :key="index"> <el-form-item label="标题" :prop="'userFilled.' + index+ '.name'" v-for="(item, index) in state.formItem.userFilled" :key="index">
<el-row style="width: 100% !important;"> <el-input v-model="item.name" placeholder="请输入标题" clearable style="width: 30%;" :disabled="true"></el-input>
<el-col :span="7"> <div style="width: 10%;"><span style="color: red;" v-if="item.radio==1">*</span>内容:</div>
<el-input v-model="item.name" placeholder="请输入标题" clearabl :disabled="true"></el-input> <el-input v-model="item.value" placeholder="请填写内容" style="width: 60%;" required></el-input>
</el-col>
<el-col :span="2">
备注:
</el-col>
<el-col :span="15">
<el-input v-model="item.value" placeholder="请填写内容" required></el-input>
</el-col>
</el-row>
<el-row style="width: 100% !important; margin-left: -8%; margin-top: 10 !important;">
<el-col :span="2">
<div>备注:</div>
</el-col>
<el-col :span="22">
<el-input v-model="item.remark" placeholder="请输入备注(选填)" clearabl :disabled="true"></el-input>
</el-col>
</el-row>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="state.formItem.addItem.remark" placeholder="请输入备注" clearable></el-input> <el-input v-model="state.formItem.addItem.remark" placeholder="请输入备注" clearable></el-input>
...@@ -89,6 +72,7 @@ import { Editor, Toolbar } from '@wangeditor/editor-for-vue' ...@@ -89,6 +72,7 @@ import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
import { claimTasksApi } from '/@/api/claimTasks' import { claimTasksApi } from '/@/api/claimTasks'
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { getUploadUrl } from "/@/utils/getHost.js";
// 定义子组件向父组件传值/事件 // 定义子组件向父组件传值/事件
const emit = defineEmits(['refresh']); const emit = defineEmits(['refresh']);
...@@ -115,8 +99,6 @@ const state = reactive({ ...@@ -115,8 +99,6 @@ const state = reactive({
// 填写内容及自定义文本框 // 填写内容及自定义文本框
formItem: { formItem: {
addItem:{ addItem:{
refer_type:'',
id:'',
}, },
dynamicItem: [ dynamicItem: [
], ],
...@@ -126,7 +108,6 @@ const state = reactive({ ...@@ -126,7 +108,6 @@ const state = reactive({
editorContent:'', // 富文本所有内容 editorContent:'', // 富文本所有内容
} }
}); });
// 编辑器实例,必须用 shallowRef // 编辑器实例,必须用 shallowRef
const editorRef = shallowRef() const editorRef = shallowRef()
const mode = ref('default') const mode = ref('default')
...@@ -140,13 +121,12 @@ editorConfig.MENU_CONF['uploadImage'] = { ...@@ -140,13 +121,12 @@ editorConfig.MENU_CONF['uploadImage'] = {
// 小于该值就插入 base64 格式(而不上传),默认为 0 // 小于该值就插入 base64 格式(而不上传),默认为 0
base64LimitSize: 5 * 1024, // 5kb base64LimitSize: 5 * 1024, // 5kb
server: "dev/api/upload/picture", server: getUploadUrl(),
fieldName: 'file', fieldName: 'file',
// 单个文件上传成功之后 // 单个文件上传成功之后
onSuccess(file, res) { // JS 语法 onSuccess(file, res) { // JS 语法
console.log(`${file.name} 上传成功`, res) console.log(`${file.name} 上传成功`, res)
}, },
// 单个文件上传失败 // 单个文件上传失败
onFailed(file, res) { // JS 语法 onFailed(file, res) { // JS 语法
console.log(`${file.name} 上传失败`, res) console.log(`${file.name} 上传失败`, res)
...@@ -157,6 +137,7 @@ editorConfig.MENU_CONF['uploadImage'] = { ...@@ -157,6 +137,7 @@ editorConfig.MENU_CONF['uploadImage'] = {
console.log(`${file.name} 上传出错`, err, res) console.log(`${file.name} 上传出错`, err, res)
}, },
} }
const valueHtml = ref()
onMounted(() => { onMounted(() => {
if(router.currentRoute.value.query.task_id){ if(router.currentRoute.value.query.task_id){
state.formItem.addItem.task_id = router.currentRoute.value.query.task_id state.formItem.addItem.task_id = router.currentRoute.value.query.task_id
...@@ -174,25 +155,27 @@ const handleCreated = (editor) => { ...@@ -174,25 +155,27 @@ const handleCreated = (editor) => {
editorRef.value = editor // 记录 editor 实例,重要! editorRef.value = editor // 记录 editor 实例,重要!
} }
// 保存数据 // 保存数据
const preserve = () =>{ const preserve = () =>{
const editor = editorRef.value; const editor = editorRef.value;
editor.getElemsByType("image").forEach((item, index) => { editor.getElemsByType("image").forEach((item, index) => {
state.formItem.editorImgList.push(item.src); state.formItem.editorImgList.push(item.src);
}) })
state.formItem.editorContent = editor.getHtml() // 获取富文本内容
let query = { let query = {
norm_receive_id:state.apiData.id, norm_receive_id:state.apiData.id,
content:JSON.stringify(state.formItem) content:JSON.stringify(state.formItem),
editor:editor.getHtml()
} }
claimTasksApi().normCollectsPreserve(query).then(res => { claimTasksApi().normCollectsPreserve(query).then(res => {
console.log(state.formItem) editor.clear()
state.btnLoading = false state.btnLoading = false
ElMessage.success('操作成功'); ElMessage.success('操作成功');
closeDialog(); closeDialog();
emit('refresh'); emit('refresh');
}).catch(() => { }).catch(() => {
state.btnLoading = false editor.clear()
state.btnLoading = false
closeDialog(); closeDialog();
emit('refresh'); emit('refresh');
}) })
...@@ -200,47 +183,72 @@ const preserve = () =>{ ...@@ -200,47 +183,72 @@ const preserve = () =>{
// 提交数据 // 提交数据
const onSubmit = () => { const onSubmit = () => {
const editor = editorRef.value;
// 获取富文本里的图片地址
editor.getElemsByType("image").forEach((item, index) => {
state.formItem.editorImgList.push(item.src);
})
state.formItem.editorContent = editor.getHtml() // 获取富文本内容
dialogFormRef.value.validate((valid, fields) => { dialogFormRef.value.validate((valid, fields) => {
let userFilledInfo = state.formItem.userFilled; if(valid){
const editor = editorRef.value;
// 获取富文本里的图片地址
editor.getElemsByType("image").forEach((item, index) => {
state.formItem.editorImgList.push(item.src);
})
state.formItem.editorContent = editor.getHtml() // 获取富文本内容
let userFilledInfo = state.formItem.userFilled;
let apiIndex = 1; let apiIndex = 1;
for(let i=0;i<userFilledInfo.length;i++) for(let i=0;i<userFilledInfo.length;i++)
{ {
if (userFilledInfo[0].radio==1) { if (userFilledInfo[i].radio==1) {
if (userFilledInfo[0].value == "") { if (userFilledInfo[i].value == "") {
apiIndex++; apiIndex++;
ElMessage.error('请填写红色星号必填项!'); ElMessage.error('请填写红色星号必填项!');
break; break;
} }
} }
} }
console.log(state.formItem.editorImgList.length+'--------------------------')
if(state.formItem.editorImgList.length>2){ if(state.formItem.editorImgList.length>2){
apiIndex++; apiIndex++;
state.formItem.editorImgList = []; state.formItem.editorImgList = [];
ElMessage.error('只允许上传两张图片!'); ElMessage.error('只允许上传两张图片!');
} }
if(apiIndex==1&&valid){ if(apiIndex==1){
claimTasksApi().normCollectsAdd(JSON.stringify(state.formItem)).then(res => { claimTasksApi().normCollectsAdd(JSON.stringify(state.formItem)).then(res => {
console.log(state.formItem) editor.clear()
state.btnLoading = false state.btnLoading = false
ElMessage.success('操作成功'); ElMessage.success('操作成功');
closeDialog(); closeDialog();
emit('refresh'); emit('refresh');
}).catch(() => { }).catch(() => {
editor.clear()
state.btnLoading = false state.btnLoading = false
closeDialog(); closeDialog();
emit('refresh'); emit('refresh');
}) })
} }
}
}) })
}; };
//有原始数据 // 打开弹窗
const openDialog = (data) => {
state.dialog.isShowDialog = true;
state.dialog.title = '指标详情';
// 清空数据
wipeData();
console.log(data)
state.apiData.id = data.id;
state.formItem.addItem.norm_list_id = data.norm_list_id
state.formItem.addItem.norm_receive_id = data.id;
claimTasksApi().normCollectsGetPreserve(state.apiData).then(res => {
if(res.data){
originalData(res.data);
}else{
newData(data)
}
}).catch(() => {
})
};
//有提交数据
const originalData= (res) => { const originalData= (res) => {
let data = JSON.parse(res.content) let data = JSON.parse(res.content)
let addItem = data.addItem; let addItem = data.addItem;
...@@ -248,7 +256,6 @@ const originalData= (res) => { ...@@ -248,7 +256,6 @@ const originalData= (res) => {
let adminFilled = data.dynamicItem; let adminFilled = data.dynamicItem;
state.formItem.addItem.task_id = addItem.task_id; state.formItem.addItem.task_id = addItem.task_id;
state.formItem.addItem.norm_id = addItem.norm_id; state.formItem.addItem.norm_id = addItem.norm_id;
state.formItem.addItem.norm_list_id = addItem.id;
state.formItem.addItem.name = addItem.name; state.formItem.addItem.name = addItem.name;
state.formItem.addItem.guide = addItem.guide; state.formItem.addItem.guide = addItem.guide;
state.formItem.addItem.task_name = addItem.task_name; state.formItem.addItem.task_name = addItem.task_name;
...@@ -265,32 +272,21 @@ const originalData= (res) => { ...@@ -265,32 +272,21 @@ const originalData= (res) => {
state.formItem.dynamicItem.push({id:item.id,name:item.name,value:item.value}); state.formItem.dynamicItem.push({id:item.id,name:item.name,value:item.value});
state.index++ state.index++
}); });
console.log(res.editor)
//富文本内容相关 //富文本内容相关
if(data.editorContent) state.formItem.editorContent = res.editor
{
state.formItem.editorContent = data.editorContent
}else{
state.formItem.editorContent = '请输入截图'
}
if(data.editorImgList){
state.formItem.editorImgList = data.editorImgList
}else{
state.formItem.editorImgList = []
}
} }
// 没有原始数据 // 没有提交数据
const newData= (data) => { const newData= (data) => {
state.formItem.editorImgList = [];
state.formItem.editorContent = '';
claimTasksApi().normReceivesDetail(state.apiData).then(res => { claimTasksApi().normReceivesDetail(state.apiData).then(res => {
let addItem = res.data.addItem; let addItem = res.data.addItem;
let userFilled = res.data.userFilled; let userFilled = res.data.userFilled;
let adminFilled = res.data.adminFilled; let adminFilled = res.data.adminFilled;
console.log(data)
// 数据详情 // 数据详情
state.formItem.addItem.task_id = addItem.task_id; state.formItem.addItem.task_id = addItem.task_id;
state.formItem.addItem.norm_id = addItem.norm_id; state.formItem.addItem.norm_id = addItem.norm_id;
state.formItem.addItem.norm_list_id = addItem.id;
state.formItem.addItem.name = addItem.name; state.formItem.addItem.name = addItem.name;
state.formItem.addItem.guide = addItem.guide; state.formItem.addItem.guide = addItem.guide;
state.formItem.addItem.task_name = addItem.task_name; state.formItem.addItem.task_name = addItem.task_name;
...@@ -307,71 +303,24 @@ const newData= (data) => { ...@@ -307,71 +303,24 @@ const newData= (data) => {
state.formItem.dynamicItem.push({id:item.id,name:item.extend_name,value:item.extend_value,}); state.formItem.dynamicItem.push({id:item.id,name:item.extend_name,value:item.extend_value,});
state.index++ state.index++
}); });
//富文本内容相关 state.formItem.editorContent = '';
if(res.data.normCollectInfo)
{
let normCollectInfo = res.data.normCollectInfo;
state.formItem.addItem.refer_type = normCollectInfo.refer_type;
state.formItem.addItem.remark = normCollectInfo.remark;
if(normCollectInfo.editorContent){
state.formItem.editorContent = normCollectInfo.editorContent
}else{
state.formItem.editorContent = '请输入截图'
}
}else{
state.formItem.editorContent = '请输入截图'
}
}).catch(() => { }).catch(() => {
}) })
} }
// 打开弹窗
const openDialog = (data) => {
// 清空数据
wipeData();
state.dialog.isShowDialog = true;
state.dialog.title = '指标详情';
state.apiData.id = data.id;
state.formItem.addItem.norm_receive_id = data.id;
claimTasksApi().normCollectsGetPreserve(state.apiData).then(res => {
if(res.data){
originalData(res.data);
}else{
newData(data)
}
}).catch(() => {
})
};
// 关闭弹窗 // 关闭弹窗
const closeDialog = () => { const closeDialog = () => {
// 清空数据 // 清空数据
state.index=0 wipeData();
state.userIndex=0
state.formItem.addItem.task_id = '';
state.formItem.addItem.norm_id = '';
state.formItem.addItem.norm_list_id = '';
state.formItem.addItem.name = '';
state.formItem.addItem.task_name = '';
state.formItem.addItem.refer = '';
state.formItem.addItem.refer_type = '';
state.formItem.addItem.remark = '';
state.formItem.dynamicItem = [];
state.formItem.userFilled = [];
state.formItem.editorImgList = [];
state.formItem.editorContent = '';
dialogFormRef.value.resetFields(); dialogFormRef.value.resetFields();
state.dialog.isShowDialog = false; state.dialog.isShowDialog = false;
}; };
// 清空数据 // 清空数据
const wipeData = () => { const wipeData = () => {
// 清空数据 // 清空数据
state.index=0 state.index=0
state.userIndex=0 state.userIndex=0
state.formItem.addItem.task_id = ''; state.formItem.addItem.task_id = '';
state.formItem.addItem.norm_id = ''; state.formItem.addItem.norm_id = '';
...@@ -381,14 +330,13 @@ const wipeData = () => { ...@@ -381,14 +330,13 @@ const wipeData = () => {
state.formItem.addItem.refer = ''; state.formItem.addItem.refer = '';
state.formItem.addItem.refer_type = ''; state.formItem.addItem.refer_type = '';
state.formItem.addItem.remark = ''; state.formItem.addItem.remark = '';
state.formItem.addItem.guide = '';
state.formItem.dynamicItem = []; state.formItem.dynamicItem = [];
state.formItem.userFilled = []; state.formItem.userFilled = [];
state.formItem.editorImgList = []; state.formItem.editorImgList = [];
state.formItem.editorContent = ''; state.formItem.editorContent = '';
}; };
// const assignment= () => {
// }
// 暴露变量 // 暴露变量
defineExpose({ defineExpose({
...@@ -405,8 +353,8 @@ defineExpose({ ...@@ -405,8 +353,8 @@ defineExpose({
justify-content: center; justify-content: center;
align-content: center; align-content: center;
} }
/** el-input disabled时的背景和边框*/
.el-input.is-disabled{ .el-input.is-disabled{
background:#fff !important; background:#fff !important;
color: var(--el-radio-text-color) !important; color: var(--el-radio-text-color) !important;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<el-table :data="state.tableData.data" border style="width: 100%" :height="state.tableHeight" <el-table :data="state.tableData.data" border style="width: 100%" :height="state.tableHeight"
ref="multipleTableRef" @selection-change="tableSelection"> ref="multipleTableRef" @selection-change="tableSelection">
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column label="序号" prop="id" width="100" show-overflow-tooltip align="center"></el-table-column> <el-table-column label="序号" type="index" width="100" show-overflow-tooltip align="center"></el-table-column>
<el-table-column prop="taskPackageInfo.name" label="任务名称" show-overflow-tooltip align="center"> <el-table-column prop="taskPackageInfo.name" label="任务名称" show-overflow-tooltip align="center">
</el-table-column> </el-table-column>
<el-table-column prop="name" label="指标名称" show-overflow-tooltip align="center"> <el-table-column prop="name" label="指标名称" show-overflow-tooltip align="center">
...@@ -88,6 +88,7 @@ const state = reactive({ ...@@ -88,6 +88,7 @@ const state = reactive({
page: 1, page: 1,
limit: 10, limit: 10,
name: '', name: '',
receives:1,
}, },
// 任务领取参数 // 任务领取参数
apiReceiveParam: { apiReceiveParam: {
......
<template> <template>
<div class="system-role-dialog-container"> <div class="system-role-dialog-container">
<el-dialog :title="state.dialog.title" v-model="state.dialog.isShowDialog" width="40%" @close="closeDialog" :close-on-click-modal="false"> <el-dialog :title="state.dialog.title" v-model="state.dialog.isShowDialog" width="60%" @close="closeDialog" :close-on-click-modal="false">
<el-form ref="dialogFormRef" :model="state.formItem.addItem" :rules="state.rules" size="default" label-width="100px" <el-form ref="dialogFormRef" :model="state.formItem.addItem" :rules="state.rules" size="default" label-width="100px"
v-loading="state.dataLoading" label-position="right" style="width: 90%;text-align: center;"> v-loading="state.dataLoading" label-position="right" style="width: 90%;text-align: center;">
<el-form-item label="指标名称" prop="name"> <el-form-item label="指标名称" prop="name">
...@@ -62,20 +62,18 @@ ...@@ -62,20 +62,18 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-divider style="width: 90%;"><span style="color: #F56C6C;">用户已领取列表</span></el-divider> <el-divider style="width: 90%;"><span style="color: #F56C6C;">用户已领取列表</span></el-divider>
<el-table :data="state.tableData" border style="width: 90%" :height="state.tableHeight" <el-table :data="state.tableData" border style="width: 100%" :height="state.tableHeight"
ref="multipleTableRef"> ref="multipleTableRef">
<el-table-column v-for="column in state.columns" :key="column.prop" :label="column.label" :prop="column.prop"></el-table-column> <el-table-column v-for="column in state.columns" :key="column.prop" :label="column.label" :prop="column.prop" show-overflow-tooltip align="center">
<template #default="scope">
<span style="color:#409EFF" v-if="column.label =='用户名称'">{{scope.row[column.prop]}}</span>
<span style="color:#909399" v-else-if="column.label =='领取状态' && scope.row[column.prop] ==1">已领取</span>
<span style="color:#E6A23C" v-else-if="column.label =='完成状态' && scope.row[column.prop] ==0">未完成</span>
<span style="color:#409EFF" v-else-if="column.label =='完成状态' && scope.row[column.prop] ==1">已完成</span>
<span v-else>{{scope.row[column.prop]}}</span>
</template>
</el-table-column>
</el-table> </el-table>
<el-divider style="width: 90%;"><span style="color: #F56C6C;">已完成的列表</span></el-divider>
<el-table :data="state.collectsTableData" border style="width: 90%" :height="state.tableHeight"
ref="multipleTableRefs">
<el-table-column v-for="column in state.collectsColumns" :key="column.prop" :label="column.label" :prop="column.prop"></el-table-column>
</el-table>
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog()" size="default">取 消</el-button>
</span>
</template>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -187,8 +185,8 @@ const openDialog = (norm_id) => { ...@@ -187,8 +185,8 @@ const openDialog = (norm_id) => {
if(receivesList){ if(receivesList){
let arr = [ let arr = [
{ label:'序号', prop: 'index'}, { label:'序号', prop: 'index'},
{ label:'ID', prop: 'id'}, // { label:'ID', prop: 'id'},
{ label:'用户名称', prop: 'userInfo.name'}, { label:'用户名称', prop: 'userInfo.name',},
{ label:'任务名称', prop: 'task_info.name'}, { label:'任务名称', prop: 'task_info.name'},
{ label:'指标名称', prop: 'norm_list_info.name'}, { label:'指标名称', prop: 'norm_list_info.name'},
]; ];
...@@ -196,10 +194,12 @@ const openDialog = (norm_id) => { ...@@ -196,10 +194,12 @@ const openDialog = (norm_id) => {
receivesList.forEach(function(item, index, arr) { receivesList.forEach(function(item, index, arr) {
let list = { let list = {
'index': index+1, 'index': index+1,
'id':item.id, // 'id':item.id,
'userInfo.name': item.userInfo.name, 'userInfo.name': item.userInfo.name,
'task_info.name': item.task_info.name, 'task_info.name': item.task_info.name,
'norm_list_info.name': item.norm_list_info.name, 'norm_list_info.name': item.norm_list_info.name,
'receives_status': item.receives_status,
'completion_status': item.completion_status,
} }
state.tableData.push(list); state.tableData.push(list);
item.norm_list_extend.forEach(function(items, indexs, arrs) { item.norm_list_extend.forEach(function(items, indexs, arrs) {
...@@ -216,44 +216,8 @@ const openDialog = (norm_id) => { ...@@ -216,44 +216,8 @@ const openDialog = (norm_id) => {
list['extend_value'+indexs] =items.extend_value; list['extend_value'+indexs] =items.extend_value;
}); });
}); });
} state.columns.push( { label: '领取状态', prop:'receives_status' })
state.columns.push( { label: '完成状态', prop:'completion_status' })
//完成列表
let collectsList = res.data.collectsList
if(collectsList){
let arr = [
{ label:'序号', prop: 'index'},
{ label:'ID', prop: 'id'},
{ label:'用户名称', prop: 'userInfo.name'},
{ label:'任务名称', prop: 'task_info.name'},
{ label:'指标名称', prop: 'norm_list_info.name'},
];
state.collectsColumns = arr;
collectsList.forEach(function(item, index, arr) {
console.log(item)
console.log(111)
let list = {
'index': index+1,
'id':item.id,
'userInfo.name': item.userInfo.name,
'task_info.name': item.task_info.name,
'norm_list_info.name': item.norm_list_info.name,
}
state.collectsTableData.push(list);
item.norm_list_extend.forEach(function(items, indexs, arrs) {
if(state.collectsColumns.length>0){
state.collectsColumns.forEach(function(itemss, indexss, arrss) {
let vlues = state.collectsColumns.map(itemsss => itemsss.prop).indexOf('extend_value'+indexs)
if(vlues== -1){
state.collectsColumns.push( { label: items.extend_name, prop: 'extend_value'+indexs })
}
});
}else{
state.collectsColumns.push( { label: items.extend_name, prop: 'extend_value'+indexs })
}
list['extend_value'+indexs] =items.extend_value;
});
});
} }
}).catch(() => { }).catch(() => {
......
...@@ -162,6 +162,7 @@ const userAddItem= (length) => { ...@@ -162,6 +162,7 @@ const userAddItem= (length) => {
state.formItem.userFilled.push({ state.formItem.userFilled.push({
name: '', name: '',
radio:'1', radio:'1',
remarks:'',
}) })
state.userIndex++ state.userIndex++
}; };
...@@ -190,31 +191,33 @@ const closeDialog = () => { ...@@ -190,31 +191,33 @@ const closeDialog = () => {
// 获取最后发布的信息 // 获取最后发布的信息
const finalData = () => { const finalData = () => {
normApi().finalData({}).then(res => { normApi().finalData({}).then(res => {
state.apiData.id = res.data.id; if(res.data.id){
normApi().normDetail(state.apiData).then(res => { state.apiData.id = res.data.id;
let addItem = res.data.addItem; normApi().normDetail(state.apiData).then(res => {
let custom = res.data.custom; let addItem = res.data.addItem;
// 数据详情 let custom = res.data.custom;
state.formItem.addItem.name = addItem.name; // 数据详情
state.formItem.addItem.level = addItem.level; state.formItem.addItem.name = addItem.name;
state.formItem.addItem.sort = addItem.sort; state.formItem.addItem.level = addItem.level;
state.formItem.addItem.refer = addItem.refer; state.formItem.addItem.sort = addItem.sort;
state.formItem.addItem.price =addItem.price; state.formItem.addItem.refer = addItem.refer;
state.formItem.addItem.guide = addItem.guide; state.formItem.addItem.price =addItem.price;
state.userIndex = 0; state.formItem.addItem.guide = addItem.guide;
state.index = 0; state.userIndex = 0;
custom.forEach(item => { state.index = 0;
if(item.user_filled==1){ custom.forEach(item => {
state.formItem.userFilled.push({name:item.extend_name,radio:item.required+"",remarks:item.extend_remarks}); if(item.user_filled==1){
state.userIndex++ state.formItem.userFilled.push({name:item.extend_name,radio:item.required+"",remarks:item.extend_remarks});
}else{ state.userIndex++
state.formItem.dynamicItem.push({name:item.extend_name,value:item.extend_value}); }else{
state.index++ state.formItem.dynamicItem.push({name:item.extend_name,value:item.extend_value});
} state.index++
}); }
}).catch(() => { });
}).catch(() => {
}) })
}
}).catch(() => { }).catch(() => {
}) })
......
...@@ -202,6 +202,7 @@ const userAddItem= (length) => { ...@@ -202,6 +202,7 @@ const userAddItem= (length) => {
state.formItem.userFilled.push({ state.formItem.userFilled.push({
name: '', name: '',
radio:'1', radio:'1',
remarks:'',
}) })
state.userIndex++ state.userIndex++
}; };
......
...@@ -37,8 +37,8 @@ const viteConfig = defineConfig((mode) => { ...@@ -37,8 +37,8 @@ const viteConfig = defineConfig((mode) => {
hmr: true, hmr: true,
proxy: { proxy: {
'/dev': { '/dev': {
// target: 'https://data-collect.raisound.com/smart-detection', target: 'https://data-collect.raisound.com/smart-detection',
target: 'http://192.168.10.168/data-collect-api', // target: 'http://192.168.10.168/data-collect-api',
ws: true, ws: true,
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/dev/, ''), rewrite: (path) => path.replace(/^\/dev/, ''),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment