|
@@ -6,7 +6,8 @@
|
|
|
:maskClosable="false"
|
|
|
title="导入"
|
|
|
v-model="isShow"
|
|
|
- @cancel="isShow=false"
|
|
|
+ :closable="!spinning"
|
|
|
+ @cancel="isShow = false"
|
|
|
:width="900">
|
|
|
<div class="chooseImport-con">
|
|
|
<!-- 可导入数据 -->
|
|
@@ -15,10 +16,10 @@
|
|
|
class="sTable"
|
|
|
ref="table"
|
|
|
size="small"
|
|
|
- :rowKey="(record) => record.allocateSn"
|
|
|
+ :rowKey="(record) => record.no"
|
|
|
:columns="nowColumns"
|
|
|
:dataSource="loadData"
|
|
|
- :loading="loading"
|
|
|
+ :loading="spinning"
|
|
|
:scroll="{ y: 200 }"
|
|
|
:pagination="false"
|
|
|
bordered>
|
|
@@ -30,10 +31,10 @@
|
|
|
class="unTable"
|
|
|
ref="unTable"
|
|
|
size="small"
|
|
|
- :rowKey="(record) => record.errorDesc"
|
|
|
+ :rowKey="(record) => record.no"
|
|
|
:columns="nowUnColumns"
|
|
|
:dataSource="unLoadData"
|
|
|
- :loading="loading"
|
|
|
+ :loading="spinning"
|
|
|
:scroll="{ y: 200 }"
|
|
|
:pagination="false"
|
|
|
bordered>
|
|
@@ -44,6 +45,7 @@
|
|
|
type="primary"
|
|
|
id="chooseImport-submit"
|
|
|
size="large"
|
|
|
+ :loading="spinning"
|
|
|
:class="loadData.length==0?'button-grey':'button-primary'"
|
|
|
@click="handleSubmit"
|
|
|
style="padding: 0 40px;">确认导入</a-button>
|
|
@@ -51,6 +53,7 @@
|
|
|
id="chooseImport-cancel"
|
|
|
size="large"
|
|
|
class="button-cancel"
|
|
|
+ :disabled="spinning"
|
|
|
@click="isShow=false"
|
|
|
style="padding: 0 40px;margin-left: 15px;">取消</a-button>
|
|
|
<a-button
|
|
@@ -58,6 +61,7 @@
|
|
|
id="chooseImport-error"
|
|
|
size="large"
|
|
|
class="button-error"
|
|
|
+ :disabled="spinning"
|
|
|
@click="handleError"
|
|
|
style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
|
|
|
</div>
|
|
@@ -69,7 +73,7 @@
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
// 接口
|
|
|
-import { allocateBillParseProducts, allocateBillFailExcel } from '@/api/allocateBill'
|
|
|
+import { allocateBillParseProducts, allocateBillFailExcel, allocateBillBatchInsert } from '@/api/allocateBill'
|
|
|
export default {
|
|
|
name: 'TransferOutChooseImportModal',
|
|
|
mixins: [commonMixin],
|
|
@@ -88,6 +92,7 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
isShow: this.openModal, // 是否打开弹框
|
|
|
+ spinning: false,
|
|
|
nowColumns: [ // 正品
|
|
|
{ title: '序号', dataIndex: 'no', width: 70, align: 'center' },
|
|
|
{ title: '产品编码', dataIndex: 'productCode', align: 'center', customRender: function (text) { return text || '--' } },
|
|
@@ -114,10 +119,10 @@ export default {
|
|
|
// 获取表格数据
|
|
|
getData () {
|
|
|
const _this = this
|
|
|
- this.loading = true
|
|
|
+ this.spinning = true
|
|
|
// 获取列表数据 无分页
|
|
|
allocateBillParseProducts(this.paramsData).then(res => {
|
|
|
- this.loading = false
|
|
|
+ this.spinning = false
|
|
|
if (res.status == 200) {
|
|
|
if (res.data.okList && res.data.okList.length > 0) {
|
|
|
res.data.okList.map((item, index) => {
|
|
@@ -139,10 +144,21 @@ export default {
|
|
|
if (this.loadData.length == 0) {
|
|
|
this.$message.warning('无可导入产品!')
|
|
|
} else {
|
|
|
- this.$emit('ok', this.loadData)
|
|
|
- this.isShow = false
|
|
|
+ this.handleGuideOk(this.loadData)
|
|
|
}
|
|
|
},
|
|
|
+ // 导入产品
|
|
|
+ handleGuideOk (obj) {
|
|
|
+ this.spinning = true
|
|
|
+ allocateBillBatchInsert(obj).then(res => {
|
|
|
+ this.spinning = false
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.isShow = false
|
|
|
+ this.$emit('ok')
|
|
|
+ this.$message.success('导入成功!')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 导出
|
|
|
handleError () {
|
|
|
const _this = this
|