|
@@ -11,47 +11,44 @@
|
|
<div class="chooseImport-con">
|
|
<div class="chooseImport-con">
|
|
<!-- 可导入数据 -->
|
|
<!-- 可导入数据 -->
|
|
<p style="font-weight:bold;">可导入数据{{ loadData.length }}条,确认要批量下线吗?</p>
|
|
<p style="font-weight:bold;">可导入数据{{ loadData.length }}条,确认要批量下线吗?</p>
|
|
- <a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
|
|
|
|
- <a-form-model-item label="下线选项">
|
|
|
|
- <a-select
|
|
|
|
- label-in-value
|
|
|
|
- @change="handleChange"
|
|
|
|
- >
|
|
|
|
- <a-select-option value="1">
|
|
|
|
- 淘汰
|
|
|
|
- </a-select-option>
|
|
|
|
- <a-select-option value="2">
|
|
|
|
- 通用
|
|
|
|
- </a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- <a-form-model-item label="通用编码">
|
|
|
|
- <a-table
|
|
|
|
- class="sTable"
|
|
|
|
- ref="table"
|
|
|
|
- size="small"
|
|
|
|
- :rowKey="(record) => record.allocateSn"
|
|
|
|
- :columns="nowColumns"
|
|
|
|
- :dataSource="loadData"
|
|
|
|
- :loading="loading"
|
|
|
|
- :scroll="{ y: 200}"
|
|
|
|
- :pagination="false"
|
|
|
|
- bordered>
|
|
|
|
- <template slot="currency" slot-scope="text, record">
|
|
|
|
- <a-input placeholder="请输入通用编码" />
|
|
|
|
- </template>
|
|
|
|
- </a-table>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- <a-form-model-item label="下线备注">
|
|
|
|
- <a-textarea
|
|
|
|
- v-model="value"
|
|
|
|
- placeholder="请输入下线备注(最多60个字符)"
|
|
|
|
- :maxLength="60"
|
|
|
|
- :auto-size="{ minRows: 2, maxRows: 5 }"
|
|
|
|
- />
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-form-model>
|
|
|
|
-
|
|
|
|
|
|
+ <a-form-model :model="form" :rules="rules" :label-col="labelCol" :wrapper-col="wrapperCol">
|
|
|
|
+ <a-form-model-item label="下线选项" prop="offlineReasonType">
|
|
|
|
+ <v-select
|
|
|
|
+ code="OFFLINE_REASON_TYPE"
|
|
|
|
+ id="productInfoOffline-offlineReasonType"
|
|
|
|
+ v-model="form.offlineReasonType"
|
|
|
|
+ allowClear
|
|
|
|
+ placeholder="请选择下线选项"
|
|
|
|
+ ></v-select>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ <a-form-model-item label="通用编码" :required="form.offlineReasonType=='通用'">
|
|
|
|
+ <a-table
|
|
|
|
+ class="sTable"
|
|
|
|
+ ref="table"
|
|
|
|
+ size="small"
|
|
|
|
+ :rowKey="(record) => record.allocateSn"
|
|
|
|
+ :columns="nowColumns"
|
|
|
|
+ :dataSource="loadData"
|
|
|
|
+ :loading="loading"
|
|
|
|
+ :scroll="{ y: 200}"
|
|
|
|
+ :pagination="false"
|
|
|
|
+ bordered>
|
|
|
|
+ <template slot="currency" slot-scope="text, record">
|
|
|
|
+ <productCodeList ref="productCodeList" mode="multiple" @change="e => productCodeChange(e, record)" />
|
|
|
|
+ </template>
|
|
|
|
+ </a-table>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ <a-form-model-item label="下线备注">
|
|
|
|
+ <a-textarea
|
|
|
|
+ v-model="form.offlineRemark"
|
|
|
|
+ placeholder="请输入下线备注(最多60个字符)"
|
|
|
|
+ :maxLength="60"
|
|
|
|
+ :auto-size="{ minRows: 2, maxRows: 5 }"
|
|
|
|
+ allowClear
|
|
|
|
+ />
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-form-model>
|
|
|
|
+
|
|
<a-divider />
|
|
<a-divider />
|
|
<!-- 不可导入数据 -->
|
|
<!-- 不可导入数据 -->
|
|
<p class="red">不可导入数据{{ unLoadData.length }}条</p>
|
|
<p class="red">不可导入数据{{ unLoadData.length }}条</p>
|
|
@@ -95,12 +92,15 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { VSelect } from '@/components'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { hdExportExcel } from '@/libs/exportExcel'
|
|
import { hdExportExcel } from '@/libs/exportExcel'
|
|
-import { batchImportProduct, exportErrorProduct } from '@/api/product'
|
|
|
|
|
|
+import { offlineImport, exportErrorOffline } from '@/api/product'
|
|
|
|
+import productCodeList from '@/views/common/productCodeList.vue'
|
|
export default {
|
|
export default {
|
|
name: 'SalesChooseImportModal',
|
|
name: 'SalesChooseImportModal',
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
|
|
+ components: { VSelect, productCodeList },
|
|
props: {
|
|
props: {
|
|
openModal: { // 弹框显示状态
|
|
openModal: { // 弹框显示状态
|
|
type: Boolean,
|
|
type: Boolean,
|
|
@@ -115,15 +115,19 @@ export default {
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
- labelCol: { span: 2 },
|
|
|
|
- wrapperCol: { span: 22 },
|
|
|
|
|
|
+ labelCol: { span: 2 },
|
|
|
|
+ wrapperCol: { span: 22 },
|
|
isShow: this.openModal, // 是否打开弹框
|
|
isShow: this.openModal, // 是否打开弹框
|
|
nowColumns: [
|
|
nowColumns: [
|
|
{ title: '序号', dataIndex: 'no', width: '3%', align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: '3%', align: 'center' },
|
|
{ title: '产品编码', dataIndex: 'code', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品编码', dataIndex: 'code', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
- { title: '通用编码',scopedSlots: { customRender: 'currency' }, width: '5%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
|
|
|
+ { title: '通用编码', scopedSlots: { customRender: 'currency' }, width: '5%', align: 'center' }
|
|
],
|
|
],
|
|
loadData: [],
|
|
loadData: [],
|
|
|
|
+ form: {
|
|
|
|
+ offlineReasonType: undefined,
|
|
|
|
+ offlineRemark: ''
|
|
|
|
+ },
|
|
nowUnColumns: [
|
|
nowUnColumns: [
|
|
{ title: '序号', dataIndex: 'no', width: '3%', align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: '3%', align: 'center' },
|
|
{ title: '产品编码', dataIndex: 'code', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品编码', dataIndex: 'code', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
@@ -131,22 +135,36 @@ export default {
|
|
{ title: '备注', dataIndex: 'errorMsg', width: '5%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
{ title: '备注', dataIndex: 'errorMsg', width: '5%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
],
|
|
],
|
|
unLoadData: [],
|
|
unLoadData: [],
|
|
- loading: false
|
|
|
|
|
|
+ loading: false,
|
|
|
|
+ rules: {
|
|
|
|
+ offlineReasonType: [
|
|
|
|
+ { required: true, message: '请选择下线选项', trigger: 'change' }
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ productCodeChange (val, row) {
|
|
|
|
+ row.commonSn = []
|
|
|
|
+ if (val.length > 0) {
|
|
|
|
+ val.map(item => {
|
|
|
|
+ row.commonSn.push({ code: item.row && item.row.code ? item.row.code : undefined, productSn: item.key || undefined })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
getData () {
|
|
getData () {
|
|
const _this = this
|
|
const _this = this
|
|
this.loading = true
|
|
this.loading = true
|
|
const params = {
|
|
const params = {
|
|
path: this.paramsData.path
|
|
path: this.paramsData.path
|
|
}
|
|
}
|
|
- batchImportProduct(params).then(res => {
|
|
|
|
|
|
+ offlineImport(params).then(res => {
|
|
this.loading = false
|
|
this.loading = false
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
if (res.data.rightList && res.data.rightList.length > 0) {
|
|
if (res.data.rightList && res.data.rightList.length > 0) {
|
|
res.data.rightList.map((item, index) => {
|
|
res.data.rightList.map((item, index) => {
|
|
item.no = index + 1
|
|
item.no = index + 1
|
|
|
|
+ item.commonSn = []
|
|
})
|
|
})
|
|
}
|
|
}
|
|
if (res.data.errorList && res.data.errorList.length > 0) {
|
|
if (res.data.errorList && res.data.errorList.length > 0) {
|
|
@@ -164,7 +182,9 @@ 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.form.type = 'offline'
|
|
|
|
+ this.form.offlineProductList = this.loadData
|
|
|
|
+ this.$emit('ok', this.form)
|
|
this.isShow = false
|
|
this.isShow = false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -176,7 +196,7 @@ export default {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
- hdExportExcel(exportErrorProduct, _this.unLoadData, '导出产品错误项', function () {
|
|
|
|
|
|
+ hdExportExcel(exportErrorOffline, _this.unLoadData, '导出产品错误项', function () {
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -192,6 +212,10 @@ export default {
|
|
this.$emit('close')
|
|
this.$emit('close')
|
|
this.loadData = []
|
|
this.loadData = []
|
|
this.unLoadData = []
|
|
this.unLoadData = []
|
|
|
|
+ this.form = {
|
|
|
|
+ offlineReasonType: '',
|
|
|
|
+ offlineRemark: ''
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
this.getData()
|
|
this.getData()
|
|
}
|
|
}
|