|
@@ -39,15 +39,8 @@
|
|
|
:pagination="false"
|
|
|
bordered>
|
|
|
<!-- 通用编码 -->
|
|
|
- <template slot="commonCode" slot-scope="text, record" >
|
|
|
- <div>
|
|
|
- <a-input
|
|
|
- id="productInfoOffline-commonCode"
|
|
|
- :maxLength="60"
|
|
|
- v-model="record.commonCode"
|
|
|
- placeholder="请输入通用编码(最多60个字符)"
|
|
|
- allowClear />
|
|
|
- </div>
|
|
|
+ <template slot="commonProductList" slot-scope="text, record" >
|
|
|
+ <productCodeList ref="productCodeList" mode="multiple" @change="e => productCodeChange(e, record)" />
|
|
|
</template>
|
|
|
</a-table>
|
|
|
</a-form-model-item>
|
|
@@ -70,10 +63,11 @@
|
|
|
|
|
|
<script>
|
|
|
import { VSelect } from '@/components'
|
|
|
+import productCodeList from '@/views/common/productCodeList.vue'
|
|
|
import { productOffline } from '@/api/product'
|
|
|
export default {
|
|
|
name: 'ProductInfoDetailModal',
|
|
|
- components: { VSelect },
|
|
|
+ components: { VSelect, productCodeList },
|
|
|
props: {
|
|
|
openModal: { // 弹框显示状态
|
|
|
type: Boolean,
|
|
@@ -105,19 +99,27 @@ export default {
|
|
|
},
|
|
|
columns: [
|
|
|
{ title: '产品编码', dataIndex: 'code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '通用编码', scopedSlots: { customRender: 'commonCode' }, align: 'center' }
|
|
|
+ { title: '通用编码', scopedSlots: { customRender: 'commonProductList' }, align: 'center' }
|
|
|
],
|
|
|
loadData: []
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ productCodeChange (val, row) {
|
|
|
+ row.commonProductList = []
|
|
|
+ if (val.length > 0) {
|
|
|
+ val.map(item => {
|
|
|
+ row.commonProductList.push({ code: item.row && item.row.code ? item.row.code : undefined, productSn: item.key || undefined })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
// 确定 下线
|
|
|
handleSubmit () {
|
|
|
const _this = this
|
|
|
if (_this.form.offlineReasonType == '通用') {
|
|
|
const arr = []
|
|
|
this.loadData.map((item, index) => {
|
|
|
- if (!item.commonCode) {
|
|
|
+ if (item.commonProductList.length < 1) {
|
|
|
arr.push(index + 1)
|
|
|
}
|
|
|
})
|