| | |
| | | @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> |
| | |
| | | import SettingIplatform from '@/utils/settingIplatform'; |
| | | import edit from './edit'; |
| | | import inventory from './inventory'; |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant'; |
| | | import detail from './detail'; |
| | | import {selectTenantWarehouse} from '@/api/baseSetting/finsystenant'; |
| | | import myImport from '@/views/components/myImport'; |
| | | import { getBaseUrl } from '@/utils/base'; |
| | | import {getBaseUrl} from '@/utils/base'; |
| | | import {inventoryDel, inventoryListApi} from '@/api/stock/inventory'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | import {mapGetters} from 'vuex'; |
| | | |
| | | export default { |
| | | name: 'index', |
| | | components: { MyButton, MyTableV2, edit, myImport, inventory }, |
| | | components: { MyButton, MyTableV2, edit, myImport, inventory,detail }, |
| | | data() { |
| | | return { |
| | | // 搜索框 |
| | | items: [ |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | dataIndex: 'businessFormCode', |
| | | label: '盘点单号', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | dataIndex: 'businessFormName', |
| | | label: '任务名称', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'warehouseId', |
| | | label: '盘点仓库', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'startTime', |
| | | label: '盘点时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'endTime', |
| | | label: '至', |
| | | defaultValue: '', |
| | | }, |
| | | ], |
| | |
| | | orgId: '', |
| | | show: false, |
| | | }, |
| | | inventoryDetail:{ |
| | | title: '', |
| | | id: '', |
| | | orgId: '', |
| | | show: false, |
| | | }, |
| | | // 表格数据 |
| | | table: { |
| | | showIndex: true, // 是否显示序号 |
| | | expand: false, // 是否显示详情数据 |
| | | url: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/select/list', // 请求地址 |
| | | url: SettingIplatform.apiBaseURL + inventoryListApi(), // 请求地址 |
| | | // 工具条 |
| | | tools: { |
| | | columnsCtrl: { |
| | |
| | | }, |
| | | // 列信息 |
| | | 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: '编辑', |
| | | 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', |
| | | 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.showInventoryDetail(row); |
| | | }, |
| | | }, |
| | | ], |
| | |
| | | }, |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(['userInfo']), |
| | | }, |
| | | created() { |
| | | // 获取机构树 |
| | | this.initTreeData(); |
| | | selectTenantWarehouse({ agencyId: this.userInfo.tenantId }).then((res) => { |
| | | this.items.forEach((v) => { |
| | | if (v.label == '盘点仓库') { |
| | | v.options = res.map((item) => { |
| | | item.label = item.warehouseName; |
| | | item.value = item.id; |
| | | return item; |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | methods: { |
| | | //导入 |
| | |
| | | callBack(); |
| | | }; |
| | | }, |
| | | // 左侧树初始化 |
| | | 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(); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | del(row) { |
| | | this.$modal |
| | | .confirm('是否确认删除名称为"' + row.name + '"的机构吗?') |
| | | .then(function () { |
| | | finsystenant.del({ id: row.id }).then((res) => {}); |
| | | }) |
| | | .then((res) => { |
| | | this.$message.success('删除成功!'); |
| | | this.search(); |
| | | .confirm('是否确认删除单号为:' + row.businessFormCode + ' 的数据吗?') |
| | | .then(() => { |
| | | inventoryDel({ id: row.id }).then((res) => { |
| | | this.$message.success('删除成功!'); |
| | | this.search(); |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | |
| | | this.editSetting.title = '编辑'; |
| | | this.editSetting.show = true; |
| | | }, |
| | | // 盘点 |
| | | showInventory(row) { |
| | | this.inventorySetting.id = row.id; |
| | | this.inventorySetting.info = JSON.stringify(row); |
| | | this.inventorySetting.title = '盘点'; |
| | | this.inventorySetting.title = '盘点任务'; |
| | | this.inventorySetting.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); |
| | | showInventoryDetail(row) { |
| | | this.inventoryDetail.id = row.id; |
| | | this.inventoryDetail.info = JSON.stringify(row); |
| | | this.inventoryDetail.title = '盘点详情'; |
| | | this.inventoryDetail.show = true; |
| | | }, |
| | | // 查询table列表 |
| | | search(pageNum) { |
| | |
| | | }, |
| | | fifterForm(params) { |
| | | this.filterFrom = Object.assign(this.filterFrom, params); |
| | | |
| | | if (this.filterFrom.startTime) { |
| | | this.filterFrom.startTime = this.filterFrom.startTime.replace(/\-/g, ''); |
| | | } |
| | | if (this.filterFrom.endTime) { |
| | | this.filterFrom.endTime = this.filterFrom.endTime.replace(/\-/g, ''); |
| | | } |
| | | this.search(1); |
| | | }, |
| | | }, |