|
@@ -23,7 +23,6 @@
|
|
|
:pagination="false"
|
|
|
bordered>
|
|
|
</a-table>
|
|
|
- <a-divider />
|
|
|
<!-- 不可导入数据 -->
|
|
|
<p class="red">不可导入数据{{ unLoadData.length }}条</p>
|
|
|
<a-table
|
|
@@ -57,6 +56,7 @@
|
|
|
type="primary"
|
|
|
id="chooseImport-error"
|
|
|
size="large"
|
|
|
+ :class="unLoadData.length==0?'button-grey':'button-primary'"
|
|
|
class="button-error"
|
|
|
@click="handleError"
|
|
|
style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
|
|
@@ -69,7 +69,7 @@
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
// 接口
|
|
|
-import { batchImportProduct, exportErrorProduct } from '@/api/product'
|
|
|
+import { exportErrorOnlineProduct } from '@/api/product'
|
|
|
export default {
|
|
|
name: 'SalesOnlineImportModal',
|
|
|
mixins: [commonMixin],
|
|
@@ -89,92 +89,40 @@ export default {
|
|
|
return {
|
|
|
isShow: this.openModal, // 是否打开弹框
|
|
|
nowColumns: [
|
|
|
- { title: '序号', dataIndex: 'no', width: '3%', align: 'center' },
|
|
|
- { title: '产品名称', dataIndex: 'name', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品编码', dataIndex: 'code', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '原厂编码', dataIndex: 'origCode', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '其它编码', dataIndex: 'otherCode', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品品牌', dataIndex: 'productBrandName', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '一级分类', dataIndex: 'productTypeName1', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '二级分类', dataIndex: 'productTypeName2', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '三级分类', dataIndex: 'productTypeName3', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '单位', dataIndex: 'unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '包装数', dataIndex: 'packQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '包装数单位', dataIndex: 'packQtyUnit', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '是否箭冠产品', dataIndex: 'arrow', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '条形码', dataIndex: 'qrCode', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品尺寸', dataIndex: 'size', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '产品重量(g)', dataIndex: 'weight', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '颜色', dataIndex: 'color', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '产品内盒尺寸', dataIndex: 'boxSize', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '产品说明', dataIndex: 'description', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '出库仓库', dataIndex: 'outWarehouseName', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '退货仓库', dataIndex: 'returnWarehouseName', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '其他说明', dataIndex: 'otherDesc', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
+ { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: '95%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
],
|
|
|
loadData: [], // 可导入数据
|
|
|
nowUnColumns: [
|
|
|
- { title: '序号', dataIndex: 'no', width: '3%', align: 'center' },
|
|
|
- { title: '产品名称', dataIndex: 'name', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品编码', dataIndex: 'code', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '原厂编码', dataIndex: 'origCode', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '其它编码', dataIndex: 'otherCode', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品品牌', dataIndex: 'productBrandName', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '一级分类', dataIndex: 'productTypeName1', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '二级分类', dataIndex: 'productTypeName2', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '三级分类', dataIndex: 'productTypeName3', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '单位', dataIndex: 'unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '包装数', dataIndex: 'packQty', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '包装数单位', dataIndex: 'packQtyUnit', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '是否箭冠产品', dataIndex: 'arrow', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '条形码', dataIndex: 'qrCode', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品尺寸', dataIndex: 'size', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '产品重量(g)', dataIndex: 'weight', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '颜色', dataIndex: 'color', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '产品内盒尺寸', dataIndex: 'boxSize', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '产品说明', dataIndex: 'description', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '其他说明', dataIndex: 'otherDesc', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '出库仓库', dataIndex: 'outWarehouseName', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '退货仓库', dataIndex: 'returnWarehouseName', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '备注', dataIndex: 'errorMsg', width: '5%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
+ { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: '35%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '备注', dataIndex: 'remarks', width: '60%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
],
|
|
|
unLoadData: [], // 导入错误数据
|
|
|
loading: false// 列表加载状态
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- // 获取导入列表数据
|
|
|
- getData () {
|
|
|
- const _this = this
|
|
|
- this.loading = true
|
|
|
- const params = {
|
|
|
- path: this.paramsData.path
|
|
|
- }
|
|
|
- batchImportProduct(params).then(res => {
|
|
|
- this.loading = false
|
|
|
- if (res.status == 200) {
|
|
|
- // 计算可导入列表序号
|
|
|
- if (res.data.rightList && res.data.rightList.length > 0) {
|
|
|
- res.data.rightList.map((item, index) => {
|
|
|
- item.no = index + 1
|
|
|
- })
|
|
|
- }
|
|
|
- // 计算错误项列表序号
|
|
|
- if (res.data.errorList && res.data.errorList.length > 0) {
|
|
|
- res.data.errorList.map((item, index) => {
|
|
|
- item.no = index + 1
|
|
|
- })
|
|
|
- }
|
|
|
- _this.loadData = res.data.rightList || []
|
|
|
- _this.unLoadData = res.data.errorList || []
|
|
|
- }
|
|
|
+ formatData (data) {
|
|
|
+ data.map((item, index) => {
|
|
|
+ item.no = index + 1
|
|
|
+ item.id = new Date().getTime() + index
|
|
|
})
|
|
|
+ return data
|
|
|
+ },
|
|
|
+ getData () {
|
|
|
+ const paramsData = this.paramsData
|
|
|
+ this.loadData = this.formatData(paramsData.rightList || [])
|
|
|
+ this.unLoadData = this.formatData(paramsData.errorList || [])
|
|
|
+ console.log(this.loadData)
|
|
|
+ console.log(this.unLoadData)
|
|
|
},
|
|
|
// 确认导入
|
|
|
handleSubmit () {
|
|
|
if (this.loadData.length == 0) {
|
|
|
this.$message.warning('无可导入产品!')
|
|
|
} else {
|
|
|
+ this.loadData.type = 'online'
|
|
|
this.$emit('ok', this.loadData)
|
|
|
this.isShow = false
|
|
|
}
|
|
@@ -187,7 +135,7 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
_this.spinning = true
|
|
|
- hdExportExcel(exportErrorProduct, _this.unLoadData, '导出产品错误项', function () {
|
|
|
+ hdExportExcel(exportErrorOnlineProduct, _this.unLoadData, '导出上线产品错误项', function () {
|
|
|
_this.spinning = false
|
|
|
})
|
|
|
}
|