增加修复库存的功能

This commit is contained in:
季圣华
2021-10-24 22:03:17 +08:00
parent 0e5374e1d4
commit 3fb0fa8a7f

View File

@@ -67,6 +67,7 @@
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> <a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(true)"><a-icon type="check-square"/>启用</a-menu-item> <a-menu-item key="2" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(true)"><a-icon type="check-square"/>启用</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(false)"><a-icon type="close-square"/>禁用</a-menu-item> <a-menu-item key="3" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(false)"><a-icon type="close-square"/>禁用</a-menu-item>
<a-menu-item key="4" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetMaterialCurrentStock()"><a-icon type="stock"/>修正库存</a-menu-item>
</a-menu> </a-menu>
<a-button style="margin-left: 8px"> <a-button style="margin-left: 8px">
批量操作 <a-icon type="down" /> 批量操作 <a-icon type="down" />
@@ -121,8 +122,8 @@
</template> </template>
<script> <script>
import MaterialModal from './modules/MaterialModal' import MaterialModal from './modules/MaterialModal'
import {queryMaterialCategoryTreeList,queryMaterialCategoryById} from '@/api/api' import {queryMaterialCategoryTreeList} from '@/api/api'
import { getAction } from '@/api/manage' import { postAction } from '@/api/manage'
import { getMpListShort } from "@/utils/util" import { getMpListShort } from "@/utils/util"
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDate from '@/components/jeecg/JDate' import JDate from '@/components/jeecg/JDate'
@@ -196,7 +197,8 @@
deleteBatch: "/material/deleteBatch", deleteBatch: "/material/deleteBatch",
importExcelUrl: "/material/importExcel", importExcelUrl: "/material/importExcel",
exportXlsUrl: "/material/exportExcel", exportXlsUrl: "/material/exportExcel",
batchSetStatusUrl: "/material/batchSetStatus" batchSetStatusUrl: "/material/batchSetStatus",
batchSetMaterialCurrentStockUrl: "/material/batchSetMaterialCurrentStock"
} }
} }
}, },
@@ -224,6 +226,34 @@
} }
}) })
}, },
batchSetMaterialCurrentStock: function () {
if (this.selectedRowKeys.length <= 0) {
this.$message.warning('请选择一条记录!');
} else {
let ids = "";
for (let a = 0; a < this.selectedRowKeys.length; a++) {
ids += this.selectedRowKeys[a] + ",";
}
let that = this;
this.$confirm({
title: "确认操作",
content: "是否操作选中数据?",
onOk: function () {
that.loading = true;
postAction(that.url.batchSetMaterialCurrentStockUrl, {ids: ids}).then((res) => {
if(res.code === 200){
that.loadData();
that.onClearSelected();
} else {
that.$message.warning(res.data.message);
}
}).finally(() => {
that.loading = false;
});
}
});
}
},
handleEdit: function (record) { handleEdit: function (record) {
this.$refs.modalForm.edit(record); this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑"; this.$refs.modalForm.title = "编辑";