Commit 91be88cc by wenyi.chen

綫上

parent 6cd788ef
...@@ -79,7 +79,7 @@ export function systemApi() { ...@@ -79,7 +79,7 @@ export function systemApi() {
}, },
editPassword: (data) => { editPassword: (data) => {
return request({ return request({
url: '/auth/change_password', url: '/api/user/changePassword',
method: 'post', method: 'post',
data data
}); });
......
...@@ -112,7 +112,7 @@ const onSubmit = () => { ...@@ -112,7 +112,7 @@ const onSubmit = () => {
}, 1000); }, 1000);
}).catch(() => { }).catch(() => {
state.btnLoading = false state.btnLoading = false
closeDialog(); // closeDialog();
}) })
} }
}) })
......
...@@ -69,12 +69,6 @@ ...@@ -69,12 +69,6 @@
<el-image style="width: 150px; height: 150px" :preview-src-list="state.srcList" :src="item"></el-image> <el-image style="width: 150px; height: 150px" :preview-src-list="state.srcList" :src="item"></el-image>
</div> </div>
</el-form-item> </el-form-item>
<!-- <el-table-column prop="not_collectible" label="是否可采集" show-overflow-tooltip align="center">
<template #default="scope">
<span style="color: #F56C6C" v-if="scope.row.not_collectible==1" effect="plain" size="small">{{scope.row.not_collectible_remarks}}</span>
<span style="color: #909399" v-else effect="plain" size="small"></span>
</template>
</el-table-column> -->
<el-form-item label="是否可采集:" prop="state.not_collectible"> <el-form-item label="是否可采集:" prop="state.not_collectible">
<template #default="scope"> <template #default="scope">
<span style="color: #F56C6C" v-if="state.not_collectible==1" effect="plain" size="small">{{state.not_collectible_remarks}}</span> <span style="color: #F56C6C" v-if="state.not_collectible==1" effect="plain" size="small">{{state.not_collectible_remarks}}</span>
......
...@@ -76,6 +76,12 @@ ...@@ -76,6 +76,12 @@
/> />
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="是否可采集:" prop="state.not_collectible">
<template #default="scope">
<span style="color: #F56C6C" v-if="state.not_collectible==1" effect="plain" size="small">{{state.not_collectible_remarks}}</span>
<span style="color: #909399" v-else effect="plain" size="small"></span>
</template>
</el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
...@@ -139,6 +145,8 @@ const state = reactive({ ...@@ -139,6 +145,8 @@ const state = reactive({
], ],
editorImgList:[], // 富文本里的内容 editorImgList:[], // 富文本里的内容
editorContent:'', // 富文本所有内容 editorContent:'', // 富文本所有内容
not_collectible:'',
not_collectible_remarks:'',
} }
}); });
...@@ -161,7 +169,8 @@ const openDialog = (data) => { ...@@ -161,7 +169,8 @@ const openDialog = (data) => {
state.formItem.addItem.name = addItem.name; state.formItem.addItem.name = addItem.name;
state.formItem.addItem.task_name = addItem.task_name; state.formItem.addItem.task_name = addItem.task_name;
state.formItem.addItem.refer = addItem.refer; state.formItem.addItem.refer = addItem.refer;
state.not_collectible_remarks = data.not_collectible_remarks
state.not_collectible = data.not_collectible
//富文本内容相关 //富文本内容相关
if(res.data.normCollectInfo) if(res.data.normCollectInfo)
...@@ -191,70 +200,9 @@ const openDialog = (data) => { ...@@ -191,70 +200,9 @@ const openDialog = (data) => {
}) })
}; };
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) => {
let userFilledInfo = state.formItem.userFilled;
let apiIndex = 1;
for(let i=0;i<userFilledInfo.length;i++)
{
if (userFilledInfo[0].radio==1) {
if (userFilledInfo[0].value == "") {
apiIndex++;
ElMessage.error('请填写红色星号必填项!');
break;
}
}
}
if(state.formItem.editorImgList.length>2){
apiIndex++;
state.formItem.editorImgList = [];
ElMessage.error('只允许上传两张图片!');
}
if(apiIndex==1&&valid){
claimTasksApi().normCollectsAdd(JSON.stringify(state.formItem)).then(res => {
state.btnLoading = false
ElMessage.success('操作成功');
closeDialog();
emit('refresh');
}).catch(() => {
state.btnLoading = false
closeDialog();
emit('refresh');
})
}
})
};
// 关闭弹窗 // 关闭弹窗
const closeDialog = () => { const closeDialog = () => {
state.index=0
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 = '';
state.review = [];
if(state.formItem.addItem.refer_type){
state.formItem.addItem.refer_type ='';
}
if(state.formItem.addItem.remark)
{
state.formItem.addItem.remark = '';
}
dialogFormRef.value.resetFields(); dialogFormRef.value.resetFields();
state.dialog.isShowDialog = false; state.dialog.isShowDialog = false;
}; };
......
...@@ -61,12 +61,12 @@ ...@@ -61,12 +61,12 @@
<el-table-column label="操作" width="350" fixed="right" align="center"> <el-table-column label="操作" width="350" fixed="right" align="center">
<template #default="scope"> <template #default="scope">
<div v-if="scope.row.status == 0 || scope.row.status == 1 || scope.row.status == 2"> <div v-if="scope.row.status == 0 || scope.row.status == 1 || scope.row.status == 2">
<el-button size="small" @click="modify(scope.row)" type="primary">修改任务</el-button> <el-button size="small" @click="modify(scope.row)" type="primary">修改信息</el-button>
<el-button size="small" @click="details(scope.row)">查看任务</el-button> <el-button size="small" @click="details(scope.row)">查看信息</el-button>
<el-button size="small" @click="receive(scope.row.id)" type="danger">退回任务</el-button> <el-button size="small" @click="receive(scope.row.id)" type="danger">退回领取</el-button>
</div> </div>
<div v-if="scope.row.status == 3 || scope.row.status == 4"> <div v-if="scope.row.status == 3 || scope.row.status == 4">
<el-button size="small" @click="details(scope.row)" type="primary">查看任务</el-button> <el-button size="small" @click="details(scope.row)" type="primary">查看信息</el-button>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -69,13 +69,30 @@ ...@@ -69,13 +69,30 @@
/> />
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="是否可采集:" prop="state.not_collectible">
<template #default="scope">
<span style="color: #F56C6C" v-if="state.not_collectible==1" effect="plain" size="small">{{state.not_collectible_remarks}}</span>
<span style="color: #909399" v-else effect="plain" size="small"></span>
</template>
</el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <el-row style="width: 100% !important;">
<el-button @click="closeDialog()" size="default">取 消</el-button> <el-col :span="12">
<el-button type="primary" :loading="state.btnLoading" @click="onSubmit(dialogFormRef)" <span class="dialog-footer">
size="default">提交</el-button> <el-col :span="20">
</span> <el-input v-model="state.notCollectibleData.reason" placeholder="请输入不可采集原因" clearable></el-input><el-button type="warning" :loading="state.btnLoading" @click="notCollectible()" size="danger">不可采集</el-button>
</el-col>
</span>
</el-col>
<el-col :span="12">
<span class="dialog-footer">
<el-button @click="closeDialog()" size="default">取 消</el-button>
<el-button type="primary" :loading="state.btnLoading" @click="onSubmit(dialogFormRef)"
size="danger">提交</el-button>
</span>
</el-col>
</el-row>
</template> </template>
</el-dialog> </el-dialog>
</div> </div>
...@@ -108,6 +125,10 @@ const state = reactive({ ...@@ -108,6 +125,10 @@ const state = reactive({
title: '', title: '',
submitTxt: '', submitTxt: '',
}, },
notCollectibleData:{
id:'',
reason:'',
},
dataLoading: false, dataLoading: false,
btnLoading: false, btnLoading: false,
// 填写内容及自定义文本框 // 填写内容及自定义文本框
...@@ -132,6 +153,8 @@ const state = reactive({ ...@@ -132,6 +153,8 @@ const state = reactive({
], ],
editorImgList:[], // 富文本里的内容 editorImgList:[], // 富文本里的内容
editorContent:'', // 富文本所有内容 editorContent:'', // 富文本所有内容
not_collectible:'',
not_collectible_remarks:'',
} }
}); });
...@@ -141,6 +164,7 @@ const openDialog = (data) => { ...@@ -141,6 +164,7 @@ const openDialog = (data) => {
state.dialog.title = '指标详情'; state.dialog.title = '指标详情';
state.apiData.id = data.id; state.apiData.id = data.id;
state.formItem.addItem.norm_receive_id = data.id; state.formItem.addItem.norm_receive_id = data.id;
state.notCollectibleData.id = data.id
// 清空数据 // 清空数据
claimTasksApi().normReceivesDetail(state.apiData).then(res => { claimTasksApi().normReceivesDetail(state.apiData).then(res => {
...@@ -154,7 +178,8 @@ const openDialog = (data) => { ...@@ -154,7 +178,8 @@ const openDialog = (data) => {
state.formItem.addItem.name = addItem.name; state.formItem.addItem.name = addItem.name;
state.formItem.addItem.task_name = addItem.task_name; state.formItem.addItem.task_name = addItem.task_name;
state.formItem.addItem.refer = addItem.refer; state.formItem.addItem.refer = addItem.refer;
state.not_collectible_remarks = data.not_collectible_remarks
state.not_collectible = data.not_collectible
//富文本内容相关 //富文本内容相关
if(res.data.normCollectInfo) if(res.data.normCollectInfo)
...@@ -185,6 +210,54 @@ const openDialog = (data) => { ...@@ -185,6 +210,54 @@ const openDialog = (data) => {
}) })
}; };
// 数据不可采集
const notCollectible = () =>{
const editor = editorRef.value;
if(state.notCollectibleData.id ==""){
ElMessage.error('无法获取ID!');
return;
}
if(state.notCollectibleData.reason ==""){
ElMessage.error('请填写不可采集的原因!');
return;
}
claimTasksApi().notCollectible(state.notCollectibleData).then(res => {
const editor = editorRef.value;
// 获取富文本里的图片地址
editor.getElemsByType("image").forEach((item, index) => {
state.formItem.editorImgList.push(item.src);
})
state.formItem.editorContent = editor.getHtml() // 获取富文本内容
let apiIndex = 1;
if(state.formItem.editorImgList.length>2){
apiIndex++;
state.formItem.editorImgList = [];
ElMessage.error('只允许上传两张图片!');
}
if(apiIndex==1&&valid){
claimTasksApi().normReceivesModify(JSON.stringify(state.formItem)).then(res => {
editor.clear()
state.btnLoading = false
ElMessage.success('操作成功');
closeDialog();
emit('refresh');
}).catch(() => {
editor.clear()
state.btnLoading = false
closeDialog();
emit('refresh');
})
}
}).catch(() => {
editor.clear()
state.btnLoading = false
closeDialog();
emit('refresh');
})
state.notCollectibleData.reason = '';
}
// 提交
const onSubmit = () => { const onSubmit = () => {
const editor = editorRef.value; const editor = editorRef.value;
// 获取富文本里的图片地址 // 获取富文本里的图片地址
...@@ -244,6 +317,8 @@ const closeDialog = () => { ...@@ -244,6 +317,8 @@ const closeDialog = () => {
state.formItem.userFilled = []; state.formItem.userFilled = [];
state.formItem.editorImgList = []; state.formItem.editorImgList = [];
state.formItem.editorContent = ''; state.formItem.editorContent = '';
state.not_collectible_remarks = ''
state.not_collectible = ''
if(state.formItem.addItem.refer_type){ if(state.formItem.addItem.refer_type){
state.formItem.addItem.refer_type =''; state.formItem.addItem.refer_type ='';
} }
......
...@@ -232,6 +232,7 @@ const notCollectible = () =>{ ...@@ -232,6 +232,7 @@ const notCollectible = () =>{
closeDialog(); closeDialog();
emit('refresh'); emit('refresh');
}) })
state.notCollectibleData.reason = '';
} }
// 保存数据 // 保存数据
......
...@@ -265,7 +265,7 @@ const onSubmit = () => { ...@@ -265,7 +265,7 @@ const onSubmit = () => {
emit('refresh'); emit('refresh');
}).catch(() => { }).catch(() => {
state.btnLoading = false state.btnLoading = false
// closeDialog(); closeDialog();
emit('refresh'); emit('refresh');
}) })
} }
......
...@@ -53,10 +53,10 @@ ...@@ -53,10 +53,10 @@
<span style="color:#F56C6C">{{scope.row.collectsQuantity}}</span> <span style="color:#F56C6C">{{scope.row.collectsQuantity}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="180" fixed="right" align="center"> <el-table-column label="操作" width="280" fixed="right" align="center">
<template #default="scope"> <template #default="scope">
<el-button size="small" link type="primary" @click="details(scope.row.id)">查看详情</el-button> <el-button size="small" type="primary" @click="details(scope.row.id)">查看详情</el-button>
<el-button size="small" link type="danger" @click="edit(scope.row.id)">修改指标</el-button> <el-button size="small" type="danger" @click="edit(scope.row.id)">修改指标</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
...@@ -10,12 +10,6 @@ ...@@ -10,12 +10,6 @@
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="state.ruleForm.name" placeholder="请输入名称" clearable></el-input> <el-input v-model="state.ruleForm.name" placeholder="请输入名称" clearable></el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item label="性别" prop="gender">
<el-radio-group v-model="state.ruleForm.gender" size="default" class="check-box">
<el-radio :label="1"></el-radio>
<el-radio :label="2"></el-radio>
</el-radio-group>
</el-form-item> -->
<el-form-item label="电话" prop="phone"> <el-form-item label="电话" prop="phone">
<el-input v-model="state.ruleForm.phone" placeholder="请输入电话" clearable></el-input> <el-input v-model="state.ruleForm.phone" placeholder="请输入电话" clearable></el-input>
</el-form-item> </el-form-item>
...@@ -62,10 +56,10 @@ const state = reactive({ ...@@ -62,10 +56,10 @@ const state = reactive({
department_id: '', department_id: '',
}, },
rules: { rules: {
account: [{ required: true, message: '请输入号', trigger: 'blur' }], account: [{ required: true, message: '请输入号', trigger: 'blur' }],
name: [{ required: true, message: '请输入职工姓名', trigger: 'blur' }], name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
phone: [{ required: true, message: '请输入电话', trigger: 'blur' }], phone: [{ required: true, message: '请输入电话', trigger: 'blur' }],
department_id: [{ required: true, message: '请选择科室', trigger: 'change' }], department_id: [{ required: true, message: '请选择部门', trigger: 'change' }],
}, },
dialog: { dialog: {
isShowDialog: false, isShowDialog: false,
......
...@@ -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