| | |
| | | </el-row> |
| | | <!--添加/编辑弹窗--> |
| | | <edit v-if="editSetting.show" :setting="editSetting" @close="editSetting.show = false" @search="search"/> |
| | | <inventory |
| | | v-if="inventorySetting.show" |
| | | :setting="inventorySetting" |
| | | @close="inventorySetting.show = false" |
| | | @search="search" |
| | | /> |
| | | <detail v-if="inventoryDetail.show" :setting="inventoryDetail" @close="inventoryDetail.show = false" |
| | | @search="search"/> |
| | | </el-card> |
| | | </el-container> |
| | | </el-container> |
| | | <my-import |
| | | :import-setting="importSetting" |
| | | :dialog-show="importSetting.dialogShow" |
| | | :dialog-title="importSetting.dialogTitle" |
| | | :import-setting="importSetting" |
| | | :dialog-show="importSetting.dialogShow" |
| | | :dialog-title="importSetting.dialogTitle" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import MyTableV2 from "@/components/myTable/myTableV2"; |
| | | import MyButton from "@/components/myButton/myButton"; |
| | | import MyTableV2 from '@/components/myTable/myTableV2'; |
| | | import MyButton from '@/components/myButton/myButton'; |
| | | import SettingIplatform from '@/utils/settingIplatform'; |
| | | import edit from './edit' |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant' |
| | | import myImport from '@/views/components/myImport' |
| | | import edit from './edit'; |
| | | import inventory from './inventory'; |
| | | import detail from './detail'; |
| | | import myImport from '@/views/components/myImport'; |
| | | import {getBaseUrl} from '@/utils/base'; |
| | | import {inventoryDel, inventoryListApi,isAddInventory} from '@/api/stock/inventory'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | import {mapGetters} from 'vuex'; |
| | | import listPage from '@/views/mixins/listPage'; |
| | | |
| | | export default { |
| | | name: "index", |
| | | components: {MyButton, MyTableV2, edit, myImport}, |
| | | name: 'index', |
| | | mixins: [listPage], |
| | | components: {MyButton, MyTableV2, edit, myImport, inventory, detail}, |
| | | data() { |
| | | return { |
| | | // 搜索框 |
| | | items: [ |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | dataIndex: 'businessFormCode', |
| | | label: '盘点单号', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | // { |
| | | // type: 'select', |
| | | // dataIndex: 'status', |
| | | // label: '类型', |
| | | // placeholder: '请选择', |
| | | // defaultValue: '1', |
| | | // options: [ |
| | | // { |
| | | // label: '启用', |
| | | // value: '1' |
| | | // }, |
| | | // { |
| | | // label: '禁用', |
| | | // value: '0' |
| | | // } |
| | | // ] |
| | | // }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | dataIndex: 'businessFormName', |
| | | label: '任务名称', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | dataIndex: 'agencyId', |
| | | label: '机构', |
| | | placeholder: '请选择', |
| | | optionsConfig: {url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null}, |
| | | cascader: [{key:'warehouseId',queryKey: 'agencyId'}], |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'warehouseId', |
| | | label: '仓库', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | optionsConfig: { |
| | | label: 'warehouseName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/warehouse/select/tenant_warehouse' |
| | | }, |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'startTime', |
| | | label: '盘点时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'endTime', |
| | | label: '至', |
| | | defaultValue: '', |
| | | }, |
| | | ], |
| | | // 树数据 |
| | |
| | | tenantId: null, |
| | | userName: null, |
| | | userPhone: null, |
| | | status: 1 |
| | | status: 1, |
| | | }, |
| | | // 导入 |
| | | importSetting: { |
| | | dialogTitle: '导入', |
| | | dialogShow: false, |
| | | fileSettings: { |
| | | data: {}, |
| | | uploadUrl: getBaseUrl()+"/pc/fin/sys/tenant/import", // 上传地址 |
| | | accept: '.xls', // 格式 |
| | | type: 'text', // 回显形式 |
| | | loading: false // 导入效果 |
| | | }, |
| | | /* 模板下载 */ |
| | | templateSettings: { |
| | | templateName: '导入模板.xls', // 名称 |
| | | templateUrl: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/getImportTemplate' // 下载地址 |
| | | }, |
| | | onSuccess: null |
| | | dialogTitle: '导入', |
| | | dialogShow: false, |
| | | fileSettings: { |
| | | data: {}, |
| | | uploadUrl: getBaseUrl() + '/pc/fin/sys/tenant/import', // 上传地址 |
| | | accept: '.xls', // 格式 |
| | | type: 'text', // 回显形式 |
| | | loading: false, // 导入效果 |
| | | }, |
| | | /* 模板下载 */ |
| | | templateSettings: { |
| | | templateName: '导入模板.xls', // 名称 |
| | | templateUrl: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/getImportTemplate', // 下载地址 |
| | | }, |
| | | onSuccess: null, |
| | | }, |
| | | editSetting: { |
| | | title: '', |
| | | id: '', |
| | | orgId: '', |
| | | show: false, |
| | | }, |
| | | inventorySetting: { |
| | | title: '', |
| | | id: '', |
| | | orgId: '', |
| | | show: false, |
| | | }, |
| | | inventoryDetail: { |
| | | title: '', |
| | | id: '', |
| | | orgId: '', |
| | |
| | | table: { |
| | | showIndex: true, // 是否显示序号 |
| | | expand: false, // 是否显示详情数据 |
| | | url: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/select/list', // 请求地址 |
| | | url: SettingIplatform.apiBaseURL + inventoryListApi(), // 请求地址 |
| | | // 工具条 |
| | | tools: { |
| | | columnsCtrl: {// 列控制按钮 |
| | | show: false |
| | | columnsCtrl: { |
| | | // 列控制按钮 |
| | | show: false, |
| | | }, |
| | | generalExport: {// 通用导出按钮 |
| | | show: false |
| | | generalExport: { |
| | | // 通用导出按钮 |
| | | show: false, |
| | | }, |
| | | // 自定义工具条按钮 |
| | | custom: [ |
| | | ] |
| | | { |
| | | name: '新增', |
| | | click: () => { |
| | | this.showAdd(); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | // 列信息 |
| | | columns: [ |
| | | {title: '盘点单号', field: 'name', align: 'left',}, |
| | | {title: '任务名称', field: 'code', align: 'center'}, |
| | | {title: '盘点仓库', field: 'lv', align: 'center', }, |
| | | {title: '盘点人', field: 'lv', align: 'center', }, |
| | | {title: '监盘人', field: 'summary', align: 'left',}, |
| | | {title: '盘点时间', field: 'summary', align: 'left',}, |
| | | {title: '创建时间', field: 'summary', align: 'left',}, |
| | | {title: '状态', field: 'summary', align: 'left',}, |
| | | ], |
| | | {title: '盘点单号', field: 'businessFormCode', align: 'center', width: 130}, |
| | | {title: '任务名称', field: 'businessFormName', align: 'left', minWidth: 140}, |
| | | {title: '盘点仓库', field: 'warehouseName', align: 'left', minWidth: 130}, |
| | | {title: '盘点人', field: 'operatorName', align: 'center', width: 120}, |
| | | {title: '监盘人', field: 'operatorName2', align: 'center', width: 120}, |
| | | { |
| | | title: '盘点时间', |
| | | field: 'inventoryDate', |
| | | align: 'center', |
| | | width: 160, |
| | | formatter: (row) => { |
| | | return {value: row.inventoryDate ? DateFormatter.LongToDateTime(row.inventoryDate) : '-'}; |
| | | }, |
| | | }, |
| | | { |
| | | title: '创建时间', |
| | | field: 'createTime', |
| | | align: 'center', |
| | | width: 160, |
| | | formatter: (row) => { |
| | | return {value: DateFormatter.LongToDateTime(row.createTime)}; |
| | | }, |
| | | }, |
| | | { |
| | | title: '状态', |
| | | field: 'states', |
| | | align: 'center', |
| | | width: 90, |
| | | type: 'primary', |
| | | formatter: (row) => { |
| | | return { |
| | | value: row.states == 0 ? '未开始' : row.states == 1 ? '进行中' : '已盘点', |
| | | type: row.states == 0 ? 'danger' : row.states == 1 ? 'success' : 'primary', |
| | | }; |
| | | }, |
| | | }, |
| | | ], |
| | | // 操作信息 |
| | | operation: { |
| | | show: true, // 显示操作列 |
| | | width: '150', // 列宽 |
| | | align: 'left', |
| | | width: '220', // 列宽 |
| | | attr: [ |
| | | { |
| | | title: '详情', |
| | | title: '编辑', |
| | | hidden: (row) => { |
| | | if (row.states != 0) { |
| | | return true; |
| | | } |
| | | }, |
| | | events: (row) => { |
| | | this.showAudit(row); |
| | | }, |
| | | }, |
| | | { |
| | | title: '删除', |
| | | hidden: (row) => { |
| | | if (row.states != 0) { |
| | | return true; |
| | | } |
| | | }, |
| | | events: (row) => { |
| | | this.del(row); |
| | | }, |
| | | }, |
| | | { |
| | | title: '盘点', |
| | | type: 'success', |
| | | hidden: (row) => { |
| | | if (row.states != 0) { |
| | | return true; |
| | | } |
| | | }, |
| | | events: (row) => { |
| | | this.showInventory(row); |
| | | }, |
| | | }, |
| | | { |
| | | title: '继续盘点', |
| | | type: 'success', |
| | | hidden: (row) => { |
| | | if (row.states != 1) { |
| | | return true; |
| | | } |
| | | }, |
| | | events: (row) => { |
| | | this.showInventory(row); |
| | | }, |
| | | }, |
| | | { |
| | | title: '盘点详情', |
| | | type: 'info', |
| | | hidden: (row) => { |
| | | if (row.states != 2) { |
| | | return true; |
| | | } |
| | | }, |
| | | events: (row) => { |
| | | this.showInventoryDetail(row); |
| | | }, |
| | | }, |
| | | { |
| | | title: '生成盘点表', |
| | | type: 'primary', |
| | | hidden: (row) => { |
| | | if (row.states != 2) { |
| | | return true; |
| | | } |
| | | }, |
| | | events: (row) => { |
| | | this.handleExport('inventoryExport', `盘点表-${row.businessFormCode}`, {id: row.id}); |
| | | }, |
| | | }, |
| | | ], |
| | |
| | | small: false, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | total: 0 |
| | | } |
| | | } |
| | | total: 0, |
| | | }, |
| | | }, |
| | | }, |
| | | } |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(['userInfo']), |
| | | }, |
| | | created() { |
| | | // 获取机构树 |
| | | this.initTreeData() |
| | | }, |
| | | methods: { |
| | | //导入 |
| | | importOrg() { |
| | | this.importSetting.dialogShow = true |
| | | this.importSetting.onSuccess = (response, callBack) => { |
| | | if (response.code===1){ |
| | | this.$message.success(response.msg) |
| | | this.search(1) |
| | | }else{ |
| | | this.$message.warning(response.msg) |
| | | } |
| | | callBack() |
| | | this.importSetting.dialogShow = true; |
| | | this.importSetting.onSuccess = (response, callBack) => { |
| | | if (response.code === 1) { |
| | | this.$message.success(response.msg); |
| | | this.search(1); |
| | | } else { |
| | | this.$message.warning(response.msg); |
| | | } |
| | | }, |
| | | // 左侧树初始化 |
| | | initTreeData() { |
| | | finsystenant.getTree().then(res => { |
| | | const content = res || [] |
| | | this.treeDataList.splice(0, this.treeDataList.length) |
| | | this.treeDataList = content |
| | | if (content.length > 0) { |
| | | this.importSetting.fileSettings.data = {pid: content[0].id} |
| | | } |
| | | }) |
| | | }, |
| | | updState(row) { |
| | | let vm = this |
| | | let text = row.status == 0 ? "启用" : "禁用"; |
| | | vm.$modal.confirm('确认要' + text + '"' + row.name + '"吗?').then(function () { |
| | | let params = Object.assign({}, row) |
| | | params.status = row.status == 1 ? 0 : 1 |
| | | finsystenant.edit(params).then(res => { |
| | | if (res) { |
| | | row.status = row.status === 1 ? 0 : 1 |
| | | vm.$modal.msgSuccess(text + "成功"); |
| | | vm.search() |
| | | } |
| | | }) |
| | | }) |
| | | callBack(); |
| | | }; |
| | | }, |
| | | del(row) { |
| | | this.$modal |
| | | .confirm('是否确认删除名称为"' + row.name + '"的机构吗?') |
| | | .then(function () { |
| | | finsystenant.del({id: row.id}).then((res) => { |
| | | .confirm('是否确认删除单号为:' + row.businessFormCode + ' 的数据吗?') |
| | | .then(() => { |
| | | inventoryDel({id: row.id}).then((res) => { |
| | | this.$message.success('删除成功!'); |
| | | this.search(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | }); |
| | | }) |
| | | .then((res) => { |
| | | this.$message.success('删除成功!'); |
| | | this.search() |
| | | }) |
| | | .catch(() => { |
| | | }); |
| | | }, |
| | | showAdd() { |
| | | // if (!this.editSetting.orgId) { |
| | | // this.$message.warning('请先选择左侧机构') |
| | | // } else { |
| | | this.editSetting.id = null; |
| | | this.editSetting.info = null; |
| | | this.editSetting.title = '新增'; |
| | | this.editSetting.show = true; |
| | | // } |
| | | // 先查询是否能增加新的盘点任务 |
| | | // 编辑接口 |
| | | isAddInventory().then((res) => { |
| | | if(res == 0){ |
| | | this.$message.warning('当前有未完成的盘点任务!'); |
| | | }else if(res == -1){ |
| | | this.$message.warning('当前仓库无物品!'); |
| | | }else{ |
| | | this.editSetting.id = null; |
| | | this.editSetting.info = null; |
| | | this.editSetting.title = '新增'; |
| | | this.editSetting.show = true; |
| | | } |
| | | }).catch(()=>{ |
| | | //this.loading = false |
| | | }); |
| | | }, |
| | | showAudit(row) { |
| | | this.editSetting.id = row.id; |
| | |
| | | this.editSetting.title = '编辑'; |
| | | this.editSetting.show = true; |
| | | }, |
| | | nodeClick(param) { |
| | | param = param || {} |
| | | this.p = Object.assign({}, { |
| | | id: param.id, |
| | | name: param.name |
| | | }) |
| | | if (this.p.id != undefined && this.p.id != null) { |
| | | this.filterFrom.tenantId = this.p.id |
| | | this.editSetting.orgId = this.p.id |
| | | } else { |
| | | this.filterFrom.tenantId = null |
| | | this.editSetting.orgId = null |
| | | } |
| | | this.importSetting.fileSettings.data = {pid: param.id} |
| | | this.search(1) |
| | | // 盘点 |
| | | showInventory(row) { |
| | | this.inventorySetting.id = row.id; |
| | | this.inventorySetting.info = JSON.stringify(row); |
| | | this.inventorySetting.title = '盘点任务'; |
| | | this.inventorySetting.show = true; |
| | | }, |
| | | showInventoryDetail(row) { |
| | | this.inventoryDetail.id = row.id; |
| | | this.inventoryDetail.info = JSON.stringify(row); |
| | | this.inventoryDetail.title = '盘点详情'; |
| | | this.inventoryDetail.show = true; |
| | | }, |
| | | // 查询table列表 |
| | | search(pageNum) { |
| | | if (pageNum != undefined) { |
| | | this.$refs.myTable.search(pageNum) |
| | | this.$refs.myTable.search({pageNum}); |
| | | } else { |
| | | this.$refs.myTable.search() |
| | | this.$refs.myTable.search(); |
| | | } |
| | | }, |
| | | fifterForm(params) { |
| | | this.filterFrom = Object.assign(this.filterFrom, params) |
| | | this.search(1) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | | <style scoped></style> |