|
@@ -139,7 +139,10 @@
|
|
align="center"
|
|
align="center"
|
|
label="附件">
|
|
label="附件">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-button :disabled="!scope.row.attachList || scope.row.attachList.length === 0" type="text" size="small" @click="attachDetails(scope.row)">查看</el-button>
|
|
|
|
|
|
+ <div v-for="(item, index) in scope.row.attachList" style="display: inline">
|
|
|
|
+ <span v-if="index > 0">,</span>
|
|
|
|
+ <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{ item.fileName }}</a>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -200,7 +203,8 @@
|
|
</span>
|
|
</span>
|
|
<!-- 新增物品 -->
|
|
<!-- 新增物品 -->
|
|
<Add v-show="addProductVisible" ref="comAddProduct" @addItem="addProductCallback"/>
|
|
<Add v-show="addProductVisible" ref="comAddProduct" @addItem="addProductCallback"/>
|
|
- <attach-detail v-if="attachVisible" ref="attachDetail" @onChose="onChose"/>
|
|
|
|
|
|
+ <!-- 文件预览 -->
|
|
|
|
+ <preview-component v-if="previewVisible" ref="preview"/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -208,12 +212,15 @@
|
|
import { getOutsourceDetail, getOutsourceDetailByScheduleId } from '@/api/sale'
|
|
import { getOutsourceDetail, getOutsourceDetailByScheduleId } from '@/api/sale'
|
|
import { getDictList } from '@/api/dict'
|
|
import { getDictList } from '@/api/dict'
|
|
import Add from './add-product'
|
|
import Add from './add-product'
|
|
- import AttachDetail from '../common/attach-detail'
|
|
|
|
|
|
+ import ApproveComponent from '../common/approve-component'
|
|
|
|
+ import PreviewComponent from '../common/preview-component'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'outsource-add-or-update',
|
|
name: 'outsource-add-or-update',
|
|
components: {
|
|
components: {
|
|
- Add, AttachDetail
|
|
|
|
|
|
+ PreviewComponent,
|
|
|
|
+ ApproveComponent,
|
|
|
|
+ Add
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
@@ -228,7 +235,7 @@ export default {
|
|
addProductVisible: false,
|
|
addProductVisible: false,
|
|
productDetails: [],
|
|
productDetails: [],
|
|
prodProductionIds: [], // 排产ID的集合
|
|
prodProductionIds: [], // 排产ID的集合
|
|
- attachVisible: false
|
|
|
|
|
|
+ previewVisible: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -365,11 +372,11 @@ export default {
|
|
str += '%'
|
|
str += '%'
|
|
return str
|
|
return str
|
|
},
|
|
},
|
|
- // 附件
|
|
|
|
- attachDetails (row) {
|
|
|
|
- this.attachVisible = true
|
|
|
|
|
|
+ // 预览
|
|
|
|
+ previewFile (fileName, url) {
|
|
|
|
+ this.previewVisible = true
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- this.$refs.attachDetail.init(row.attachList)
|
|
|
|
|
|
+ this.$refs.preview.init(fileName, url)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|