部门物品:物品分发,物品报废静态。调拨管理联调,price由元改为分,仓库管理库管员
| | |
| | | // 添加仓库管理员 |
| | | export function warehouseManagerAdd(data) { |
| | | return request({ |
| | | url: '/pc/base/warehouse/manager/add', |
| | | url: '/pc/base/warehouse/manager/save', |
| | | method: 'post', |
| | | data |
| | | }) |
| | |
| | | method: 'get', |
| | | params, |
| | | }); |
| | | } |
| | | |
| | | // 导出 |
| | | export function transferDetailListApi(params) { |
| | | return '/pc/l/wh/form/transfer/detail/list' |
| | | } |
| | |
| | | <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> |
| | | <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-form> |
| | | <div slot="footer" align="center" class="dialog-footer"> |
| | | <my-button name="取消" site="form" @click="close"/> |
| | | <my-button name="保存" site="form" @click="save"/> |
| | | <el-dialog |
| | | width="1000px" |
| | | :visible="true" |
| | | :top="'15vh'" |
| | | :close-on-click-modal="false" |
| | | :append-to-body="true" |
| | | :destroy-on-close="true" |
| | | @close="close" |
| | | > |
| | | <div slot="title" align="left" class="dialog-title"> |
| | | <div |
| | | class="tab-item" |
| | | :class="tabIndex == index ? 'active' : ''" |
| | | v-for="(item, index) in tabs" |
| | | :key="index" |
| | | @click="tabIndex = index" |
| | | > |
| | | {{ item }} |
| | | </div> |
| | | </div> |
| | | </win-sm> |
| | | <el-form v-show="tabIndex == 0" ref="ruleForm" :model="formData" :rules="rules" class="demo-ruleForm"> |
| | | <div v-for="(item, index) in formData.list" :key="index"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="规格型号:"> |
| | | {{ item.modelName }} |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="单位:"> |
| | | {{ item.unit }} |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" v-for="(childItem, childIndex) in item.list" :key="childIndex"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="分发数量:"> |
| | | {{ childItem.count }} |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="使用人:"> |
| | | {{ childItem.user }} |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="联系电话:"> |
| | | <el-input v-if="childItem.isEdit" v-model="childItem.phone" style="width: 120px"></el-input> |
| | | <span v-else>{{ childItem.phone }}</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6" v-if="!childItem.isEdit"> |
| | | <el-form-item> |
| | | <span class="edit-text" @click="handleEditItem(index, childIndex, childItem.isEdit)">修改</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | |
| | | <el-form |
| | | v-show="tabIndex == 1" |
| | | ref="ruleForm" |
| | | :model="formData" |
| | | :rules="rules" |
| | | class="demo-ruleForm" |
| | | style="width: 96%" |
| | | > |
| | | <div v-for="(item, index) in formData.list" :key="index"> |
| | | <el-row :gutter="20" class="item-header"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="修改时间:"> |
| | | {{ item.time }} |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="修改人:"> |
| | | {{ item.userName }} |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="line"></div> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="规格型号:"> |
| | | {{ item.modelName }} |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="单位:"> |
| | | {{ item.unit }} |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" v-for="(childItem, childIndex) in item.list" :key="childIndex"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="分发数量:"> |
| | | {{ childItem.count }} |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="使用人:"> |
| | | {{ childItem.user }} |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="联系电话:"> |
| | | <span>{{ childItem.phone }}</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="line"></div> |
| | | </div> |
| | | </el-form> |
| | | <div v-if="tabIndex == 0" slot="footer" align="center" class="dialog-footer"> |
| | | <my-button name="取消" site="form" @click="close" /> |
| | | <my-button name="保存" site="form" @click="save" /> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import winSm from '@/components/win/win-sm' |
| | | import myButton from '@/components/myButton/myButton' |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant' |
| | | import myButton from '@/components/myButton/myButton'; |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant'; |
| | | |
| | | export default { |
| | | components: {winSm, myButton}, |
| | | components: { myButton }, |
| | | props: { |
| | | setting: { |
| | | type: Object, |
| | | default: () => { |
| | | } |
| | | } |
| | | default: () => {}, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | checkAll: false, |
| | | tabs: ['修改使用人', '使用记录'], |
| | | tabIndex: 0, |
| | | checkedList: [], |
| | | formData: { |
| | | code: '', |
| | | name: '', |
| | | status: true, |
| | | summary: '', |
| | | list: [ |
| | | { |
| | | modelName: '型号111111', |
| | | unit: '套', |
| | | time: '2023-08-08 10:23:34', |
| | | userName: '管理员', |
| | | list: [ |
| | | { |
| | | count: 1, |
| | | user: '张三', |
| | | phone: '18500000001', |
| | | isEdit: false, |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | modelName: '型号222222', |
| | | unit: '套', |
| | | list: [ |
| | | { |
| | | count: 1, |
| | | user: '张三', |
| | | phone: '18500000001', |
| | | isEdit: false, |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | 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)) |
| | | } |
| | | }, |
| | | created() {}, |
| | | methods: { |
| | | getEditInfo(id){ |
| | | |
| | | getEditInfo(id) {}, |
| | | handleEditItem(index, childIndex) { |
| | | this.formData.list[index].list[childIndex].isEdit = true; |
| | | }, |
| | | 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> |
| | | <style lang="scss" scoped> |
| | | .dialog-title { |
| | | display: flex; |
| | | align-items: center; |
| | | .tab-item { |
| | | color: #3d3d3d; |
| | | font-size: 16px; |
| | | font-style: normal; |
| | | padding: 0 10px; |
| | | position: relative; |
| | | cursor: pointer; |
| | | &.active::after { |
| | | content: ''; |
| | | width: 100%; |
| | | height: 2px; |
| | | background: #409eff; |
| | | position: absolute; |
| | | bottom: -10px; |
| | | left: 0; |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | .edit-text { |
| | | color: #409eff; |
| | | cursor: pointer; |
| | | } |
| | | .item-header { |
| | | ::v-deep { |
| | | .el-form-item__label, |
| | | .el-form-item__content { |
| | | font-weight: 700; |
| | | } |
| | | } |
| | | } |
| | | ::v-deep { |
| | | .el-form-item { |
| | | margin-top: 10px; |
| | | margin-bottom: 10px; |
| | | } |
| | | } |
| | | .line { |
| | | width: 100%; |
| | | height: 1px; |
| | | margin: 10px 0; |
| | | background: rgba($color: #dcdfe6, $alpha: 0.45); |
| | | } |
| | | </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"/> |
| | | <edit v-if="editSetting.show" :setting="editSetting" @close="editSetting.show = false" @search="search" /> |
| | | <detail v-if="detailSetting.show" :setting="detailSetting" @close="detailSetting.show = false" /> |
| | | </el-card> |
| | | </el-container> |
| | | </el-container> |
| | | <my-import |
| | | :import-setting="importSetting" |
| | | :dialog-show="importSetting.dialogShow" |
| | | :dialog-title="importSetting.dialogTitle" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import MyTableV2 from "@/components/myTable/myTableV2"; |
| | | import MyButton from "@/components/myButton/myButton"; |
| | | import MyTableV2 from '@/components/myTable/myTableV2'; |
| | | import MyButton from '@/components/myButton/myButton'; |
| | | import SettingIplatform from '@/utils/settingIplatform'; |
| | | import edit from './edit' |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant' |
| | | import myImport from '@/views/components/myImport' |
| | | import {getBaseUrl} from '@/utils/base'; |
| | | import edit from './edit'; |
| | | import detail from '../distribution/detail'; |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant'; |
| | | import { getBaseUrl } from '@/utils/base'; |
| | | |
| | | export default { |
| | | name: "index", |
| | | components: {MyButton, MyTableV2, edit, myImport}, |
| | | name: 'index', |
| | | components: { MyButton, MyTableV2, edit, detail }, |
| | | data() { |
| | | return { |
| | | // 搜索框 |
| | |
| | | dataIndex: 'name', |
| | | label: '单号', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'status', |
| | | label: '类型', |
| | | placeholder: '请选择', |
| | | defaultValue: '1', |
| | | options: [ |
| | | { |
| | | label: '启用', |
| | | value: '1' |
| | | }, |
| | | { |
| | | label: '禁用', |
| | | value: '0' |
| | | } |
| | | ] |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '物品名称', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'name', |
| | | 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: 'select', |
| | | dataIndex: 'name', |
| | | label: '部门', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '创建人', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'incomeTimeStart', |
| | | label: '时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'incomeTimeEnd', |
| | | label: '至', |
| | | defaultValue: '', |
| | | }, |
| | | ], |
| | | // 树数据 |
| | | treeDataList: [], |
| | | // 搜索条件 |
| | | filterFrom: { |
| | | tenantId: null, |
| | | userName: null, |
| | | userPhone: null, |
| | | 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 |
| | | status: 1, |
| | | }, |
| | | editSetting: { |
| | | title: '', |
| | | id: '', |
| | | orgId: '', |
| | | show: false, |
| | | }, |
| | | detailSetting: { |
| | | title: '', |
| | | id: '', |
| | | orgId: '', |
| | |
| | | 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: 'code', align: 'center' }, |
| | | { title: '物品名称', field: 'lv', 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' }, |
| | | ], |
| | | // 操作信息 |
| | | operation: { |
| | | show: true, // 显示操作列 |
| | | width: '150', // 列宽 |
| | | width: '200', // 列宽 |
| | | attr: [ |
| | | { |
| | | title: '详情', |
| | | title: '使用人', |
| | | type: 'primary', |
| | | events: (row) => { |
| | | this.showAudit(row); |
| | | this.handleEdit(row); |
| | | }, |
| | | }, |
| | | { |
| | | title: '详情', |
| | | type: 'info', |
| | | events: (row) => { |
| | | this.handleDetail(row); |
| | | }, |
| | | }, |
| | | ], |
| | |
| | | small: false, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | total: 0 |
| | | } |
| | | } |
| | | total: 0, |
| | | }, |
| | | }, |
| | | }, |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | // 获取机构树 |
| | | this.initTreeData() |
| | | }, |
| | | created() {}, |
| | | 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) { |
| | | handleEdit(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) |
| | | handleDetail(row) { |
| | | this.detailSetting.id = row.id; |
| | | this.detailSetting.info = JSON.stringify(row); |
| | | this.detailSetting.title = '详情'; |
| | | this.detailSetting.show = true; |
| | | }, |
| | | // 查询table列表 |
| | | search(pageNum) { |
| | | if (pageNum != undefined) { |
| | | this.$refs.myTable.search(pageNum) |
| | | this.$refs.myTable.search(pageNum); |
| | | } else { |
| | | this.$refs.myTable.search() |
| | | this.$refs.myTable.search(); |
| | | } |
| | | }, |
| | | fifterForm(params) { |
| | | this.filterFrom = Object.assign(this.filterFrom, params) |
| | | this.search(1) |
| | | } |
| | | } |
| | | } |
| | | this.filterFrom = Object.assign(this.filterFrom, params); |
| | | this.search(1); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | | <style scoped></style> |
| | |
| | | <template> |
| | | <win-md class="stock-edit" :title="`${setting.title}采购入库`" @close="close" :width="'800px'"> |
| | | <win-md class="stock-edit" 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-option v-for="item in departmentOptions" :key="item.id" :label="item.name" :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="领取人" prop="warehouseId"> |
| | | <el-input v-model="formData.warehouseId" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24" class="headerHeight"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="联系电话" prop="buyType"> |
| | | <el-input v-model.number="formData.buyType" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | </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"> |
| | | <el-form-item label="分发审批手续" prop="procureDoc"> |
| | | <upload ref="uploadRef" :values="fileList" :settings="uploadSettings" @on-change="uploadChange"></upload> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="供货商" prop="supplier"> |
| | | <el-input v-model="goodsItem.supplier" clearable maxlength="20" show-word-limit /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="goodsItem.models" :stripe="true"> |
| | | <el-table-column prop="baseGoodsModelsId" label="规格型号" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ getGoodsModelsName(scope.row.baseGoodsModelsId) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="单位" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.unit }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="priceYuan" label="单价(元)" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-form-item |
| | | label-width="0" |
| | | style="margin-bottom: 0" |
| | | :prop="`procureGoods[${goodsIndex}].models[${scope.$index}].priceYuan`" |
| | | :rules="rules.priceYuan" |
| | | > |
| | | <el-input |
| | | type="number" |
| | | v-model.number="scope.row.priceYuan" |
| | | @change="priceChange($event, goodsIndex, scope.$index)" |
| | | ></el-input> |
| | | <el-row class="card3" v-for="(mItem, mIndex) in goodsItem.models" :key="mIndex"> |
| | | <el-row :gutter="24" type="flex" align="middle" style="height: 50px"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="规格型号:" prop="baseGoodsModelsId" style="margin-bottom: 0"> |
| | | {{ getGoodsModelsName(mItem.baseGoodsModelsId) }} |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="counts" label="采购数量" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-form-item |
| | | label-width="0" |
| | | style="margin-bottom: 0" |
| | | :prop="`procureGoods[${goodsIndex}].models[${scope.$index}].counts`" |
| | | :rules="rules.counts" |
| | | > |
| | | <el-input v-model.number="scope.row.counts"></el-input> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="剩余数量:" prop="baseGoodsModelsId" style="margin-bottom: 0" label-width="80"> |
| | | 50 |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-col> |
| | | <el-col :span="10" v-if="true"> |
| | | <el-form-item label="分发数量:" prop="baseGoodsModelsId" style="margin-bottom: 0" label-width="80"> |
| | | <el-input v-model.number="mItem.count" style="width: 160px;"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="mItem.clist" :stripe="true" v-if="false"> |
| | | <el-table-column prop="count" label="分发数量" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-model="scope.row.count"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="count" label="使用人" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-model="scope.row.user" maxlength="20"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="count" label="联系电话" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-model.number="scope.row.phone" maxlength="11"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="left" width="60"> |
| | | <template slot-scope="scope"> |
| | | <i |
| | | v-if="mItem.clist.length > 1" |
| | | class="el-icon-remove-outline" |
| | | style="color: #f56c6c; font-size: 16px; cursor: pointer" |
| | | @click="handleDel(goodsIndex, mIndex, scope.$index)" |
| | | ></i> |
| | | <i |
| | | v-if="mItem.clist.length - 1 == scope.$index" |
| | | class="el-icon-circle-plus-outline" |
| | | style="color: #0d997c; font-size: 16px; cursor: pointer" |
| | | @click="handleAdd(goodsIndex, mIndex, scope.$index)" |
| | | ></i> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-row> |
| | | <div class="btn-group"> |
| | | <el-button |
| | | v-if="formData.procureGoods.length > 1" |
| | |
| | | goodsModel, |
| | | procureDetail, |
| | | } from '@/api/stock/procure/purchaseOrder'; |
| | | import { departmentListAll } from '@/api/system/deptment'; |
| | | import { getTree } from '@/api/foudation/classification'; |
| | | import MyButton from '@/components/myButton/myButton'; |
| | | import winMd from '@/components/win/win-md'; |
| | |
| | | import { getUploadUrl, getDownUrl } from '@/utils/base'; |
| | | import { findParentIds } from '@/utils/index'; |
| | | import { mapGetters } from 'vuex'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | |
| | | export default { |
| | | components: { MyButton, winMd, upload }, |
| | |
| | | let temp = this.formData.procureGoods.filter((v) => v.baseGoodsTemplateId == value); |
| | | if (!temp || temp.length != 1) { |
| | | return callback(new Error('已选过此物品')); |
| | | } |
| | | callback(); |
| | | }; |
| | | // 金额校验 |
| | | var checkPrice = (rule, value, callback) => { |
| | | console.log(value); |
| | | if (!value) { |
| | | return callback(new Error('请输入')); |
| | | } |
| | | if (value == 0) { |
| | | this.$message.warning('数字值不能为0'); |
| | | return callback(new Error('数字值不能为0')); |
| | | } |
| | | callback(); |
| | | }; |
| | |
| | | }, |
| | | ], |
| | | fileList: [], |
| | | warehouses: [], // 入库仓库列表 |
| | | departmentOptions: [], // 部门列表 |
| | | categoryOptions: [], // 物品分类列表 |
| | | modelList: [], //型号列表 |
| | | formData: { |
| | | procureDoc: '', |
| | | warehouseId: '', // 入库仓库id |
| | | procureTime: '', // 采购时间 |
| | | buyType: '2', // 采购方式(1:集采;2=自采) |
| | | procureTime: DateFormatter.formatDate(new Date()), // 采购时间 |
| | | procureGoods: [], |
| | | }, |
| | | goodsItem: { |
| | |
| | | }, |
| | | modelsItem: { |
| | | baseGoodsModelsId: '', // 规格型号编号 |
| | | priceYuan: null, // 单价(元) |
| | | price: null, // 单价(分 采购需要,调拨不需要) |
| | | counts: null, // 操作数量 |
| | | unit: null, //单位 |
| | | syCount: '', |
| | | }, |
| | | clistItem: { |
| | | count: null, |
| | | user: null, |
| | | phone: null, |
| | | }, |
| | | rules: { |
| | | warehouseId: [{ required: true, message: '请选择', trigger: 'change' }], |
| | |
| | | baseCategoryIds: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | baseGoodsTemplateId: [{ validator: checkGoodsTemplateId, trigger: ['blur', 'change'] }], |
| | | modelsIds: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | priceYuan: [{ validator: checkPrice, trigger: 'blur' }], |
| | | counts: [{ validator: checkCounts, trigger: 'blur' }], |
| | | }, |
| | | |
| | |
| | | }, |
| | | methods: { |
| | | async init() { |
| | | this.getWarehouseList(); |
| | | this.getdeptmentList(); |
| | | this.getgoodsTemplate(); |
| | | this.getgoodsModel(); |
| | | // 获取物品分类列表 |
| | |
| | | }, |
| | | |
| | | // 获取入库仓库列表 |
| | | getWarehouseList() { |
| | | selectTenantWarehouse({ agencyId: this.userInfo.tenantId }) |
| | | getdeptmentList() { |
| | | departmentListAll({ agencyId: this.userInfo.tenantId }) |
| | | .then((res) => { |
| | | this.warehouses = res; |
| | | this.departmentOptions = res; |
| | | if (!this.setting.id && res.length) { |
| | | this.formData.procureGoods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | } |
| | | if (this.warehouses.length && !this.formData.warehouseId) { |
| | | if (this.departmentOptions.length && !this.formData.warehouseId) { |
| | | // 默认选中第一个仓库 |
| | | this.formData.warehouseId = this.warehouses[0].id; |
| | | this.formData.warehouseId = this.departmentOptions[0].id; |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | |
| | | let str = JSON.stringify(arr); |
| | | e.forEach((item) => { |
| | | if (str.indexOf(item) == -1) { |
| | | let temp = this.goodsModelAll.find((v) => v.id == item); |
| | | arr.push({ ...this.modelsItem, baseGoodsModelsId: item, unit: temp.unit }); |
| | | let clist = [JSON.parse(JSON.stringify(this.clistItem))]; |
| | | arr.push({ ...this.modelsItem, baseGoodsModelsId: item, clist }); |
| | | } |
| | | }); |
| | | this.formData.procureGoods[index].models = arr; |
| | |
| | | let arr = this.formData.procureGoods[index].models; |
| | | let delIndex = arr.findIndex((v) => v.baseGoodsModelsId == e); |
| | | this.formData.procureGoods[index].models.splice(delIndex, 1); |
| | | }, |
| | | |
| | | //型号分发新增 |
| | | handleAdd(goodsIndex, mIndex, cIndex) { |
| | | this.formData.procureGoods[goodsIndex].models[mIndex].clist.push(JSON.parse(JSON.stringify(this.clistItem))); |
| | | }, |
| | | handleDel(goodsIndex, mIndex, cIndex) { |
| | | this.formData.procureGoods[goodsIndex].models[mIndex].clist.splice(cIndex, 1); |
| | | }, |
| | | |
| | | // 价格input监听 转为分 |
| | |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | @import url(../../../../styles/store.scss); |
| | | .card3 { |
| | | border-radius: 2px; |
| | | background: #ffffff; |
| | | } |
| | | </style> |
| | |
| | | <el-col> |
| | | <!--列表--> |
| | | <div class="table-tool-bar" style="margin-bottom: 15px"> |
| | | <my-button name="新增" @click="handleAdd" site="tools" size="medium" /> |
| | | <my-button name="物品分发" @click="handleAdd" site="tools" size="medium" icon="el-icon-edit-outline" /> |
| | | <my-button name="导入" @click="importSetting.dialogShow = true" site="tools" size="medium" /> |
| | | </div> |
| | | <div :style="{ 'overflow-y': 'auto', height: `${clientHeight - 320}px` }" v-loading="loading"> |
| | |
| | | <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 ? '待入库' : '已入库' }} |
| | | </div> |
| | | </div> |
| | | <div class="card-header-right"> |
| | | <template v-if="item.states == 1"> |
| | | <el-button name="编辑" site="form" type="success" size="mini" @click="handleEdit(item)" |
| | | >编辑</el-button |
| | | > |
| | | <el-button name="入库" site="form" type="primary" size="mini" @click="handleIncome(item)" |
| | | >入库</el-button |
| | | > |
| | | <el-button name="删除" site="form" type="danger" size="mini" @click="del(item)" |
| | | >删除</el-button |
| | | > |
| | | </template> |
| | | <template v-if="item.states != 1"> |
| | | <el-button site="form" type="success" size="mini" @click="handleExport(item)" |
| | | >导出入库单</el-button |
| | | > |
| | | </template> |
| | | <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.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 class="box"> |
| | | <span class="span-two">入库时间:</span>{{ item.incomeTime | formatTime }} |
| | | <span class="span-two">分发时间:</span>{{ item.procureTime | formatTime }} |
| | | </div> |
| | | </div> |
| | | <div class="card-end"> |
| | |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'businessFormCode', |
| | | label: '入库单号', |
| | | label: '分发单号', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'agencyId', |
| | | label: '分发部门', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | dataIndex: 'agencyId', |
| | | label: '机构', |
| | | placeholder: '请选择', |
| | | optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null }, |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'createName', |
| | | label: '创建人', |
| | | label: '分发人', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'states', |
| | | label: '状态', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [ |
| | | { |
| | | label: '全部', |
| | | value: '', |
| | | }, |
| | | { |
| | | label: '待入库', |
| | | value: '1', |
| | | }, |
| | | { |
| | | label: '已入库', |
| | | value: '2', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'incomeTimeStart', |
| | | label: '入库时间', |
| | | label: '分发时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | |
| | | callBack(); |
| | | }; |
| | | }, |
| | | // 入库 |
| | | // 分发 |
| | | handleIncome(row) { |
| | | this.$confirm(`您确定 单号:${row.businessFormCode} 入库吗?`, '采购入库').then(() => { |
| | | this.$confirm(`您确定 单号:${row.businessFormCode} 分发吗?`, '分发分发').then(() => { |
| | | procureIncome({ id: row.id }) |
| | | .then((res) => { |
| | | this.$message.success('入库成功!'); |
| | | this.$message.success('分发成功!'); |
| | | this.search(); |
| | | }) |
| | | .catch(() => {}); |
| | | }); |
| | | }, |
| | | del(row) { |
| | | this.$modal.confirm('是否确认删除入库单号为"' + row.businessFormCode + '"的数据吗?').then( () => { |
| | | this.$modal.confirm('是否确认删除分发单号为"' + row.businessFormCode + '"的数据吗?').then( () => { |
| | | procureDel({ id: row.id }) |
| | | .then((res) => { |
| | | this.$message.success('删除成功!'); |
| | |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'status', |
| | | label: '类型', |
| | | placeholder: '请选择', |
| | | defaultValue: '1', |
| | | options: [ |
| | | { |
| | | label: '启用', |
| | | value: '1' |
| | | }, |
| | | { |
| | | label: '禁用', |
| | | value: '0' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '物品名称', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'name', |
| | | 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: 'select', |
| | | dataIndex: 'name', |
| | | label: '部门', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | options:[] |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | }, |
| | | // 列信息 |
| | | 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: 'summary', align: 'left',}, |
| | | {title: '操作时间', field: 'summary', align: 'left',}, |
| | | ], |
New file |
| | |
| | | <template> |
| | | <win-md class="stock-detail" :title="setting.title" @close="close" :width="'800px'"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <span>出库单号:</span> |
| | | <span>{{ detail.businessFormCode }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>出库仓库:</span> |
| | | <span>{{ detail.warehouseName }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>所属机构:</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.operatorName }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>出库时间:</span> |
| | | <span>{{ detail.dealTime | formatTime }}</span> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="detail.procureDoc" :gutter="20" style="margin-top: 20px"> |
| | | <el-col class="img-row" :span="24"> |
| | | <span>出库手续:</span> |
| | | <div class="img-box"></div> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="goods-card" v-for="(goodsItem, goodsIndex) in detail.fromOutputGoods" :key="goodsIndex"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <span>物品分类:</span> |
| | | <span>{{ goodsItem.categoryName }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>物品名称:</span> |
| | | <span>{{ goodsItem.goodsName }}</span> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="goodsItem.models" :stripe="true" style="margin-top: 20px"> |
| | | <el-table-column prop="baseGoodsModelsName" label="规格型号" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.baseGoodsModelsName }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="单位" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.unit }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="counts" label="出库数量" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ 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 | formatPrice}} |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </win-md> |
| | | </template> |
| | | <script> |
| | | import { outputDetail } from '@/api/stock/accessStock'; |
| | | import winMd from '@/components/win/win-md'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | |
| | | export default { |
| | | components: { winMd }, |
| | | |
| | | props: { |
| | | setting: { |
| | | type: Object, |
| | | default: () => {}, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | detail: { |
| | | categoryName: '', |
| | | businessFormCode: '', |
| | | goodsName: '', |
| | | agencyId: '', |
| | | agencyName: '', |
| | | states: '', |
| | | createName: '', |
| | | fromOutputGoods: [], |
| | | }, |
| | | }; |
| | | }, |
| | | filters: { |
| | | formatTime(time) { |
| | | if (!time) return; |
| | | return DateFormatter.LongToDateTime(time); |
| | | }, |
| | | formatPrice(price) { |
| | | return price / 100 |
| | | } |
| | | }, |
| | | created() { |
| | | outputDetail({ id: this.setting.id }).then((res) => { |
| | | this.detail = res; |
| | | }); |
| | | }, |
| | | methods: { |
| | | close() { |
| | | this.$emit('close') |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | @import url(../../../../styles/store.scss); |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <win-md class="stock-edit" 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-input v-model="formData.departmentName" disabled></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="报废人" prop="createName"> |
| | | <el-input v-model="formData.createName" disabled></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="报废时间" prop="dealTime"> |
| | | <el-date-picker |
| | | v-model="formData.dealTime" |
| | | type="datetime" |
| | | value="yyyy-MM-dd HH:mm:ss" |
| | | value-format="yyyyMMddHHmmss" |
| | | placeholder="请选择日期" |
| | | style="width: 100%" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24" class="headerHeight"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="报废手续" prop="procureDoc"> |
| | | <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.goods" :key="goodsIndex"> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="物品分类" |
| | | :prop="`goods[${goodsIndex}].baseCategoryIds`" |
| | | :rules="{ |
| | | required: true, |
| | | message: '请选择', |
| | | trigger: 'change', |
| | | }" |
| | | > |
| | | <el-cascader |
| | | v-model="goodsItem.baseCategoryIds" |
| | | :options="categoryOptions" |
| | | :props="{ value: 'id' }" |
| | | @change="categoryChange($event, goodsIndex)" |
| | | style="width: 100%" |
| | | ></el-cascader> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="物品名称" |
| | | :prop="`goods[${goodsIndex}].baseGoodsTemplateId`" |
| | | :rules="rules.baseGoodsTemplateId" |
| | | > |
| | | <el-select |
| | | v-model="goodsItem.baseGoodsTemplateId" |
| | | placeholder="请先择物品分类" |
| | | filterable |
| | | :disabled="!goodsItem.baseCategoryId" |
| | | style="width: 100%" |
| | | @change="goodsTemplateChange($event, goodsIndex)" |
| | | > |
| | | <el-option |
| | | v-for="item in goodsItem.goodsOptions" |
| | | :key="item.id" |
| | | :label="item.goodsName" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="选择分发单" :prop="`goods[${goodsIndex}].modelsIds`"> |
| | | <el-input v-if="!goodsItem.baseGoodsTemplateId" placeholder="请先择物品名称" readonly suffix-icon="el-icon-arrow-down" class="cursor-p"></el-input> |
| | | <div v-else @click="fenfaSetting.show=true"> |
| | | <el-input placeholder="请选择" readonly suffix-icon="el-icon-arrow-down" class="cursor-p"></el-input> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="goodsItem.models" :stripe="true"> |
| | | <el-table-column prop="baseGoodsModelsId" label="规格型号" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ getGoodsModelsName(scope.row.baseGoodsModelsId) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="单位" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.unit }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="price" label="现有库存" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.worehouseCount }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="counts" label="报废数量" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-form-item |
| | | label-width="0" |
| | | style="margin-bottom: 0" |
| | | :prop="`goods[${goodsIndex}].models[${scope.$index}].counts`" |
| | | :rules="rules.counts" |
| | | > |
| | | <el-input |
| | | type="number" |
| | | v-model="scope.row.counts" |
| | | @change="countsChange($event, goodsIndex, scope.$index)" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="btn-group"> |
| | | <el-button |
| | | v-if="formData.goods.length > 1" |
| | | name="移除" |
| | | type="danger" |
| | | plain |
| | | size="mini" |
| | | @click="removeGoods(goodsIndex)" |
| | | >移除</el-button |
| | | > |
| | | <el-button |
| | | v-if="formData.goods.length - 1 == goodsIndex" |
| | | name="新增物品" |
| | | type="primary" |
| | | plain |
| | | size="mini" |
| | | @click="addGoods" |
| | | >新增物品</el-button |
| | | > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-form> |
| | | <div slot="footer" align="center" class="dialog-footer"> |
| | | <my-button name="取消" site="form" @click="close" /> |
| | | <my-button name="保存" site="form" @click="handleSubmit" /> |
| | | </div> |
| | | <div v-if="fenfaSetting.show"> |
| | | <win-sm title="选择分发单" @close="fenfaSetting.show=false" :width="'800px'"> |
| | | <el-table :data="fenfaData"> |
| | | <el-table-column type="selection" width="55"> </el-table-column> |
| | | <el-table-column label="分发单号" prop="businessFormCode"></el-table-column> |
| | | <el-table-column label="物品名称" prop="modelName"></el-table-column> |
| | | <el-table-column label="分发数量" prop="fenfaCount"></el-table-column> |
| | | <el-table-column label="剩余数量" prop="count"></el-table-column> |
| | | <el-table-column label="分发时间" prop="time"></el-table-column> |
| | | </el-table> |
| | | <div slot="footer" align="center" class="dialog-footer"> |
| | | <my-button name="取消" site="form" @click="fenfaSetting.show=false" /> |
| | | <my-button name="确定" site="form" @click="handleConfirm" /> |
| | | </div> |
| | | </win-sm> |
| | | </div> |
| | | </win-md> |
| | | </template> |
| | | <script> |
| | | import { |
| | | goodsTemplate, |
| | | goodsModel, |
| | | selectTenantWarehouse, |
| | | warehouseSelectNumber, |
| | | } from '@/api/baseSetting/finsystenant'; |
| | | import { outputAdd } from '@/api/stock/accessStock'; |
| | | import { getTree } from '@/api/foudation/classification'; |
| | | import MyButton from '@/components/myButton/myButton'; |
| | | import winMd from '@/components/win/win-md'; |
| | | import winSm from '@/components/win/win-sm'; |
| | | import upload from '@/components/upload/index'; |
| | | import { getUploadUrl } from '@/utils/base'; |
| | | import { mapGetters } from 'vuex'; |
| | | |
| | | export default { |
| | | components: { MyButton, winMd, winSm, upload }, |
| | | props: { |
| | | setting: { |
| | | type: Object, |
| | | default: () => {}, |
| | | }, |
| | | }, |
| | | data() { |
| | | // 自定义校验 |
| | | // 物品重复校验 |
| | | var checkGoodsTemplateId = (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(new Error('请选择')); |
| | | } |
| | | let temp = this.formData.goods.filter((v) => v.baseGoodsTemplateId == value); |
| | | if (!temp || temp.length != 1) { |
| | | return callback(new Error('已选过此物品')); |
| | | } |
| | | callback(); |
| | | }; |
| | | return { |
| | | loading: false, |
| | | warehouseOptions: [], // 报废仓库列表 |
| | | categoryOptions: [], // 物品分类列表 |
| | | modelList: [], //型号列表 |
| | | fenfaSetting: { |
| | | show: false, |
| | | id: '', |
| | | }, |
| | | fenfaData:[], |
| | | formData: { |
| | | warehouseId: '', // 报废仓库id |
| | | dealTime: '', // 报废时间 |
| | | procureDoc: '', |
| | | goods: [], |
| | | }, |
| | | goodsItem: { |
| | | baseCategoryIds: '', // 分类编号数组 |
| | | baseCategoryId: '', // 分类编号 |
| | | baseGoodsTemplateId: '', // 物品模版编号 |
| | | goodsTemplateName: '', // 物品模版名称 |
| | | goodsOptions: [], // 物品列表select |
| | | modelsOptions: [], //规格型号select |
| | | models: [], // 物品名称 |
| | | modelsIds: [], //规格型号 |
| | | }, |
| | | modelsItem: { |
| | | baseGoodsModelsId: '', // 规格型号编号 |
| | | worehouseCount: 0, |
| | | counts: null, // 操作数量 |
| | | unit: null, //单位 |
| | | }, |
| | | rules: { |
| | | warehouseId: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | dealTime: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | buyType: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | |
| | | baseCategoryIds: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | baseGoodsTemplateId: [{ validator: checkGoodsTemplateId, trigger: ['blur', 'change'] }], |
| | | modelsIds: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | counts: [{ required: true, message: '请输入', trigger: 'change' }], |
| | | }, |
| | | |
| | | uploadSettings: { |
| | | title: '上传', |
| | | max: 20, // 最大大小,单位M |
| | | num: 10, // 支持上传图片个数 |
| | | accept: '.jpg,.png', // 限制格式 |
| | | tip: '', // 提示 默认:`只能上传${this.defaultSettings.num}个${this.defaultSettings.accept}文件,且不超过${this.defaultSettings.max}kb` |
| | | uploadUrl: getUploadUrl(), // 上传路径 |
| | | multiple: true, // 是否支持批量上传 |
| | | disabled: false, // 是否禁用 |
| | | type: 'picture', // text/picture |
| | | }, |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(['userInfo']), |
| | | }, |
| | | created() { |
| | | this.init(); |
| | | }, |
| | | methods: { |
| | | async init() { |
| | | this.getWarehouseList(); |
| | | this.getgoodsTemplate(); |
| | | // 获取物品分类列表 |
| | | const treeRes = await getTree(); |
| | | this.categoryOptions = this.removeEmptyChildren(treeRes); |
| | | this.formData.departmentName = this.userInfo.sysDeptName; |
| | | this.formData.createName = this.userInfo.userName; |
| | | }, |
| | | |
| | | // 获取报废仓库列表 |
| | | getWarehouseList() { |
| | | selectTenantWarehouse({ agencyId: this.userInfo.tenantId }) |
| | | .then((res) => { |
| | | this.warehouseOptions = res; |
| | | if (res.length) { |
| | | this.formData.goods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | } |
| | | if (this.warehouseOptions.length && !this.formData.warehouseId) { |
| | | // 默认选中第一个仓库 |
| | | this.formData.warehouseId = this.warehouseOptions[0].id; |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.log('err', err); |
| | | }); |
| | | }, |
| | | |
| | | removeEmptyChildren(arr) { |
| | | arr.forEach((item) => { |
| | | if (!item.children || !item.children.length) { |
| | | delete item.children; |
| | | } else { |
| | | this.removeEmptyChildren(item.children); |
| | | } |
| | | }); |
| | | return arr; |
| | | }, |
| | | |
| | | // 获取物品名称列表 |
| | | getgoodsTemplate(id, index) { |
| | | goodsTemplate({ categoryId: id || '' }).then((res) => { |
| | | if (index || index == 0) { |
| | | this.$set(this.formData.goods[index], 'goodsOptions', res); |
| | | } else { |
| | | this.goodsTemplatelAll = res; |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 根据物品名称id获取名字 |
| | | getGoodsTemplateName(id) { |
| | | let item = this.goodsTemplatelAll.find((v) => v.id == id); |
| | | if (item) { |
| | | return item.goodsName; |
| | | } |
| | | return; |
| | | }, |
| | | |
| | | // 根据规格型号id获取名字 |
| | | getGoodsModelsName(id) { |
| | | let item = this.goodsModelAll.find((v) => v.id == id); |
| | | if (item) { |
| | | return item.modelName; |
| | | } |
| | | return; |
| | | }, |
| | | |
| | | // 物品分类选择 |
| | | categoryChange(e, index) { |
| | | 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.goods[index].baseCategoryId = e[e.length - 1]; |
| | | // 根据选中分类请求物品名称列表 |
| | | this.getgoodsTemplate(e[e.length - 1], index); |
| | | }, |
| | | |
| | | // 物品名称列表选择 |
| | | goodsTemplateChange(e, index) { |
| | | this.formData.goods[index].modelsOptions = []; |
| | | this.formData.goods[index].modelsIds = []; |
| | | this.formData.goods[index].models = []; |
| | | |
| | | this.formData.goods[index].goodsTemplateName = this.getGoodsTemplateName(e); |
| | | }, |
| | | |
| | | // 上传 |
| | | uploadChange() { |
| | | let arr = this.$refs.uploadRef.fileList; |
| | | this.formData.procureDoc = JSON.stringify(arr); |
| | | }, |
| | | |
| | | // 点击新增物品 |
| | | addGoods() { |
| | | this.formData.goods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | }, |
| | | |
| | | // 点击移除 |
| | | removeGoods(index) { |
| | | this.formData.goods.splice(index, 1); |
| | | }, |
| | | |
| | | // 报废数量校验 |
| | | countsChange(e, goodsIndex, index) { |
| | | const curItem = this.formData.goods[goodsIndex].models[index]; |
| | | const worehouseCount = curItem.worehouseCount; |
| | | if (e == 0) { |
| | | this.$message.warning('数额不能为0'); |
| | | curItem.counts = null; |
| | | } |
| | | if (e > worehouseCount) { |
| | | this.$message.warning('数额超过现有库存'); |
| | | curItem.counts = worehouseCount > 0 ? worehouseCount : null; |
| | | } |
| | | }, |
| | | |
| | | handleConfirm(){ |
| | | |
| | | }, |
| | | |
| | | // 提交 |
| | | handleSubmit() { |
| | | this.$refs['ruleForm'].validate((valid) => { |
| | | if (valid) { |
| | | console.log('this.formData', this.formData); |
| | | outputAdd(this.formData) |
| | | .then((res) => { |
| | | this.$message.success('保存成功!'); |
| | | this.close(); |
| | | this.$emit('search'); |
| | | }) |
| | | .catch((err) => { |
| | | console.log('edit err', err); |
| | | this.$message.error('保存失败'); |
| | | }); |
| | | } else { |
| | | this.$message.error('校验未通过,请检查。'); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | close() { |
| | | this.formData = { |
| | | warehouseId: '', // 报废仓库id |
| | | dealTime: '', // 报废时间 |
| | | goods: [], |
| | | }; |
| | | this.$emit('close'); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | @import url(../../../../styles/store.scss); |
| | | .cursor-p { |
| | | ::v-deep { |
| | | .el-input__inner { |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="app-container stock-container"> |
| | | <el-container> |
| | | <el-container> |
| | | <el-card class="box-card" style="width: 100%" shadow="never"> |
| | | <!--搜索条件--> |
| | | <div class="filter-container"> |
| | | <my-search ref="searchBar" :items="items" @search="fifterForm"></my-search> |
| | | </div> |
| | | <el-row style="margin-top: 15px"> |
| | | <el-col> |
| | | <!--列表--> |
| | | <my-button name="新增" @click="addtable" site="form" /> |
| | | <div :style="{'overflow-y': 'auto', height:`${clientHeight - 320}px`}"> |
| | | <el-row class="card" |
| | | :gutter="5"> |
| | | <el-col v-for="(item, index) in proData" :key="index" class="cm-item"> |
| | | <el-card class="card-data"> |
| | | <div class="card-container"> |
| | | <div class="hed-one">出库单号:{{ item.order_no }}</div> |
| | | <div class="one-hed"> |
| | | <div class="box"><span class="span-two">机构:</span>{{ item.customer_name }}</div> |
| | | <div class="box"><span class="span-two">操作人:</span>{{ item.customer_name }}</div> |
| | | <div class="box"><span class="span-two">出库时间:</span>{{ item.customer_name }}</div> |
| | | </div> |
| | | <div class="card-end"> |
| | | <div v-for="(just, index) in item.data" class="two-end"> |
| | | <div class="item"><span>{{ just.order_no }}:</span>{{ just.customer_name }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="card-but"> |
| | | <my-button name="查看详情" site="form" /> |
| | | <my-button name="导出出库单" site="form" /> |
| | | </div> |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <el-pagination |
| | | :small="false" |
| | | :current-page="1" |
| | | :page-sizes="[5, 10, 20, 50, 100, 200, 300, 400, 500]" |
| | | :page-size="10" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="0" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </el-col> |
| | | </el-row> |
| | | <!--添加/编辑弹窗--> |
| | | <el-dialog title="新增出库" :close-on-click-modal="false" :visible.sync="adddialog" width="60%" > |
| | | <el-form ref="ruleForm" :model="formData" class="demo-ruleForm" label-width="100px"> |
| | | <el-row :gutter="24" class="headerHeight"> |
| | | <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-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" class="headerHeight"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="出库手续" prop="name"> |
| | | 仅允许导入xls、xlsx格式文件 |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <div style="position: relative;"> |
| | | <div style="background-color: #F9F9F9;width: 90%;"> |
| | | <el-row :gutter="24" class=""> |
| | | <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-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" class=""> |
| | | <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-table :data="formData.tableData" height="100%" :stripe="true"> |
| | | <el-table-column prop="projectName" label="规格型号" align="center"> </el-table-column> |
| | | <el-table-column prop="time1" label="单位" align="center"> </el-table-column> |
| | | <el-table-column prop="unit" label="现有库存" align="center"> </el-table-column> |
| | | <el-table-column prop="time2" label="出库数量" align="center"> </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div style="position: absolute;right: 0;top: 152px;"> |
| | | <my-button style="display: block;margin-left: 10px;margin-bottom: 5px;" name="移除" site="form"/> |
| | | <my-button name="新增物品" site="form"/> |
| | | </div> |
| | | </div> |
| | | </el-form> |
| | | <div slot="footer" align="center" class="dialog-footer"> |
| | | <my-button name="确定" site="form" /> |
| | | <my-button name="取消" site="form" @click="adddialog = false"/> |
| | | <el-card class="box-card" style="width: 100%" shadow="never"> |
| | | <!--搜索条件--> |
| | | <div class="filter-container"> |
| | | <my-search ref="searchBar" :items="items" @search="fifterForm"></my-search> |
| | | </div> |
| | | <el-row style="margin-top: 15px"> |
| | | <el-col> |
| | | <!--列表--> |
| | | <div class="table-tool-bar" style="margin-bottom: 15px;"> |
| | | <my-button name="新增" @click="handleAdd" site="tools" size="medium" /> |
| | | </div> |
| | | </el-dialog> |
| | | </el-card> |
| | | </el-container> |
| | | <div :style="{ 'overflow-y': 'auto', height: `${clientHeight - 320}px` }" v-loading="loading"> |
| | | <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"> |
| | | <div class="card-header"> |
| | | <div class="card-header-left"> |
| | | <span>报废单号:</span> |
| | | <span class="value">{{ item.businessFormCode }}</span> |
| | | </div> |
| | | <div class="card-header-right"> |
| | | <el-button site="form" type="success" size="mini" @click="handleExport(item)" |
| | | >导出报废单</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.agencyName }}</div> |
| | | <div class="box"><span class="span-two">操作人:</span>{{ item.operatorName }}</div> |
| | | <div class="box"> |
| | | <span class="span-two">报废时间:</span>{{ item.dealTime | formatTime }} |
| | | </div> |
| | | </div> |
| | | <div class="card-end"> |
| | | <div v-for="(just, index) in item.formOutputTemplateInfoList" :key="index" class="item"> |
| | | <div class="name">{{ just.goodsName }}</div> |
| | | <div class="value-box"> |
| | | <div class="value-box-item"> |
| | | <span class="label">数量:</span> |
| | | <span class="value">{{ just.count }}</span> |
| | | <span class="unit">{{ just.unit }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="no-data" v-else>暂无数据</div> |
| | | </div> |
| | | <el-pagination |
| | | :small="false" |
| | | :current-page="pageNum" |
| | | :page-sizes="[5, 10, 20, 50, 100, 200, 300, 400, 500]" |
| | | :page-size="pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | </el-container> |
| | | <my-import |
| | | :import-setting="importSetting" |
| | | :dialog-show="importSetting.dialogShow" |
| | | :dialog-title="importSetting.dialogTitle" |
| | | /> |
| | | <!--添加/编辑弹窗--> |
| | | <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> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import MyButton from "@/components/myButton/myButton"; |
| | | import SettingIplatform from '@/utils/settingIplatform'; |
| | | import myImport from '@/views/components/myImport' |
| | | import {getBaseUrl} from '@/utils/base'; |
| | | import { outputList } from '@/api/stock/accessStock'; |
| | | import MyButton from '@/components/myButton/myButton'; |
| | | import myImport from '@/views/components/myImport'; |
| | | import edit from './edit'; |
| | | import detail from './detail'; |
| | | import listPage from '../../../mixins/listPage' |
| | | |
| | | export default { |
| | | name: "index", |
| | | components: {MyButton, myImport}, |
| | | name: 'index', |
| | | mixins: [listPage], |
| | | components: { MyButton, myImport, edit, detail }, |
| | | data() { |
| | | return { |
| | | |
| | | adddialog: false, |
| | | formData:{ |
| | | tableData:[ |
| | | { |
| | | projectName:'555' |
| | | }, |
| | | { |
| | | projectName:'444' |
| | | } |
| | | ], |
| | | }, |
| | | list: [], |
| | | // 搜索框 |
| | | items: [ |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '出库单号', |
| | | dataIndex: 'businessFormCode', |
| | | label: '报废单号', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'businessFormCode', |
| | | label: '分发部门', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | options:[] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | dataIndex: 'goodsName', |
| | | label: '物品名称', |
| | | placeholder: '可模糊搜索', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '创建人', |
| | | dataIndex: 'createName', |
| | | label: '报废人', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val1', |
| | | label: '出库时间', |
| | | defaultValue: '' |
| | | dataIndex: 'startTime', |
| | | label: '报废时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val2', |
| | | dataIndex: 'endTime', |
| | | label: '至', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | // { |
| | | // type: 'select', |
| | | // dataIndex: 'status', |
| | | // label: '状态', |
| | | // placeholder: '请选择', |
| | | // defaultValue: '1', |
| | | // options: [ |
| | | // { |
| | | // label: '启用', |
| | | // value: '1' |
| | | // }, |
| | | // { |
| | | // label: '禁用', |
| | | // value: '0' |
| | | // } |
| | | // ] |
| | | // } |
| | | ], |
| | | proData: [ |
| | | { |
| | | order_no:'55555', |
| | | customer_name:'666', |
| | | data:[ |
| | | { |
| | | order_no:'石勒芬褐色碳粉', |
| | | customer_name:'20件' |
| | | }, |
| | | { |
| | | order_no:'石勒芬褐色碳粉', |
| | | customer_name:'666' |
| | | }, |
| | | ] |
| | | }, |
| | | { |
| | | order_no:'55555', |
| | | customer_name:'666', |
| | | data:[ |
| | | { |
| | | order_no:'石勒芬褐色碳粉', |
| | | customer_name:'666' |
| | | }, |
| | | { |
| | | order_no:'石勒芬褐色碳粉', |
| | | customer_name:'666' |
| | | }, |
| | | { |
| | | order_no:'石勒芬褐色碳粉', |
| | | customer_name:'666' |
| | | }, |
| | | { |
| | | order_no:'石勒芬褐色碳粉', |
| | | customer_name:'666' |
| | | }, |
| | | { |
| | | order_no:'石勒芬褐色碳粉', |
| | | customer_name:'666' |
| | | }, |
| | | ] |
| | | }, |
| | | { |
| | | order_no:'55555', |
| | | customer_name:'666', |
| | | data:[ |
| | | { |
| | | order_no:'石勒芬褐色碳粉', |
| | | customer_name:'20件' |
| | | }, |
| | | { |
| | | order_no:'石勒芬褐色碳粉', |
| | | customer_name:'666' |
| | | }, |
| | | ] |
| | | }, |
| | | { |
| | | order_no:'55555', |
| | | customer_name:'666', |
| | | data:[ |
| | | { |
| | | order_no:'石勒芬褐色碳粉', |
| | | customer_name:'20件' |
| | | }, |
| | | { |
| | | order_no:'石勒芬褐色碳粉', |
| | | customer_name:'666' |
| | | }, |
| | | ] |
| | | |
| | | }, |
| | | { |
| | | order_no:'55555', |
| | | customer_name:'666', |
| | | data:[ |
| | | { |
| | | order_no:'石勒芬褐色碳粉', |
| | | customer_name:'20件' |
| | | }, |
| | | { |
| | | order_no:'石勒芬褐色碳粉', |
| | | customer_name:'666' |
| | | }, |
| | | ] |
| | | |
| | | }, |
| | | { |
| | | order_no:'55555', |
| | | customer_name:'666', |
| | | data:[ |
| | | { |
| | | order_no:'石勒芬褐色碳粉', |
| | | customer_name:'20件' |
| | | }, |
| | | { |
| | | order_no:'石勒芬褐色碳粉', |
| | | customer_name:'666' |
| | | }, |
| | | ] |
| | | |
| | | }, |
| | | { |
| | | order_no:'55555', |
| | | customer_name:'666', |
| | | data:[ |
| | | { |
| | | order_no:'石勒芬褐色碳粉', |
| | | customer_name:'20件' |
| | | }, |
| | | { |
| | | order_no:'石勒芬褐色碳粉', |
| | | customer_name:'666' |
| | | }, |
| | | ] |
| | | |
| | | } |
| | | ], |
| | | // 树数据 |
| | | treeDataList: [], |
| | | // 搜索条件 |
| | | filterFrom: { |
| | | tenantId: null, |
| | | userName: null, |
| | | userPhone: null, |
| | | 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 |
| | | }, |
| | | editSetting: { |
| | | title: '', |
| | | id: '', |
| | | orgId: '', |
| | | show: false, |
| | | }, |
| | | } |
| | | }, |
| | | computed: { |
| | | clientHeight () { |
| | | return document.documentElement.clientHeight |
| | | }, |
| | | }, |
| | | created() { |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleSizeChange(){}, |
| | | handleCurrentChange(){}, |
| | | //导入 |
| | | 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() |
| | | } |
| | | }, |
| | | |
| | | addtable() { |
| | | this.adddialog = true |
| | | }, |
| | | // 查询table列表 |
| | | search(pageNum) { |
| | | if (pageNum != undefined) { |
| | | // this.$refs.myTable.search(pageNum) |
| | | } else { |
| | | // this.$refs.myTable.search() |
| | | } |
| | | fetchData() { |
| | | this.loading = true; |
| | | outputList({ |
| | | pageNum: this.pageNum, |
| | | pageSize: this.pageSize, |
| | | ...this.filterFrom, |
| | | }).then((res) => { |
| | | this.list = res.datas; |
| | | this.total = res.totalRows; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | fifterForm(params) { |
| | | console.log(params,'555'); |
| | | this.filterFrom = Object.assign(this.filterFrom, params) |
| | | this.search(1) |
| | | } |
| | | } |
| | | } |
| | | this.filterFrom = Object.assign(this.filterFrom, params); |
| | | if (this.filterFrom.startTime) { |
| | | this.filterFrom.startTime = this.filterFrom.startTime.replace(/\-/g, ''); |
| | | } |
| | | if (this.filterFrom.endTime) { |
| | | this.filterFrom.endTime = this.filterFrom.endTime.replace(/\-/g, ''); |
| | | } |
| | | if (this.filterFrom.agencyId&&this.filterFrom.agencyId.length) { |
| | | this.filterFrom.agencyId = this.filterFrom.agencyId[this.filterFrom.agencyId.length - 1]; |
| | | } |
| | | this.search(1); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .card { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | margin: 0px !important; |
| | | .cm-item { |
| | | width: 100%; |
| | | } |
| | | .cm-item /deep/ .el-card__body { |
| | | padding: 10px; |
| | | } |
| | | } |
| | | .card-data{ |
| | | margin-top: 8px; |
| | | .card-container{ |
| | | display: inline-block; |
| | | width: 70%; |
| | | .hed-one{ |
| | | color: #2298EE; |
| | | font-size: 18px; |
| | | } |
| | | .one-hed{ |
| | | margin-top: 15px; |
| | | .box{ |
| | | display: inline-block; |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | .span-two{ |
| | | color: #83919e; |
| | | font-size: 14px; |
| | | } |
| | | .card-end{ |
| | | font-size: 14px; |
| | | color: #3d3d3d; |
| | | margin-top: 15px; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | .two-end{ |
| | | width: calc(33.33% - 20px); |
| | | margin-bottom: 15px; |
| | | } |
| | | } |
| | | |
| | | } |
| | | .card-but{ |
| | | display: inline-block; |
| | | } |
| | | .end{ |
| | | display: inline-block; |
| | | } |
| | | |
| | | } |
| | | |
| | | <style scoped lang="scss"> |
| | | @import url(../../../../styles/store.scss); |
| | | </style> |
| | |
| | | <el-tree ref="tree" :data="treeData" node-key="id" :props="defaultProps" default-expand-all> |
| | | <template slot-scope="{ node, data }"> |
| | | <div v-if="data.type != 'user'">{{ data.name }}</div> |
| | | <div v-else class="leaf-node" :class="data.checked ? 'checked' : ''" @click="handleCheckItem(node, data)"> |
| | | <div v-else class="leaf-node" :class="data.checked ? 'checked' : ''" @click="handleCheckItem(data)"> |
| | | {{ data.name }} |
| | | </div> |
| | | </template> |
| | |
| | | children: 'children', |
| | | label: 'name', |
| | | }, |
| | | key: Math.random(), |
| | | }; |
| | | }, |
| | | computed: { |
| | | checkedKeys() { |
| | | console.log( |
| | | 1111, |
| | | this.selectdSections.map((v) => v.id), |
| | | ); |
| | | return this.selectdSections.map((v) => v.id); |
| | | }, |
| | | }, |
| | |
| | | if (this.setting.info) { |
| | | this.formData = Object.assign({}, JSON.parse(this.setting.info)); |
| | | } |
| | | this.initTree(); |
| | | this.init(); |
| | | warehouseManagerList({ warehouseId: this.formData.id }).then((res) => { |
| | | console.log(res); |
| | | this.selectdSections = res.map((item) => { |
| | | item.name = item.managerName; |
| | | item.id = item.managerId; |
| | | return item; |
| | | }); |
| | | this.key = Math.random(); |
| | | }); |
| | | }, |
| | | methods: { |
| | | initTree() { |
| | | userSelectDepartment({ agencyId: this.formData.agencyId }).then((res) => { |
| | | this.treeData = [res]; |
| | | async init() { |
| | | let managerRes = await warehouseManagerList({ warehouseId: this.formData.id }); |
| | | this.managerListStr = JSON.stringify(managerRes); |
| | | const res = await userSelectDepartment({ agencyId: this.formData.agencyId }); |
| | | this.treeData = this.deepList([res]); |
| | | }, |
| | | deepList(list) { |
| | | return list.map((item) => { |
| | | if (item.children && item.children.length) { |
| | | this.deepList(item.children); |
| | | } else { |
| | | if (this.managerListStr.includes(item.id)) { |
| | | item.checked = true; |
| | | } else { |
| | | item.checked = false; |
| | | } |
| | | } |
| | | return item; |
| | | }); |
| | | }, |
| | | handleCheckItem(node, data) { |
| | | handleCheckItem(data) { |
| | | this.selectdSections = []; |
| | | this.treeData[0].children.forEach((item, index) => { |
| | | if (item.children) { |
| | |
| | | }); |
| | | } |
| | | }); |
| | | console.log(this.treeData); |
| | | }, |
| | | handleDel(item) { |
| | | this.handleCheckItem({}, item); |
| | | this.handleCheckItem(item); |
| | | }, |
| | | handleClear() { |
| | | this.selectdSections.forEach((item) => { |
| | | this.handleCheckItem({}, item); |
| | | this.handleCheckItem(item); |
| | | }); |
| | | this.selectdSections = []; |
| | | }, |
| | |
| | | this.$emit('close'); |
| | | }, |
| | | save() { |
| | | let params = []; |
| | | let params = { |
| | | warehouseId: this.setting.id, |
| | | warehouseManagerInfoList: [], |
| | | }; |
| | | this.selectdSections.forEach((item) => { |
| | | params.push({ |
| | | params.warehouseManagerInfoList.push({ |
| | | managerId: item.id, |
| | | managerName: item.name, |
| | | baseWarehouseId: this.setting.id, |
| | | }); |
| | | }); |
| | | debugger; |
| | | warehouseManagerAdd(params).then((res) => { |
| | | if (res) { |
| | | this.$message.success('保存成功!'); |
| | | this.close(); |
| | | this.$emit('search'); |
| | | } else { |
| | | this.$message.error('保存失败'); |
| | | } |
| | | this.$message.success('保存成功!'); |
| | | this.close(); |
| | | this.$emit('search'); |
| | | }); |
| | | }, |
| | | }, |
| | |
| | | import winSm from '@/components/win/win-sm'; |
| | | import myButton from '@/components/myButton/myButton'; |
| | | import {formatDate} from '@/utils/DateFormatter' |
| | | import { mapGetters } from 'vuex'; |
| | | |
| | | export default { |
| | | components: { winSm, myButton }, |
| | |
| | | }, |
| | | }; |
| | | }, |
| | | computed:{ |
| | | ...mapGetters(['userInfo']) |
| | | }, |
| | | created() { |
| | | if (this.setting.info) { |
| | | this.formData = Object.assign({}, JSON.parse(this.setting.info)); |
| | |
| | | methods: { |
| | | // 获取仓库列表 |
| | | handleSelectTenantWarehouse() { |
| | | selectTenantWarehouse().then((res) => { |
| | | selectTenantWarehouse({agencyId:this.userInfo.tenantId}).then((res) => { |
| | | this.warehouseOptions = res; |
| | | }); |
| | | }, |
| | |
| | | {{ scope.row.unit }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="price" label="现有库存" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.price }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="counts" label="调拨数量" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.counts }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="price" label="金额" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.price }} |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | // 入库 |
| | | handleIncome(row) { |
| | | this.$confirm(`您确定 单号:${row.businessFormCode} 调拨出库吗?`, '调拨出库').then(() => { |
| | | this.$confirm(`您确定 单号:${row.businessFormCode} 接收入库吗?`, '接收入库').then(() => { |
| | | transfeIncome({ id: row.id }).then((res) => { |
| | | this.$message.success('调拨出库成功!'); |
| | | this.$message.success('接收入库成功!'); |
| | | this.search(1); |
| | | }); |
| | | }); |
| | |
| | | <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"/> |
| | | <detail |
| | | v-if="detailSetting.show" |
| | | :setting="detailSetting" |
| | | @close="detailSetting.show = false" |
| | | @search="search" |
| | | /> |
| | | </el-card> |
| | | </el-container> |
| | | </el-container> |
| | | <my-import |
| | | :import-setting="importSetting" |
| | | :dialog-show="importSetting.dialogShow" |
| | | :dialog-title="importSetting.dialogTitle" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import MyTableV2 from "@/components/myTable/myTableV2"; |
| | | import MyButton from "@/components/myButton/myButton"; |
| | | import MyTableV2 from '@/components/myTable/myTableV2'; |
| | | import MyButton from '@/components/myButton/myButton'; |
| | | import SettingIplatform from '@/utils/settingIplatform'; |
| | | import edit from './edit' |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant' |
| | | import myImport from '@/views/components/myImport' |
| | | import {getBaseUrl} from '@/utils/base'; |
| | | import detail from '../transferApplication/detail'; |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant'; |
| | | import myImport from '@/views/components/myImport'; |
| | | import { getBaseUrl } from '@/utils/base'; |
| | | import { goodsModel } from '@/api/baseSetting/finsystenant'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | |
| | | export default { |
| | | name: "index", |
| | | components: {MyButton, MyTableV2, edit, myImport}, |
| | | name: 'index', |
| | | components: { MyButton, MyTableV2, detail, myImport }, |
| | | data() { |
| | | return { |
| | | // 搜索框 |
| | | items: [ |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | dataIndex: 'businessFormCode', |
| | | label: '单号', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | dataIndex: 'goodsName', |
| | | label: '物品名称', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'warehouseId', |
| | | dataIndex: 'baseGoodsModelsId', |
| | | label: '规格型号', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | dataIndex: 'name', |
| | | dataIndex: 'outAgencyId', |
| | | label: '调拨机构', |
| | | placeholder: '请选择', |
| | | optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null }, |
| | |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | dataIndex: 'name', |
| | | dataIndex: 'inAgencyId', |
| | | label: '接收机构', |
| | | placeholder: '请选择', |
| | | optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null }, |
| | |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'status', |
| | | label: '类型', |
| | | placeholder: '请选择', |
| | | defaultValue: '1', |
| | | options: [ |
| | | { |
| | | label: '启用', |
| | | value: '1' |
| | | }, |
| | | { |
| | | label: '禁用', |
| | | value: '0' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '物品名称', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | dataIndex: 'operatorName', |
| | | label: '创建人', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | |
| | | defaultValue: '', |
| | | }, |
| | | ], |
| | | // 树数据 |
| | | treeDataList: [], |
| | | // 搜索条件 |
| | | filterFrom: { |
| | | 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 |
| | | }, |
| | | editSetting: { |
| | | detailSetting: { |
| | | title: '', |
| | | id: '', |
| | | orgId: '', |
| | | show: false, |
| | | }, |
| | | // 表格数据 |
| | | table: { |
| | | showIndex: true, // 是否显示序号 |
| | | expand: false, // 是否显示详情数据 |
| | | url: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/select/list', // 请求地址 |
| | | url: SettingIplatform.apiBaseURL + '/pc/l/wh/form/transfer/detail/list', // 请求地址 |
| | | // 工具条 |
| | | tools: { |
| | | columnsCtrl: {// 列控制按钮 |
| | | show: false |
| | | columnsCtrl: { |
| | | // 列控制按钮 |
| | | show: false, |
| | | }, |
| | | generalExport: {// 通用导出按钮 |
| | | show: false |
| | | generalExport: { |
| | | // 通用导出按钮 |
| | | show: false, |
| | | }, |
| | | // 自定义工具条按钮 |
| | | custom: [ |
| | | ] |
| | | custom: [], |
| | | }, |
| | | // 列信息 |
| | | columns: [ |
| | | {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',}, |
| | | {title: '调拨时间', field: 'summary', align: 'left',}, |
| | | { title: '单号', field: 'businessFormCode', align: 'center' }, |
| | | { title: '物品名称', field: 'goodsName', align: 'center' }, |
| | | { title: '规格型号', field: 'baseGoodsModelsName', align: 'center' }, |
| | | { title: '数量', field: 'counts', align: 'left' }, |
| | | { title: '接受机构', field: 'inAgencyName', align: 'left' }, |
| | | { title: '创建人', field: 'operatorName', align: 'left' }, |
| | | { |
| | | title: '申请时间', |
| | | field: 'createTime', |
| | | align: 'center', |
| | | width: 160, |
| | | formatter: (row) => { |
| | | return { value: DateFormatter.LongToDateTime(row.createTime) }; |
| | | }, |
| | | }, |
| | | { |
| | | title: '接收时间', |
| | | field: 'inTime', |
| | | align: 'center', |
| | | width: 160, |
| | | formatter: (row) => { |
| | | return { value: row.inTime ? DateFormatter.LongToDateTime(row.inTime) : '-' }; |
| | | }, |
| | | }, |
| | | { title: '调拨机构', field: 'outAgencyName', align: 'left' }, |
| | | { |
| | | title: '调拨人', |
| | | field: 'outOperatorName', |
| | | align: 'center', |
| | | formatter: (row) => { |
| | | return { value: row.outOperatorName || '-' }; |
| | | }, |
| | | }, |
| | | { |
| | | title: '调拨时间', |
| | | field: 'outputTime', |
| | | align: 'center', |
| | | width: 160, |
| | | formatter: (row) => { |
| | | return { value: row.outputTime ? DateFormatter.LongToDateTime(row.outputTime) : '-' }; |
| | | }, |
| | | }, |
| | | ], |
| | | // 操作信息 |
| | | operation: { |
| | |
| | | { |
| | | title: '详情', |
| | | events: (row) => { |
| | | this.showAudit(row); |
| | | this.showDetail(row); |
| | | }, |
| | | }, |
| | | ], |
| | |
| | | small: false, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | total: 0 |
| | | } |
| | | } |
| | | total: 0, |
| | | }, |
| | | }, |
| | | }, |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | // 获取机构树 |
| | | this.initTreeData() |
| | | this.initSearch(); |
| | | }, |
| | | 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) => { |
| | | initSearch() { |
| | | this.items.map(async (item) => { |
| | | if (item.label == '规格型号') { |
| | | let res = await goodsModel(); |
| | | item.options = res.map((v) => { |
| | | v.label = v.modelName; |
| | | v.value = v.id; |
| | | return v; |
| | | }); |
| | | }) |
| | | .then((res) => { |
| | | this.$message.success('删除成功!'); |
| | | this.search() |
| | | }) |
| | | .catch(() => { |
| | | }); |
| | | } |
| | | return item; |
| | | }); |
| | | }, |
| | | 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.info = JSON.stringify(row); |
| | | this.detailSetting.title = '详情'; |
| | | this.detailSetting.show = true; |
| | | }, |
| | | // 查询table列表 |
| | | search(pageNum) { |
| | | if (pageNum != undefined) { |
| | | this.$refs.myTable.search(pageNum) |
| | | this.$refs.myTable.search(pageNum); |
| | | } else { |
| | | this.$refs.myTable.search() |
| | | this.$refs.myTable.search(); |
| | | } |
| | | }, |
| | | fifterForm(params) { |
| | | this.filterFrom = Object.assign(this.filterFrom, params) |
| | | this.search(1) |
| | | } |
| | | } |
| | | } |
| | | this.filterFrom = Object.assign(this.filterFrom, params); |
| | | if (this.filterFrom.outAgencyId && this.filterFrom.outAgencyId.length) { |
| | | this.filterFrom.outAgencyId = this.filterFrom.outAgencyId[this.filterFrom.outAgencyId.length - 1]; |
| | | } |
| | | if (this.filterFrom.inAgencyId && this.filterFrom.inAgencyId.length) { |
| | | this.filterFrom.inAgencyId = this.filterFrom.inAgencyId[this.filterFrom.inAgencyId.length - 1]; |
| | | } |
| | | if (this.filterFrom.createTimeStart) { |
| | | this.filterFrom.createTimeStart = this.filterFrom.createTimeStart.replace(/\-/g, ''); |
| | | } |
| | | if (this.filterFrom.createTimeEnd) { |
| | | this.filterFrom.createTimeEnd = this.filterFrom.createTimeEnd.replace(/\-/g, ''); |
| | | } |
| | | if (this.filterFrom.startTime) { |
| | | this.filterFrom.startTime = this.filterFrom.startTime.replace(/\-/g, ''); |
| | | } |
| | | if (this.filterFrom.endTime) { |
| | | this.filterFrom.endTime = this.filterFrom.endTime.replace(/\-/g, ''); |
| | | } |
| | | this.search(1); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | {{ scope.row.unit }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="price" label="现有库存" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.price }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="counts" label="调拨数量" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.counts }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="price" label="金额" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.price }} |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |