|
@@ -4,9 +4,9 @@
|
|
|
class="chooseImport-modal"
|
|
|
:footer="null"
|
|
|
:maskClosable="false"
|
|
|
- title="确认导入"
|
|
|
+ title="确认导入货位"
|
|
|
v-model="isShow"
|
|
|
- @cancel="isShow=false"
|
|
|
+ @cancle="isShow=false"
|
|
|
:width="900">
|
|
|
<div class="chooseImport-con">
|
|
|
<!-- 可导入数据 -->
|
|
@@ -15,7 +15,7 @@
|
|
|
class="sTable"
|
|
|
ref="table"
|
|
|
size="small"
|
|
|
- :rowKey="(record) => record.shelfSn"
|
|
|
+ :rowKey="(record) => record.allocateSn"
|
|
|
:columns="nowColumns"
|
|
|
:dataSource="loadData"
|
|
|
:loading="loading"
|
|
@@ -27,7 +27,7 @@
|
|
|
<!-- 不可导入数据 -->
|
|
|
<p class="red">不可导入数据{{ unLoadData.length }}条</p>
|
|
|
<a-table
|
|
|
- class="sTable unTable"
|
|
|
+ class="unTable"
|
|
|
ref="unTable"
|
|
|
size="small"
|
|
|
:rowKey="(record) => record.errorDesc"
|
|
@@ -44,22 +44,33 @@
|
|
|
type="primary"
|
|
|
id="chooseImport-submit"
|
|
|
size="large"
|
|
|
+ :disabled="disabled"
|
|
|
:class="loadData.length==0?'button-grey':'button-primary'"
|
|
|
@click="handleSubmit"
|
|
|
style="padding: 0 40px;">确认导入</a-button>
|
|
|
<a-button
|
|
|
id="chooseImport-cancel"
|
|
|
size="large"
|
|
|
+ :disabled="disabled"
|
|
|
class="button-cancel"
|
|
|
@click="isShow=false"
|
|
|
style="padding: 0 40px;margin-left: 15px;">取消</a-button>
|
|
|
+ <a-button
|
|
|
+ type="primary"
|
|
|
+ id="chooseImport-error"
|
|
|
+ size="large"
|
|
|
+ :disabled="disabled"
|
|
|
+ class="button-error"
|
|
|
+ @click="handleError"
|
|
|
+ style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</a-modal>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { shelfProductParseProducts } from '@/api/shelf'
|
|
|
+import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
+import { shelfTemplateImportDetailError } from '@/api/shelfTemplate'
|
|
|
import { toThousands } from '@/libs/tools.js'
|
|
|
export default {
|
|
|
name: 'ChooseImportModal',
|
|
@@ -80,60 +91,67 @@ export default {
|
|
|
return {
|
|
|
toThousands,
|
|
|
isShow: this.openModal, // 是否打开弹框
|
|
|
- nowColumns: [ // 可导入
|
|
|
- { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
|
|
|
- { title: '货位号', dataIndex: 'shelfPlaceCode', width: '19%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '绑定产品编码', dataIndex: 'productCode', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '绑定产品名称', dataIndex: 'productName', width: '26%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '车主价', dataIndex: 'price', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
|
|
|
- { title: '结算价', dataIndex: 'cost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
|
|
|
- { title: '最大库容', dataIndex: 'maxQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
+ nowColumns: [
|
|
|
+ { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
|
|
|
+ { title: '货位号', dataIndex: 'shelfPlaceCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: '35%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ // { title: '产品名称', dataIndex: 'productName', width: '45%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '车主价', dataIndex: 'price', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) && text.length ? _this.toThousands(text, 2) : '--') } },
|
|
|
+ { title: '结算价', dataIndex: 'cost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) && text.length ? _this.toThousands(text, 2) : '--') } },
|
|
|
+ { title: '最大库容', dataIndex: 'maxQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
],
|
|
|
- nowUnColumns: [ // 不可导入
|
|
|
- { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
|
|
|
- { title: '货位号', dataIndex: 'shelfPlaceCode', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '绑定产品编码', dataIndex: 'productCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '绑定产品名称', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '车主价', dataIndex: 'price', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
|
|
|
- { title: '结算价', dataIndex: 'cost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
|
|
|
+ loadData: [],
|
|
|
+ nowUnColumns: [
|
|
|
+ { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
|
|
|
+ { title: '货位号', dataIndex: 'shelfPlaceCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: '35%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ // { title: '产品名称', dataIndex: 'productName', width: '30%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '车主价', dataIndex: 'price', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) && text.length ? _this.toThousands(text, 2) : '--') } },
|
|
|
+ { title: '结算价', dataIndex: 'cost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) && text.length ? _this.toThousands(text, 2) : '--') } },
|
|
|
{ title: '最大库容', dataIndex: 'maxQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '错误原因', dataIndex: 'remarks', width: '17%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true }
|
|
|
+ { title: '错误原因', dataIndex: 'remark', width: '25%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
],
|
|
|
- loadData: [],
|
|
|
unLoadData: [],
|
|
|
- loading: false
|
|
|
+ loading: false,
|
|
|
+ disabled: false
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
getData () {
|
|
|
- const _this = this
|
|
|
- this.loading = true
|
|
|
- shelfProductParseProducts(this.paramsData).then(res => {
|
|
|
- this.loading = false
|
|
|
- if (res.status == 200) {
|
|
|
- if (res.data.successList && res.data.successList.length > 0) {
|
|
|
- res.data.successList.map((item, index) => {
|
|
|
- item.no = index + 1
|
|
|
- })
|
|
|
- }
|
|
|
- if (res.data.failList && res.data.failList.length > 0) {
|
|
|
- res.data.failList.map((item, index) => {
|
|
|
- item.no = index + 1
|
|
|
- })
|
|
|
- }
|
|
|
- _this.loadData = res.data.successList || []
|
|
|
- _this.unLoadData = res.data.failList || []
|
|
|
- }
|
|
|
+ const paramsData = JSON.parse(JSON.stringify(this.paramsData))
|
|
|
+ this.loadData = paramsData.rightList || []
|
|
|
+ this.unLoadData = paramsData.errorList || []
|
|
|
+ this.loadData.map((item, index) => {
|
|
|
+ item.no = index + 1
|
|
|
+ item.templateSn = paramsData.templateSn
|
|
|
+ })
|
|
|
+ this.unLoadData.map((item, index) => {
|
|
|
+ item.no = index + 1
|
|
|
+ item.templateSn = paramsData.templateSn
|
|
|
})
|
|
|
},
|
|
|
// 确认导入
|
|
|
handleSubmit () {
|
|
|
- if (this.loadData.length == 0) {
|
|
|
- this.$message.warning('无可导入产品!')
|
|
|
+ if (this.paramsData.rightList.length == 0) {
|
|
|
+ this.$message.warning('无可导入的货位!')
|
|
|
} else {
|
|
|
- this.$emit('ok', this.loadData)
|
|
|
+ const data = this.paramsData.rightList
|
|
|
+
|
|
|
+ this.$emit('ok', data)
|
|
|
this.isShow = false
|
|
|
}
|
|
|
+ },
|
|
|
+ // 导出
|
|
|
+ handleError () {
|
|
|
+ const _this = this
|
|
|
+ if (_this.paramsData.errorList.length < 1) {
|
|
|
+ _this.$message.info('暂无可导出错误项~')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ _this.spinning = true
|
|
|
+ hdExportExcel(shelfTemplateImportDetailError, _this.paramsData.errorList, '货架模板货位错误项', function () {
|
|
|
+ _this.spinning = false
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
watch: {
|