|
@@ -4,7 +4,7 @@
|
|
|
class="chooseImport-modal"
|
|
|
:footer="null"
|
|
|
:maskClosable="false"
|
|
|
- title="确认导入"
|
|
|
+ title="确认导入货位"
|
|
|
v-model="isShow"
|
|
|
@cancle="isShow=false"
|
|
|
:width="900">
|
|
@@ -53,14 +53,21 @@
|
|
|
class="button-cancel"
|
|
|
@click="isShow=false"
|
|
|
style="padding: 0 40px;margin-left: 15px;">取消</a-button>
|
|
|
+ <a-button
|
|
|
+ type="primary"
|
|
|
+ id="chooseImport-error"
|
|
|
+ size="large"
|
|
|
+ class="button-error"
|
|
|
+ @click="handleError"
|
|
|
+ style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</a-modal>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-// import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
-import { saveBatchExcel, exportExcelData } from '@/api/shelf'
|
|
|
+import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
+import { shelfPlaceReadExcel, shelfSaveBatchExcel, shelfPlaceFailExcel } from '@/api/shelf'
|
|
|
export default {
|
|
|
name: 'ChooseImportModal',
|
|
|
props: {
|
|
@@ -79,14 +86,24 @@ export default {
|
|
|
return {
|
|
|
isShow: this.openModal, // 是否打开弹框
|
|
|
nowColumns: [
|
|
|
- { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
|
|
|
- { title: '货位号', dataIndex: 'shelfPlaceCode', width: '90%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
+ { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
|
|
|
+ { title: '货位号', dataIndex: 'shelfPlaceCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: '15%', 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: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '结算价', dataIndex: 'cost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '最大库容', dataIndex: 'maxQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
],
|
|
|
loadData: [],
|
|
|
nowUnColumns: [
|
|
|
- { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
|
|
|
- { title: '货位号', dataIndex: 'shelfPlaceCode', width: '40%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '错误原因', dataIndex: 'remarks', width: '50%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
+ { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
|
|
|
+ { title: '货位号', dataIndex: 'shelfPlaceCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: '15%', 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: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '结算价', dataIndex: 'cost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '最大库容', dataIndex: 'maxQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '错误原因', dataIndex: 'remarks', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
],
|
|
|
unLoadData: [],
|
|
|
loading: false
|
|
@@ -100,7 +117,7 @@ export default {
|
|
|
shelfSn: this.paramsData.shelfSn,
|
|
|
path: this.paramsData.path
|
|
|
}
|
|
|
- exportExcelData(params).then(res => {
|
|
|
+ shelfPlaceReadExcel(params).then(res => {
|
|
|
this.loading = false
|
|
|
if (res.status == 200) {
|
|
|
if (res.data.successList && res.data.successList.length > 0) {
|
|
@@ -123,13 +140,25 @@ export default {
|
|
|
if (this.loadData.length == 0) {
|
|
|
this.$message.warning('无可导入产品!')
|
|
|
} else {
|
|
|
- saveBatchExcel(this.loadData).then(res => {
|
|
|
+ shelfSaveBatchExcel(this.loadData).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.$emit('ok', this.loadData)
|
|
|
this.isShow = false
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ },
|
|
|
+ // 导出
|
|
|
+ handleError () {
|
|
|
+ const _this = this
|
|
|
+ if (_this.unLoadData.length < 1) {
|
|
|
+ _this.$message.info('暂无可导出错误项~')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ _this.spinning = true
|
|
|
+ hdExportExcel(shelfPlaceFailExcel, _this.unLoadData, '货位绑定产品错误项导出', function () {
|
|
|
+ _this.spinning = false
|
|
|
+ }, true)
|
|
|
}
|
|
|
},
|
|
|
watch: {
|