|
@@ -39,7 +39,6 @@
|
|
|
<a-icon type="upload"/>
|
|
|
导入
|
|
|
</a-button>
|
|
|
- <a-button style="margin-left: 8px" type="primary" @click="handleSync">设备同步</a-button>
|
|
|
</div>
|
|
|
<a-table
|
|
|
:data-source="data"
|
|
@@ -62,19 +61,17 @@
|
|
|
<import-form-add ref="importModal" @ok="handleOk"></import-form-add>
|
|
|
<spare-part-info-select-modal :type="'checkbox'" ref="spareSelectModal" @selected="handleSpareSelected"/>
|
|
|
<spare-store-select-modal ref="spareStoreSelectModal" @selected="handleSpareStoreSelected"/>
|
|
|
- <SbInfoSelectModal ref="sbInfoSelectModal" :type="'checkbox'" @selected="handleSbStoreSelected"/>
|
|
|
</a-card>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import DetailList from '@/components/tools/DetailList'
|
|
|
-import { addSbModelBomBatch, selectSpareInfoListByModelId, deleteSbModelBoms, exportSbModelBom, addSyncBoms } from '@/api/sb/modelbom'
|
|
|
+import { addSbModelBomBatch, selectSpareInfoListByModelId, deleteSbModelBoms, exportSbModelBom } from '@/api/sb/modelbom'
|
|
|
import SparePartInfoSelectModal from '@/views/sqarepartmanage/sparepartinfo/modules/SparePartInfoSelectModal'
|
|
|
import BaseForm from './BaseForm'
|
|
|
import ImportFormAdd from './ImportFormAdd'
|
|
|
import SpareBaseForm from '@/views/sqarepartmanage/sparepartinfo/modules/BaseForm'
|
|
|
import SpareStoreSelectModal from '@/views/store/sparestore/modules/SpareStoreSelectModalYY'
|
|
|
-import SbInfoSelectModal from './SbInfoSelectModal.vue'
|
|
|
const DetailListItem = DetailList.Item
|
|
|
|
|
|
export default {
|
|
@@ -86,8 +83,7 @@ export default {
|
|
|
SparePartInfoSelectModal,
|
|
|
ImportFormAdd,
|
|
|
SpareBaseForm,
|
|
|
- SpareStoreSelectModal,
|
|
|
- SbInfoSelectModal
|
|
|
+ SpareStoreSelectModal
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
@@ -110,8 +106,6 @@ export default {
|
|
|
levelMap: {},
|
|
|
unitMap: {},
|
|
|
periodTypeMap: {},
|
|
|
- spareIds: [],
|
|
|
- sparePartInfoList: [],
|
|
|
// 表头
|
|
|
columns: [
|
|
|
/* {
|
|
@@ -220,10 +214,8 @@ export default {
|
|
|
},
|
|
|
handleSpareStoreSelected (record, keys, rows) {
|
|
|
const addData = []
|
|
|
- this.spareIds = [...keys, ...this.spareIds]
|
|
|
- this.sparePartInfoList = [...rows, ...this.sparePartInfoList]
|
|
|
for (let i = 0; i < rows.length; i++) {
|
|
|
- addData.push({ spareId: keys[i], sbId: this.model.id, modelId: this.model.id, no: rows[i].no, spareName: rows[i].spareName, num: 1, ggxh: rows[i].ggxh })
|
|
|
+ addData.push({ spareId: 111111, sbId: this.model.id, modelId: this.model.id, no: rows[i].no, spareName: rows[i].spareName, num: 1, ggxh: rows[i].ggxh })
|
|
|
}
|
|
|
addSbModelBomBatch(addData)
|
|
|
.then((response) => {
|
|
@@ -260,8 +252,6 @@ export default {
|
|
|
modal.base(record)
|
|
|
},
|
|
|
handleCancel () {
|
|
|
- this.spareIds = []
|
|
|
- this.sparePartInfoList = []
|
|
|
this.visible = false
|
|
|
this.confirmLoading = false
|
|
|
this.$emit('ok')
|
|
@@ -299,26 +289,6 @@ export default {
|
|
|
exportSbModelBom(parameter).then(file => {
|
|
|
this.BaseTool.UPLOAD.downLoadExportExcel(file)
|
|
|
})
|
|
|
- },
|
|
|
- handleSync () {
|
|
|
- console.log(this.sparePartInfoList, this.spareIds)
|
|
|
- this.$refs.sbInfoSelectModal.base({}, { spareIds: this.spareIds })
|
|
|
- },
|
|
|
- handleSbStoreSelected (keys, rows) {
|
|
|
- console.log(keys, rows)
|
|
|
- const params = {
|
|
|
- sbIds: keys,
|
|
|
- sparePartInfoList: this.sparePartInfoList
|
|
|
- }
|
|
|
- addSyncBoms(params)
|
|
|
- .then((response) => {
|
|
|
- this.$message.info('同步成功')
|
|
|
- this.spareIds = []
|
|
|
- this.sparePartInfoList = []
|
|
|
- this.handleOk()
|
|
|
- }).catch(() => {
|
|
|
- this.confirmLoading = false
|
|
|
- })
|
|
|
}
|
|
|
}
|
|
|
}
|