|
@@ -12,7 +12,6 @@
|
|
|
:total="dataSource.length || 0"
|
|
|
openType="detail"
|
|
|
:stockType="stockType"
|
|
|
- @changeForm="handleChangeForm"
|
|
|
></edit-form>
|
|
|
<a-divider />
|
|
|
<div>
|
|
@@ -74,14 +73,6 @@
|
|
|
:loading="loading"
|
|
|
@change="handleTableChange"
|
|
|
>
|
|
|
- <!-- <template v-for="col in colList" :slot="col" slot-scope="text, record">
|
|
|
- <div :key="col">
|
|
|
- <a-input v-if="editableData[record.id]" v-model="editableData[record.id][col]" style="margin: -5px 0" />
|
|
|
- <template v-else>
|
|
|
- {{ col }}
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- </template> -->
|
|
|
<span slot="action" v-if="openType !== 'detail'" slot-scope="text, record">
|
|
|
<a type="text" @click="handleEdit(record)">编辑</a>
|
|
|
</span>
|
|
@@ -97,13 +88,6 @@
|
|
|
<a-button v-if="isShowBtn" @click="handleUpdate" type="primary">确定更新盘点数据</a-button>
|
|
|
</template>
|
|
|
</a-modal>
|
|
|
- <j-select-material-modal
|
|
|
- @ok="getGoods"
|
|
|
- @all="findAllSelect"
|
|
|
- ref="selectModal"
|
|
|
- :multi="true"
|
|
|
- :isStock="true"
|
|
|
- ></j-select-material-modal>
|
|
|
<a-modal @cancel="editVisible = false" @ok="onSubmitGoods" :visible="editVisible" title="编辑" width="50%">
|
|
|
<a-form-model :model="editForm" :rules="editFormRules" ref="editFormModel">
|
|
|
<a-form-model-item label="盘点任务名称" :labelCol="{ span: 4 }" :wrapperCol="{ span: 14 }" prop="name">
|
|
@@ -283,7 +267,7 @@ export default {
|
|
|
methods: {
|
|
|
handleEdit(data) {
|
|
|
console.log('handleEdit=====',data)
|
|
|
- this.editForm = { ...data }
|
|
|
+ this.editForm = { ...data,name:this.form.taskName }
|
|
|
this.editVisible = true
|
|
|
this.handleChangeNewInventory(data.inventory)
|
|
|
},
|
|
@@ -293,6 +277,7 @@ export default {
|
|
|
postAction(this.url.edit, this.editForm).then((res) => {
|
|
|
this.$message.success('操作成功')
|
|
|
this.editVisible = false
|
|
|
+ this.getList(this.taskId)
|
|
|
})
|
|
|
} else {
|
|
|
return false
|
|
@@ -347,10 +332,6 @@ export default {
|
|
|
})
|
|
|
this.handleCancel()
|
|
|
},
|
|
|
- onChangeGoods() {
|
|
|
- this.$refs.selectModal.queryParam.depotId = this.form.depotId
|
|
|
- this.$refs.selectModal.showModal()
|
|
|
- },
|
|
|
getDetailList(id) {
|
|
|
const url = this.url.detail + id
|
|
|
const form = this.$refs['editForm'].form
|
|
@@ -406,59 +387,10 @@ export default {
|
|
|
this.getForm(form.getFieldsValue())
|
|
|
})
|
|
|
},
|
|
|
- getGoods(rows, ids) {
|
|
|
- const str = ids
|
|
|
- .split(',')
|
|
|
- .filter((item) => item)
|
|
|
- .join(',')
|
|
|
- this.getBatchData(str)
|
|
|
- },
|
|
|
- findAllSelect() {
|
|
|
- const params = { ...this.$refs.selectModal.queryParam }
|
|
|
- getAction('/material/findBatchNumbersBySelect', params).then((res) => {
|
|
|
- this.$refs.selectModal.close()
|
|
|
- this.getBatchData(res.data)
|
|
|
- })
|
|
|
- },
|
|
|
- getBatchData(val) {
|
|
|
- const batchStr = val
|
|
|
- .split(',')
|
|
|
- .filter((item) => item)
|
|
|
- .join(',')
|
|
|
- const params = {
|
|
|
- batchNumber: batchStr,
|
|
|
- organId: '',
|
|
|
- mpList: '',
|
|
|
- prefixNo: '',
|
|
|
- }
|
|
|
- getMaterialByBatchNumber(params).then((res) => {
|
|
|
- this.dataSource.push(...res.data)
|
|
|
- this.dataSource = this.dataSource.reduce((acc, cur) => {
|
|
|
- const hasDuplicate = acc.some((item) => item.batchNumber === cur.batchNumber)
|
|
|
- if (!hasDuplicate) {
|
|
|
- acc.push(cur)
|
|
|
- }
|
|
|
- return acc
|
|
|
- }, [])
|
|
|
- })
|
|
|
- },
|
|
|
getForm(val) {
|
|
|
this.form = val
|
|
|
this.$refs['editForm'].model = val
|
|
|
},
|
|
|
- //删除
|
|
|
- handleDelete(record) {
|
|
|
- this.dataSource = this.dataSource.filter((item) => item.batchNumber !== record.batchNumber)
|
|
|
- },
|
|
|
-
|
|
|
- handleChangeForm(val) {
|
|
|
- this.dataSource = []
|
|
|
- this.getForm(val)
|
|
|
- if (val.taskType === 1) {
|
|
|
- this.findAllSelect()
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
handleChangeNewInventory(val) {
|
|
|
console.log('1111111======',val)
|
|
|
const inventory = this.editForm.inventory ? Number(this.editForm.inventory) : 0
|