|
@@ -56,8 +56,8 @@
|
|
|
</a-col>
|
|
|
<span>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-button type="primary" @click="getList">查询</a-button>
|
|
|
- <a-button style="margin-left: 8px" @click="getList">重置</a-button>
|
|
|
+ <a-button type="primary" @click="onSearch">查询</a-button>
|
|
|
+ <a-button style="margin-left: 8px" @click="onReset">重置</a-button>
|
|
|
</a-col>
|
|
|
</span>
|
|
|
</a-row>
|
|
@@ -95,8 +95,8 @@
|
|
|
</a-spin>
|
|
|
<template slot="footer">
|
|
|
<a-button @click="handleCancel">取消</a-button>
|
|
|
- <a-button v-if="isShowBtn" @click="handleCancel">完成盘点</a-button>
|
|
|
- <a-button v-if="isShowBtn" @click="handleOk" type="primary">确认更新盘点数据</a-button>
|
|
|
+ <a-button v-if="isShowBtn" @click="handleOk">完成盘点</a-button>
|
|
|
+ <a-button v-if="isShowBtn" @click="handleUpdate" type="primary">确定更新盘点数据</a-button>
|
|
|
</template>
|
|
|
</a-modal>
|
|
|
<j-select-material-modal
|
|
@@ -139,6 +139,8 @@ import JSelectMaterialModal from '../../../components/jeecgbiz/modal/JSelectMate
|
|
|
import { getAction, postAction } from '@/api/manage'
|
|
|
import { getMaterialByBatchNumber } from '@/api/api'
|
|
|
import { newTableMixin } from '@/mixins/newTableMixin'
|
|
|
+import { Modal } from 'ant-design-vue'
|
|
|
+
|
|
|
// import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
// import { Form } from 'ant-design-vue'
|
|
|
// const useForm = Form.useForm
|
|
@@ -191,6 +193,9 @@ export default {
|
|
|
add: '/stocktaking/add',
|
|
|
update: '/stocktaking/detailUpdate',
|
|
|
edit: '/stocktaking/itemUpdate',
|
|
|
+ updateStock: '/stocktaking/taskUpdateStock/',
|
|
|
+ taskCom: ' /stocktaking/taskComplete/',
|
|
|
+ detail: '/stocktaking/detail/',
|
|
|
},
|
|
|
form: {},
|
|
|
isShow: false,
|
|
@@ -245,7 +250,12 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
isShowBtn() {
|
|
|
- return this.openType !== 'detail' || this.form.taskStatus !== 1
|
|
|
+ console.log('==================', this.form.taskStatus)
|
|
|
+
|
|
|
+ if (this.openType === 'detail') return false
|
|
|
+ if (this.form.taskStatus !== 1) return false
|
|
|
+
|
|
|
+ return true
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
@@ -275,27 +285,44 @@ export default {
|
|
|
handleCancel() {
|
|
|
this.$emit('update:stockVisible', false)
|
|
|
},
|
|
|
- handleOk() {
|
|
|
- this.$refs.editForm.form.validateFields((err, values) => {
|
|
|
- if (!err) {
|
|
|
- const params = { ...values }
|
|
|
- if (params.taskType === 2) {
|
|
|
- params.materialExtendIdList = this.dataSource.map((item) => item.batchNumber)
|
|
|
- }
|
|
|
- const url = this.openType === 'add' ? this.url.add : this.url.update
|
|
|
- postAction(url, params).then((res) => {
|
|
|
- this.$message.success('操作成功')
|
|
|
- this.handleCancel()
|
|
|
- })
|
|
|
- }
|
|
|
+ //更新盘点数据
|
|
|
+ handleUpdate() {
|
|
|
+ let that = this
|
|
|
+ const url = this.url.updateStock + this.taskId
|
|
|
+
|
|
|
+ Modal.confirm({
|
|
|
+ title: '是否确定更新盘点数据,确定后商品库存将按照当前的盘点数据进行更新',
|
|
|
+ onOk() {
|
|
|
+ getAction(url)
|
|
|
+ .then((res) => {
|
|
|
+ that.$message.success('操作成功')
|
|
|
+ that.handleCancel()
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.$message.error('操作失败')
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onCancel() {
|
|
|
+ console.log('Cancel')
|
|
|
+ },
|
|
|
})
|
|
|
},
|
|
|
+ handleOk() {
|
|
|
+ getAction(this.url.taskCom + this.taskId)
|
|
|
+ .then((res) => {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.$message.error('操作失败')
|
|
|
+ })
|
|
|
+ this.handleCancel()
|
|
|
+ },
|
|
|
onChangeGoods() {
|
|
|
this.$refs.selectModal.queryParam.depotId = this.form.depotId
|
|
|
this.$refs.selectModal.showModal()
|
|
|
},
|
|
|
getDetailList(id) {
|
|
|
- const url = '/stocktaking/detail/' + id
|
|
|
+ const url = this.url.detail + id
|
|
|
const form = this.$refs['editForm'].form
|
|
|
|
|
|
getAction(url).then((res) => {
|
|
@@ -332,6 +359,7 @@ export default {
|
|
|
},
|
|
|
getList(id) {
|
|
|
const url2 = '/stocktaking/detailByItemList'
|
|
|
+ const form = this.$refs['editForm'].form
|
|
|
|
|
|
const params = { ...this.queryParams, taskStocktakingId: id }
|
|
|
const url = url2 + '?pageNum=' + this.ipagination.current + '&pageSize=' + this.ipagination.pageSize
|