| | |
| | | }) |
| | | } |
| | | |
| | | export function editmaterial(data) { |
| | | return request({ |
| | | url: `/pc/base/goods/template/detail/?id=${data}`, |
| | | method: 'get', |
| | | }) |
| | | } |
| | | |
| | | |
| | | export function editcode(data) { |
| | | return request({ |
| | | url: '/pc/base/goods/template/edit', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | export function upcode(data) { |
| | | return request({ |
| | | url: '/pc/base/goods/template/updStatus', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | export function delCode(data) { |
| | | return request({ |
| | | url: '/pc/base/goods/template/del', |
| | | method: 'delete', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | export function treeList() { |
| | | return request({ |
| | |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据机构id获取用户 |
| | | * @Author wh |
| | | * @Date 2023/10/4 16:10 |
| | | */ |
| | | export function getUserByOrgId(parameter) { |
| | | return request.get(SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/getUserByOrgId', {params: parameter}) |
| | | } |
| | | |
| | | // 仓库选择列表 |
| | | export function selectTenantWarehouse(params) { |
| | | return request({ |
| | |
| | | params, |
| | | }); |
| | | } |
| | | |
| | | // 物品分类列表 |
| | | export function getCategoryDetail(params) { |
| | | return request({ |
| | | url: '/pc/base/category/detail', |
| | | method: 'get', |
| | | params, |
| | | }); |
| | | } |
| | | |
| | | // 物品列表 |
| | | export function goodsTemplate(params) { |
| | | return request({ |
| | |
| | | method: 'get', |
| | | params, |
| | | }); |
| | | } |
| | | } |
New file |
| | |
| | | import request from "@/utils/request"; |
| | | /*物品管理*/ |
| | | |
| | | /* |
| | | * 新增物品 |
| | | * */ |
| | | export function addGoods(data) { |
| | | return request({ |
| | | url: '/pc/base/goods/template/add', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | /* |
| | | * 删除物品 |
| | | * */ |
| | | export function delGoods(data) { |
| | | return request({ |
| | | url: '/pc/base/goods/template/del', |
| | | method: 'delete', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | /* |
| | | * 编辑物品 |
| | | * */ |
| | | export function editGoods(data) { |
| | | return request({ |
| | | url: '/pc/base/goods/template/edit', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | /* |
| | | * 物品详情 |
| | | * */ |
| | | export function goodsDetail(data) { |
| | | return request({ |
| | | url: `/pc/base/goods/template/detail/?id=${data}`, |
| | | method: 'get', |
| | | }) |
| | | } |
| | | |
| | | /* |
| | | * 启用/禁用 |
| | | * */ |
| | | export function updStatus(data) { |
| | | return request({ |
| | | url: '/pc/base/goods/template/updStatus', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | |
| | | /* 规格型号管理 */ |
| | | |
| | | /* |
| | | * 新增物品规格型号 |
| | | * */ |
| | | export function addSpecs(data) { |
| | | return request({ |
| | | url: '/pc/base/goods/template/add', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | /* |
| | | * 删除物品规格型号 |
| | | * */ |
| | | export function delSpecs(data) { |
| | | return request({ |
| | | url: '/pc/base/goods/template/del', |
| | | method: 'delete', |
| | | data: data |
| | | }) |
| | | } |
| | |
| | | <script> |
| | | import winMd from '@/components/win/win-md' |
| | | import myButton from '@/components/myButton/myButton' |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant' |
| | | import {addGoods,editGoods,goodsDetail} from "@/api/foudation/material"; |
| | | import {getTree} from '@/api/foudation/classification'; |
| | | import {mapGetters} from 'vuex' |
| | | |
| | |
| | | }, |
| | | async created() { |
| | | if (this.setting.id) { |
| | | await finsystenant.editmaterial(this.setting.id).then(res => { |
| | | await goodsDetail(this.setting.id).then(res => { |
| | | this.formData = res |
| | | if (!this.formData.agencyId) { |
| | | this.formData.agencyId = this.userInfo.tenantId |
| | |
| | | this.loading = true |
| | | if (this.setting.id) { |
| | | // 编辑接口 |
| | | finsystenant.editcode(params).then(res => { |
| | | editGoods(params).then(res => { |
| | | this.loading = false |
| | | if (res) { |
| | | this.$message.success('保存成功!') |
| | |
| | | }); |
| | | } else { |
| | | params.orgId = this.setting.orgId |
| | | finsystenant.addcode(params).then(res => { |
| | | addGoods(params).then(res => { |
| | | this.loading = false |
| | | if (res) { |
| | | this.$message.success('保存成功!') |
| | |
| | | <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> |
| | | <!--添加/编辑弹窗--> |
| | | <edit v-if="editSetting.show" :setting="editSetting" @close="editSetting.show = false" @search="search"/> |
| | | <!--规格--> |
| | | <specs v-if="specsSetting.show" :setting="specsSetting" @close="specsSetting.show = false" @search="search"></specs> |
| | | <my-import |
| | | :import-setting="importSetting" |
| | | :dialog-show="importSetting.dialogShow" |
| | |
| | | import MyButton from "@/components/myButton/myButton"; |
| | | import SettingIplatform from '@/utils/settingIplatform'; |
| | | import edit from './edit' |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant' |
| | | import {updStatus,delGoods} from '@/api/foudation/material' |
| | | import myImport from '@/views/components/myImport' |
| | | import {getBaseUrl} from '@/utils/base'; |
| | | import Specs from "@/views/foundation/material/specs/list.vue"; |
| | | |
| | | export default { |
| | | name: "index", |
| | | components: {MyButton, MyTableV2, edit, myTree, myImport}, |
| | | components: {Specs, MyButton, MyTableV2, edit, myTree, myImport}, |
| | | data() { |
| | | return { |
| | | // 搜索框 |
| | |
| | | orgId: '', |
| | | show: false, |
| | | }, |
| | | specsSetting: { |
| | | title: '', |
| | | id: '', |
| | | show: false, |
| | | }, |
| | | // 表格数据 |
| | | table: { |
| | | showIndex: true, // 是否显示序号 |
| | |
| | | // 操作信息 |
| | | operation: { |
| | | show: true, // 显示操作列 |
| | | width: 160, // 列宽 |
| | | width: 250, // 列宽 |
| | | attr: [ |
| | | { |
| | | title: '编辑', |
| | |
| | | this.del(row); |
| | | }, |
| | | }, |
| | | // { |
| | | // title: '规格型号', |
| | | // events: (row) => { |
| | | // this.showAudit(row); |
| | | // }, |
| | | // }, |
| | | { |
| | | title: '规格型号', |
| | | type: 'primary', |
| | | events: (row) => { |
| | | this.showSpecs(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | paging: { |
| | |
| | | vm.$modal.confirm('确认要' + text + '"' + row.goodsName + '"吗?').then(function () { |
| | | let params = Object.assign({}, row) |
| | | params.states = row.states == 1 ? 0 : 1 |
| | | finsystenant.upcode(params).then(res => { |
| | | updStatus(params).then(res => { |
| | | if (res) { |
| | | row.states = row.states === 1 ? 0 : 1 |
| | | vm.$modal.msgSuccess(text + "成功"); |
| | |
| | | this.$modal |
| | | .confirm('是否确认删除名称为"' + row.goodsName + '"的机构吗?') |
| | | .then(function () { |
| | | finsystenant.delCode({id: row.id}).then((res) => { |
| | | delGoods({id: row.id}).then((res) => { |
| | | }); |
| | | }) |
| | | .then((res) => { |
| | |
| | | this.editSetting.show = true; |
| | | // } |
| | | }, |
| | | showAudit(row) { |
| | | this.editSetting.id = row.id; |
| | | this.editSetting.title = '编辑'; |
| | | this.editSetting.show = true; |
| | | showSpecs(row) { |
| | | this.specsSetting.id = row.id; |
| | | this.specsSetting.show = true; |
| | | }, |
| | | // 查询table列表 |
| | | search(pageNum) { |
New file |
| | |
| | | <template> |
| | | <win-md title="规格型号" @close="close" :width="'800px'"> |
| | | <!--列表--> |
| | | <my-table-v2 ref="myTable" :table="table"/> |
| | | <div slot="footer" align="center" class="dialog-footer"> |
| | | <my-button name="取消" site="form" @click="close"/> |
| | | </div> |
| | | <specsAdd v-if="specsSetting.show" :setting="specsSetting" @close="specsSetting.show = false" @search="search"/> |
| | | </win-md> |
| | | </template> |
| | | |
| | | <script> |
| | | import winMd from '@/components/win/win-md' |
| | | import myButton from '@/components/myButton/myButton' |
| | | import {delSpecs} from "@/api/foudation/material"; |
| | | import specsAdd from "@/views/foundation/material/specs/specsAdd.vue"; |
| | | import {mapGetters} from 'vuex' |
| | | import MyTableV2 from "@/components/myTable/myTableV2.vue"; |
| | | import SettingIplatform from "@/utils/settingIplatform"; |
| | | |
| | | export default { |
| | | name: 'specs', |
| | | components: {MyTableV2, winMd, myButton, specsAdd}, |
| | | props: { |
| | | setting: { |
| | | type: Object, |
| | | default: () => { |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | specsSetting: { |
| | | title: '', |
| | | id: '', |
| | | show: false, |
| | | }, |
| | | // 表格数据 |
| | | table: { |
| | | showIndex: true, // 是否显示序号 |
| | | expand: false, // 是否显示详情数据 |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/list', // 请求地址 |
| | | // 工具条 |
| | | tools: { |
| | | columnsCtrl: {// 列控制按钮 |
| | | show: false |
| | | }, |
| | | generalExport: {// 通用导出按钮 |
| | | show: false |
| | | }, |
| | | // 自定义工具条按钮 |
| | | custom: [ |
| | | { |
| | | name: '新增', |
| | | click: () => { |
| | | this.showAdd(null); |
| | | }, |
| | | }, |
| | | ] |
| | | }, |
| | | // 列信息 |
| | | columns: [ |
| | | {title: '规格型号', field: 'goodsCode', align: 'left', minWidth: 120}, |
| | | {title: '单位', field: 'classification', align: 'center', width: 100}, |
| | | { |
| | | field: 'states', |
| | | title: '状态', |
| | | align: 'center', |
| | | width: 100, |
| | | switch: row => { |
| | | const result = {} |
| | | if (row.states == 1) { |
| | | Object.assign(result, { |
| | | value: true, // 开 |
| | | label: '是', // 开的描述 |
| | | click: () => { // 点击事件 |
| | | this.updState(row) |
| | | } |
| | | }) |
| | | } else { |
| | | Object.assign(result, { |
| | | value: false, // 关 |
| | | label: '否', // 关的描述 |
| | | click: () => { |
| | | this.updState(row) |
| | | } |
| | | }) |
| | | } |
| | | return result |
| | | } |
| | | } |
| | | ], |
| | | // 操作信息 |
| | | operation: { |
| | | show: true, // 显示操作列 |
| | | width: 100, // 列宽 |
| | | attr: [ |
| | | { |
| | | title: '删除', |
| | | events: (row) => { |
| | | this.del(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | paging: { |
| | | show: true, // 显示分页 |
| | | // 分页信息 |
| | | page: { |
| | | small: false, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | total: 0 |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(['userInfo']) |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | showAdd(){ |
| | | this.specsSetting.mid = this.setting.id;//物品ID |
| | | this.specsSetting.show = true; |
| | | }, |
| | | del(row) { |
| | | this.$modal |
| | | .confirm('是否确认删除名称为"' + row.categoryName + '"的机构吗?') |
| | | .then(function () { |
| | | delSpecs({ id: row.id }).then((res) => {}); |
| | | }) |
| | | .then((res) => { |
| | | this.$message.success('删除成功!');this.$refs.myTable.search(); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | close() { |
| | | this.$emit('close') |
| | | }, |
| | | // 查询table列表 |
| | | search() { |
| | | this.$refs.myTable.search() |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <win-md title="新增规格型号" @close="close" width="500px" :loading="loading"> |
| | | <el-form ref="ruleForm" :model="formData" :rules="rules" class="demo-ruleForm" label-width="100px"> |
| | | <el-form-item label="型号名称" prop="modelName"> |
| | | <el-input v-model="formData.modelName" placeholder="请输入型号名称" clearable maxlength="20" show-word-limit |
| | | style="width: 100%"/> |
| | | </el-form-item> |
| | | <el-form-item label="单位" prop="unit"> |
| | | <el-input v-model="formData.unit" placeholder="请输入单位" clearable maxlength="20" show-word-limit |
| | | style="width: 100%"/> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="states"> |
| | | <el-radio-group v-model="formData.states"> |
| | | <el-radio :label="1" border>启用</el-radio> |
| | | <el-radio :label="0" border>禁用</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" align="center" class="dialog-footer"> |
| | | <my-button name="取消" site="form" @click="close"/> |
| | | <my-button name="保存" site="form" @click="save"/> |
| | | </div> |
| | | </win-md> |
| | | </template> |
| | | |
| | | <script> |
| | | import winMd from '@/components/win/win-md' |
| | | import myButton from '@/components/myButton/myButton' |
| | | import {mapGetters} from 'vuex' |
| | | import {addSpecs} from "@/api/foudation/material"; |
| | | |
| | | |
| | | export default { |
| | | name: 'specsAdd', |
| | | components: {winMd, myButton}, |
| | | props: { |
| | | setting: { |
| | | type: Object, |
| | | default: () => { |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | formData: { |
| | | modelName: '', |
| | | unit: '', |
| | | states: 1, |
| | | }, |
| | | rules: { |
| | | modelName: [ |
| | | {required: true, message: '请输入型号名称', trigger: 'blur'} |
| | | ], |
| | | unit: [ |
| | | {required: true, message: '请输入单位', trigger: 'blur'} |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(['userInfo']) |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | close() { |
| | | this.$emit('close') |
| | | }, |
| | | save() { |
| | | this.$refs.ruleForm.validate((valid) => { |
| | | if (valid) { |
| | | const params = Object.assign({}, this.formData) |
| | | if (this.loading) return |
| | | this.loading = true |
| | | addSpecs(params).then(res => { |
| | | this.loading = false |
| | | if (res) { |
| | | this.$message.success('保存成功!') |
| | | this.close() |
| | | this.$emit('search') |
| | | } else { |
| | | this.$message.error('保存失败') |
| | | } |
| | | }).catch(() => { |
| | | this.loading = false |
| | | }); |
| | | } else { |
| | | this.$message.error('校验未通过,请检查。') |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |