|
@@ -170,14 +170,15 @@
|
|
|
@click="openDetail(scope.row.id)"
|
|
|
v-hasPermi="['production:record:edit']"
|
|
|
>整改记录
|
|
|
- </el-button><el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-edit"
|
|
|
- @click="handleUpdate(scope.row)"
|
|
|
- v-hasPermi="['production:inspection:edit']"
|
|
|
- >修改
|
|
|
- </el-button>
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ v-hasPermi="['production:inspection:edit']"
|
|
|
+ >修改
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
@@ -213,7 +214,7 @@
|
|
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
|
|
|
<el-form-item label="区域序号" prop="regionOrder">
|
|
|
- <el-select v-model="form.regionOrder" filterable clearable placeholder="请选择区域序号"
|
|
|
+ <el-select v-model="form.regionOrder" filterable clearable placeholder="请选择区域序号"
|
|
|
style="width: 100%" @change="selectChange">
|
|
|
<el-option v-for="region in regionList"
|
|
|
:key="region.orderNo"
|
|
@@ -224,7 +225,7 @@
|
|
|
<el-form-item label="位置" prop="position">
|
|
|
<el-input v-model="form.position" disabled placeholder="请输入位置"/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="区域负责人" prop="owner">
|
|
|
+ <el-form-item label="区域负责人" prop="owner">
|
|
|
<el-input v-model="form.owner" disabled placeholder="请输入区域负责人"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="检查日期" prop="checkDate">
|
|
@@ -249,6 +250,7 @@
|
|
|
:disabled="file.isUploading"
|
|
|
:on-progress="handleFileDocProgress"
|
|
|
:on-success="handleFileDocSuccess"
|
|
|
+ :on-remove="handleRemove"
|
|
|
:auto-upload="true"
|
|
|
:limit="4"
|
|
|
:on-exceed="exceedFile"
|
|
@@ -291,6 +293,7 @@
|
|
|
:disabled="file.isUploading"
|
|
|
:on-progress="handleFileDocProgress"
|
|
|
:on-success="handleFileDocSuccess2"
|
|
|
+ :on-remove="handleRemove"
|
|
|
:auto-upload="true"
|
|
|
:limit="4"
|
|
|
:on-exceed="exceedFile"
|
|
@@ -302,12 +305,9 @@
|
|
|
<i class="el-icon-plus"></i>
|
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="整改结果" prop="changeResult">
|
|
|
- <el-input v-model="form.changeResult" placeholder="请输入整改结果"/>
|
|
|
- </el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="changeRecord">确 定</el-button>
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
@@ -320,7 +320,6 @@
|
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
@click="handleChange"
|
|
|
- v-hasPermi="['production:details:add']"
|
|
|
>添加整改记录
|
|
|
</el-button>
|
|
|
</el-col>
|
|
@@ -344,7 +343,29 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="整改内容" align="center" prop="changeContent" :show-overflow-tooltip="true"/>
|
|
|
- <el-table-column label="整改结果" align="center" prop="changeResult" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="整改结果" align="center" prop="changeResult" :show-overflow-tooltip="true">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-if="scope.row.changeResult==null">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-tickets"
|
|
|
+ @click="checkRecord(scope.row,'合格')"
|
|
|
+ v-hasPermi="['production:record:approve']"
|
|
|
+ >合格
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-tickets"
|
|
|
+ @click="checkRecord(scope.row,'不合格')"
|
|
|
+ v-hasPermi="['production:record:approve']"
|
|
|
+ >不合格
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <div v-else>{{ scope.row.changeResult }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -390,7 +411,7 @@ import {
|
|
|
addRecord,
|
|
|
updateRecord,
|
|
|
exportRecord,
|
|
|
- importTemplate
|
|
|
+ importTemplate, approveRecord, changeRecord
|
|
|
} from "@/api/production/record";
|
|
|
import {treeselect} from "@/api/system/dept";
|
|
|
import {getToken} from "@/utils/auth";
|
|
@@ -513,9 +534,6 @@ export default {
|
|
|
changeContent: [
|
|
|
{required: true, message: "请输入整改内容", trigger: "blur"}
|
|
|
],
|
|
|
- changeResult: [
|
|
|
- {required: true, message: "请输入整改结果", trigger: "blur"}
|
|
|
- ]
|
|
|
}
|
|
|
};
|
|
|
},
|
|
@@ -535,6 +553,43 @@ export default {
|
|
|
this.getRegion();
|
|
|
},
|
|
|
methods: {
|
|
|
+ checkRecord(row, result) {
|
|
|
+ console.log(row)
|
|
|
+ approveRecord({id: row.id, recordId: row.recordId, changeResult: result}).then(res => {
|
|
|
+ this.getDetailList(row.recordId);
|
|
|
+ this.getList();
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleRemove(file, fileList){
|
|
|
+ console.log(this.fileIds,this.personFiles)
|
|
|
+ console.log(file)
|
|
|
+ if(file.response.data!=null){
|
|
|
+ if (this.fileIds.indexOf(file.response.data)>=0){
|
|
|
+ this.fileIds.splice(this.fileIds.indexOf(file.response.data),1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(this.fileIds,this.personFiles)
|
|
|
+ },
|
|
|
+ changeRecord(row, result) {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.fileIds != []) {
|
|
|
+ this.form.checkFile = this.fileIds.join(',');
|
|
|
+ }
|
|
|
+ if (this.changeFileIds != []) {
|
|
|
+ this.form.changeFile = this.changeFileIds.join(',');
|
|
|
+ }
|
|
|
+ changeRecord(this.form).then(response => {
|
|
|
+ this.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.changeOpen = false;
|
|
|
+ this.getList();
|
|
|
+ this.getDetailList(this.form.id);
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
// 文件超出个数限制时的钩子
|
|
|
exceedFile(files, fileList) {
|
|
|
this.$message.warning(
|
|
@@ -546,23 +601,23 @@ export default {
|
|
|
this.regionList = res.data;
|
|
|
})
|
|
|
},
|
|
|
- selectChange(event){
|
|
|
- this.form.position=this.regionList.find((o) => o.orderNo === event).position
|
|
|
- this.form.owner=this.regionList.find((o) => o.orderNo === event).personLiable
|
|
|
+ selectChange(event) {
|
|
|
+ this.form.position = this.regionList.find((o) => o.orderNo === event).position
|
|
|
+ this.form.owner = this.regionList.find((o) => o.orderNo === event).personLiable
|
|
|
},
|
|
|
openDetail(id) {
|
|
|
this.detail.recordId = id;
|
|
|
this.detail.open = true;
|
|
|
this.getDetailList(id);
|
|
|
},
|
|
|
- getDetailList(id){
|
|
|
+ getDetailList(id) {
|
|
|
listDetails({recordId: id}).then(response => {
|
|
|
this.detailsList = response.rows;
|
|
|
});
|
|
|
},
|
|
|
openFile(fileIds, title) {
|
|
|
this.file.title = title;
|
|
|
- this.file.file=null;
|
|
|
+ this.file.file = null;
|
|
|
this.file.open = true;
|
|
|
this.srcList = [];
|
|
|
let ids = fileIds.split(',');
|
|
@@ -667,6 +722,16 @@ export default {
|
|
|
const id = row.id || this.ids
|
|
|
getRecord(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
+ if (this.form.checkFile!=null){
|
|
|
+ let ids = this.form.checkFile.split(',')
|
|
|
+ for (const id of ids) {
|
|
|
+ getFile(id).then(res=>{
|
|
|
+ let item = {url: process.env.VUE_APP_BASE_API +res.data.url,response: {msg: res.data.url,data:id} }
|
|
|
+ this.fileList.push(item)
|
|
|
+ this.fileIds.push(id)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
this.open = true;
|
|
|
this.title = "修改区域检查整改记录";
|
|
|
});
|
|
@@ -678,10 +743,10 @@ export default {
|
|
|
this.reset();
|
|
|
getRecord(this.detail.recordId).then(response => {
|
|
|
this.form = response.data;
|
|
|
- this.form.changeContent='';
|
|
|
- this.form.changeFile='';
|
|
|
- this.form.changeResult='';
|
|
|
- this.form.changeDate='';
|
|
|
+ this.form.changeContent = '';
|
|
|
+ this.form.changeFile = '';
|
|
|
+ this.form.changeResult = '';
|
|
|
+ this.form.changeDate = '';
|
|
|
this.changeOpen = true;
|
|
|
this.title = "添加区域检查整改记录";
|
|
|
});
|