| | |
| | | // 接口请求地址 |
| | | // apiBaseURL: 'http://116.198.39.83:8082/progress', // 正式 |
| | | // apiBaseURL: 'http://172.16.60.90:8082/progress',//开发 |
| | | apiBaseURL: 'http://172.16.60.175:8083/lowConsum',//开发 |
| | | apiBaseURL: 'http://172.16.20.10:8083/lowConsum',//开发 |
| | | // apiBaseURL: 'https://yqzx.jinmingyuan.com/lowConsum',//开发 |
| | | // apiBaseURL: 'https://jmy.jinmingyuan.com/progress',// 测试, |
| | | // socket连接 |
| | | wsSocketUrl: VUE_APP_WS_URL, |
| | |
| | | export function getUserByOrgId(parameter) { |
| | | return request.get(SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/getUserByOrgId', {params: parameter}) |
| | | } |
| | | |
| | | // 仓库选择列表 |
| | | export function selectTenantWarehouse(params) { |
| | | return request({ |
| | | url: '/pc/base/warehouse/select/tenant_warehouse', |
| | | method: 'get', |
| | | params, |
| | | }); |
| | | } |
| | | |
| | | // 物品分类列表 |
| | | export function getCategoryDetail(params) { |
| | | return request({ |
| | | url: '/pc/base/category/detail', |
| | | method: 'get', |
| | | params, |
| | | }); |
| | | } |
| | | |
| | | // 物品列表 |
| | | export function goodsTemplate(params) { |
| | | return request({ |
| | | url: '/pc/base/goods/template/query/goodsTemplate', |
| | | method: 'get', |
| | | params, |
| | | }); |
| | | } |
| | | |
| | | // 规格型号 |
| | | export function goodsModel(params) { |
| | | return request({ |
| | | url: '/pc/base/goods/models/query/goodsModel', |
| | | method: 'get', |
| | | params, |
| | | }); |
| | | } |
| | | |
| | | // 物品分类tree |
| | | export function getCategorySelectTree(parameter) { |
| | | return request.get(SettingIplatform.apiBaseURL + '/pc/base/category/select/tree', {params: parameter}) |
| | | } |
New file |
| | |
| | | import request from '@/utils/request'; |
| | | |
| | | // 出库列表 |
| | | export function outputList(params) { |
| | | return request({ |
| | | url: '/pc/l/wh/form/output/list', |
| | | method: 'get', |
| | | params, |
| | | }); |
| | | } |
| | | // 新增出库 |
| | | export function outputAdd(data) { |
| | | return request({ |
| | | url: '/pc/l/wh/form/output/add', |
| | | method: 'post', |
| | | data, |
| | | }); |
| | | } |
| | | // 出库详情 |
| | | export function outputDetail(params) { |
| | | return request({ |
| | | url: '/pc/l/wh/form/output/detail', |
| | | method: 'get', |
| | | params, |
| | | }); |
| | | } |
| | | // 库存 |
| | | export function outputSelectNumber(params) { |
| | | return request({ |
| | | url: '/pc/l/wh/form/output/select/number', |
| | | method: 'get', |
| | | params, |
| | | }); |
| | | } |
| | |
| | | // 接口请求地址 |
| | | // apiBaseURL: 'http://116.198.39.83:8082/progress', // 正式 |
| | | // apiBaseURL: 'http://172.16.60.90:8082/progress',//开发 |
| | | apiBaseURL: 'http://172.16.60.175:8083/lowConsum',//开发 |
| | | // apiBaseURL: 'http://172.16.60.175:8083/lowConsum',//开发 |
| | | apiBaseURL: 'http://172.16.20.10:8083/lowConsum',//开发 |
| | | // apiBaseURL: 'https://yqzx.jinmingyuan.com/lowConsum',//开发 |
| | | // apiBaseURL: 'https://jmy.jinmingyuan.com/progress',// 测试, |
| | | // socket连接 |
| | | wsSocketUrl: VUE_APP_WS_URL, |
| | |
| | | <div class="img-box"></div> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="goods-card" v-for="(goodsItem, goodsIndex) in detail.procureGoods" :key="goodsIndex"> |
| | | <div class="goods-card" v-for="(goodsItem, goodsIndex) in detail.goods" :key="goodsIndex"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <span>物品分类:</span> |
| | |
| | | </win-md> |
| | | </template> |
| | | <script> |
| | | import { procureDetail } from '@/api/stock/procure/purchaseOrder'; |
| | | import { outputDetail } from '@/api/stock/accessStock'; |
| | | import winMd from '@/components/win/win-md'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | |
| | |
| | | agencyName: '', |
| | | states: '', |
| | | createName: '', |
| | | time: '', |
| | | procureGoods: [{}, {}], |
| | | goods: [], |
| | | }, |
| | | }; |
| | | }, |
| | |
| | | }, |
| | | }, |
| | | created() { |
| | | procureDetail({ id: this.setting.id }).then((res) => { |
| | | outputDetail({ id: this.setting.id }).then((res) => { |
| | | this.detail = res; |
| | | }); |
| | | }, |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="出库仓库" prop="warehouseId"> |
| | | <el-select v-model="formData.warehouseId" placeholder="请选择" style="width: 100%"> |
| | | <el-option v-for="item in warehouses" :key="item.id" :label="item.warehouseName" :value="item.id" /> |
| | | <el-option v-for="item in warehouseOptions" :key="item.id" :label="item.warehouseName" :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="出库时间" prop="procureTime"> |
| | | <el-form-item label="出库时间" prop="dealTime"> |
| | | <el-date-picker |
| | | v-model="formData.procureTime" |
| | | v-model="formData.dealTime" |
| | | type="datetime" |
| | | value="yyyy-MM-dd HH:mm:ss" |
| | | value-format="yyyyMMddHHmmss" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24" class="headerHeight"> |
| | | <el-col :span="12"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="出库手续" prop="procureDoc"> |
| | | <upload :settings="uploadSettings" @on-change="uploadChange"></upload> |
| | | <upload ref="uploadRef" :settings="uploadSettings" @on-change="uploadChange"></upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="goods-card" v-for="(goodsItem, goodsIndex) in formData.procureGoods" :key="goodsIndex"> |
| | | <div class="goods-card" v-for="(goodsItem, goodsIndex) in formData.goods" :key="goodsIndex"> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="物品分类" |
| | | :prop="`procureGoods[${goodsIndex}].baseCategoryIds`" |
| | | :prop="`goods[${goodsIndex}].baseCategoryIds`" |
| | | :rules="{ |
| | | required: true, |
| | | message: '请选择', |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="物品名称" |
| | | :prop="`procureGoods[${goodsIndex}].baseGoodsTemplateId`" |
| | | :prop="`goods[${goodsIndex}].baseGoodsTemplateId`" |
| | | :rules="{ |
| | | required: true, |
| | | message: '请选择', |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="规格型号" |
| | | :prop="`procureGoods[${goodsIndex}].modelsIds`" |
| | | :prop="`goods[${goodsIndex}].modelsIds`" |
| | | :rules="{ |
| | | required: true, |
| | | message: '请选择', |
| | |
| | | </el-table> |
| | | <div class="btn-group"> |
| | | <el-button |
| | | v-if="formData.procureGoods.length > 1" |
| | | v-if="formData.goods.length > 1" |
| | | name="移除" |
| | | type="danger" |
| | | plain |
| | |
| | | >移除</el-button |
| | | > |
| | | <el-button |
| | | v-if="formData.procureGoods.length - 1 == goodsIndex" |
| | | v-if="formData.goods.length - 1 == goodsIndex" |
| | | name="新增物品" |
| | | type="primary" |
| | | plain |
| | |
| | | <script> |
| | | import { |
| | | goodsTemplate, |
| | | procureAdd, |
| | | procureEdit, |
| | | selectTenantWarehouse, |
| | | goodsModel, |
| | | procureDetail, |
| | | } from '@/api/stock/procure/purchaseOrder'; |
| | | selectTenantWarehouse, |
| | | } from '@/api/baseSetting/finsystenant'; |
| | | import { |
| | | outputAdd, |
| | | outputSelectNumber |
| | | } from '@/api/stock/accessStock'; |
| | | import { getTree } from '@/api/foudation/classification'; |
| | | import MyButton from '@/components/myButton/myButton'; |
| | | import winMd from '@/components/win/win-md'; |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | loading: false, |
| | | buyTypeOptions: [ |
| | | { |
| | | label: '集采', |
| | | value: '1', |
| | | }, |
| | | { |
| | | label: '自采', |
| | | value: '2', |
| | | }, |
| | | ], |
| | | warehouses: [], // 出库仓库列表 |
| | | warehouseOptions: [], // 出库仓库列表 |
| | | categoryOptions: [], // 物品分类列表 |
| | | modelList: [], //型号列表 |
| | | formData: { |
| | | warehouseId: '', // 出库仓库id |
| | | procureTime: '', // 出库时间 |
| | | buyType: '2', // 出库方式(1:集采;2=自采) |
| | | procureGoods: [], |
| | | dealTime: '', // 出库时间 |
| | | procureDoc: '', |
| | | goods: [], |
| | | }, |
| | | goodsItem: { |
| | | whFormProcureId: '', // 出库单ID |
| | | baseCategoryIds: '', // 分类编号数组 |
| | | baseCategoryId: '', // 分类编号 |
| | | baseGoodsTemplateId: '', // 物品模版编号 |
| | | goodsTemplateName: '', // 物品模版名称 |
| | | supplier: '', // 供应商 |
| | | sort: '', // 显示顺序 |
| | | goodsOptions: [], // 物品列表select |
| | | modelsOptions: [], //规格型号select |
| | | models: [], // 物品名称 |
| | |
| | | }, |
| | | modelsItem: { |
| | | baseGoodsModelsId: '', // 规格型号编号 |
| | | price: 0, // 单价(出库需要,调拨不需要) |
| | | worehouseCount: 0, |
| | | counts: 0, // 操作数量 |
| | | supplier: '', // 供应商 |
| | | unit: null, //单位 |
| | | }, |
| | | rules: { |
| | | warehouseId: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | procureTime: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | dealTime: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | buyType: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | |
| | | // procureDoc: [{ required: true, message: '请上传', trigger: 'change' }], |
| | | procureDoc: [{ required: true, message: '请上传', trigger: 'change' }], |
| | | baseCategoryIds: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | baseGoodsTemplateId: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | modelsIds: [{ required: true, message: '请选择', trigger: 'change' }], |
| | |
| | | uploadSettings: { |
| | | title: '上传', |
| | | max: 20, // 最大大小,单位M |
| | | num: 2, // 支持上传图片个数 |
| | | num: 10, // 支持上传图片个数 |
| | | accept: '.jpg,.png', // 限制格式 |
| | | tip: '', // 提示 默认:`只能上传${this.defaultSettings.num}个${this.defaultSettings.accept}文件,且不超过${this.defaultSettings.max}kb` |
| | | uploadUrl: getUploadUrl(), // 上传路径 |
| | | multiple: true, // 是否支持批量上传 |
| | | disabled: false, // 是否禁用 |
| | | type: 'text', // text/picture |
| | | type: 'picture', // text/picture |
| | | }, |
| | | }; |
| | | }, |
| | |
| | | // 获取物品分类列表 |
| | | const treeRes = await getTree(); |
| | | this.categoryOptions = this.removeEmptyChildren(treeRes); |
| | | if (this.setting.id) { |
| | | const detail = await procureDetail({ id: this.setting.id }); |
| | | this.formData = Object.assign(this.formData, detail); |
| | | this.$set(this.formData, 'buyType', this.formData.buyType.toString()); |
| | | this.formData.procureTime = this.formData.procureTime.toString(); |
| | | this.formData.procureGoods.map((item, index) => { |
| | | // 根据子集ID拼接物品分类列表 |
| | | let pIds = this.findParentIds(this.categoryOptions, item.baseCategoryId); |
| | | pIds = pIds.reverse(); |
| | | item.baseCategoryIds = [...pIds, item.baseCategoryId]; |
| | | this.$set( |
| | | this.formData.procureGoods[index], |
| | | 'modelsIds', |
| | | item.models.map((v) => v.baseGoodsModelsId), |
| | | ); |
| | | this.getgoodsTemplate(item.baseCategoryId, index); |
| | | this.getgoodsModel(item.baseGoodsTemplateId, index); |
| | | return item; |
| | | }); |
| | | } else { |
| | | this.formData.procureGoods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | } |
| | | this.visible = true; |
| | | this.formData.goods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | }, |
| | | |
| | | // 获取出库仓库列表 |
| | | getWarehouseList() { |
| | | selectTenantWarehouse() |
| | | .then((res) => { |
| | | this.warehouses = res; |
| | | if (this.warehouses.length && !this.formData.warehouseId) { |
| | | this.warehouseOptions = res; |
| | | if (this.warehouseOptions.length && !this.formData.warehouseId) { |
| | | // 默认选中第一个仓库 |
| | | this.formData.warehouseId = this.warehouses[0].id; |
| | | this.formData.warehouseId = this.warehouseOptions[0].id; |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | |
| | | getgoodsTemplate(id, index) { |
| | | goodsTemplate({ categoryId: id || '' }).then((res) => { |
| | | if (index || index == 0) { |
| | | this.$set(this.formData.procureGoods[index], 'goodsOptions', res); |
| | | this.$set(this.formData.goods[index], 'goodsOptions', res); |
| | | } else { |
| | | this.goodsTemplatelAll = res; |
| | | } |
| | |
| | | getgoodsModel(id, index) { |
| | | goodsModel({ goodsTemplatesId: id || '' }).then((res) => { |
| | | if (index || index == 0) { |
| | | this.$set(this.formData.procureGoods[index], 'modelsOptions', res); |
| | | this.$set(this.formData.goods[index], 'modelsOptions', res); |
| | | } else { |
| | | this.goodsModelAll = res; |
| | | } |
| | |
| | | |
| | | // 物品分类选择 |
| | | categoryChange(e, index) { |
| | | this.formData.procureGoods[index].goodsOptions = []; |
| | | this.formData.procureGoods[index].baseGoodsTemplateId = ''; |
| | | this.formData.procureGoods[index].goodsTemplateName = ''; |
| | | this.formData.procureGoods[index].modelsOptions = []; |
| | | this.formData.procureGoods[index].modelsIds = []; |
| | | this.formData.procureGoods[index].models = []; |
| | | this.formData.goods[index].goodsOptions = []; |
| | | this.formData.goods[index].baseGoodsTemplateId = ''; |
| | | this.formData.goods[index].goodsTemplateName = ''; |
| | | this.formData.goods[index].modelsOptions = []; |
| | | this.formData.goods[index].modelsIds = []; |
| | | this.formData.goods[index].models = []; |
| | | |
| | | this.formData.procureGoods[index].baseCategoryId = e[e.length - 1]; |
| | | this.formData.goods[index].baseCategoryId = e[e.length - 1]; |
| | | // 根据选中分类请求物品名称列表 |
| | | this.getgoodsTemplate(e[e.length - 1], index); |
| | | }, |
| | | |
| | | // 物品名称列表 |
| | | goodsTemplateChange(e, index) { |
| | | this.formData.procureGoods[index].modelsOptions = []; |
| | | this.formData.procureGoods[index].modelsIds = []; |
| | | this.formData.procureGoods[index].models = []; |
| | | this.formData.goods[index].modelsOptions = []; |
| | | this.formData.goods[index].modelsIds = []; |
| | | this.formData.goods[index].models = []; |
| | | |
| | | this.formData.procureGoods[index].goodsTemplateName = this.getGoodsTemplateName(e); |
| | | this.formData.goods[index].goodsTemplateName = this.getGoodsTemplateName(e); |
| | | // 根据选中物品名称id获取规格型号列表 |
| | | this.getgoodsModel(e, index); |
| | | }, |
| | | |
| | | // 规格型号选择 |
| | | modelChange(e, index) { |
| | | let arr = [...this.formData.procureGoods[index].models]; |
| | | async modelChange(e, index) { |
| | | let arr = [...this.formData.goods[index].models]; |
| | | let str = JSON.stringify(arr); |
| | | e.forEach((item) => { |
| | | for(let item of e) { |
| | | if (str.indexOf(item) == -1) { |
| | | let temp = this.goodsModelAll.find((v) => v.id == item); |
| | | arr.push({ ...this.modelsItem, baseGoodsModelsId: item, unit: temp.unit }); |
| | | // 获取库存 |
| | | let num = await outputSelectNumber({warehouseId:this.formData.warehouseId,baseGoodsModelsId:item}) |
| | | arr.push({ ...this.modelsItem, baseGoodsModelsId: item, unit: temp.unit,worehouseCount: num}); |
| | | } |
| | | }); |
| | | this.formData.procureGoods[index].models = arr; |
| | | } |
| | | this.formData.goods[index].models = arr; |
| | | }, |
| | | |
| | | // 规格型号移除 |
| | | modelRemoveTag(e, index) { |
| | | let arr = this.formData.procureGoods[index].models; |
| | | let arr = this.formData.goods[index].models; |
| | | let delIndex = arr.findIndex((v) => v.baseGoodsModelsId == e); |
| | | this.formData.procureGoods[index].models.splice(delIndex, 1); |
| | | this.formData.goods[index].models.splice(delIndex, 1); |
| | | }, |
| | | |
| | | // 上传 |
| | | uploadChange(e) { |
| | | console.log('uploadChange', e); |
| | | uploadChange() { |
| | | let arr = this.$refs.uploadRef.fileList |
| | | this.formData.procureDoc = JSON.stringify(arr) |
| | | }, |
| | | |
| | | // 点击新增物品 |
| | | addGoods() { |
| | | this.formData.procureGoods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | this.formData.goods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | }, |
| | | |
| | | // 点击移除 |
| | | removeGoods(index) { |
| | | this.formData.procureGoods.splice(index, 1); |
| | | this.formData.goods.splice(index, 1); |
| | | }, |
| | | |
| | | // 出库数量校验 |
| | | countsChange(e, goodsIndex,index) { |
| | | const curItem = this.formData.procureGoods[goodsIndex].models[index] |
| | | const curItem = this.formData.goods[goodsIndex].models[index] |
| | | const worehouseCount = curItem.worehouseCount |
| | | if (e > worehouseCount) { |
| | | this.$message.warning('数额超过现有库存'); |
| | |
| | | this.$refs['ruleForm'].validate((valid) => { |
| | | if (valid) { |
| | | console.log('this.formData', this.formData); |
| | | if (this.setting.id) { |
| | | procureAdd(this.formData) |
| | | .then((res) => { |
| | | this.$message.success('保存成功!'); |
| | | this.close(); |
| | | this.$emit('search'); |
| | | }) |
| | | .catch((err) => { |
| | | console.log('create err', err); |
| | | this.$message.error('保存失败'); |
| | | }); |
| | | } else { |
| | | procureEdit(this.formData) |
| | | outputAdd(this.formData) |
| | | .then((res) => { |
| | | this.$message.success('保存成功!'); |
| | | this.close(); |
| | |
| | | console.log('edit err', err); |
| | | this.$message.error('保存失败'); |
| | | }); |
| | | } |
| | | } else { |
| | | this.$message.error('校验未通过,请检查。'); |
| | | } |
| | |
| | | close() { |
| | | this.formData = { |
| | | warehouseId: '', // 出库仓库id |
| | | procureTime: '', // 出库时间 |
| | | procureGoods: [], |
| | | dealTime: '', // 出库时间 |
| | | goods: [], |
| | | }; |
| | | this.$emit('close'); |
| | | }, |
| | |
| | | <!--列表--> |
| | | <div class="table-tool-bar" style="margin-bottom: 15px;"> |
| | | <my-button name="新增" @click="handleAdd" site="tools" size="medium" /> |
| | | <my-button name="导入" @click="importSetting.dialogShow = true" site="tools" size="medium" /> |
| | | </div> |
| | | <div :style="{ 'overflow-y': 'auto', height: `${clientHeight - 320}px` }" v-loading="loading"> |
| | | <el-row class="card" :gutter="5"> |
| | | <el-row v-if="list.length" class="card" :gutter="5"> |
| | | <el-col v-for="(item, index) in list" :key="index" class="cm-item"> |
| | | <el-card class="card-data"> |
| | | <div class="card-container"> |
| | |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="no-data" v-else>暂无数据</div> |
| | | </div> |
| | | <el-pagination |
| | | :small="false" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { procureList, procureDel, procureIncome } from '@/api/stock/procure/purchaseOrder'; |
| | | import { outputList, procureDel, procureIncome } from '@/api/stock/accessStock'; |
| | | import MyButton from '@/components/myButton/myButton'; |
| | | import SettingIplatform from '@/utils/settingIplatform'; |
| | | import myImport from '@/views/components/myImport'; |
| | |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'name', |
| | | type: 'cascader', |
| | | dataIndex: 'agencyId', |
| | | label: '机构', |
| | | placeholder: '请选择', |
| | | optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null }, |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | |
| | | }, |
| | | created() { |
| | | this.fetchData(); |
| | | |
| | | }, |
| | | methods: { |
| | | fetchData() { |
| | | this.loading = true; |
| | | procureList({ |
| | | outputList({ |
| | | pageNum: this.pageNum, |
| | | pageSize: this.pageSize, |
| | | ...this.filterFrom, |
| | |
| | | this.search({ pageNum: 1 }); |
| | | }, |
| | | handleCurrentChange(pageNum) { |
| | | this.myTable.paging.page.pageNum = pageNum; |
| | | this.search({ pageNum: pageNum }); |
| | | this.pageNum = pageNum; |
| | | this.search(); |
| | | }, |
| | | // 查询table列表 |
| | | search(pageNum) { |
| | | if(pageNum){ |
| | | this.pageNum = pageNum |
| | | } |
| | | this.fetchData(); |
| | | }, |
| | | refreshData() { |
| | |
| | | }, |
| | | fifterForm(params) { |
| | | this.filterFrom = Object.assign(this.filterFrom, params); |
| | | this.search(1); |
| | | if (this.filterFrom.incomeTimeStart) { |
| | | this.filterFrom.incomeTimeStart = this.filterFrom.incomeTimeStart.replace(/\-/g, ''); |
| | | } |
| | | if (this.filterFrom.incomeTimeEnd) { |
| | | this.filterFrom.incomeTimeEnd = this.filterFrom.incomeTimeEnd.replace(/\-/g, ''); |
| | | } |
| | | if (this.filterFrom.agencyId.length) { |
| | | this.filterFrom.agencyId = this.filterFrom.agencyId[this.filterFrom.agencyId.length - 1]; |
| | | } |
| | | this.search({ pageNum: 1 }); |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | .ml-20 { |
| | | margin-left: 20px; |
| | | } |
| | | .card { |
| | | .card,.list-item { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | margin: 0px !important; |
| | | width: 100%; |
| | | min-height: 100%; |
| | | .cm-item { |
| | | width: 100%; |
| | | } |
| | |
| | | } |
| | | } |
| | | .card-data { |
| | | width: 100%; |
| | | position: relative; |
| | | margin-top: 8px; |
| | | .card-container { |
| | |
| | | } |
| | | } |
| | | } |
| | | .no-data{ |
| | | margin-top: 100px; |
| | | text-align: center; |
| | | } |
| | | |
| | | /*编辑*/ |
| | | .stock-edit{ |
| | |
| | | <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"/> |
| | | </el-card> |
| | | </el-container> |
| | | </el-container> |
| | |
| | | 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 {getBaseUrl} from '@/utils/base'; |
| | | |
| | | export default { |
| | | name: "index", |
| | | components: {MyButton, MyTableV2, edit, myImport}, |
| | | components: {MyButton, MyTableV2, myImport}, |
| | | data() { |
| | | return { |
| | | // 搜索框 |
| | | items: [ |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '盘点单号', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | type: 'cascader', |
| | | dataIndex: 'agencyId', |
| | | label: '机构', |
| | | placeholder: '请选择', |
| | | optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null }, |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | // { |
| | | // type: 'select', |
| | | // dataIndex: 'status', |
| | | // label: '类型', |
| | | // placeholder: '请选择', |
| | | // defaultValue: '1', |
| | | // options: [ |
| | | // { |
| | | // label: '启用', |
| | | // value: '1' |
| | | // }, |
| | | // { |
| | | // label: '禁用', |
| | | // value: '0' |
| | | // } |
| | | // ] |
| | | // }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'warehouseId', |
| | | label: '盘点仓库', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '任务名称', |
| | | label: '物品名称', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'warehouseId', |
| | | label: '规格型号', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'warehouseId', |
| | | label: '类型', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'warehouseId', |
| | | label: '出入库类型', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '单号', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '操作人', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'incomeTimeStart', |
| | | label: '时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'incomeTimeEnd', |
| | | label: '至', |
| | | defaultValue: '', |
| | | }, |
| | | ], |
| | | // 树数据 |
| | |
| | | }, |
| | | // 列信息 |
| | | 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: 'name', align: 'left',}, |
| | | {title: '物品名称', field: 'WAREHOUSE_NAME', 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: 'summary', align: 'left',}, |
| | | {title: '机构', field: 'summary', align: 'left',}, |
| | | {title: '操作人', field: 'summary', align: 'left',}, |
| | | {title: '操作时间', field: 'summary', align: 'left',}, |
| | | ], |
| | | // 操作信息 |
| | | operation: { |
| | | show: true, // 显示操作列 |
| | | show: false, // 显示操作列 |
| | | width: '150', // 列宽 |
| | | attr: [ |
| | | { |
| | | title: '详情', |
| | | events: (row) => { |
| | | this.showAudit(row); |
| | | }, |
| | | }, |
| | | ], |
| | | attr: [], |
| | | }, |
| | | paging: { |
| | | show: true, // 显示分页 |
| | |
| | | <template> |
| | | <win-sm :title="setting.title" @close="close" :width="'800px'"> |
| | | <el-form ref="ruleForm" :model="formData" :rules="rules" class="demo-ruleForm" label-width="100px"> |
| | | <el-form-item label="盘点单名" prop="code"> |
| | | <el-input disabled v-model="formData.code" clearable maxlength="20" show-word-limit style="width: 100%" /> |
| | | <el-form-item label="盘点单名" prop="businessFormName"> |
| | | <el-input |
| | | disabled |
| | | v-model="formData.businessFormName" |
| | | clearable |
| | | maxlength="20" |
| | | show-word-limit |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="盘点仓库" prop="name"> |
| | | <el-input v-model="formData.name" clearable maxlength="20" show-word-limit style="width: 100%" /> |
| | | <el-form-item label="盘点仓库" prop="warehouseName"> |
| | | <el-select v-model="formData.warehouseId" placeholder="请选择" style="width: 100%"> |
| | | <el-option v-for="item in warehouseOptions" :key="item.id" :label="item.warehouseName" :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="盘点人"> |
| | | <el-input v-model="formData.adss" clearable maxlength="20" show-word-limit style="width: 100%" /> |
| | | <el-form-item label="盘点人" prop="operatorName"> |
| | | <el-select v-model="formData.warehouseId" placeholder="请选择" style="width: 100%"> |
| | | <el-option v-for="item in operatorOptions" :key="item.id" :label="item.warehouseName" :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="监盘人"> |
| | | <el-input v-model="formData.adss" clearable maxlength="20" show-word-limit style="width: 100%" /> |
| | | <el-form-item label="监盘人" prop="operatorName2"> |
| | | <el-select v-model="formData.warehouseId" placeholder="请选择" style="width: 100%"> |
| | | <el-option v-for="item in operatorOptions" :key="item.id" :label="item.warehouseName" :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="status"> |
| | | <el-form-item label="备注" prop="beiz1"> |
| | | <el-input |
| | | type="textarea" |
| | | placeholder="请输入内容" |
| | | v-model="formData.adss" |
| | | v-model="formData.beiz1" |
| | | resize="none" |
| | | maxlength="100" |
| | | show-word-limit |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { selectTenantWarehouse } from '@/api/baseSetting/finsystenant'; |
| | | import winSm from '@/components/win/win-sm'; |
| | | import myButton from '@/components/myButton/myButton'; |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant'; |
| | |
| | | return { |
| | | checkAll: false, |
| | | checkedList: [], |
| | | warehouseOptions: [], // 仓库列表 |
| | | operatorOptions:[], |
| | | formData: { |
| | | code: '', |
| | | name: '', |
| | |
| | | summary: '', |
| | | }, |
| | | rules: { |
| | | code: [{ required: true, message: '请输入机构编号', trigger: 'blur' }], |
| | | name: [{ required: true, message: '请输入机构名称', trigger: 'blur' }], |
| | | status: [{ required: true, message: '请选择状态', trigger: 'blur' }], |
| | | businessFormName: [{ required: true, message: '请输入机构编号', trigger: 'blur' }], |
| | | warehouseName: [{ required: true, message: '请选择', trigger: 'blur' }], |
| | | operatorName: [{ required: true, message: '请选择', trigger: 'blur' }], |
| | | operatorName2: [{ required: true, message: '请选择', trigger: 'blur' }], |
| | | }, |
| | | }; |
| | | }, |
| | |
| | | if (this.setting.info) { |
| | | this.formData = Object.assign({}, JSON.parse(this.setting.info)); |
| | | } |
| | | this.handleSelectTenantWarehouse(); |
| | | }, |
| | | methods: { |
| | | // 获取仓库列表 |
| | | handleSelectTenantWarehouse() { |
| | | selectTenantWarehouse().then((res) => { |
| | | this.warehouseOptions = res; |
| | | }); |
| | | }, |
| | | getEditInfo(id) {}, |
| | | close() { |
| | | this.$emit('close'); |
| | |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant'; |
| | | import myImport from '@/views/components/myImport'; |
| | | import { getBaseUrl } from '@/utils/base'; |
| | | import { selectTenantWarehouse } from '@/api/baseSetting/finsystenant'; |
| | | |
| | | export default { |
| | | name: 'index', |
| | |
| | | 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: 'incomeTimeStart', |
| | | label: '盘点时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'incomeTimeEnd', |
| | | label: '至', |
| | | defaultValue: '', |
| | | }, |
| | | ], |
| | |
| | | }, |
| | | // 列信息 |
| | | 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: 'left' }, |
| | | { title: '任务名称', field: 'businessFormName', align: 'center' }, |
| | | { title: '盘点仓库', field: 'warehouseName', align: 'center' }, |
| | | { title: '盘点人', field: 'operatorName', align: 'center' }, |
| | | { title: '监盘人', field: 'operatorName2', align: 'left' }, |
| | | { title: '盘点时间', field: 'inventoryDate', align: 'left' }, |
| | | { title: '创建时间', field: 'createTime', align: 'left' }, |
| | | { title: '状态', field: 'states', align: 'left' }, |
| | | ], |
| | | // 操作信息 |
| | | operation: { |
| | |
| | | }, |
| | | { |
| | | title: '盘点', |
| | | type:'success', |
| | | type: 'success', |
| | | events: (row) => { |
| | | this.showInventory(row); |
| | | }, |
| | |
| | | }; |
| | | }, |
| | | created() { |
| | | // 获取机构树 |
| | | this.initTreeData(); |
| | | selectTenantWarehouse().then(res=>{ |
| | | this.items.forEach(v=>{ |
| | | if(v.label=='盘点仓库') { |
| | | v.options = res.map(item=>{ |
| | | item.label=item.warehouseName |
| | | item.vlaue=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(); |
| | | .then(() => { |
| | | finsystenant.del({ 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.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); |
| | | }, |
| | | // 查询table列表 |
| | | search(pageNum) { |
| | |
| | | <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"/> |
| | | </el-card> |
| | | </el-container> |
| | | </el-container> |
| | |
| | | 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 {getBaseUrl} from '@/utils/base'; |
| | | import { selectTenantWarehouse, getCategorySelectTree } from '@/api/baseSetting/finsystenant'; |
| | | import { getDicts } from '@/api/system/dict/data'; |
| | | |
| | | export default { |
| | | name: "index", |
| | | components: {MyButton, MyTableV2, edit, myImport}, |
| | | components: {MyButton, MyTableV2, myImport}, |
| | | data() { |
| | | return { |
| | | // 搜索框 |
| | | items: [ |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '单号', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'status', |
| | | label: '类型', |
| | | placeholder: '请选择', |
| | | defaultValue: '1', |
| | | options: [ |
| | | { |
| | | label: '启用', |
| | | value: '1' |
| | | }, |
| | | { |
| | | label: '禁用', |
| | | value: '0' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '创建人', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | type: 'select', |
| | | dataIndex: 'status', |
| | | label: '规格型号', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'status', |
| | | label: '分类', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'status', |
| | | label: '类别', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [] |
| | | }, |
| | | ], |
| | | // 树数据 |
| | |
| | | }, |
| | | // 列信息 |
| | | 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: 'summary', align: 'left',}, |
| | | {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',}, |
| | | ], |
| | | // 操作信息 |
| | | operation: { |
| | | show: true, // 显示操作列 |
| | | width: '150', // 列宽 |
| | | attr: [ |
| | | { |
| | | title: '详情', |
| | | events: (row) => { |
| | | this.showAudit(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | paging: { |
| | | show: true, // 显示分页 |
| | | // 分页信息 |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | // 获取机构树 |
| | | this.initTreeData() |
| | | this.initQuery(); |
| | | }, |
| | | 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() |
| | | } |
| | | }, |
| | | // 左侧树初始化 |
| | | 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() |
| | | initQuery() { |
| | | getDicts('GOODS_PRICE').then((res) => { |
| | | this.items.forEach((v) => { |
| | | if (v.label == '类别') { |
| | | v.options = res.map((v) => { |
| | | v.label = v.dict_label; |
| | | v.value = v.dict_value; |
| | | return v; |
| | | }); |
| | | } |
| | | }) |
| | | }) |
| | | }); |
| | | }); |
| | | getCategorySelectTree().then((res) => { |
| | | this.items.forEach((v) => { |
| | | if (v.label == '分类') { |
| | | v.options = res.map((item) => { |
| | | item.label = item.label; |
| | | item.vlaue = item.id; |
| | | return item; |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | del(row) { |
| | | this.$modal |
| | |
| | | }) |
| | | .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; |
| | | // } |
| | | }, |
| | | showAudit(row) { |
| | | this.editSetting.id = row.id; |
| | | this.editSetting.info = JSON.stringify(row); |
| | | 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) |
| | | }, |
| | | // 查询table列表 |
| | | search(pageNum) { |
| | |
| | | <template> |
| | | <win-sm :title="setting.title" @close="close" :width="'800px'"> |
| | | <win-md :title="setting.title" @close="close" :width="'800px'"> |
| | | <el-form ref="ruleForm" :model="formData" :rules="rules" class="demo-ruleForm" label-width="100px"> |
| | | <el-form-item label="编号" prop="code"> |
| | | <el-input disabled v-model="formData.code" clearable maxlength="20" show-word-limit style="width: 100%"/> |
| | | </el-form-item> |
| | | <el-form-item label="仓库名称" prop="name"> |
| | | <el-input v-model="formData.name" clearable maxlength="20" show-word-limit style="width: 100%"/> |
| | | </el-form-item> |
| | | <el-form-item label="地址" > |
| | | <el-input v-model="formData.adss" clearable maxlength="20" show-word-limit style="width: 100%"/> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-switch |
| | | v-model="formData.status" |
| | | active-color="#0d997c" |
| | | inactive-color="#C0CCDA"> |
| | | </el-switch> |
| | | </el-form-item> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="物品分类" prop="code"> |
| | | <el-input disabled v-model="formData.code" clearable maxlength="20" show-word-limit style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="物品名称" prop="name"> |
| | | <el-input v-model="formData.name" clearable maxlength="20" show-word-limit style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="规格型号"> |
| | | <el-input v-model="formData.adss" clearable maxlength="20" show-word-limit style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="formData.models" :stripe="true"> |
| | | <el-table-column prop="baseGoodsModelsId" label="规格型号" align="center"> </el-table-column> |
| | | <el-table-column prop="baseGoodsModelsId" label="保底库存" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-model="scope.row.baseGoodsModelsId"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="baseGoodsModelsId" label="封顶库存" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-model="scope.row.baseGoodsModelsId"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-form> |
| | | <div slot="footer" align="center" class="dialog-footer"> |
| | | <my-button name="取消" site="form" @click="close"/> |
| | | <my-button name="保存" site="form" @click="save"/> |
| | | <my-button name="取消" site="form" @click="close" /> |
| | | <my-button name="保存" site="form" @click="save" /> |
| | | </div> |
| | | </win-sm> |
| | | </win-md> |
| | | </template> |
| | | |
| | | <script> |
| | | import winSm from '@/components/win/win-sm' |
| | | import myButton from '@/components/myButton/myButton' |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant' |
| | | import winMd from '@/components/win/win-md'; |
| | | import myButton from '@/components/myButton/myButton'; |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant'; |
| | | |
| | | export default { |
| | | components: {winSm, myButton}, |
| | | components: { winMd, myButton }, |
| | | props: { |
| | | setting: { |
| | | type: Object, |
| | | default: () => { |
| | | } |
| | | } |
| | | default: () => {}, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | checkAll: false, |
| | | checkedList: [], |
| | | formData: { |
| | | code: '', |
| | | name: '', |
| | | status: true, |
| | | summary: '', |
| | | baseCategoryIds: '', // 分类编号数组 |
| | | baseCategoryId: '', // 分类编号 |
| | | baseGoodsTemplateId: '', // 物品模版编号 |
| | | modelsIds: [], //规格型号 |
| | | models:[] |
| | | }, |
| | | modelsItem: { |
| | | baseGoodsModelsId: '', // 规格型号编号 |
| | | worehouseCount: 0, |
| | | counts: 0, // 操作数量 |
| | | }, |
| | | rules: { |
| | | code: [ |
| | | {required: true, message: '请输入机构编号', trigger: 'blur'} |
| | | ], |
| | | name: [ |
| | | {required: true, message: '请输入机构名称', trigger: 'blur'} |
| | | ], |
| | | status: [ |
| | | {required: true, message: '请选择状态', trigger: 'blur'} |
| | | ] |
| | | } |
| | | } |
| | | code: [{ required: true, message: '请输入机构编号', trigger: 'blur' }], |
| | | name: [{ required: true, message: '请输入机构名称', trigger: 'blur' }], |
| | | status: [{ required: true, message: '请选择状态', trigger: 'blur' }], |
| | | }, |
| | | }; |
| | | }, |
| | | created() { |
| | | if(this.setting.info){ |
| | | this.formData = Object.assign({},JSON.parse(this.setting.info)) |
| | | if (this.setting.info) { |
| | | this.formData = Object.assign({}, JSON.parse(this.setting.info)); |
| | | } |
| | | }, |
| | | methods: { |
| | | getEditInfo(id){ |
| | | |
| | | }, |
| | | getEditInfo(id) {}, |
| | | close() { |
| | | this.$emit('close') |
| | | this.$emit('close'); |
| | | }, |
| | | save() { |
| | | this.$refs.ruleForm.validate((valid) => { |
| | | if (valid) { |
| | | const params = Object.assign({}, this.formData) |
| | | if(this.setting.id){ |
| | | const params = Object.assign({}, this.formData); |
| | | if (this.setting.id) { |
| | | // 编辑接口 |
| | | finsystenant.edit(params).then(res => { |
| | | finsystenant.edit(params).then((res) => { |
| | | if (res) { |
| | | this.$message.success('保存成功!') |
| | | this.close() |
| | | this.$emit('search') |
| | | this.$message.success('保存成功!'); |
| | | this.close(); |
| | | this.$emit('search'); |
| | | } else { |
| | | this.$message.error('保存失败') |
| | | this.$message.error('保存失败'); |
| | | } |
| | | }) |
| | | }else{ |
| | | params.orgId = this.setting.orgId |
| | | finsystenant.add(params).then(res => { |
| | | }); |
| | | } else { |
| | | params.orgId = this.setting.orgId; |
| | | finsystenant.add(params).then((res) => { |
| | | if (res) { |
| | | this.$message.success('保存成功!') |
| | | this.close() |
| | | this.$emit('search') |
| | | this.$message.success('保存成功!'); |
| | | this.close(); |
| | | this.$emit('search'); |
| | | } else { |
| | | this.$message.error('保存失败') |
| | | this.$message.error('保存失败'); |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | } else { |
| | | this.$message.error('校验未通过,请检查。') |
| | | this.$message.error('校验未通过,请检查。'); |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | <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" /> |
| | | </el-card> |
| | | </el-container> |
| | | </el-container> |
| | |
| | | </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 {getBaseUrl} from '@/utils/base'; |
| | | import edit from './edit'; |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant'; |
| | | import myImport from '@/views/components/myImport'; |
| | | import { getBaseUrl } from '@/utils/base'; |
| | | import { selectTenantWarehouse, getCategorySelectTree } from '@/api/baseSetting/finsystenant'; |
| | | import { getDicts } from '@/api/system/dict/data'; |
| | | |
| | | export default { |
| | | name: "index", |
| | | components: {MyButton, MyTableV2, edit, myImport}, |
| | | name: 'index', |
| | | components: { MyButton, MyTableV2, edit, myImport }, |
| | | data() { |
| | | return { |
| | | // 搜索框 |
| | | items: [ |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '单号', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | type: 'cascader', |
| | | dataIndex: 'agencyId', |
| | | label: '机构', |
| | | placeholder: '请选择', |
| | | optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null }, |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'status', |
| | | label: '类型', |
| | | dataIndex: 'warehouseId', |
| | | label: '仓库', |
| | | placeholder: '请选择', |
| | | defaultValue: '1', |
| | | options: [ |
| | | { |
| | | label: '启用', |
| | | value: '1' |
| | | }, |
| | | { |
| | | label: '禁用', |
| | | value: '0' |
| | | } |
| | | ] |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '物品名称', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '创建人', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | type: 'select', |
| | | dataIndex: 'warehouseId', |
| | | label: '分类', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'warehouseId', |
| | | label: '类别', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | ], |
| | | // 树数据 |
| | |
| | | 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: '', |
| | |
| | | url: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/select/list', // 请求地址 |
| | | // 工具条 |
| | | tools: { |
| | | columnsCtrl: {// 列控制按钮 |
| | | show: false |
| | | columnsCtrl: { |
| | | // 列控制按钮 |
| | | show: false, |
| | | }, |
| | | generalExport: {// 通用导出按钮 |
| | | show: false |
| | | generalExport: { |
| | | // 通用导出按钮 |
| | | show: false, |
| | | }, |
| | | // 自定义工具条按钮 |
| | | custom: [ |
| | | ] |
| | | { |
| | | name: '新增', |
| | | click: () => { |
| | | this.showAdd(null); |
| | | }, |
| | | }, |
| | | { |
| | | name: '导出', |
| | | click: () => { |
| | | this.handleExport(); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | // 列信息 |
| | | 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: 'summary', align: 'left',}, |
| | | { 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' }, |
| | | ], |
| | | // 操作信息 |
| | | operation: { |
| | |
| | | width: '150', // 列宽 |
| | | attr: [ |
| | | { |
| | | title: '详情', |
| | | title: '编辑', |
| | | events: (row) => { |
| | | this.showAudit(row); |
| | | }, |
| | | }, |
| | | { |
| | | title: '删除', |
| | | events: (row) => { |
| | | this.del(row); |
| | | }, |
| | | }, |
| | | ], |
| | |
| | | small: false, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | total: 0 |
| | | } |
| | | } |
| | | total: 0, |
| | | }, |
| | | }, |
| | | }, |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | // 获取机构树 |
| | | this.initTreeData() |
| | | this.initQuery(); |
| | | }, |
| | | 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() |
| | | } |
| | | }, |
| | | // 左侧树初始化 |
| | | 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() |
| | | initQuery() { |
| | | selectTenantWarehouse().then((res) => { |
| | | this.items.forEach((v) => { |
| | | if (v.label == '仓库') { |
| | | v.options = res.map((item) => { |
| | | item.label = item.warehouseName; |
| | | item.vlaue = item.id; |
| | | return item; |
| | | }); |
| | | } |
| | | }) |
| | | }) |
| | | }); |
| | | }); |
| | | getDicts('GOODS_PRICE').then((res) => { |
| | | this.items.forEach((v) => { |
| | | if (v.label == '类别') { |
| | | v.options = res.map((v) => { |
| | | v.label = v.dict_label; |
| | | v.value = v.dict_value; |
| | | return v; |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | getCategorySelectTree().then((res) => { |
| | | this.items.forEach((v) => { |
| | | if (v.label == '分类') { |
| | | v.options = res.map((item) => { |
| | | item.label = item.label; |
| | | item.vlaue = item.id; |
| | | return item; |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | del(row) { |
| | | this.$modal |
| | | .confirm('是否确认删除名称为"' + row.name + '"的机构吗?') |
| | | .then(function () { |
| | | finsystenant.del({id: row.id}).then((res) => { |
| | | }); |
| | | }) |
| | | .then((res) => { |
| | | this.$modal.confirm('是否确认删除名称为"' + row.name + '"的机构吗?').then(() => { |
| | | finsystenant.del({ id: row.id }).then((res) => { |
| | | this.$message.success('删除成功!'); |
| | | this.search() |
| | | }) |
| | | .catch(() => { |
| | | this.search(); |
| | | }); |
| | | }); |
| | | }, |
| | | showAdd() { |
| | | // if (!this.editSetting.orgId) { |
| | | // this.$message.warning('请先选择左侧机构') |
| | | // } else { |
| | | this.editSetting.id = null; |
| | | this.editSetting.info = null; |
| | | this.editSetting.title = '新增'; |
| | | this.editSetting.show = true; |
| | | // } |
| | | this.editSetting.id = null; |
| | | this.editSetting.info = null; |
| | | this.editSetting.title = '新增'; |
| | | this.editSetting.show = true; |
| | | }, |
| | | 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) |
| | | }, |
| | | // 查询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) |
| | | } |
| | | } |
| | | } |
| | | this.filterFrom = Object.assign(this.filterFrom, params); |
| | | this.search(1); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | | <style scoped></style> |
| | |
| | | <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"/> |
| | | </el-card> |
| | | </el-container> |
| | | </el-container> |
| | |
| | | </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 {getBaseUrl} from '@/utils/base'; |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant'; |
| | | import myImport from '@/views/components/myImport'; |
| | | import { getBaseUrl } from '@/utils/base'; |
| | | import { selectTenantWarehouse, getCategorySelectTree } from '@/api/baseSetting/finsystenant'; |
| | | import { getDicts } from '@/api/system/dict/data'; |
| | | |
| | | export default { |
| | | name: "index", |
| | | components: {MyButton, MyTableV2, edit, myImport}, |
| | | name: 'index', |
| | | components: { MyButton, MyTableV2, myImport }, |
| | | data() { |
| | | return { |
| | | // 搜索框 |
| | | items: [ |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '单号', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | type: 'cascader', |
| | | dataIndex: 'agencyId', |
| | | label: '机构', |
| | | placeholder: '请选择', |
| | | optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null }, |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'status', |
| | | label: '类型', |
| | | dataIndex: 'warehouseId', |
| | | label: '仓库', |
| | | placeholder: '请选择', |
| | | defaultValue: '1', |
| | | options: [ |
| | | { |
| | | label: '启用', |
| | | value: '1' |
| | | }, |
| | | { |
| | | label: '禁用', |
| | | value: '0' |
| | | } |
| | | ] |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '物品名称', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '创建人', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | type: 'select', |
| | | dataIndex: 'modelsIds', |
| | | multiple: true, |
| | | label: '分类', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'warehouseId', |
| | | label: '类别', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | ], |
| | | // 树数据 |
| | |
| | | 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: '', |
| | |
| | | url: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/select/list', // 请求地址 |
| | | // 工具条 |
| | | tools: { |
| | | columnsCtrl: {// 列控制按钮 |
| | | show: false |
| | | columnsCtrl: { |
| | | // 列控制按钮 |
| | | show: false, |
| | | }, |
| | | generalExport: {// 通用导出按钮 |
| | | show: false |
| | | generalExport: { |
| | | // 通用导出按钮 |
| | | show: false, |
| | | }, |
| | | // 自定义工具条按钮 |
| | | custom: [ |
| | | ] |
| | | custom: [], |
| | | }, |
| | | // 列信息 |
| | | 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: 'summary', align: 'left',}, |
| | | { 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' }, |
| | | ], |
| | | // 操作信息 |
| | | operation: { |
| | | show: true, // 显示操作列 |
| | | width: '150', // 列宽 |
| | | attr: [ |
| | | { |
| | | title: '详情', |
| | | events: (row) => { |
| | | this.showAudit(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | paging: { |
| | | show: true, // 显示分页 |
| | | // 分页信息 |
| | |
| | | small: false, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | total: 0 |
| | | } |
| | | } |
| | | total: 0, |
| | | }, |
| | | }, |
| | | }, |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | // 获取机构树 |
| | | this.initTreeData() |
| | | this.initQuery(); |
| | | }, |
| | | 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() |
| | | } |
| | | }, |
| | | // 左侧树初始化 |
| | | 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() |
| | | initQuery() { |
| | | selectTenantWarehouse().then((res) => { |
| | | this.items.forEach((v) => { |
| | | if (v.label == '仓库') { |
| | | v.options = res.map((item) => { |
| | | item.label = item.warehouseName; |
| | | item.vlaue = item.id; |
| | | return item; |
| | | }); |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | del(row) { |
| | | this.$modal |
| | | .confirm('是否确认删除名称为"' + row.name + '"的机构吗?') |
| | | .then(function () { |
| | | finsystenant.del({id: row.id}).then((res) => { |
| | | }); |
| | | }) |
| | | .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; |
| | | // } |
| | | }, |
| | | showAudit(row) { |
| | | this.editSetting.id = row.id; |
| | | this.editSetting.info = JSON.stringify(row); |
| | | 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) |
| | | }); |
| | | getDicts('GOODS_PRICE').then((res) => { |
| | | this.items.forEach((v) => { |
| | | if (v.label == '类别') { |
| | | v.options = res.map((v) => { |
| | | v.label = v.dict_label; |
| | | v.value = v.dict_value; |
| | | return v; |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | getCategorySelectTree().then((res) => { |
| | | this.items.forEach((v) => { |
| | | if (v.label == '分类') { |
| | | v.options = res.map((item) => { |
| | | item.label = item.label; |
| | | item.vlaue = item.id; |
| | | return item; |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | // 查询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) |
| | | } |
| | | } |
| | | } |
| | | this.filterFrom = Object.assign(this.filterFrom, params); |
| | | this.search(1); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | | <style scoped></style> |
| | |
| | | <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"/> |
| | | </el-card> |
| | | </el-container> |
| | | </el-container> |
| | |
| | | </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 {getBaseUrl} from '@/utils/base'; |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant'; |
| | | import myImport from '@/views/components/myImport'; |
| | | import { getBaseUrl } from '@/utils/base'; |
| | | import { getCategorySelectTree, goodsModel } from '@/api/baseSetting/finsystenant'; |
| | | import { getDicts } from '@/api/system/dict/data'; |
| | | |
| | | export default { |
| | | name: "index", |
| | | components: {MyButton, MyTableV2, edit, myImport}, |
| | | name: 'index', |
| | | components: { MyButton, MyTableV2, myImport }, |
| | | data() { |
| | | return { |
| | | // 搜索框 |
| | | items: [ |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '单号', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'status', |
| | | label: '类型', |
| | | type: 'cascader', |
| | | dataIndex: 'agencyId', |
| | | label: '机构', |
| | | placeholder: '请选择', |
| | | defaultValue: '1', |
| | | options: [ |
| | | { |
| | | label: '启用', |
| | | value: '1' |
| | | }, |
| | | { |
| | | label: '禁用', |
| | | value: '0' |
| | | } |
| | | ] |
| | | optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null }, |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '物品名称', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'status', |
| | | label: '规格型号', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'status', |
| | | label: '分类', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'status', |
| | | label: '类别', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '创建人', |
| | | label: '单号', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '操作人', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val1', |
| | | label: '出库时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val2', |
| | | 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: '', |
| | |
| | | url: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/select/list', // 请求地址 |
| | | // 工具条 |
| | | tools: { |
| | | columnsCtrl: {// 列控制按钮 |
| | | show: false |
| | | columnsCtrl: { |
| | | // 列控制按钮 |
| | | show: false, |
| | | }, |
| | | generalExport: {// 通用导出按钮 |
| | | show: false |
| | | generalExport: { |
| | | // 通用导出按钮 |
| | | show: false, |
| | | }, |
| | | // 自定义工具条按钮 |
| | | custom: [ |
| | | ] |
| | | custom: [], |
| | | }, |
| | | // 列信息 |
| | | 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: 'summary', align: 'left',}, |
| | | { 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: 'summary', align: 'left' }, |
| | | { title: '在途', field: 'summary', align: 'left' }, |
| | | { title: '操作时间', field: 'summary', align: 'left' }, |
| | | ], |
| | | // 操作信息 |
| | | operation: { |
| | | show: true, // 显示操作列 |
| | | width: '150', // 列宽 |
| | | attr: [ |
| | | { |
| | | title: '详情', |
| | | events: (row) => { |
| | | this.showAudit(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | paging: { |
| | | show: true, // 显示分页 |
| | | // 分页信息 |
| | |
| | | small: false, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | total: 0 |
| | | } |
| | | } |
| | | total: 0, |
| | | }, |
| | | }, |
| | | }, |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | // 获取机构树 |
| | | this.initTreeData() |
| | | this.initQuery(); |
| | | }, |
| | | 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() |
| | | } |
| | | }, |
| | | // 左侧树初始化 |
| | | 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() |
| | | initQuery() { |
| | | goodsModel().then((res) => { |
| | | this.items.forEach((v) => { |
| | | if (v.label == '规格型号') { |
| | | v.options = res.map((item) => { |
| | | item.label = item.modelName; |
| | | item.vlaue = item.id; |
| | | return item; |
| | | }); |
| | | } |
| | | }) |
| | | }) |
| | | }); |
| | | }); |
| | | getDicts('GOODS_PRICE').then((res) => { |
| | | this.items.forEach((v) => { |
| | | if (v.label == '类别') { |
| | | v.options = res.map((v) => { |
| | | v.label = v.dict_label; |
| | | v.value = v.dict_value; |
| | | return v; |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | getCategorySelectTree().then((res) => { |
| | | this.items.forEach((v) => { |
| | | if (v.label == '分类') { |
| | | v.options = res.map((item) => { |
| | | item.label = item.label; |
| | | item.vlaue = item.id; |
| | | return item; |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | del(row) { |
| | | this.$modal |
| | | .confirm('是否确认删除名称为"' + row.name + '"的机构吗?') |
| | | .then(function () { |
| | | finsystenant.del({id: row.id}).then((res) => { |
| | | }); |
| | | finsystenant.del({ id: row.id }).then((res) => {}); |
| | | }) |
| | | .then((res) => { |
| | | this.$message.success('删除成功!'); |
| | | this.search() |
| | | this.search(); |
| | | }) |
| | | .catch(() => { |
| | | }); |
| | | .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; |
| | | this.editSetting.id = null; |
| | | this.editSetting.info = null; |
| | | this.editSetting.title = '新增'; |
| | | this.editSetting.show = true; |
| | | // } |
| | | }, |
| | | showAudit(row) { |
| | |
| | | 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) |
| | | }, |
| | | // 查询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) |
| | | } |
| | | } |
| | | } |
| | | this.filterFrom = Object.assign(this.filterFrom, params); |
| | | this.search(1); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | }, |
| | | filters: { |
| | | formatTime(time) { |
| | | if (!time) return; |
| | | if (!time) return '-'; |
| | | return DateFormatter.LongToDateTime(time); |
| | | }, |
| | | }, |
| | |
| | | procureGoods: [], |
| | | }, |
| | | goodsItem: { |
| | | whFormProcureId: '', // 采购单ID |
| | | baseCategoryIds: '', // 分类编号数组 |
| | | baseCategoryId: '', // 分类编号 |
| | | baseGoodsTemplateId: '', // 物品模版编号 |
| | |
| | | this.formData.procureTime = this.formData.procureTime.toString(); |
| | | this.formData.procureGoods.map((item, index) => { |
| | | // 根据子集ID拼接物品分类列表 |
| | | let pIds = this.findParentIds(this.categoryOptions, item.baseCategoryId); |
| | | item.baseCategoryIds = [...pIds, item.baseCategoryId]; |
| | | item.baseCategoryIds = this.findParentIds(this.categoryOptions, item.baseCategoryId); |
| | | this.$set(this.formData.procureGoods[index],'modelsIds',item.models.map((v) => v.baseGoodsModelsId)) |
| | | this.getgoodsTemplate(item.baseCategoryId, index); |
| | | this.getgoodsModel(item.baseGoodsTemplateId, index); |
| | | return item |
| | | }); |
| | | console.log('this.formData.procureGoods',this.formData.procureGoods) |
| | | } else { |
| | | this.formData.procureGoods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | } |
| | |
| | | <my-button name="新增" @click="handleAdd" site="tools" size="medium" /> |
| | | <my-button name="导入" @click="importSetting.dialogShow = true" site="tools" size="medium" /> |
| | | </div> |
| | | <div :style="{ 'overflow-y': 'auto', height: `${clientHeight - 320}px` }" v-loading="loading"> |
| | | <el-row class="card" :gutter="5"> |
| | | <div :style="{ 'overflow-y': 'auto', height: `${clientHeight - 320}px` }"> |
| | | <el-row class="card" :gutter="5" v-loading="loading"> |
| | | <el-col v-for="(item, index) in list" :key="index" class="cm-item"> |
| | | <el-card class="card-data"> |
| | | <div class="card-container"> |
| | |
| | | // 分页 |
| | | handleSizeChange(pageSize) { |
| | | this.pageSize = pageSize; |
| | | this.search(1); |
| | | this.pageNum = 1; |
| | | this.search(); |
| | | }, |
| | | handleCurrentChange(pageNum) { |
| | | this.pageNum = pageNum; |
| | |
| | | if (this.filterFrom.agencyId.length) { |
| | | this.filterFrom.agencyId = this.filterFrom.agencyId[this.filterFrom.agencyId.length - 1]; |
| | | } |
| | | this.search(1); |
| | | this.search(); |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'baseGoodsTemplateId', |
| | | dataIndex: 'baseGoodsModelsId', |
| | | label: '规格型号', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | |
| | | <template> |
| | | <el-dialog |
| | | title="详情" |
| | | width="60%" |
| | | :modal="true" |
| | | :visible.sync="visible" |
| | | :top="'15vh'" |
| | | :close-on-click-modal="false" |
| | | :append-to-body="true" |
| | | :destroy-on-close="true" |
| | | @close="close" |
| | | class="stock-detail" |
| | | > |
| | | <win-md class="stock-detail" :title="setting.title" @close="close" :width="'800px'"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <span>入库单号:</span> |
| | | <span>报废单号:</span> |
| | | <span>{{ detail.businessFormCode }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>入库仓库:</span> |
| | | <span>{{ detail.goodsTemplateName }}</span> |
| | | <span>报废仓库:</span> |
| | | <span>{{ detail.warehouseName }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>所属机构:</span> |
| | | <span>{{ detail.agencyId }}</span> |
| | | <span>{{ detail.agencyName }}</span> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" style="margin-top: 20px"> |
| | | <el-col :span="8"> |
| | | <span>状态:</span> |
| | | <span>{{ detail.states == 1 ? '待入库' : '已入库' }}</span> |
| | | <span>{{ detail.states == 1 ? '待报废' : '已报废' }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>创建人:</span> |
| | | <span>{{ detail.buyerName }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>入库时间:</span> |
| | | <span>{{ detail.time }}</span> |
| | | <span>报废时间:</span> |
| | | <span>{{ detail.incomeTime | formatTime }}</span> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" style="margin-top: 20px"> |
| | | <el-col class="img-row" :span="12"> |
| | | <span>报废类型:</span> |
| | | <span>{{ detail.buyType == 1 ? '集采' : '自采' }}</span> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" style="margin-top: 20px"> |
| | | <el-col class="img-row" :span="24"> |
| | | <span>采购手续照片:</span> |
| | | <div class="img-box"></div> |
| | | <span>报废手续照片:</span> |
| | | <div class="img-box" v-for="(item, index) in fileList" :key="index" @click="handlePreview(item)"> |
| | | <img class="img" :src="getUrl(item.path)" alt="" /> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="goods-card" v-for="(goodsItem, goodsIndex) in detail.procureGoods" :key="goodsIndex"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <span>物品分类:</span> |
| | | <span>{{ goodsItem.baseCategoryId }}</span> |
| | | <span>{{ goodsItem.baseCategoryName }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>物品名称:</span> |
| | | <span>{{ goodsItem.baseGoodsTemplateId }}</span> |
| | | <span>{{ goodsItem.goodsTemplateName }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>供货商:</span> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="goodsItem.models" :stripe="true" style="margin-top: 20px"> |
| | | <el-table-column prop="baseGoodsModelsId" label="规格型号" align="center"> |
| | | <el-table-column prop="baseGoodsModelsName" label="规格型号" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.baseGoodsModelsId }} |
| | | {{ scope.row.baseGoodsModelsName }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="单位" align="center"> |
| | |
| | | {{ scope.row.unit }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="price" label="现有库存" align="center"> |
| | | <el-table-column prop="price" label="单价" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-model="scope.row.price"></el-input> |
| | | {{ scope.row.price }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="counts" label="出库数量" align="center"> |
| | | <el-table-column prop="counts" label="报废数量" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-model="scope.row.counts"></el-input> |
| | | {{ scope.row.counts }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="counts" label="金额" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ (scope.row.price * scope.row.counts).toFixed(2) }} |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-dialog> |
| | | <div id="uploadPreviewImages" style="display: none"> |
| | | <span v-for="(src, index) in fileList" :key="index"> |
| | | <img |
| | | v-if="checkImg(src.name)" |
| | | class="v-img" |
| | | :src="src.url" |
| | | :alt="src.name" |
| | | style="width: 100px; height: 100px" |
| | | /> |
| | | </span> |
| | | </div> |
| | | </win-md> |
| | | </template> |
| | | <script> |
| | | import { procureDetail } from '@/api/stock/procure/purchaseOrder'; |
| | | import winMd from '@/components/win/win-md'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | import { getDownUrl } from '@/utils/base'; |
| | | import Viewer from 'viewerjs'; |
| | | import 'viewerjs/dist/viewer.css'; |
| | | |
| | | let viewer = null; |
| | | |
| | | export default { |
| | | components: { winMd }, |
| | | |
| | | props: { |
| | | setting: { |
| | | type: Object, |
| | | default: () => {}, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | fileList: [], |
| | | detail: { |
| | | baseCategoryName: '', |
| | | businessFormCode: '', |
| | | goodsTemplateName: '', |
| | | procureDoc: '', |
| | | agencyId: '', |
| | | agencyName: '', |
| | | states: '', |
| | | createName: '', |
| | | time: '', |
| | | procureGoods: [{}, {}], |
| | | fileKey: Math.random(), |
| | | }, |
| | | }; |
| | | }, |
| | | methods: { |
| | | open(id) { |
| | | this.visible = true; |
| | | procureDetail({ id }).then((res) => { |
| | | this.detail = res; |
| | | filters: { |
| | | formatTime(time) { |
| | | if (!time) return; |
| | | return DateFormatter.LongToDateTime(time); |
| | | }, |
| | | }, |
| | | created() { |
| | | procureDetail({ id: this.setting.id }).then((res) => { |
| | | this.detail = res; |
| | | this.fileList = this.detail.procureDoc ? JSON.parse(this.detail.procureDoc) : []; |
| | | this.$nextTick(() => { |
| | | this.initPreviewImg(); |
| | | }); |
| | | }); |
| | | }, |
| | | methods: { |
| | | initPreviewImg() { |
| | | if (viewer != null) { |
| | | viewer.destroy(); |
| | | } |
| | | const ViewerDom = document.querySelector('#uploadPreviewImages'); |
| | | viewer = new Viewer(ViewerDom, {}); |
| | | }, |
| | | handlePreview(file) { |
| | | if (!this.checkImg(file.name)) { |
| | | return false; |
| | | } |
| | | let index = 0; |
| | | for (let i = 0; i < this.fileList.length; i++) { |
| | | const f = this.fileList[i]; |
| | | if (this.checkImg(f.name)) { |
| | | if (file.id == f.id) { |
| | | break; |
| | | } |
| | | index++; |
| | | } |
| | | } |
| | | // this.fileList.forEach((f, i) => { |
| | | // if (file.uid == f.uid) { |
| | | // index = i |
| | | // } |
| | | // }) |
| | | // document.querySelector('#uploadPreviewImages').children[0].click() |
| | | viewer.view(index); |
| | | }, |
| | | checkImg(name) { |
| | | const suffix = name.substring(name.lastIndexOf('.'), name.length); |
| | | const imgArray = ['.jpg', '.jpeg', '.png', '.bmp']; |
| | | if (imgArray.indexOf(suffix) < 0) { |
| | | return false; |
| | | } |
| | | return true; |
| | | }, |
| | | getUrl(path) { |
| | | if (path.substr(0, 7).toLowerCase() == 'http://' || path.substr(0, 8).toLowerCase() == 'https://') { |
| | | return path; |
| | | } else { |
| | | return getDownUrl() + path; |
| | | } |
| | | }, |
| | | close() { |
| | | this.visible = false; |
| | | this.$emit('close'); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | @import url(../../index.scss); |
| | | .el-dialog { |
| | | z-index: 1100 !important; |
| | | } |
| | | >>> .el-dialog { |
| | | z-index: 1100 !important; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <el-dialog |
| | | :title="`${type == 'create' ? '新增' : '编辑'}${title}`" |
| | | width="60%" |
| | | :modal="true" |
| | | :visible.sync="visible" |
| | | :top="'15vh'" |
| | | :close-on-click-modal="false" |
| | | :append-to-body="true" |
| | | :destroy-on-close="true" |
| | | @close="close" |
| | | class="stock-edit" |
| | | > |
| | | <win-md class="stock-edit" :title="`${setting.title}报废报废`" @close="close" :width="'800px'"> |
| | | <el-form class="form" ref="ruleForm" :model="formData" :rules="rules" label-width="120px"> |
| | | <div class="main-w"> |
| | | <el-row :gutter="24" class="headerHeight"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="入库仓库" prop="warehouseId"> |
| | | <el-form-item label="报废仓库" prop="warehouseId"> |
| | | <el-select v-model="formData.warehouseId" placeholder="请选择" style="width: 100%"> |
| | | <el-option v-for="item in warehouses" :key="item.id" :label="item.warehouseName" :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="采购时间" prop="procureTime"> |
| | | <el-form-item label="报废时间" prop="procureTime"> |
| | | <el-date-picker |
| | | v-model="formData.procureTime" |
| | | type="datetime" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24" class="headerHeight"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="报废类型" prop="buyType"> |
| | | <el-select v-model="formData.buyType" placeholder="请选择" style="width: 100%"> |
| | | <el-option v-for="item in buyTypeOptions" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24" class="headerHeight"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="采购入库手续" prop="procureDoc"> |
| | | <upload :settings="uploadSettings" @on-change="uploadChange"></upload> |
| | | <el-form-item label="报废报废手续" prop="procureDoc"> |
| | | <upload ref="uploadRef" :values="fileList" :settings="uploadSettings" @on-change="uploadChange"></upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-input type="number" v-model="scope.row.price"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="counts" label="采购数量" align="center"> |
| | | <el-table-column prop="counts" label="报废数量" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input type="number" v-model="scope.row.counts"></el-input> |
| | | </template> |
| | |
| | | </div> |
| | | </el-form> |
| | | <div slot="footer" align="center" class="dialog-footer"> |
| | | <el-button name="确定" site="form" type="primary" @click="handleSubmit">确定</el-button> |
| | | <el-button name="取消" site="form" @click="close">取消</el-button> |
| | | <my-button name="取消" site="form" @click="close"/> |
| | | <my-button name="保存" site="form" @click="handleSubmit"/> |
| | | </div> |
| | | </el-dialog> |
| | | </win-md> |
| | | </template> |
| | | <script> |
| | | import { |
| | |
| | | import MyButton from '@/components/myButton/myButton'; |
| | | import winMd from '@/components/win/win-md'; |
| | | import upload from '@/components/upload/index'; |
| | | import { getUploadUrl } from '@/utils/base'; |
| | | import { getUploadUrl,getDownUrl} from '@/utils/base'; |
| | | |
| | | import SettingIplatform from '../../../../../public/static/config'; |
| | | |
| | | export default { |
| | | components: { MyButton, winMd, upload }, |
| | | props: { |
| | | title: { |
| | | type: String, |
| | | default: '采购入库', |
| | | }, |
| | | setting: { |
| | | type: Object, |
| | | default: () => { |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | type: 'create', |
| | | visible: false, |
| | | loading: false, |
| | | warehouses: [], // 入库仓库列表 |
| | | buyTypeOptions:[{ |
| | | label:'集采', |
| | | value: '1' |
| | | },{ |
| | | label:'自采', |
| | | value: '2' |
| | | }], |
| | | fileList:[], |
| | | warehouses: [], // 报废仓库列表 |
| | | categoryOptions: [], // 物品分类列表 |
| | | modelList: [], //型号列表 |
| | | formData: { |
| | | warehouseId: '', // 入库仓库id |
| | | procureTime: '', // 采购时间 |
| | | procureDoc:'', |
| | | warehouseId: '', // 报废仓库id |
| | | procureTime: '', // 报废时间 |
| | | buyType: '2', // 报废方式(1:集采;2=自采) |
| | | procureGoods: [], |
| | | }, |
| | | goodsItem: { |
| | | whFormProcureId: '', // 采购单ID |
| | | baseCategoryIds: '', // 分类编号数组 |
| | | baseCategoryId: '', // 分类编号 |
| | | baseGoodsTemplateId: '', // 物品模版编号 |
| | |
| | | }, |
| | | modelsItem: { |
| | | baseGoodsModelsId: '', // 规格型号编号 |
| | | price: 0, // 单价(采购需要,调拨不需要) |
| | | price: 0, // 单价(报废需要,调拨不需要) |
| | | counts: 0, // 操作数量 |
| | | supplier: '', // 供应商 |
| | | unit: null, //单位 |
| | |
| | | rules: { |
| | | warehouseId: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | procureTime: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | buyType: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | |
| | | // procureDoc: [{ required: true, message: '请上传', trigger: 'change' }], |
| | | procureDoc: [{ required: true, message: '请上传', trigger: 'change' }], |
| | | baseCategoryIds: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | baseGoodsTemplateId: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | modelsIds: [{ required: true, message: '请选择', trigger: 'change' }], |
| | |
| | | uploadSettings: { |
| | | title: '上传', |
| | | max: 20, // 最大大小,单位M |
| | | num: 2, // 支持上传图片个数 |
| | | num: 10, // 支持上传图片个数 |
| | | accept: '.jpg,.png', // 限制格式 |
| | | tip: '', // 提示 默认:`只能上传${this.defaultSettings.num}个${this.defaultSettings.accept}文件,且不超过${this.defaultSettings.max}kb` |
| | | uploadUrl: getUploadUrl(), // 上传路径 |
| | | multiple: true, // 是否支持批量上传 |
| | | disabled: false, // 是否禁用 |
| | | type: 'text', // text/picture |
| | | type: 'picture', // text/picture |
| | | }, |
| | | }; |
| | | }, |
| | | created() {}, |
| | | created() { |
| | | this.init() |
| | | }, |
| | | methods: { |
| | | async open(id) { |
| | | async init() { |
| | | this.getWarehouseList(); |
| | | this.getgoodsTemplate() |
| | | this.getgoodsModel(); |
| | | // 获取物品分类列表 |
| | | const treeRes = await getTree(); |
| | | this.categoryOptions = this.removeEmptyChildren(treeRes); |
| | | if (id) { |
| | | this.type = 'edit'; |
| | | const detail = await procureDetail({ id }); |
| | | console.log('procureDetail', detail); |
| | | if (this.setting.id) { |
| | | const detail = await procureDetail({ id:this.setting.id }); |
| | | this.formData = Object.assign(this.formData, detail); |
| | | if(this.formData.procureDoc) { |
| | | this.fileList = JSON.parse(this.formData.procureDoc) |
| | | } |
| | | this.$set(this.formData,'buyType',this.formData.buyType.toString()) |
| | | this.formData.procureTime = this.formData.procureTime.toString(); |
| | | this.formData.procureGoods.map((item, index) => { |
| | | // 根据子集ID拼接物品分类列表 |
| | | let pIds = this.findParentIds(this.categoryOptions, item.baseCategoryId); |
| | | pIds = pIds.reverse(); |
| | | item.baseCategoryIds = [...pIds, item.baseCategoryId]; |
| | | item.modelsIds = item.models.map((v) => v.baseGoodsModelsId); |
| | | item.baseCategoryIds = this.findParentIds(this.categoryOptions, item.baseCategoryId); |
| | | this.$set(this.formData.procureGoods[index],'modelsIds',item.models.map((v) => v.baseGoodsModelsId)) |
| | | this.getgoodsTemplate(item.baseCategoryId, index); |
| | | this.getgoodsModel(item.baseGoodsTemplateId, index); |
| | | return item |
| | | }); |
| | | console.log('this.formData.procureGoods',this.formData.procureGoods) |
| | | } else { |
| | | this.type = 'create'; |
| | | this.formData.procureGoods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | } |
| | | this.visible = true; |
| | | }, |
| | | |
| | | // 获取入库仓库列表 |
| | | // 获取报废仓库列表 |
| | | getWarehouseList() { |
| | | selectTenantWarehouse() |
| | | .then((res) => { |
| | |
| | | goodsTemplate({ categoryId: id || '' }).then((res) => { |
| | | if (index || index == 0) { |
| | | this.$set(this.formData.procureGoods[index], 'goodsOptions', res); |
| | | }else { |
| | | this.goodsTemplatelAll = res; |
| | | } |
| | | }); |
| | | }, |
| | |
| | | this.goodsModelAll = res; |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 根据物品名称id获取名字 |
| | | getGoodsTemplateName(id) { |
| | | let item = this.goodsTemplatelAll.find((v) => v.id == id); |
| | | if (item) { |
| | | return item.goodsName; |
| | | } |
| | | return; |
| | | }, |
| | | |
| | | // 根据规格型号id获取名字 |
| | |
| | | this.formData.procureGoods[index].goodsOptions = [] |
| | | this.formData.procureGoods[index].baseGoodsTemplateId = '' |
| | | this.formData.procureGoods[index].goodsTemplateName = '' |
| | | this.formData.procureGoods[index].modelsOptions = [] |
| | | this.formData.procureGoods[index].modelsIds = [] |
| | | this.formData.procureGoods[index].models = [] |
| | | |
| | | this.formData.procureGoods[index].baseCategoryId = e[e.length - 1]; |
| | | // 根据选中分类请求物品名称列表 |
| | |
| | | this.formData.procureGoods[index].modelsIds = [] |
| | | this.formData.procureGoods[index].models = [] |
| | | |
| | | this.formData.goodsTemplateName = this.getGoodsModelsName(e) |
| | | this.formData.procureGoods[index].goodsTemplateName = this.getGoodsTemplateName(e) |
| | | // 根据选中物品名称id获取规格型号列表 |
| | | this.getgoodsModel(e, index); |
| | | }, |
| | |
| | | }, |
| | | |
| | | // 上传 |
| | | uploadChange(e) { |
| | | console.log('uploadChange', e); |
| | | uploadChange() { |
| | | let arr = this.$refs.uploadRef.fileList |
| | | this.formData.procureDoc = JSON.stringify(arr) |
| | | }, |
| | | |
| | | // 点击新增物品 |
| | |
| | | this.$refs['ruleForm'].validate((valid) => { |
| | | if (valid) { |
| | | console.log('this.formData', this.formData); |
| | | if (this.type == 'create') { |
| | | if (!this.setting.id) { |
| | | procureAdd(this.formData) |
| | | .then((res) => { |
| | | this.$message.success('保存成功!'); |
| | |
| | | |
| | | close() { |
| | | this.formData ={ |
| | | warehouseId: '', // 入库仓库id |
| | | procureTime: '', // 采购时间 |
| | | warehouseId: '', // 报废仓库id |
| | | procureTime: '', // 报废时间 |
| | | procureGoods: [], |
| | | } |
| | | this.visible = false; |
| | | this.$emit('close') |
| | | }, |
| | | |
| | | // 通过子集id查到所以相关父级id并返回数组 |
| | | findParentIds(dataSource, nodeId) { |
| | | const parentIds = []; // 用于存储所有父节点ID的数组 |
| | | const parentIds = [nodeId]; // 用于存储所有父节点ID的数组 |
| | | |
| | | // 定义一个递归函数,用于遍历整棵树并查找子节点的所有父节点 |
| | | function traverse(node, nodeId) { |
| | |
| | | for (const childNode of node.children) { |
| | | if (traverse(childNode, nodeId)) { |
| | | // 如果在子节点中找到了子节点的父节点,则将当前节点的ID添加到父节点ID数组中,并返回true表示已经找到了子节点 |
| | | parentIds.push(node.id); |
| | | parentIds.unshift(node.id); |
| | | return true; |
| | | } |
| | | } |
| | |
| | | <el-row style="margin-top: 15px"> |
| | | <el-col> |
| | | <!--列表--> |
| | | <div :style="{ 'overflow-y': 'auto', height: `${clientHeight - 320}px` }" v-loading="loading"> |
| | | <el-row class="card" :gutter="5"> |
| | | <div class="table-tool-bar" style="margin-bottom: 15px"> |
| | | <my-button name="新增" @click="handleAdd" site="tools" size="medium" /> |
| | | </div> |
| | | <div :style="{ 'overflow-y': 'auto', height: `${clientHeight - 320}px` }"> |
| | | <el-row class="card" :gutter="5" v-loading="loading"> |
| | | <el-col v-for="(item, index) in list" :key="index" class="cm-item"> |
| | | <el-card class="card-data"> |
| | | <div class="card-container"> |
| | | <div class="card-header"> |
| | | <div class="card-header-left"> |
| | | <span>调拨单号:</span> |
| | | <span>报废单号:</span> |
| | | <span class="value">{{ item.businessFormCode }}</span> |
| | | <div class="states" :class="item.states == 1 ? '' : 'states-success'"> |
| | | {{ item.states == 1 ? '待调拨' : '已调拨' }} |
| | | {{ item.states == 1 ? '待报废' : '已报废' }} |
| | | </div> |
| | | </div> |
| | | <div class="card-header-right"> |
| | | <el-button site="form" type="success" size="mini" @click="handleExport(item)" |
| | | >导出调拨出库单</el-button |
| | | >导出报废单</el-button |
| | | > |
| | | <el-button name="查看详情" site="form" type="info" size="mini" @click="handleDetail(item)" |
| | | >查看详情</el-button |
| | |
| | | </div> |
| | | </div> |
| | | <div class="one-hed"> |
| | | <div class="box"><span class="span-two">接收机构:</span>{{ item.agencyId }}</div> |
| | | <div class="box"><span class="span-two">申请人:</span>{{ item.buyerName }}</div> |
| | | <div class="box"><span class="span-two">申请调拨时间:</span>{{ item.procureTime }}</div> |
| | | <div class="box"><span class="span-two">接收时间:</span>{{ item.procureTime }}</div> |
| | | <div class="box"><span class="span-two">调拨机构:</span>{{ item.procureTime }}</div> |
| | | <div class="box"><span class="span-two">调拨人:</span>{{ item.procureTime }}</div> |
| | | <div class="box"><span class="span-two">调拨时间:</span>{{ item.procureTime }}</div> |
| | | <div class="box"><span class="span-two">机构:</span>{{ item.agencyId }}</div> |
| | | <div class="box"><span class="span-two">操作人:</span>{{ item.buyerName }}</div> |
| | | <div class="box"> |
| | | <span class="span-two">报废时间:</span>{{ item.procureTime | formatTime }} |
| | | </div> |
| | | </div> |
| | | <div class="card-end"> |
| | | <div v-for="(just, index) in item.models" :key="index" class="item"> |
| | | <div class="name">{{ just.baseGoodsModelsId }}</div> |
| | | <div v-for="(just, index) in item.fromProcureTemplateInfoList" :key="index" class="item"> |
| | | <div class="name">{{ just.goodsTemplateName }}</div> |
| | | <div class="value-box"> |
| | | <div class="value-box-item"> |
| | | <span class="label">数量:</span> |
| | | <span class="value">{{ just.counts }}</span> |
| | | <span class="value">{{ just.count }}</span> |
| | | <span class="unit">{{ just.unit }}</span> |
| | | </div> |
| | | </div> |
| | |
| | | </el-card> |
| | | </el-container> |
| | | <!--添加/编辑弹窗--> |
| | | <edit ref="editRef"></edit> |
| | | <detail ref="detailRef"></detail> |
| | | <edit |
| | | v-if="editSetting.show" |
| | | :setting="editSetting" |
| | | ref="editRef" |
| | | @close="editSetting.show = false" |
| | | @search="refreshData" |
| | | ></edit> |
| | | <detail |
| | | v-if="detailSetting.show" |
| | | :setting="detailSetting" |
| | | @close="detailSetting.show = false" |
| | | ref="detailRef" |
| | | ></detail> |
| | | <my-import |
| | | :import-setting="importSetting" |
| | | :dialog-show="importSetting.dialogShow" |
| | |
| | | |
| | | <script> |
| | | import { procureList, procureDel, procureIncome } from '@/api/stock/procure/purchaseOrder'; |
| | | import { getTree } from '@/api/baseSetting/finsystenant'; |
| | | import MyButton from '@/components/myButton/myButton'; |
| | | import SettingIplatform from '@/utils/settingIplatform'; |
| | | import myImport from '@/views/components/myImport'; |
| | | import edit from './edit'; |
| | | import detail from './detail'; |
| | | import { getBaseUrl } from '@/utils/base'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | |
| | | export default { |
| | | name: 'index', |
| | |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'businessFormCode', |
| | | label: '调拨单号', |
| | | label: '报废单号', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | }, |
| | |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'name', |
| | | type: 'cascader', |
| | | dataIndex: 'agencyId', |
| | | label: '机构', |
| | | placeholder: '请选择', |
| | | optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null }, |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'buyerName', |
| | | label: '创建人', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'states', |
| | | label: '状态', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [ |
| | | { |
| | | label: '全部', |
| | | value: '', |
| | | }, |
| | | { |
| | | label: '待调拨', |
| | | value: '1', |
| | | }, |
| | | { |
| | | label: '已调拨', |
| | | value: '2', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val1', |
| | | label: '调拨时间', |
| | | dataIndex: 'incomeTimeStart', |
| | | label: '报废时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val2', |
| | | dataIndex: 'incomeTimeEnd', |
| | | label: '至', |
| | | defaultValue: '', |
| | | }, |
| | |
| | | orgId: '', |
| | | show: false, |
| | | }, |
| | | detailSetting: { |
| | | title: '详情', |
| | | id: '', |
| | | show: false, |
| | | }, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | total: 0, |
| | |
| | | computed: { |
| | | clientHeight() { |
| | | return document.documentElement.clientHeight; |
| | | }, |
| | | }, |
| | | filters: { |
| | | formatTime(time) { |
| | | if (!time) return; |
| | | return DateFormatter.LongToDateTime(time); |
| | | }, |
| | | }, |
| | | created() { |
| | |
| | | console.log(this.list); |
| | | }); |
| | | }, |
| | | |
| | | //导入 |
| | | importOrg() { |
| | | this.importSetting.dialogShow = true; |
| | |
| | | // 导出 |
| | | handleExport() {}, |
| | | // 新增 |
| | | addtable() { |
| | | this.$refs.editRef.open(); |
| | | handleAdd() { |
| | | this.editSetting.id = null; |
| | | this.editSetting.info = null; |
| | | this.editSetting.title = '新增'; |
| | | this.editSetting.show = true; |
| | | }, |
| | | // 编辑 |
| | | handleEdit(row) { |
| | | this.$refs.editRef.open(row.id); |
| | | this.editSetting.id = row.id; |
| | | this.editSetting.info = null; |
| | | this.editSetting.title = '编辑'; |
| | | this.editSetting.show = true; |
| | | }, |
| | | // 详情 |
| | | handleDetail(row) { |
| | | this.$refs.detailRef.open(row.id); |
| | | this.detailSetting.id = row.id; |
| | | this.detailSetting.show = true; |
| | | }, |
| | | // 调拨 |
| | | // 报废 |
| | | handleIncome(row) { |
| | | this.$confirm(`您确定 单号:${row.businessFormCode} 调拨吗?`, '采购调拨') |
| | | .then(function () { |
| | | procureIncome({ id: row.id }).then((res) => { |
| | | this.$message.success('调拨成功!'); |
| | | }); |
| | | }) |
| | | .then((res) => { |
| | | this.search(); |
| | | }) |
| | | .catch(() => {}); |
| | | this.$confirm(`您确定 单号:${row.businessFormCode} 报废吗?`, '报废报废').then(() => { |
| | | procureIncome({ id: row.id }) |
| | | .then((res) => { |
| | | this.$message.success('报废成功!'); |
| | | this.search(); |
| | | }) |
| | | .catch(() => {}); |
| | | }); |
| | | }, |
| | | del(row) { |
| | | this.$modal |
| | | .confirm('是否确认删除调拨单号为"' + row.businessFormCode + '"的数据吗?') |
| | | .then(function () { |
| | | procureDel({ id: row.id }).then((res) => {}); |
| | | }) |
| | | .then((res) => { |
| | | this.$message.success('删除成功!'); |
| | | this.search(); |
| | | }) |
| | | .catch(() => {}); |
| | | this.$modal.confirm('是否确认删除报废单号为"' + row.businessFormCode + '"的数据吗?').then(() => { |
| | | procureDel({ id: row.id }) |
| | | .then((res) => { |
| | | this.$message.success('删除成功!'); |
| | | this.search(); |
| | | }) |
| | | .catch(() => {}); |
| | | }); |
| | | }, |
| | | // 分页 |
| | | handleSizeChange(pageSize) { |
| | | this.pageSize = pageSize; |
| | | this.search({ pageNum: 1 }); |
| | | this.search(1); |
| | | }, |
| | | handleCurrentChange(pageNum) { |
| | | this.myTable.paging.page.pageNum = pageNum; |
| | | this.search({ pageNum: pageNum }); |
| | | this.pageNum = pageNum; |
| | | this.search(pageNum); |
| | | }, |
| | | // 查询table列表 |
| | | search(pageNum) { |
| | | if (pageNum) { |
| | | this.pageNum = pageNum; |
| | | } |
| | | this.fetchData(); |
| | | }, |
| | | refreshData() { |
| | | this.pageNum = 1; |
| | | this.pageSize = 10; |
| | | this.search(); |
| | | }, |
| | | fifterForm(params) { |
| | | this.filterFrom = Object.assign(this.filterFrom, params); |
| | | if (this.filterFrom.incomeTimeStart) { |
| | | this.filterFrom.incomeTimeStart = this.filterFrom.incomeTimeStart.replace(/\-/g, ''); |
| | | } |
| | | if (this.filterFrom.incomeTimeEnd) { |
| | | this.filterFrom.incomeTimeEnd = this.filterFrom.incomeTimeEnd.replace(/\-/g, ''); |
| | | } |
| | | if (this.filterFrom.agencyId.length) { |
| | | this.filterFrom.agencyId = this.filterFrom.agencyId[this.filterFrom.agencyId.length - 1]; |
| | | } |
| | | this.search(1); |
| | | }, |
| | | }, |
| | |
| | | <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"/> |
| | | </el-card> |
| | | </el-container> |
| | | </el-container> |
| | |
| | | :dialog-show="importSetting.dialogShow" |
| | | :dialog-title="importSetting.dialogTitle" |
| | | /> |
| | | <detail |
| | | v-if="detailSetting.show" |
| | | :setting="detailSetting" |
| | | @close="detailSetting.show = false" |
| | | ref="detailRef" |
| | | ></detail> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | 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 detail from '../itemScrapping/detail'; |
| | | import {getBaseUrl} from '@/utils/base'; |
| | | |
| | | export default { |
| | | name: "index", |
| | | components: {MyButton, MyTableV2, edit, myImport}, |
| | | components: {MyButton, MyTableV2, myImport,detail}, |
| | | data() { |
| | | return { |
| | | // 搜索框 |
| | |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'status', |
| | | label: '类型', |
| | | placeholder: '请选择', |
| | | defaultValue: '1', |
| | | options: [ |
| | | { |
| | | label: '启用', |
| | | value: '1' |
| | | }, |
| | | { |
| | | label: '禁用', |
| | | value: '0' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '物品名称', |
| | |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'warehouseId', |
| | | label: '规格型号', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | dataIndex: 'agencyId', |
| | | label: '机构', |
| | | placeholder: '请选择', |
| | | optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null }, |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '创建人', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'incomeTimeStart', |
| | | label: '报废时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'incomeTimeEnd', |
| | | label: '至', |
| | | defaultValue: '', |
| | | }, |
| | | ], |
| | | // 树数据 |
| | |
| | | }, |
| | | // 列信息 |
| | | columns: [ |
| | | {title: '类型', field: 'name', align: 'left',}, |
| | | {title: '单号', field: 'code', align: 'center'}, |
| | | {title: '物品名称', field: 'lv', align: 'center', }, |
| | | {title: '单号', field: 'name', align: 'left',}, |
| | | {title: '物品名称', field: 'code', align: 'center'}, |
| | | {title: '规格型号', field: 'lv', align: 'center', }, |
| | | {title: '出入库数量', field: 'summary', align: 'left',}, |
| | | {title: '金额', field: 'summary', align: 'left',}, |
| | | {title: '报废数量', field: 'lv', align: 'center', }, |
| | | {title: '所属机构', field: 'summary', align: 'left',}, |
| | | {title: '创建人', field: 'summary', align: 'left',}, |
| | | {title: '操作时间', field: 'summary', align: 'left',}, |
| | |
| | | { |
| | | title: '详情', |
| | | events: (row) => { |
| | | this.showAudit(row); |
| | | this.showDetail(row); |
| | | }, |
| | | }, |
| | | ], |
| | |
| | | } |
| | | } |
| | | }, |
| | | detailSetting: { |
| | | title: '详情', |
| | | id: '', |
| | | show: false, |
| | | }, |
| | | } |
| | | }, |
| | | 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() |
| | | } |
| | | }, |
| | | // 左侧树初始化 |
| | | 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() |
| | | }) |
| | | .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; |
| | | // } |
| | | }, |
| | | showAudit(row) { |
| | | this.editSetting.id = row.id; |
| | | this.editSetting.info = JSON.stringify(row); |
| | | 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) |
| | | showDetail(row) { |
| | | this.detailSetting.id = row.id; |
| | | this.detailSetting.show = true; |
| | | }, |
| | | // 查询table列表 |
| | | search(pageNum) { |
| | |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'name', |
| | | type: 'cascader', |
| | | dataIndex: 'agencyId', |
| | | label: '调拨机构', |
| | | placeholder: '请选择', |
| | | optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null }, |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'select', |
| | | type: 'cascader', |
| | | dataIndex: 'name', |
| | | label: '接收机构', |
| | | placeholder: '请选择', |
| | | optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null }, |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '物品名称', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'warehouseId', |
| | | label: '规格型号', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | dataIndex: 'name', |
| | | label: '调拨机构', |
| | | placeholder: '请选择', |
| | | optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null }, |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | dataIndex: 'name', |
| | | label: '接收机构', |
| | | placeholder: '请选择', |
| | | optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null }, |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'status', |
| | | label: '类型', |
| | |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val1', |
| | | label: '申请时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val2', |
| | | label: '至', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val1', |
| | | label: '接收时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val2', |
| | | label: '至', |
| | | defaultValue: '', |
| | | }, |
| | | ], |
| | | // 树数据 |
| | | treeDataList: [], |