Commit 1dcaa1d1 authored by 高滢's avatar 高滢

feat(样品): bug

parent db9ad441
...@@ -75,7 +75,6 @@ ...@@ -75,7 +75,6 @@
:data="tableData" :data="tableData"
style="width: 100%" style="width: 100%"
border border
:cell-style="taskNameCellStyle"
@sort-change="sortClick" @sort-change="sortClick"
> >
<el-table-column type="index" width="55" label="序号" align="center"> <el-table-column type="index" width="55" label="序号" align="center">
...@@ -140,7 +139,7 @@ ...@@ -140,7 +139,7 @@
show-overflow-tooltip show-overflow-tooltip
min-width="200" min-width="200"
/> />
<el-table-column label="相关任务"> <el-table-column label="相关任务" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.taskSampleRelation.length > 0"> <div v-if="scope.row.taskSampleRelation.length > 0">
<el-link <el-link
...@@ -360,17 +359,17 @@ ...@@ -360,17 +359,17 @@
<el-form-item label="样品照片:" prop="samplePhotos"> <el-form-item label="样品照片:" prop="samplePhotos">
<div v-if="clickNameForm.samplePhotos"> <div v-if="clickNameForm.samplePhotos">
<image-preview <image-preview
:src="clickNameForm.samplePhotos" v-for="(item, index) in clickNameForm.samplePhotos"
:key="index"
width="150px" width="150px"
height="150px" height="150px"
style="margin-right: 20px"
:src="item"
></image-preview> ></image-preview>
</div> </div>
<div v-else>暂无数据</div> <div v-else>暂无数据</div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
</div>
</el-dialog> </el-dialog>
<MaterialLibrary <MaterialLibrary
...@@ -391,6 +390,7 @@ import { ...@@ -391,6 +390,7 @@ import {
} from '@/api/system/sample' } from '@/api/system/sample'
import MaterialLibrary from '@/views/setting/materialLibrary/index.vue' import MaterialLibrary from '@/views/setting/materialLibrary/index.vue'
import materialLibrary from '@/views/setting/materialLibrary/index.vue' import materialLibrary from '@/views/setting/materialLibrary/index.vue'
import { isExternal } from '@/utils/validate'
export default { export default {
components: { MaterialLibrary }, components: { MaterialLibrary },
...@@ -487,11 +487,6 @@ export default { ...@@ -487,11 +487,6 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
taskNameCellStyle(row, column, rowIndex, columnIndex) {
if (row.columnIndex === 9) {
return { whiteSpace: 'nowrap' }
}
},
closeMaterial(data) { closeMaterial(data) {
this.materialShow = data this.materialShow = data
}, },
...@@ -537,7 +532,11 @@ export default { ...@@ -537,7 +532,11 @@ export default {
}) })
}, },
clickAddButton() { clickAddButton() {
this.dialogTitle = '新增' if (this.activeName === 'completeSample') {
this.dialogTitle = '新增整车样品'
} else {
this.dialogTitle = '新增零部件样品'
}
this.dialogVisible = true this.dialogVisible = true
this.determineActiveName() this.determineActiveName()
}, },
...@@ -622,24 +621,35 @@ export default { ...@@ -622,24 +621,35 @@ export default {
clickSampleName(row) { clickSampleName(row) {
this.dialogFormVisible = true this.dialogFormVisible = true
this.clickNameForm = row this.clickNameForm = row
this.clickNameForm.samplePhotos =
this.clickNameForm.samplePhotos.split(',')
console.log(row)
}, },
closeSamplePhoto() { closeSamplePhoto() {
this.clickNameForm = {} this.clickNameForm = {}
}, },
handleUpdate(id) { handleUpdate(id) {
this.dialogTitle = '编辑' if (this.activeName === 'completeSample') {
this.dialogTitle = '编辑整车样品'
} else {
this.dialogTitle = '编辑零部件样品'
}
selectSampleInfo({ id: id }).then(res => { selectSampleInfo({ id: id }).then(res => {
this.editParamsForm = res.data this.editParamsForm = res.data
this.dialogVisible = true this.dialogVisible = true
}) })
}, },
handleDelete(id) { handleDelete(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { this.$confirm('是否确定删除该条数据?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
removeSample({ id: id }).then(() => { removeSample({ id: id }).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.getList() this.getList()
}) })
}) })
...@@ -655,7 +665,7 @@ export default { ...@@ -655,7 +665,7 @@ export default {
} }
} }
</script> </script>
<style> <style lang="scss" scoped>
.dialog-button { .dialog-button {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
...@@ -664,4 +674,7 @@ export default { ...@@ -664,4 +674,7 @@ export default {
.custom-link:hover { .custom-link:hover {
text-decoration: underline; text-decoration: underline;
} }
::v-deep .el-textarea__inner {
font-family: 微软雅黑;
}
</style> </style>
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