|
@@ -8,59 +8,61 @@
|
|
v-model="isShow"
|
|
v-model="isShow"
|
|
@cancle="isShow=false"
|
|
@cancle="isShow=false"
|
|
:width="900">
|
|
:width="900">
|
|
- <div class="chooseImport-con">
|
|
|
|
- <!-- 可导入数据 -->
|
|
|
|
- <p class="chooseImport-tit">可导入数据{{ loadData.length }}条</p>
|
|
|
|
- <a-table
|
|
|
|
- class="sTable"
|
|
|
|
- ref="table"
|
|
|
|
- size="small"
|
|
|
|
- :rowKey="(record) => record.purchaseBillSn"
|
|
|
|
- :columns="nowColumns"
|
|
|
|
- :dataSource="loadData"
|
|
|
|
- :loading="loading"
|
|
|
|
- :scroll="{ y: 200 }"
|
|
|
|
- :pagination="false"
|
|
|
|
- bordered>
|
|
|
|
- </a-table>
|
|
|
|
- <a-divider />
|
|
|
|
- <!-- 不可导入数据 -->
|
|
|
|
- <p class="chooseImport-tit red">不可导入数据{{ unLoadData.length }}条</p>
|
|
|
|
- <a-table
|
|
|
|
- class="unTable sTable"
|
|
|
|
- ref="unTable"
|
|
|
|
- size="small"
|
|
|
|
- :rowClassName="(record, index) => 'yellowBg-row'"
|
|
|
|
- :rowKey="(record) => record.errorDesc"
|
|
|
|
- :columns="nowUnColumns"
|
|
|
|
- :dataSource="unLoadData"
|
|
|
|
- :loading="loading"
|
|
|
|
- :scroll="{ y: 200 }"
|
|
|
|
- :pagination="false"
|
|
|
|
- bordered>
|
|
|
|
- </a-table>
|
|
|
|
- <!-- 按钮 -->
|
|
|
|
- <div class="btn-con">
|
|
|
|
- <a-button
|
|
|
|
- type="primary"
|
|
|
|
- id="chooseImport-submit"
|
|
|
|
- size="large"
|
|
|
|
- :class="loadData.length==0?'button-grey':'button-primary'"
|
|
|
|
- @click="handleSubmit"
|
|
|
|
- style="padding: 0 60px;">确认导入</a-button>
|
|
|
|
- <a-button
|
|
|
|
- id="chooseImport-cancel"
|
|
|
|
- size="large"
|
|
|
|
- class="button-cancel"
|
|
|
|
- @click="isShow=false"
|
|
|
|
- style="padding: 0 60px;margin-left: 15px;">取消</a-button>
|
|
|
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
|
+ <div class="chooseImport-con">
|
|
|
|
+ <!-- 可导入数据 -->
|
|
|
|
+ <p class="chooseImport-tit">可导入数据{{ loadData.length }}条</p>
|
|
|
|
+ <a-table
|
|
|
|
+ class="sTable"
|
|
|
|
+ ref="table"
|
|
|
|
+ size="small"
|
|
|
|
+ :rowKey="(record) => record.purchaseBillSn"
|
|
|
|
+ :columns="nowColumns"
|
|
|
|
+ :dataSource="loadData"
|
|
|
|
+ :loading="loading"
|
|
|
|
+ :scroll="{ y: 200 }"
|
|
|
|
+ :pagination="false"
|
|
|
|
+ bordered>
|
|
|
|
+ </a-table>
|
|
|
|
+ <a-divider />
|
|
|
|
+ <!-- 不可导入数据 -->
|
|
|
|
+ <p class="chooseImport-tit red">不可导入数据{{ unLoadData.length }}条</p>
|
|
|
|
+ <a-table
|
|
|
|
+ class="unTable sTable"
|
|
|
|
+ ref="unTable"
|
|
|
|
+ size="small"
|
|
|
|
+ :rowClassName="(record, index) => 'yellowBg-row'"
|
|
|
|
+ :rowKey="(record) => record.errorDesc"
|
|
|
|
+ :columns="nowUnColumns"
|
|
|
|
+ :dataSource="unLoadData"
|
|
|
|
+ :loading="loading"
|
|
|
|
+ :scroll="{ y: 200 }"
|
|
|
|
+ :pagination="false"
|
|
|
|
+ bordered>
|
|
|
|
+ </a-table>
|
|
|
|
+ <!-- 按钮 -->
|
|
|
|
+ <div class="btn-con">
|
|
|
|
+ <a-button
|
|
|
|
+ type="primary"
|
|
|
|
+ id="chooseImport-submit"
|
|
|
|
+ size="large"
|
|
|
|
+ :class="loadData.length==0?'button-grey':'button-primary'"
|
|
|
|
+ @click="handleSubmit"
|
|
|
|
+ style="padding: 0 60px;">确认导入</a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ id="chooseImport-cancel"
|
|
|
|
+ size="large"
|
|
|
|
+ class="button-cancel"
|
|
|
|
+ @click="isShow=false"
|
|
|
|
+ style="padding: 0 60px;margin-left: 15px;">取消</a-button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
|
|
+ </a-spin>
|
|
</a-modal>
|
|
</a-modal>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { purchaseDetailParseProducts } from '@/api/purchase'
|
|
|
|
|
|
+import { purchaseDetailParseProducts, purchaseDetailBatchInsert } from '@/api/purchase'
|
|
export default {
|
|
export default {
|
|
name: 'ChooseImportModal',
|
|
name: 'ChooseImportModal',
|
|
props: {
|
|
props: {
|
|
@@ -77,6 +79,7 @@ export default {
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
|
|
+ spinning: false,
|
|
isShow: this.openModal, // 是否打开弹框
|
|
isShow: this.openModal, // 是否打开弹框
|
|
nowColumns: [ // 正品
|
|
nowColumns: [ // 正品
|
|
{ title: '序号', dataIndex: 'no', width: '15%', align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: '15%', align: 'center' },
|
|
@@ -125,8 +128,14 @@ export default {
|
|
if (this.loadData.length == 0) {
|
|
if (this.loadData.length == 0) {
|
|
this.$message.warning('无可导入产品!')
|
|
this.$message.warning('无可导入产品!')
|
|
} else {
|
|
} else {
|
|
- this.$emit('ok', this.loadData)
|
|
|
|
- this.isShow = false
|
|
|
|
|
|
+ this.spinning = true
|
|
|
|
+ purchaseDetailBatchInsert(this.loadData).then(res => {
|
|
|
|
+ this.spinning = false
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.$emit('ok', '')
|
|
|
|
+ this.isShow = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|