|
@@ -72,14 +72,13 @@
|
|
|
#slot-add-goods-btn
|
|
#slot-add-goods-btn
|
|
|
v-if="showAddBtn"
|
|
v-if="showAddBtn"
|
|
|
>
|
|
>
|
|
|
- <el-button
|
|
|
|
|
- type="primary"
|
|
|
|
|
- size="mini"
|
|
|
|
|
- @click="add()"
|
|
|
|
|
- >添加</el-button>
|
|
|
|
|
-</template>
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="add()"
|
|
|
|
|
+ >添加</el-button>
|
|
|
|
|
+ </template>
|
|
|
</x-crud>
|
|
</x-crud>
|
|
|
-
|
|
|
|
|
<item-list-layer
|
|
<item-list-layer
|
|
|
:show.sync="showItemModal"
|
|
:show.sync="showItemModal"
|
|
|
@confirm="selGoodsConfirmFn"
|
|
@confirm="selGoodsConfirmFn"
|
|
@@ -122,11 +121,23 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
selGoodsConfirmFn (item) {
|
|
selGoodsConfirmFn (item) {
|
|
|
- return false
|
|
|
|
|
- GhsService.bindGhs({ sjId: this.selectSjId, ghsSjId: item.id }).then(res => {
|
|
|
|
|
- this.$message.success('操作成功!');
|
|
|
|
|
- this.ghsModal = false;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ let param = []
|
|
|
|
|
+ item.forEach(value => {
|
|
|
|
|
+ let newObj = {}
|
|
|
|
|
+ newObj.itemId = value.id
|
|
|
|
|
+ newObj.classId = this.classId
|
|
|
|
|
+ newObj.cost = value.cost
|
|
|
|
|
+ newObj.addPrice = value.addPrice
|
|
|
|
|
+ newObj.stockWarning = value.stockWarning
|
|
|
|
|
+ param.push(newObj)
|
|
|
|
|
+ })
|
|
|
|
|
+ param = JSON.stringify(param)
|
|
|
|
|
+ console.log(param)
|
|
|
|
|
+ this.$service.item.batchAdd({ data: param }).then(res => {
|
|
|
|
|
+ this.$message.success('操作成功!');
|
|
|
|
|
+ this.showItemModal = false
|
|
|
|
|
+ this.$router.go(0)
|
|
|
|
|
+ }).catch(err => { console.log(err) })
|
|
|
},
|
|
},
|
|
|
add () {
|
|
add () {
|
|
|
this.showItemModal = true
|
|
this.showItemModal = true
|