| | |
| | | <el-row style="margin-top: 15px"> |
| | | <el-col> |
| | | <!--列表--> |
| | | <my-table-v2 ref="myTable" :filter="filterFrom" :table="table" /> |
| | | <my-table-v2 ref="myTable" :filter="filterFrom" :table="table"/> |
| | | </el-col> |
| | | </el-row> |
| | | <!--添加/编辑弹窗--> |
| | | <edit v-if="editSetting.show" :setting="editSetting" @close="editSetting.show = false" @search="search" /> |
| | | <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" |
| | | 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" /> |
| | | <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> |
| | |
| | | import edit from './edit'; |
| | | import inventory from './inventory'; |
| | | import detail from './detail'; |
| | | import {selectTenantWarehouse} from '@/api/baseSetting/finsystenant'; |
| | | import myImport from '@/views/components/myImport'; |
| | | import {getBaseUrl} from '@/utils/base'; |
| | | import {inventoryDel, inventoryListApi} from '@/api/stock/inventory'; |
| | | 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, inventory,detail }, |
| | | mixins: [listPage], |
| | | components: {MyButton, MyTableV2, edit, myImport, inventory, detail}, |
| | | data() { |
| | | return { |
| | | // 搜索框 |
| | |
| | | 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: '盘点仓库', |
| | | label: '仓库', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | optionsConfig: { |
| | | label: 'warehouseName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/warehouse/select/tenant_warehouse' |
| | | }, |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | |
| | | orgId: '', |
| | | show: false, |
| | | }, |
| | | inventoryDetail:{ |
| | | inventoryDetail: { |
| | | title: '', |
| | | id: '', |
| | | orgId: '', |
| | |
| | | }, |
| | | // 列信息 |
| | | columns: [ |
| | | { 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: '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) : '-' }; |
| | | return {value: row.inventoryDate ? DateFormatter.LongToDateTime(row.inventoryDate) : '-'}; |
| | | }, |
| | | }, |
| | | { |
| | |
| | | align: 'center', |
| | | width: 160, |
| | | formatter: (row) => { |
| | | return { value: DateFormatter.LongToDateTime(row.createTime) }; |
| | | return {value: DateFormatter.LongToDateTime(row.createTime)}; |
| | | }, |
| | | }, |
| | | { |
| | |
| | | } |
| | | }, |
| | | events: (row) => { |
| | | this.showInventoryDetail(row); |
| | | this.handleExport('inventoryExport', `盘点表-${row.businessFormCode}`, {id: row.id}); |
| | | }, |
| | | }, |
| | | ], |
| | |
| | | ...mapGetters(['userInfo']), |
| | | }, |
| | | created() { |
| | | 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: { |
| | | //导入 |
| | |
| | | }, |
| | | del(row) { |
| | | this.$modal |
| | | .confirm('是否确认删除单号为:' + row.businessFormCode + ' 的数据吗?') |
| | | .then(() => { |
| | | inventoryDel({ id: row.id }).then((res) => { |
| | | this.$message.success('删除成功!'); |
| | | this.search(); |
| | | .confirm('是否确认删除单号为:' + row.businessFormCode + ' 的数据吗?') |
| | | .then(() => { |
| | | inventoryDel({id: row.id}).then((res) => { |
| | | this.$message.success('删除成功!'); |
| | | this.search(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | showAdd() { |
| | | 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; |
| | |
| | | // 查询table列表 |
| | | search(pageNum) { |
| | | if (pageNum != undefined) { |
| | | this.$refs.myTable.search(pageNum); |
| | | this.$refs.myTable.search({pageNum}); |
| | | } else { |
| | | this.$refs.myTable.search(); |
| | | } |
| | | }, |
| | | 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); |
| | | }, |
| | | }, |
| | | }; |