|
@@ -18,7 +18,7 @@
|
|
|
v-decorator="['outNo', {rules: [{required: false, message: '出库单号不能为空'}]}]" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
-<!-- <a-col :lg="12" :md="24" :sm="24">
|
|
|
+ <!-- <a-col :lg="12" :md="24" :sm="24">
|
|
|
<a-form-item
|
|
|
label="领用/退货单号"
|
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
@@ -66,7 +66,7 @@
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
-<!-- <a-col :lg="12" :md="24" :sm="24">
|
|
|
+ <!-- <a-col :lg="12" :md="24" :sm="24">
|
|
|
<a-form-item
|
|
|
label="操作人"
|
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
@@ -127,19 +127,14 @@
|
|
|
:row-selection="rowSelection">
|
|
|
<template slot="num" slot-scope="text, record">
|
|
|
<div class="editable-cell-input-wrapper">
|
|
|
- <a-input :value="text" :id="record.spareId + ',num'" @change="$event => onQuantityChange($event, record.id, 'num')" />
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template slot="totalPrice" slot-scope="text, record">
|
|
|
- <div class="editable-cell-input-wrapper">
|
|
|
- <a-input :value="text" :id="record.spareId + ',totalPrice'" @change="$event => onTotalPriceChange($event, record.id, 'totalPrice')" />
|
|
|
+ <a-input :value="text" :id="record.cbatch + ',num'" @change="$event => onQuantityChange($event, record.cbatch, 'num')" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<span slot="action" slot-scope="record">
|
|
|
<template>
|
|
|
<a @click="handleBaseFormForModifySelect(record)">修改</a>
|
|
|
<a-divider type="vertical" />
|
|
|
- <a-popconfirm title="是否要删除该条数据?" @confirm="handleDelOne(record.id)">
|
|
|
+ <a-popconfirm title="是否要删除该条数据?" @confirm="handleDelOne(record)">
|
|
|
<a>删除</a>
|
|
|
</a-popconfirm>
|
|
|
</template>
|
|
@@ -164,7 +159,7 @@
|
|
|
|
|
|
<script>
|
|
|
import pick from 'lodash.pick'
|
|
|
-import { addOutStoreForm, updateOutStoreForm } from '@/api/store/outstoreform'
|
|
|
+import { addOutStoreFormYY, updateOutStoreFormYY } from '@/api/store/outstoreform'
|
|
|
import SparePickFormSelectModal from '@/views/store/sparepickform/modules/SparePickFormSelectModal'
|
|
|
import SpareBackFormSelectModal from '@/views/store/sparebackform/modules/SpareBackFormSelectModal'
|
|
|
import DetailBaseForm from './DetailBaseForm'
|
|
@@ -207,10 +202,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
title: '名称',
|
|
|
- dataIndex: 'spareId',
|
|
|
- customRender: (text, record, index) => {
|
|
|
- return record.spareName
|
|
|
- }
|
|
|
+ dataIndex: 'spareName'
|
|
|
},
|
|
|
{
|
|
|
title: '编号',
|
|
@@ -221,8 +213,12 @@ export default {
|
|
|
dataIndex: 'ggxh'
|
|
|
},
|
|
|
{
|
|
|
- title: '原厂编号',
|
|
|
- dataIndex: 'initNo'
|
|
|
+ title: '仓库',
|
|
|
+ dataIndex: 'storeName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '批次',
|
|
|
+ dataIndex: 'cbatch'
|
|
|
},
|
|
|
{
|
|
|
title: '数量',
|
|
@@ -231,21 +227,7 @@ export default {
|
|
|
scopedSlots: { customRender: 'num' }
|
|
|
},
|
|
|
{
|
|
|
- title: '价格',
|
|
|
- dataIndex: 'price',
|
|
|
- customRender: (text, record, index) => {
|
|
|
- return this.BaseTool.Amount.formatter(text)
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '总价',
|
|
|
- dataIndex: 'totalPrice',
|
|
|
- customRender: (text, record, index) => {
|
|
|
- return this.BaseTool.Amount.formatter(text)
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '所在仓库',
|
|
|
+ title: '仓库',
|
|
|
dataIndex: 'storeName'
|
|
|
},
|
|
|
{
|
|
@@ -334,14 +316,14 @@ export default {
|
|
|
values.userTime = BaseTool.Date.formatter(values.userTime, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
|
|
|
// 日期处理
|
|
|
if (this.BaseTool.String.isBlank(values.id)) {
|
|
|
- addOutStoreForm(values)
|
|
|
+ addOutStoreFormYY(values)
|
|
|
.then(() => {
|
|
|
this.handleCancel(values)
|
|
|
}).catch(() => {
|
|
|
this.confirmLoading = false
|
|
|
})
|
|
|
} else {
|
|
|
- updateOutStoreForm(values)
|
|
|
+ updateOutStoreFormYY(values)
|
|
|
.then(() => {
|
|
|
this.handleCancel(values)
|
|
|
}).catch(() => {
|
|
@@ -428,19 +410,19 @@ export default {
|
|
|
}
|
|
|
this.data = data.filter(item => !this.selectedRowKeys.includes(item.id))
|
|
|
},
|
|
|
- handleDelOne (id) {
|
|
|
+ handleDelOne (record) {
|
|
|
const data = [...this.data]
|
|
|
- this.data = data.filter(item => id !== item.id)
|
|
|
+ this.data = data.filter(item => record.cbatch !== item.cbatch)
|
|
|
},
|
|
|
handleSpareStoreSelect () {
|
|
|
- this.$refs.spareStoreSelectModal.base({}, { num: 0 })
|
|
|
+ this.$refs.spareStoreSelectModal.base()
|
|
|
},
|
|
|
handleSpareStoreSelected (record, keys, rows) {
|
|
|
const { data } = this
|
|
|
for (let i = 0; i < rows.length; i++) {
|
|
|
let find = false
|
|
|
for (let j = 0; j < data.length; j++) {
|
|
|
- if (rows[i].id === data[j].id || rows[i].spareId === data[j].spareId) {
|
|
|
+ if (rows[i].cbatch === data[j].cbatch) {
|
|
|
find = true
|
|
|
break
|
|
|
}
|
|
@@ -448,9 +430,6 @@ export default {
|
|
|
if (!find) {
|
|
|
const selectData = rows[i]
|
|
|
selectData.num = 1
|
|
|
- selectData.totalPrice = selectData.price
|
|
|
- selectData.storeId = rows[i].storeId
|
|
|
- selectData.storeName = rows[i].storeName
|
|
|
data.push(selectData)
|
|
|
}
|
|
|
}
|
|
@@ -472,18 +451,17 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- onQuantityChange (e, id, attr) {
|
|
|
+ onQuantityChange (e, cbatch, attr) {
|
|
|
const value = e.target.value
|
|
|
console.log(value)
|
|
|
if (value !== 0 && !value) {
|
|
|
return
|
|
|
}
|
|
|
const data = [...this.data]
|
|
|
- const target = data.find(item => item.id === id)
|
|
|
+ const target = data.find(item => item.cbatch === cbatch)
|
|
|
console.log('target: ' + target)
|
|
|
if (target) {
|
|
|
target[attr] = value
|
|
|
- target['totalPrice'] = Math.floor(value * target['price'] * 10000) / 10000
|
|
|
this.data = data
|
|
|
}
|
|
|
},
|