| | |
| | | <template> |
| | | <div class="draw-upload"> |
| | | <a-card> |
| | | <a-row> |
| | | <a-col :span="8"> |
| | | <span class="content-label">母物料编号:</span> |
| | | <span class="content-value">{{ parentInfo.parentCode }}</span> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <span class="content-label">母物料名称:</span> |
| | | <span class="content-value">{{ parentInfo.parentName }}</span> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <span class="content-label">母物料型号:</span> |
| | | <span class="content-value">{{ parentInfo.parentModel }}</span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-card> |
| | | <a-table |
| | | ref="aTable" |
| | | size="small" :scroll="{ x: 1920, y: y}" bordered |
| | | :columns="columns" :data-source="dataSource" |
| | | :pagination="false" rowKey="subCode"> |
| | | <template slot="pictureUrl" slot-scope="text"> |
| | | <image-view v-if="text" :url="webUrl+text" @load="imageLoad"></image-view> |
| | | </template> |
| | | <template slot="dwgExist" slot-scope="text"> |
| | | <a-tag :color="text?'blue':'red'">{{text?"已上传":"未上传"}}</a-tag> |
| | | </template> |
| | | <template slot="action" slot-scope="text, record"> |
| | | <div v-if="record.dwgUrl"> |
| | | <a>预览</a> |
| | | <a-divider type="vertical"></a-divider> |
| | | <a :href="webUrl+record.dwgUrl" download>下载</a> |
| | | </div> |
| | | </template> |
| | | </a-table> |
| | | <a-spin :spinning="spinning" tip="拼命加载中..."> |
| | | <a-card> |
| | | <a-row> |
| | | <a-col :span="8"> |
| | | <span class="content-label">母物料编号:</span> |
| | | <span class="content-value">{{ parentInfo.parentCode }}</span> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <span class="content-label">母物料名称:</span> |
| | | <span class="content-value">{{ parentInfo.parentName }}</span> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <span class="content-label">母物料型号:</span> |
| | | <span class="content-value">{{ parentInfo.parentModel }}</span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-card> |
| | | <a-table |
| | | ref="aTable" |
| | | size="small" :scroll="{ x: 1920, y: y}" bordered |
| | | :columns="columns" :data-source="dataSource" |
| | | :pagination="false" rowKey="subCode"> |
| | | <template slot="pictureUrl" slot-scope="text"> |
| | | <image-view v-if="text" :url="webUrl+text" @load="imageLoad"></image-view> |
| | | </template> |
| | | <template slot="dwgExist" slot-scope="text"> |
| | | <a-tag :color="text?'blue':'red'">{{text?"已上传":"未上传"}}</a-tag> |
| | | </template> |
| | | <template slot="action" slot-scope="text, record"> |
| | | <div v-if="record.dwgUrl"> |
| | | <a @click="dwgReview(record.dwgUrl)">预览</a> |
| | | <a-divider type="vertical"></a-divider> |
| | | <a :href="webUrl+record.dwgUrl" download>下载</a> |
| | | </div> |
| | | </template> |
| | | </a-table> |
| | | </a-spin> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import getWebUrl from "@/assets/js/tools/getWebUrl"; |
| | | import ImageView from "@/pages/components/ImageView"; |
| | | import {dwgReview} from "@/pages/workplace/apis"; |
| | | export default { |
| | | name: "DrawUpload", |
| | | components: {ImageView}, |
| | |
| | | align: 'center', |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: '基本单位', |
| | | dataIndex: 'unit', |
| | | align: 'center', |
| | | ellipsis: true, |
| | | }, |
| | | // { |
| | | // title: '基本单位', |
| | | // dataIndex: 'unit', |
| | | // align: 'center', |
| | | // ellipsis: true, |
| | | // }, |
| | | { |
| | | title: '子件数量', |
| | | dataIndex: 'quantity', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: '生产商', |
| | | dataIndex: 'producer', |
| | | align: 'center', |
| | | ellipsis: true, |
| | | }, |
| | | // { |
| | | // title: '生产商', |
| | | // dataIndex: 'producer', |
| | | // align: 'center', |
| | | // ellipsis: true, |
| | | // }, |
| | | { |
| | | title: '封装类型/材质', |
| | | dataIndex: 'material', |
| | |
| | | columns: columns, |
| | | webUrl: getWebUrl(), |
| | | y: 500, |
| | | spinning: false |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | this.y++; |
| | | this.$nextTick(()=>{ |
| | | this.y--; |
| | | }); |
| | | }, |
| | | dwgReview(url) { |
| | | this.spinning = true; |
| | | dwgReview(url).then(res=>{ |
| | | this.spinning = false; |
| | | let rs = res.data; |
| | | if(rs.code == 1 && rs.data) { |
| | | window.open(this.webUrl+rs.data); |
| | | }else { |
| | | this.$message.error(rs.msg); |
| | | } |
| | | }).catch(error=>{ |
| | | this.spinning = false; |
| | | console.log(error); |
| | | }); |
| | | } |
| | | }, |
| | |
| | | parentModel: "", |
| | | parentName: "", |
| | | }; |
| | | if(this.list.length != 0) { |
| | | if(this.list.length !== 0) { |
| | | let item = this.list[0]; |
| | | info.parentCode = item.parentCode; |
| | | info.parentModel = item.parentModel; |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | console.log(this.$refs.aTable); |
| | | |
| | | } |
| | | } |
| | | </script> |