|
|
|
@ -54,8 +54,14 @@ export default { |
|
|
|
default: false |
|
|
|
} |
|
|
|
}, |
|
|
|
data () { |
|
|
|
return { |
|
|
|
data(){ |
|
|
|
return{ |
|
|
|
// 导出 |
|
|
|
exportData: [], |
|
|
|
exportName: 'Part Info' + this.dayjs().format('YYYYMMDDHHmmss') + '.xlsx', |
|
|
|
exportHeader: ['Part Info'], |
|
|
|
exportFooter: [], |
|
|
|
resultList: [], |
|
|
|
no: 1, |
|
|
|
size: 50, |
|
|
|
total: 0, |
|
|
|
@ -1190,7 +1196,41 @@ export default { |
|
|
|
this.savePart.qtyPerCarton = this.qtyPerCarton() |
|
|
|
this.category = JSON.parse(JSON.stringify(category)) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
// ======== 导出相关方法 ======== |
|
|
|
/** |
|
|
|
* 导出excel |
|
|
|
*/ |
|
|
|
async createExportData () { |
|
|
|
let params = { |
|
|
|
...this.part, |
|
|
|
site: this.$store.state.user.site, |
|
|
|
no:1, |
|
|
|
size:-1, |
|
|
|
} |
|
|
|
await selectExternalPartPage(params).then(({data}) => { |
|
|
|
this.resultList = data.rows |
|
|
|
}) |
|
|
|
return this.resultList |
|
|
|
}, |
|
|
|
|
|
|
|
startDownload () {}, |
|
|
|
|
|
|
|
finishDownload () {}, |
|
|
|
|
|
|
|
fields () { |
|
|
|
let json = '{' |
|
|
|
this.columnList.forEach((item, index) => { |
|
|
|
if (index == this.columnList.length - 1) { |
|
|
|
json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' |
|
|
|
} else { |
|
|
|
json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ',' |
|
|
|
} |
|
|
|
}) |
|
|
|
json += '}' |
|
|
|
let s = eval('(' + json + ')') |
|
|
|
return s |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: {}, |
|
|
|
activated () { |
|
|
|
@ -1242,6 +1282,20 @@ export default { |
|
|
|
<el-button type="primary" @click="handleSave" v-if="!ofComponents">New</el-button> |
|
|
|
<!-- <el-button type="primary" @click="selectExternalPartList">Query</el-button>--> |
|
|
|
<el-button type="primary" @click="handleSelectExternalPartPage">Query</el-button> |
|
|
|
<download-excel |
|
|
|
:fields="fields()" |
|
|
|
:data="exportData" |
|
|
|
type="xlsx" |
|
|
|
:name="exportName" |
|
|
|
:header="exportHeader" |
|
|
|
:footer="exportFooter" |
|
|
|
:fetch="createExportData" |
|
|
|
:before-generate="startDownload" |
|
|
|
:before-finish="finishDownload" |
|
|
|
worksheet="Input Information" |
|
|
|
class="el-button el-button--primary el-button--medium"> |
|
|
|
{{ "Input" }} |
|
|
|
</download-excel> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
@ -1440,7 +1494,7 @@ export default { |
|
|
|
<div v-show="false"> |
|
|
|
<img :src="item" v-for="(item,index) in base64List" :key="index" style="display: none"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<style scoped> |
|
|
|
|