| | |
| | | name: 'App', |
| | | }; |
| | | </script> |
| | | <style> |
| | | </style> |
| | |
| | | |
| | | //数据字典下拉类 |
| | | data_dict:"/admin/component/data_dict", |
| | | |
| | | //机构下拉类 |
| | | cascader_tree_fin_tenant:"/pc/fin/sys/tenant/select/tree_fin_tenant", |
| | | |
| | | }; |
| | |
| | | params, |
| | | }); |
| | | } |
| | | // 明细详情 |
| | | export function outputDtailList(params) { |
| | | return request({ |
| | | url: '/pc/l/wh/form/output/detail/list', |
| | | method: 'get', |
| | | params, |
| | | }); |
| | | } |
| | | |
New file |
| | |
| | | import request from '@/utils/request'; |
| | | |
| | | // 单据新增 |
| | | export function transferAdd(data) { |
| | | return request({ |
| | | url: '/pc/l/wh/form/transfer/add', |
| | | method: 'post', |
| | | data, |
| | | }); |
| | | } |
| | | // 列表 |
| | | export function transferList(params) { |
| | | return request({ |
| | | url: '/pc/l/wh/form/transfer/list', |
| | | method: 'get', |
| | | params, |
| | | }); |
| | | } |
| | | |
| | | // 查询父级机构 |
| | | export function getParentTenant(params) { |
| | | return request({ |
| | | url: '/pc/fin/sys/tenant/get/parent/tenant', |
| | | method: 'get', |
| | | params, |
| | | }); |
| | | } |
| | | // 查询父级机构下的物品 |
| | | export function queryWarehouseGoods(params) { |
| | | return request({ |
| | | url: '/pc/base/goods/template/query/warehouse/goods', |
| | | method: 'get', |
| | | params, |
| | | }); |
| | | } |
| | | |
| | | // 详情 |
| | | export function transferDetail(params) { |
| | | return request({ |
| | | url: '/pc/l/wh/form/transfer/detail', |
| | | method: 'get', |
| | | params, |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 出库 |
| | | export function transferOutput(params) { |
| | | return request({ |
| | | url: '/pc/l/wh/form/transfer/output', |
| | | method: 'post', |
| | | params, |
| | | }); |
| | | } |
| | | |
| | | // 入库 |
| | | export function transfeIncome(params) { |
| | | return request({ |
| | | url: '/pc/l/wh/form/transfer/income', |
| | | method: 'post', |
| | | params, |
| | | }); |
| | | } |
| | | |
| | | // 撤销 |
| | | export function transferUpdStatus(params) { |
| | | return request({ |
| | | url: '/pc/l/wh/form/transfer/updStatus', |
| | | method: 'post', |
| | | params, |
| | | }); |
| | | } |
| | | |
| | | // 导出 |
| | | export function transferExport(params) { |
| | | return request({ |
| | | url: '/pc/l/wh/form/transfer/export', |
| | | method: 'get', |
| | | params, |
| | | }); |
| | | } |
| | |
| | | this.mySize = this.tools.size |
| | | this.myPlain = this.tools.plain |
| | | this.myType = this.tools.type |
| | | if (this.icons != null) { |
| | | this.myIcon = this.icons |
| | | if (this.icon != null) { |
| | | this.myIcon = this.icon |
| | | } else { |
| | | this.myIcon = this.tools.other[this.myName].icon |
| | | } |
| | |
| | | button{ |
| | | font-family: sans-serif!important; |
| | | } |
| | | |
| | | .viewer-container{ |
| | | z-index: 9999!important; |
| | | } |
| | |
| | | |
| | | import Cookies from 'js-cookie'; |
| | | /** |
| | | * Created by PanJiaChen on 16/11/18. |
| | |
| | | return staff.some((item) => item.avatar === JavaInfo.account); |
| | | } |
| | | } |
| | | |
| | | // 通过子集id查到所以相关父级id并返回数组 |
| | | export function findParentIds(dataSource, nodeId) { |
| | | const parentIds = [nodeId]; // 用于存储所有父节点ID的数组 |
| | | |
| | | // 定义一个递归函数,用于遍历整棵树并查找子节点的所有父节点 |
| | | function traverse(node, nodeId) { |
| | | if (node.id === nodeId) { |
| | | // 如果当前节点的ID等于子节点的ID,则表示已经找到了子节点,可以开始向上查找父节点 |
| | | return true; // 返回true表示已经找到了子节点 |
| | | } |
| | | |
| | | if (node.children) { |
| | | // 如果当前节点有子节点,则继续遍历子节点 |
| | | for (const childNode of node.children) { |
| | | if (traverse(childNode, nodeId)) { |
| | | // 如果在子节点中找到了子节点的父节点,则将当前节点的ID添加到父节点ID数组中,并返回true表示已经找到了子节点 |
| | | parentIds.unshift(node.id); |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; // 如果当前节点不是子节点的父节点,则返回false |
| | | } |
| | | |
| | | // 从根节点开始遍历整棵树,并调用递归函数查找子节点的所有父节点 |
| | | for (const node of dataSource) { |
| | | if (traverse(node, nodeId)) { |
| | | // 如果在当前节点的子树中找到了子节点的父节点,则直接退出循环 |
| | | break; |
| | | } |
| | | } |
| | | |
| | | return parentIds; // 返回所有父节点ID的数组 |
| | | } |
| | |
| | | import winMd from '@/components/win/win-md' |
| | | import myButton from '@/components/myButton/myButton' |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant' |
| | | import {mapGetters} from 'vuex' |
| | | |
| | | export default { |
| | | components: {winMd, myButton}, |
| | |
| | | states: 1, |
| | | summary: '', |
| | | categoryId: null, |
| | | agencyId:'', |
| | | agencyName:'', |
| | | models:[ |
| | | { |
| | | modelName:'', |
| | |
| | | } |
| | | } |
| | | }, |
| | | computed:{ |
| | | ...mapGetters(['userInfo']) |
| | | }, |
| | | created() { |
| | | this.tree_List() |
| | | if(this.setting.info){ |
| | | this.formData = Object.assign({},JSON.parse(this.setting.info)) |
| | | } |
| | | if(!this.formData.agencyId) { |
| | | this.formData.agencyId = this.userInfo.tenantId |
| | | this.formData.agencyName = this.userInfo.tenantName |
| | | } |
| | | }, |
| | | methods: { |
| | | tree_List (){ |
New file |
| | |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | import { mapGetters } from 'vuex'; |
| | | export default { |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | list: [], |
| | | items:[], |
| | | filterFrom:{}, |
| | | editSetting: { |
| | | title: '', |
| | | id: '', |
| | | orgId: '', |
| | | show: false, |
| | | }, |
| | | detailSetting: { |
| | | title: '详情', |
| | | id: '', |
| | | show: false, |
| | | }, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | total: 0, |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(['userInfo']), |
| | | clientHeight() { |
| | | return document.documentElement.clientHeight; |
| | | }, |
| | | }, |
| | | created() { |
| | | this.fetchData(); |
| | | }, |
| | | filters: { |
| | | formatTime(time) { |
| | | if (!time) return '-'; |
| | | return DateFormatter.LongToDateTime(time); |
| | | }, |
| | | }, |
| | | methods:{ |
| | | fetchData() {}, |
| | | // 导出 |
| | | handleExport() {}, |
| | | // 新增 |
| | | handleAdd() { |
| | | this.editSetting.id = null; |
| | | this.editSetting.info = null; |
| | | this.editSetting.title = '新增'; |
| | | this.editSetting.show = true; |
| | | }, |
| | | // 编辑 |
| | | handleEdit(row) { |
| | | this.editSetting.id = row.id; |
| | | this.editSetting.info = null; |
| | | this.editSetting.title = '编辑'; |
| | | this.editSetting.show = true; |
| | | }, |
| | | // 详情 |
| | | handleDetail(row) { |
| | | this.detailSetting.id = row.id; |
| | | this.detailSetting.title = '详情'; |
| | | this.detailSetting.show = true; |
| | | }, |
| | | // 分页 |
| | | handleSizeChange(pageSize) { |
| | | this.pageSize = pageSize; |
| | | this.search({ pageNum: 1 }); |
| | | }, |
| | | handleCurrentChange(pageNum) { |
| | | this.pageNum = pageNum; |
| | | this.search(); |
| | | }, |
| | | // 查询table列表 |
| | | search(pageNum) { |
| | | if(pageNum){ |
| | | this.pageNum = pageNum |
| | | } |
| | | this.fetchData(); |
| | | }, |
| | | refreshData() { |
| | | this.pageNum = 1; |
| | | this.pageSize = 10; |
| | | this.search(); |
| | | }, |
| | | fifterForm(params) { |
| | | this.filterFrom = Object.assign(this.filterFrom, params); |
| | | this.search(1); |
| | | }, |
| | | } |
| | | } |
New file |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | statesOptions:[ |
| | | { |
| | | label: '全部', |
| | | value: '', |
| | | }, |
| | | { |
| | | label: '待出库', |
| | | value: '0', |
| | | }, |
| | | { |
| | | label: '待接收', |
| | | value: '1', |
| | | }, |
| | | { |
| | | label: '已接收', |
| | | value: '2', |
| | | }, |
| | | { |
| | | label: '已撤销', |
| | | value: '4', |
| | | }, |
| | | ] |
| | | } |
| | | }, |
| | | methods:{ |
| | | getStatesLabel(value) { |
| | | let item = this.statesOptions.find(v=>v.value==value) |
| | | return item ? item.label : '' |
| | | } |
| | | } |
| | | } |
| | |
| | | <el-row :gutter="20" style="margin-top: 20px"> |
| | | <el-col :span="8"> |
| | | <span>创建人:</span> |
| | | <span>{{ detail.buyerName }}</span> |
| | | <span>{{ detail.operatorName }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>出库时间:</span> |
| | | <span>{{ detail.incomeTime | formatTime }}</span> |
| | | <span>{{ detail.dealTime | formatTime }}</span> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" style="margin-top: 20px"> |
| | | <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.goods" :key="goodsIndex"> |
| | | <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.baseCategoryName }}</span> |
| | | <span>{{ goodsItem.categoryName }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>物品名称:</span> |
| | | <span>{{ goodsItem.goodsTemplateName }}</span> |
| | | <span>{{ goodsItem.goodsName }}</span> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="goodsItem.models" :stripe="true" style="margin-top: 20px"> |
| | |
| | | data() { |
| | | return { |
| | | detail: { |
| | | baseCategoryName: '', |
| | | categoryName: '', |
| | | businessFormCode: '', |
| | | goodsTemplateName: '', |
| | | goodsName: '', |
| | | agencyId: '', |
| | | agencyName: '', |
| | | states: '', |
| | | createName: '', |
| | | goods: [], |
| | | fromOutputGoods: [], |
| | | }, |
| | | }; |
| | | }, |
| | |
| | | }); |
| | | }, |
| | | methods: { |
| | | close() {}, |
| | | close() { |
| | | this.$emit('close') |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | <el-form-item |
| | | label="物品名称" |
| | | :prop="`goods[${goodsIndex}].baseGoodsTemplateId`" |
| | | :rules="{ |
| | | required: true, |
| | | message: '请选择', |
| | | trigger: 'change', |
| | | }" |
| | | :rules="rules.baseGoodsTemplateId" |
| | | > |
| | | <el-select |
| | | v-model="goodsItem.baseGoodsTemplateId" |
| | |
| | | </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> |
| | |
| | | import winMd from '@/components/win/win-md'; |
| | | import upload from '@/components/upload/index'; |
| | | import { getUploadUrl } from '@/utils/base'; |
| | | |
| | | import SettingIplatform from '../../../../../public/static/config'; |
| | | import {mapGetters} from 'vuex' |
| | | |
| | | export default { |
| | | components: { MyButton, winMd, upload }, |
| | |
| | | }, |
| | | }, |
| | | 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: [], // 出库仓库列表 |
| | |
| | | modelsItem: { |
| | | baseGoodsModelsId: '', // 规格型号编号 |
| | | worehouseCount: 0, |
| | | counts: 0, // 操作数量 |
| | | counts: null, // 操作数量 |
| | | unit: null, //单位 |
| | | }, |
| | | rules: { |
| | |
| | | dealTime: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | buyType: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | |
| | | procureDoc: [{ required: true, message: '请上传', trigger: 'change' }], |
| | | baseCategoryIds: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | baseGoodsTemplateId: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | baseGoodsTemplateId: [{ validator: checkGoodsTemplateId, trigger: ['blur', 'change'] }], |
| | | modelsIds: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | counts: [{ required: true, message: '请输入', trigger: 'change' }], |
| | | }, |
| | | |
| | | uploadSettings: { |
| | |
| | | }, |
| | | }; |
| | | }, |
| | | computed:{ |
| | | ...mapGetters(['userInfo']) |
| | | }, |
| | | created() { |
| | | this.init(); |
| | | }, |
| | |
| | | // 获取物品分类列表 |
| | | const treeRes = await getTree(); |
| | | this.categoryOptions = this.removeEmptyChildren(treeRes); |
| | | this.formData.goods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | }, |
| | | |
| | | // 获取出库仓库列表 |
| | | getWarehouseList() { |
| | | selectTenantWarehouse() |
| | | selectTenantWarehouse({agencyId:this.userInfo.tenantId}) |
| | | .then((res) => { |
| | | this.warehouseOptions = 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; |
| | |
| | | this.getgoodsTemplate(e[e.length - 1], index); |
| | | }, |
| | | |
| | | // 物品名称列表 |
| | | // 物品名称列表选择 |
| | | goodsTemplateChange(e, index) { |
| | | this.formData.goods[index].modelsOptions = []; |
| | | this.formData.goods[index].modelsIds = []; |
| | |
| | | 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 |
| | | curItem.counts = worehouseCount > 0 ? worehouseCount : null |
| | | } |
| | | }, |
| | | |
| | |
| | | goods: [], |
| | | }; |
| | | this.$emit('close'); |
| | | }, |
| | | |
| | | // 通过子集id查到所以相关父级id并返回数组 |
| | | findParentIds(dataSource, nodeId) { |
| | | const parentIds = []; // 用于存储所有父节点ID的数组 |
| | | |
| | | // 定义一个递归函数,用于遍历整棵树并查找子节点的所有父节点 |
| | | function traverse(node, nodeId) { |
| | | if (node.id === nodeId) { |
| | | // 如果当前节点的ID等于子节点的ID,则表示已经找到了子节点,可以开始向上查找父节点 |
| | | return true; // 返回true表示已经找到了子节点 |
| | | } |
| | | |
| | | if (node.children) { |
| | | // 如果当前节点有子节点,则继续遍历子节点 |
| | | for (const childNode of node.children) { |
| | | if (traverse(childNode, nodeId)) { |
| | | // 如果在子节点中找到了子节点的父节点,则将当前节点的ID添加到父节点ID数组中,并返回true表示已经找到了子节点 |
| | | parentIds.push(node.id); |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; // 如果当前节点不是子节点的父节点,则返回false |
| | | } |
| | | |
| | | // 从根节点开始遍历整棵树,并调用递归函数查找子节点的所有父节点 |
| | | for (const node of dataSource) { |
| | | if (traverse(node, nodeId)) { |
| | | // 如果在当前节点的子树中找到了子节点的父节点,则直接退出循环 |
| | | break; |
| | | } |
| | | } |
| | | |
| | | return parentIds; // 返回所有父节点ID的数组 |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | </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.agencyName }}</div> |
| | | <div class="box"><span class="span-two">操作人:</span>{{ item.operatorName }}</div> |
| | | <div class="box"> |
| | | <span class="span-two">出库时间:</span>{{ item.procureTime | formatTime }} |
| | | <span class="span-two">出库时间:</span>{{ item.dealTime | formatTime }} |
| | | </div> |
| | | </div> |
| | | <div class="card-end"> |
| | | <div v-for="(just, index) in item.fromProcureTemplateInfoList" :key="index" class="item"> |
| | | <div class="name">{{ just.goodsTemplateName }}</div> |
| | | <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> |
| | |
| | | </el-container> |
| | | <!--添加/编辑弹窗--> |
| | | <edit v-if="editSetting.show" :setting="editSetting" ref="editRef" @close="editSetting.show=false" @search="refreshData"></edit> |
| | | <detail v-if="detailSetting.show" :setting="detailSetting" @close="editSetting.show=false" ref="detailRef"></detail> |
| | | <my-import |
| | | :import-setting="importSetting" |
| | | :dialog-show="importSetting.dialogShow" |
| | | :dialog-title="importSetting.dialogTitle" |
| | | /> |
| | | <detail v-if="detailSetting.show" :setting="detailSetting" @close="detailSetting.show=false" ref="detailRef"></detail> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { outputList, procureDel, procureIncome } from '@/api/stock/accessStock'; |
| | | import { outputList } from '@/api/stock/accessStock'; |
| | | import MyButton from '@/components/myButton/myButton'; |
| | | import SettingIplatform from '@/utils/settingIplatform'; |
| | | import myImport from '@/views/components/myImport'; |
| | | import edit from './edit'; |
| | | import detail from './detail'; |
| | | import { getBaseUrl } from '@/utils/base'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | import listPage from '../../../mixins/listPage' |
| | | |
| | | export default { |
| | | name: 'index', |
| | | mixins: [listPage], |
| | | components: { MyButton, myImport, edit, detail }, |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | adddialog: false, |
| | | list: [], |
| | | // 搜索框 |
| | | items: [ |
| | |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'goodsTemplateName', |
| | | dataIndex: 'goodsName', |
| | | label: '物品名称', |
| | | placeholder: '可模糊搜索', |
| | | defaultValue: '', |
| | |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'buyerName', |
| | | dataIndex: 'createName', |
| | | label: '创建人', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val1', |
| | | dataIndex: 'startTime', |
| | | label: '出库时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val2', |
| | | dataIndex: 'endTime', |
| | | label: '至', |
| | | defaultValue: '', |
| | | }, |
| | | ], |
| | | // 树数据 |
| | | treeDataList: [], |
| | | // 搜索条件 |
| | | filterFrom: { |
| | | tenantId: null, |
| | | userName: null, |
| | | userPhone: null, |
| | | states: null, |
| | | }, |
| | | // 导入 |
| | | 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, |
| | | }, |
| | | detailSetting: { |
| | | title: '详情', |
| | | id: '', |
| | | show: false, |
| | | }, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | total: 0, |
| | | }; |
| | | }, |
| | | computed: { |
| | | clientHeight() { |
| | | return document.documentElement.clientHeight; |
| | | }, |
| | | }, |
| | | filters: { |
| | | formatTime(time) { |
| | | if (!time) return; |
| | | return DateFormatter.LongToDateTime(time); |
| | | }, |
| | | }, |
| | | created() { |
| | | this.fetchData(); |
| | | |
| | | }, |
| | | methods: { |
| | | fetchData() { |
| | |
| | | this.list = res.datas; |
| | | this.total = res.totalRows; |
| | | this.loading = false; |
| | | console.log(this.list); |
| | | }); |
| | | }, |
| | | //导入 |
| | | 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(); |
| | | }; |
| | | }, |
| | | // 导出 |
| | | handleExport() {}, |
| | | // 新增 |
| | | handleAdd() { |
| | | this.editSetting.id = null; |
| | | this.editSetting.info = null; |
| | | this.editSetting.title = '新增'; |
| | | this.editSetting.show = true; |
| | | }, |
| | | // 编辑 |
| | | handleEdit(row) { |
| | | this.editSetting.id = row.id; |
| | | this.editSetting.info = null; |
| | | this.editSetting.title = '编辑'; |
| | | this.editSetting.show = true; |
| | | }, |
| | | // 详情 |
| | | handleDetail(row) { |
| | | this.detailSetting.id = row.id; |
| | | this.detailSetting.info = JSON.stringify(row); |
| | | this.detailSetting.title = '详情'; |
| | | this.detailSetting.show = true; |
| | | }, |
| | | // 出库 |
| | | handleIncome(row) { |
| | | this.$confirm(`您确定 单号:${row.businessFormCode} 出库吗?`, '出库出库') |
| | | .then(function () { |
| | | procureIncome({ id: row.id }).then((res) => { |
| | | this.$message.success('出库成功!'); |
| | | this.search(); |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | del(row) { |
| | | this.$modal |
| | | .confirm('是否确认删除出库单号为"' + row.businessFormCode + '"的数据吗?') |
| | | .then(function () { |
| | | procureDel({ id: row.id }).then((res) => {}); |
| | | }) |
| | | .then((res) => { |
| | | this.$message.success('删除成功!'); |
| | | this.search(); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | // 分页 |
| | | handleSizeChange(pageSize) { |
| | | this.pageSize = pageSize; |
| | | this.search({ pageNum: 1 }); |
| | | }, |
| | | handleCurrentChange(pageNum) { |
| | | this.pageNum = pageNum; |
| | | this.search(); |
| | | }, |
| | | // 查询table列表 |
| | | search(pageNum) { |
| | | if(pageNum){ |
| | | this.pageNum = pageNum |
| | | } |
| | | this.fetchData(); |
| | | }, |
| | | refreshData() { |
| | | this.pageNum = 1; |
| | | this.pageSize = 10; |
| | | this.search(); |
| | | }, |
| | | fifterForm(params) { |
| | | this.filterFrom = Object.assign(this.filterFrom, params); |
| | | if (this.filterFrom.incomeTimeStart) { |
| | | this.filterFrom.incomeTimeStart = this.filterFrom.incomeTimeStart.replace(/\-/g, ''); |
| | | if (this.filterFrom.startTime) { |
| | | this.filterFrom.startTime = this.filterFrom.startTime.replace(/\-/g, ''); |
| | | } |
| | | if (this.filterFrom.incomeTimeEnd) { |
| | | this.filterFrom.incomeTimeEnd = this.filterFrom.incomeTimeEnd.replace(/\-/g, ''); |
| | | if (this.filterFrom.endTime) { |
| | | this.filterFrom.endTime = this.filterFrom.endTime.replace(/\-/g, ''); |
| | | } |
| | | if (this.filterFrom.agencyId.length) { |
| | | if (this.filterFrom.agencyId&&this.filterFrom.agencyId.length) { |
| | | this.filterFrom.agencyId = this.filterFrom.agencyId[this.filterFrom.agencyId.length - 1]; |
| | | } |
| | | this.search({ pageNum: 1 }); |
| | | 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> |
| | | <!--添加/编辑弹窗--> |
| | | <detail v-if="detailSetting.show" :setting="detailSetting" @close="detailSetting.show = false"/> |
| | | <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 detail from '../outbound/detail' |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant' |
| | | import myImport from '@/views/components/myImport' |
| | | import {getBaseUrl} from '@/utils/base'; |
| | | import detail from '../outbound/detail'; |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant'; |
| | | import myImport from '@/views/components/myImport'; |
| | | import { goodsTemplate, goodsModel } from '@/api/baseSetting/finsystenant'; |
| | | import { outputDtailList } from '@/api/stock/accessStock'; |
| | | |
| | | export default { |
| | | name: "index", |
| | | components: {MyButton, MyTableV2, detail, myImport}, |
| | | name: 'index', |
| | | components: { MyButton, MyTableV2, detail, myImport }, |
| | | data() { |
| | | return { |
| | | // 搜索框 |
| | | items: [ |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | dataIndex: 'businessFormId', |
| | | label: '单号', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'status', |
| | | dataIndex: 'thisType', |
| | | label: '类型', |
| | | placeholder: '请选择', |
| | | defaultValue: '1', |
| | | options: [ |
| | | { |
| | | label: '启用', |
| | | value: '1' |
| | | }, |
| | | { |
| | | label: '禁用', |
| | | value: '0' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | label: '物品名称', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | options: [{ |
| | | label:'采购入库', |
| | | value:1 |
| | | },{ |
| | | label:'退还入库', |
| | | value:2 |
| | | }], |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'modelsIds', |
| | | dataIndex: 'goodsTemplateId', |
| | | label: '物品名称', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'baseGoodsModelsId', |
| | | label: '规格型号', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | dataIndex: 'createdName', |
| | | label: '创建人', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'dealTimeStart', |
| | | label: '时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'dealTimeEnd', |
| | | label: '至', |
| | | defaultValue: '', |
| | | }, |
| | | ], |
| | | // 树数据 |
| | |
| | | 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: '', |
| | |
| | | table: { |
| | | showIndex: true, // 是否显示序号 |
| | | expand: false, // 是否显示详情数据 |
| | | url: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/select/list', // 请求地址 |
| | | url: SettingIplatform.apiBaseURL + '/pc/l/wh/form/output/detail/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: 'thisType', align: 'left' }, |
| | | { title: '单号', field: 'businessFormId', align: 'center' }, |
| | | { title: '物品名称', field: 'goodsTemplateName', align: 'center' }, |
| | | { title: '规格型号', field: 'baseGoodsModelsName', align: 'center' }, |
| | | { title: '出入库数量', field: 'thisCount', align: 'left' }, |
| | | { title: '金额', field: 'totalPrice', align: 'left' }, |
| | | { title: '所属机构', field: 'agencyName', align: 'left' }, |
| | | { title: '创建人', field: 'createdName', align: 'left' }, |
| | | { title: '操作时间', field: 'dealTime', align: 'left' }, |
| | | ], |
| | | // 操作信息 |
| | | operation: { |
| | |
| | | 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 goodsTemplate(); |
| | | item.options = res.map((v) => { |
| | | v.label = v.goodsName; |
| | | v.value = v.id; |
| | | return v; |
| | | }); |
| | | }) |
| | | .then((res) => { |
| | | this.$message.success('删除成功!'); |
| | | this.search() |
| | | }) |
| | | .catch(() => { |
| | | }); |
| | | } |
| | | if (item.label == '规格型号') { |
| | | let res = await goodsModel(); |
| | | item.options = res.map((v) => { |
| | | v.label = v.modelName; |
| | | v.value = v.id; |
| | | return v; |
| | | }); |
| | | } |
| | | return item; |
| | | }); |
| | | }, |
| | | showDetail(row) { |
| | | this.detailSetting.id = row.id; |
| | |
| | | // 查询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> |
| | |
| | | text-align: center; |
| | | border-radius: 4px; |
| | | border: 1px solid #f9675b99; |
| | | background: #f9675b1a; |
| | | background: rgba($color:#f9675b99,$alpha:0.1); |
| | | font-family: 'Microsoft YaHei'; |
| | | color: #f9675b; |
| | | font-size: 13px; |
| | |
| | | } |
| | | .states-success { |
| | | border: 1px solid #39ad6199; |
| | | background: #39ad610f; |
| | | background: rgba($color:#39ad6199,$alpha:0.1); |
| | | color: #39ad61; |
| | | } |
| | | .states-info { |
| | | border: 1px solid #999999; |
| | | background: #39ad610f; |
| | | background: rgba($color:#999999,$alpha:0.1); |
| | | color: #999999; |
| | | } |
| | | .states-warning { |
| | | border: 1px solid #e6a23c; |
| | | background: rgba($color:#e6a23c,$alpha:0.1); |
| | | color: #e6a23c; |
| | | } |
| | | } |
| | | .one-hed { |
| | |
| | | .no-data{ |
| | | margin-top: 100px; |
| | | text-align: center; |
| | | color: #909399; |
| | | } |
| | | |
| | | /*编辑*/ |
New file |
| | |
| | | <template> |
| | | <win-md :title="setting.title" @close="close" :width="'1200px'"> |
| | | <el-row :gutter="20" style="margin-bottom: 20px" type="flex" align="middle"> |
| | | <el-col :span="6">盘点单号:{{ formData.businessFormCode }}</el-col> |
| | | <el-col :span="6">盘点任务:{{ formData.businessTaskCode }}</el-col> |
| | | <el-col :span="6">盘点仓库:{{ formData.warehouseId }}</el-col> |
| | | </el-row> |
| | | <el-table v-loading="loading" :data="formData.tableData" height="100%" :stripe="true" class="the-table"> |
| | | <el-table-column prop="goodsTemplateName" label="物品名称"> </el-table-column> |
| | | <el-table-column prop="baseGoodsModelsId" label="型号" align="center"> </el-table-column> |
| | | <el-table-column prop="classification" label="购置日期"> </el-table-column> |
| | | <el-table-column prop="unit" label="使用部门" align="center"> </el-table-column> |
| | | <el-table-column prop="kc" label="使用人" align="center"> </el-table-column> |
| | | <el-table-column prop="price" label="单价" align="center"> </el-table-column> |
| | | <el-table-column prop="inventoryResult" label="金额" align="center"> </el-table-column> |
| | | <el-table-column prop="inventoryCounts" label="应盘数量" align="center"></el-table-column> |
| | | <el-table-column prop="inventoryCounts" label="实盘数量" align="center"></el-table-column> |
| | | <el-table-column prop="inventoryCounts" label="状态" align="center"></el-table-column> |
| | | </el-table> |
| | | |
| | | <div slot="footer" align="center" class="dialog-footer"> |
| | | <my-button name="暂存" site="form" type="primary" @click="close" /> |
| | | <my-button name="完成盘点" site="form" type="success" @click="save" /> |
| | | </div> |
| | | </win-md> |
| | | </template> |
| | | |
| | | <script> |
| | | import winMd from '@/components/win/win-md'; |
| | | import myButton from '@/components/myButton/myButton'; |
| | | export default { |
| | | components: { winMd, myButton }, |
| | | props: { |
| | | setting: { |
| | | type: Object, |
| | | default: () => {}, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | formData: { |
| | | businessFormCode: '2023080812', |
| | | businessTaskCode: '2023年9月盘点单', |
| | | warehouseId: '开封市仓库', |
| | | tableData: [], |
| | | }, |
| | | }; |
| | | }, |
| | | created() { |
| | | for (let i = 0; i < 10; i++) { |
| | | this.formData.tableData.push({ |
| | | goodsTemplateName: '施乐黑色碳粉', |
| | | baseGoodsModelsId: '施乐c2201', |
| | | classification: 'A', |
| | | unit: '套', |
| | | kc: 10, |
| | | price: 20, |
| | | inventoryResult: 200, |
| | | inventoryCounts: 0, |
| | | }); |
| | | } |
| | | }, |
| | | methods: { |
| | | close() { |
| | | this.$emit('close'); |
| | | }, |
| | | save() {}, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style></style> |
| | |
| | | }, |
| | | // 列信息 |
| | | columns: [ |
| | | { title: '机构', field: 'name', align: 'left' }, |
| | | { title: '仓库', field: 'code', align: 'center' }, |
| | | { title: '物品名称', field: 'lv', align: 'center' }, |
| | | { title: '规格型号', field: 'lv', align: 'center' }, |
| | | { title: '机构', field: 'agencyName', align: 'left' }, |
| | | { title: '仓库', field: 'warehouseName', align: 'center' }, |
| | | { title: '物品名称', field: 'goodsTemplateName', align: 'center' }, |
| | | { title: '规格型号', field: 'baseGoodsModelsName', align: 'center' }, |
| | | { title: '类型', field: 'summary', align: 'left' }, |
| | | { title: '单号', field: 'summary', align: 'left' }, |
| | | { title: '数量', field: 'summary', align: 'left' }, |
| | | { title: '数量', field: 'counts', align: 'left' }, |
| | | { title: '操作前数量', field: 'summary', align: 'left' }, |
| | | { title: '操作后数量', field: 'summary', align: 'left' }, |
| | | { title: '在途', field: 'summary', align: 'left' }, |
| | |
| | | <el-form-item |
| | | label="物品名称" |
| | | :prop="`procureGoods[${goodsIndex}].baseGoodsTemplateId`" |
| | | :rules="{ |
| | | required: true, |
| | | message: '请选择', |
| | | trigger: 'change', |
| | | }" |
| | | :rules="rules.baseGoodsTemplateId" |
| | | > |
| | | <el-select |
| | | v-model="goodsItem.baseGoodsTemplateId" |
| | | v-model="goodsItem.baseGoodsTemplateId" |
| | | placeholder="请先择物品分类" |
| | | filterable |
| | | :disabled="!goodsItem.baseCategoryId" |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="price" label="单价(元)" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input type="number" v-model="scope.row.price"></el-input> |
| | | <el-form-item |
| | | label-width="0" |
| | | style="margin-bottom: 0" |
| | | :prop="`procureGoods[${goodsIndex}].models[${scope.$index}].price`" |
| | | :rules="rules.price" |
| | | > |
| | | <el-input type="number" v-model.number="scope.row.price"></el-input> |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="counts" label="采购数量" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input type="number" v-model="scope.row.counts"></el-input> |
| | | <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-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </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"/> |
| | | <my-button name="取消" site="form" @click="close" /> |
| | | <my-button name="保存" site="form" @click="handleSubmit" /> |
| | | </div> |
| | | </win-md> |
| | | </template> |
| | |
| | | import MyButton from '@/components/myButton/myButton'; |
| | | import winMd from '@/components/win/win-md'; |
| | | import upload from '@/components/upload/index'; |
| | | import { getUploadUrl,getDownUrl} from '@/utils/base'; |
| | | |
| | | import SettingIplatform from '../../../../../public/static/config'; |
| | | import { getUploadUrl, getDownUrl } from '@/utils/base'; |
| | | import { findParentIds } from '@/utils/index'; |
| | | import { mapGetters } from 'vuex'; |
| | | |
| | | export default { |
| | | components: { MyButton, winMd, upload }, |
| | | props: { |
| | | setting: { |
| | | type: Object, |
| | | default: () => { |
| | | } |
| | | } |
| | | default: () => {}, |
| | | }, |
| | | }, |
| | | data() { |
| | | // 自定义校验 |
| | | // 物品重复校验 |
| | | var checkGoodsTemplateId = (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(new Error('请选择')); |
| | | } |
| | | 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) => { |
| | | if (!value) { |
| | | return callback(new Error('请输入')); |
| | | } |
| | | if (value == 0) { |
| | | this.$message.warning('数字值不能为0'); |
| | | return callback(new Error('数字值不能为0')); |
| | | } |
| | | callback(); |
| | | }; |
| | | // 数量校验 |
| | | var checkCounts = (rule, value, callback) => { |
| | | console.log(value) |
| | | if (!value) { |
| | | return callback(new Error('请输入')); |
| | | } |
| | | if (!Number.isInteger(value)) { |
| | | this.$message.warning('请输入数字值'); |
| | | return callback(new Error('请输入数字值')); |
| | | } |
| | | if (value == 0) { |
| | | this.$message.warning('数字值不能为0'); |
| | | return callback(new Error('数字值不能为0')); |
| | | } |
| | | callback(); |
| | | }; |
| | | return { |
| | | visible: false, |
| | | loading: false, |
| | | buyTypeOptions:[{ |
| | | label:'集采', |
| | | value: '1' |
| | | },{ |
| | | label:'自采', |
| | | value: '2' |
| | | }], |
| | | fileList:[], |
| | | buyTypeOptions: [ |
| | | { |
| | | label: '集采', |
| | | value: '1', |
| | | }, |
| | | { |
| | | label: '自采', |
| | | value: '2', |
| | | }, |
| | | ], |
| | | fileList: [], |
| | | warehouses: [], // 入库仓库列表 |
| | | categoryOptions: [], // 物品分类列表 |
| | | modelList: [], //型号列表 |
| | | formData: { |
| | | procureDoc:'', |
| | | procureDoc: '', |
| | | warehouseId: '', // 入库仓库id |
| | | procureTime: '', // 采购时间 |
| | | buyType: '2', // 采购方式(1:集采;2=自采) |
| | |
| | | }, |
| | | modelsItem: { |
| | | baseGoodsModelsId: '', // 规格型号编号 |
| | | price: 0, // 单价(采购需要,调拨不需要) |
| | | counts: 0, // 操作数量 |
| | | supplier: '', // 供应商 |
| | | price: null, // 单价(采购需要,调拨不需要) |
| | | counts: null, // 操作数量 |
| | | unit: null, //单位 |
| | | }, |
| | | rules: { |
| | |
| | | |
| | | procureDoc: [{ required: true, message: '请上传', trigger: 'change' }], |
| | | baseCategoryIds: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | baseGoodsTemplateId: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | baseGoodsTemplateId: [{ validator: checkGoodsTemplateId, trigger: ['blur', 'change'] }], |
| | | modelsIds: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | price: [{ validator: checkPrice, trigger: 'blur' }], |
| | | counts: [{ validator: checkCounts, trigger: 'blur' }], |
| | | }, |
| | | |
| | | uploadSettings: { |
| | |
| | | }, |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(['userInfo']), |
| | | }, |
| | | created() { |
| | | this.init() |
| | | this.init(); |
| | | }, |
| | | methods: { |
| | | async init() { |
| | | this.getWarehouseList(); |
| | | this.getgoodsTemplate() |
| | | this.getgoodsTemplate(); |
| | | this.getgoodsModel(); |
| | | // 获取物品分类列表 |
| | | const treeRes = await getTree(); |
| | | this.categoryOptions = this.removeEmptyChildren(treeRes); |
| | | if (this.setting.id) { |
| | | const detail = await procureDetail({ id:this.setting.id }); |
| | | const detail = await procureDetail({ id: this.setting.id }); |
| | | this.formData = Object.assign(this.formData, detail); |
| | | if(this.formData.procureDoc) { |
| | | this.fileList = JSON.parse(this.formData.procureDoc) |
| | | if (this.formData.procureDoc) { |
| | | this.fileList = JSON.parse(this.formData.procureDoc); |
| | | } |
| | | this.$set(this.formData,'buyType',this.formData.buyType.toString()) |
| | | this.$set(this.formData, 'buyType', this.formData.buyType.toString()); |
| | | this.formData.procureTime = this.formData.procureTime.toString(); |
| | | this.formData.procureGoods.map((item, index) => { |
| | | // 根据子集ID拼接物品分类列表 |
| | | item.baseCategoryIds = this.findParentIds(this.categoryOptions, item.baseCategoryId); |
| | | this.$set(this.formData.procureGoods[index],'modelsIds',item.models.map((v) => v.baseGoodsModelsId)) |
| | | item.baseCategoryIds = findParentIds(this.categoryOptions, item.baseCategoryId); |
| | | this.$set( |
| | | this.formData.procureGoods[index], |
| | | 'modelsIds', |
| | | item.models.map((v) => v.baseGoodsModelsId), |
| | | ); |
| | | this.getgoodsTemplate(item.baseCategoryId, index); |
| | | this.getgoodsModel(item.baseGoodsTemplateId, index); |
| | | return item |
| | | return item; |
| | | }); |
| | | console.log('this.formData.procureGoods',this.formData.procureGoods) |
| | | } else { |
| | | this.formData.procureGoods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | } |
| | | this.visible = true; |
| | | }, |
| | | |
| | | // 获取入库仓库列表 |
| | | getWarehouseList() { |
| | | selectTenantWarehouse() |
| | | selectTenantWarehouse({ agencyId: this.userInfo.tenantId }) |
| | | .then((res) => { |
| | | this.warehouses = res; |
| | | if (!this.setting.id && res.length) { |
| | | this.formData.procureGoods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | } |
| | | if (this.warehouses.length && !this.formData.warehouseId) { |
| | | // 默认选中第一个仓库 |
| | | this.formData.warehouseId = this.warehouses[0].id; |
| | |
| | | goodsTemplate({ categoryId: id || '' }).then((res) => { |
| | | if (index || index == 0) { |
| | | this.$set(this.formData.procureGoods[index], 'goodsOptions', res); |
| | | }else { |
| | | } else { |
| | | this.goodsTemplatelAll = res; |
| | | } |
| | | }); |
| | |
| | | |
| | | // 物品分类选择 |
| | | categoryChange(e, index) { |
| | | this.formData.procureGoods[index].goodsOptions = [] |
| | | this.formData.procureGoods[index].baseGoodsTemplateId = '' |
| | | this.formData.procureGoods[index].goodsTemplateName = '' |
| | | this.formData.procureGoods[index].modelsOptions = [] |
| | | this.formData.procureGoods[index].modelsIds = [] |
| | | this.formData.procureGoods[index].models = [] |
| | | this.formData.procureGoods[index].goodsOptions = []; |
| | | this.formData.procureGoods[index].baseGoodsTemplateId = ''; |
| | | this.formData.procureGoods[index].goodsTemplateName = ''; |
| | | this.formData.procureGoods[index].modelsOptions = []; |
| | | this.formData.procureGoods[index].modelsIds = []; |
| | | this.formData.procureGoods[index].models = []; |
| | | |
| | | this.formData.procureGoods[index].baseCategoryId = e[e.length - 1]; |
| | | // 根据选中分类请求物品名称列表 |
| | |
| | | |
| | | // 物品名称列表 |
| | | goodsTemplateChange(e, index) { |
| | | this.formData.procureGoods[index].modelsOptions = [] |
| | | this.formData.procureGoods[index].modelsIds = [] |
| | | this.formData.procureGoods[index].models = [] |
| | | this.formData.procureGoods[index].modelsOptions = []; |
| | | this.formData.procureGoods[index].modelsIds = []; |
| | | this.formData.procureGoods[index].models = []; |
| | | |
| | | this.formData.procureGoods[index].goodsTemplateName = this.getGoodsTemplateName(e) |
| | | this.formData.procureGoods[index].goodsTemplateName = this.getGoodsTemplateName(e); |
| | | // 根据选中物品名称id获取规格型号列表 |
| | | this.getgoodsModel(e, index); |
| | | }, |
| | |
| | | |
| | | // 上传 |
| | | uploadChange() { |
| | | let arr = this.$refs.uploadRef.fileList |
| | | this.formData.procureDoc = JSON.stringify(arr) |
| | | let arr = this.$refs.uploadRef.fileList; |
| | | this.formData.procureDoc = JSON.stringify(arr); |
| | | }, |
| | | |
| | | // 点击新增物品 |
| | |
| | | }, |
| | | |
| | | close() { |
| | | this.formData ={ |
| | | this.formData = { |
| | | warehouseId: '', // 入库仓库id |
| | | procureTime: '', // 采购时间 |
| | | procureGoods: [], |
| | | } |
| | | this.$emit('close') |
| | | }, |
| | | |
| | | // 通过子集id查到所以相关父级id并返回数组 |
| | | findParentIds(dataSource, nodeId) { |
| | | const parentIds = [nodeId]; // 用于存储所有父节点ID的数组 |
| | | |
| | | // 定义一个递归函数,用于遍历整棵树并查找子节点的所有父节点 |
| | | function traverse(node, nodeId) { |
| | | if (node.id === nodeId) { |
| | | // 如果当前节点的ID等于子节点的ID,则表示已经找到了子节点,可以开始向上查找父节点 |
| | | return true; // 返回true表示已经找到了子节点 |
| | | } |
| | | |
| | | if (node.children) { |
| | | // 如果当前节点有子节点,则继续遍历子节点 |
| | | for (const childNode of node.children) { |
| | | if (traverse(childNode, nodeId)) { |
| | | // 如果在子节点中找到了子节点的父节点,则将当前节点的ID添加到父节点ID数组中,并返回true表示已经找到了子节点 |
| | | parentIds.unshift(node.id); |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; // 如果当前节点不是子节点的父节点,则返回false |
| | | } |
| | | |
| | | // 从根节点开始遍历整棵树,并调用递归函数查找子节点的所有父节点 |
| | | for (const node of dataSource) { |
| | | if (traverse(node, nodeId)) { |
| | | // 如果在当前节点的子树中找到了子节点的父节点,则直接退出循环 |
| | | break; |
| | | } |
| | | } |
| | | |
| | | return parentIds; // 返回所有父节点ID的数组 |
| | | }; |
| | | this.$emit('close'); |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | <my-button name="新增" @click="handleAdd" site="tools" size="medium" /> |
| | | <my-button name="导入" @click="importSetting.dialogShow = true" site="tools" size="medium" /> |
| | | </div> |
| | | <div :style="{ 'overflow-y': 'auto', height: `${clientHeight - 320}px` }"> |
| | | <el-row class="card" :gutter="5" v-loading="loading"> |
| | | <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"> |
| | |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="no-data" v-else>暂无数据</div> |
| | | </div> |
| | | <el-pagination |
| | | :small="false" |
| | |
| | | |
| | | <script> |
| | | import { procureList, procureDel, procureIncome } from '@/api/stock/procure/purchaseOrder'; |
| | | import { getTree } from '@/api/baseSetting/finsystenant'; |
| | | import MyButton from '@/components/myButton/myButton'; |
| | | import SettingIplatform from '@/utils/settingIplatform'; |
| | | import myImport from '@/views/components/myImport'; |
| | | import edit from './edit'; |
| | | import detail from './detail'; |
| | | import { getBaseUrl } from '@/utils/base'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | import listPage from '../../../mixins/listPage' |
| | | |
| | | export default { |
| | | name: 'index', |
| | | mixins: [listPage], |
| | | components: { MyButton, myImport, edit, detail }, |
| | | data() { |
| | | return { |
| | |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'buyerName', |
| | | dataIndex: 'createName', |
| | | label: '创建人', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | |
| | | ], |
| | | // 树数据 |
| | | treeDataList: [], |
| | | // 搜索条件 |
| | | filterFrom: { |
| | | tenantId: null, |
| | | userName: null, |
| | | userPhone: null, |
| | | states: null, |
| | | }, |
| | | // 导入 |
| | | importSetting: { |
| | | dialogTitle: '导入', |
| | |
| | | }, |
| | | onSuccess: null, |
| | | }, |
| | | editSetting: { |
| | | title: '', |
| | | id: '', |
| | | orgId: '', |
| | | show: false, |
| | | }, |
| | | detailSetting: { |
| | | title: '详情', |
| | | id: '', |
| | | show: false, |
| | | }, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | total: 0, |
| | | }; |
| | | }, |
| | | computed: { |
| | | clientHeight() { |
| | | return document.documentElement.clientHeight; |
| | | }, |
| | | }, |
| | | filters: { |
| | | formatTime(time) { |
| | | if (!time) return; |
| | | return DateFormatter.LongToDateTime(time); |
| | | }, |
| | | }, |
| | | created() { |
| | | this.fetchData(); |
| | | }, |
| | | methods: { |
| | | fetchData() { |
| | |
| | | callBack(); |
| | | }; |
| | | }, |
| | | // 导出 |
| | | handleExport() {}, |
| | | // 新增 |
| | | handleAdd() { |
| | | this.editSetting.id = null; |
| | | this.editSetting.info = null; |
| | | this.editSetting.title = '新增'; |
| | | this.editSetting.show = true; |
| | | }, |
| | | // 编辑 |
| | | handleEdit(row) { |
| | | this.editSetting.id = row.id; |
| | | this.editSetting.info = null; |
| | | this.editSetting.title = '编辑'; |
| | | this.editSetting.show = true; |
| | | }, |
| | | // 详情 |
| | | handleDetail(row) { |
| | | this.detailSetting.id = row.id; |
| | | this.detailSetting.show = true; |
| | | }, |
| | | // 入库 |
| | | handleIncome(row) { |
| | | this.$confirm(`您确定 单号:${row.businessFormCode} 入库吗?`, '采购入库').then(() => { |
| | |
| | | .catch(() => {}); |
| | | }); |
| | | }, |
| | | // 分页 |
| | | handleSizeChange(pageSize) { |
| | | this.pageSize = pageSize; |
| | | this.pageNum = 1; |
| | | this.search(); |
| | | }, |
| | | handleCurrentChange(pageNum) { |
| | | this.pageNum = pageNum; |
| | | this.search(pageNum); |
| | | }, |
| | | // 查询table列表 |
| | | search(pageNum) { |
| | | if (pageNum) { |
| | | this.pageNum = pageNum; |
| | | } |
| | | this.fetchData(); |
| | | }, |
| | | refreshData() { |
| | | this.pageNum = 1; |
| | | this.pageSize = 10; |
| | | this.search(); |
| | | }, |
| | | fifterForm(params) { |
| | | this.filterFrom = Object.assign(this.filterFrom, params); |
| | | if (this.filterFrom.incomeTimeStart) { |
| | |
| | | if (this.filterFrom.incomeTimeEnd) { |
| | | this.filterFrom.incomeTimeEnd = this.filterFrom.incomeTimeEnd.replace(/\-/g, ''); |
| | | } |
| | | if (this.filterFrom.agencyId.length) { |
| | | if (this.filterFrom.agencyId && this.filterFrom.agencyId.length) { |
| | | this.filterFrom.agencyId = this.filterFrom.agencyId[this.filterFrom.agencyId.length - 1]; |
| | | } |
| | | this.search(); |
| | | this.search(1); |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'buyerName', |
| | | dataIndex: 'createName', |
| | | label: '创建人', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | |
| | | <div class="main-w"> |
| | | <el-row :gutter="24" class="headerHeight"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="机构" prop="warehouseId"> |
| | | <el-input :value="formData.agencyName" disabled></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="报废仓库" prop="warehouseId"> |
| | | <el-select v-model="formData.warehouseId" placeholder="请选择" style="width: 100%"> |
| | | <el-option v-for="item in warehouses" :key="item.id" :label="item.warehouseName" :value="item.id" /> |
| | | </el-select> |
| | | <el-input :value="formData.warehouseName" disabled></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 :value="formData.operatorName" disabled></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"> |
| | | <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"> |
| | | <el-table-column prop="price" label="剩余数量" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input type="number" v-model="scope.row.price"></el-input> |
| | | </template> |
| | |
| | | <el-table-column prop="counts" label="报废数量" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input type="number" v-model="scope.row.counts"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="counts" label="报废原因" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-select v-model="scope.row.modelsIds" multiple placeholder="请选择"> |
| | | <el-option v-for="item in []" :key="item.id" :label="item.label" :value="item.id" /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </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"/> |
| | | <my-button name="取消" site="form" @click="close" /> |
| | | <my-button name="保存" site="form" @click="handleSubmit" /> |
| | | </div> |
| | | </win-md> |
| | | </template> |
| | |
| | | import MyButton from '@/components/myButton/myButton'; |
| | | import winMd from '@/components/win/win-md'; |
| | | import upload from '@/components/upload/index'; |
| | | import { getUploadUrl,getDownUrl} from '@/utils/base'; |
| | | |
| | | import { getUploadUrl, getDownUrl } from '@/utils/base'; |
| | | import { mapGetters } from 'vuex'; |
| | | import SettingIplatform from '../../../../../public/static/config'; |
| | | |
| | | export default { |
| | |
| | | props: { |
| | | setting: { |
| | | type: Object, |
| | | default: () => { |
| | | } |
| | | } |
| | | default: () => {}, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | loading: false, |
| | | buyTypeOptions:[{ |
| | | label:'集采', |
| | | value: '1' |
| | | },{ |
| | | label:'自采', |
| | | value: '2' |
| | | }], |
| | | fileList:[], |
| | | buyTypeOptions: [ |
| | | { |
| | | label: '集采', |
| | | value: '1', |
| | | }, |
| | | { |
| | | label: '自采', |
| | | value: '2', |
| | | }, |
| | | ], |
| | | fileList: [], |
| | | warehouses: [], // 报废仓库列表 |
| | | categoryOptions: [], // 物品分类列表 |
| | | modelList: [], //型号列表 |
| | | formData: { |
| | | procureDoc:'', |
| | | procureDoc: '', |
| | | warehouseId: '', // 报废仓库id |
| | | procureTime: '', // 报废时间 |
| | | buyType: '2', // 报废方式(1:集采;2=自采) |
| | |
| | | baseCategoryId: '', // 分类编号 |
| | | baseGoodsTemplateId: '', // 物品模版编号 |
| | | goodsTemplateName: '', // 物品模版名称 |
| | | supplier: '', // 供应商 |
| | | sort: '', // 显示顺序 |
| | | goodsOptions: [], // 物品列表select |
| | | modelsOptions: [], //规格型号select |
| | |
| | | }, |
| | | modelsItem: { |
| | | baseGoodsModelsId: '', // 规格型号编号 |
| | | price: 0, // 单价(报废需要,调拨不需要) |
| | | counts: 0, // 操作数量 |
| | | supplier: '', // 供应商 |
| | | unit: null, //单位 |
| | | }, |
| | | rules: { |
| | | warehouseId: [{ required: true, message: '请选择', trigger: 'change' }], |
| | |
| | | }, |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(['userInfo']), |
| | | }, |
| | | created() { |
| | | this.init() |
| | | this.init(); |
| | | }, |
| | | methods: { |
| | | async init() { |
| | | this.getWarehouseList(); |
| | | this.getgoodsTemplate() |
| | | this.getgoodsTemplate(); |
| | | this.getgoodsModel(); |
| | | this.getCategoryTree(); |
| | | this.formData.procureGoods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | this.formData.operatorId = this.userInfo.userCode; |
| | | this.formData.operatorName = this.userInfo.id; |
| | | this.formData.agencyId = this.userInfo.tenantId; |
| | | this.formData.agencyName = this.userInfo.tenantName; |
| | | this.formData.warehouseId = this.userInfo.tenantId; |
| | | this.formData.warehouseName = this.userInfo.tenantName; |
| | | this.formData.WAREHOUSE_TYPE = 0; |
| | | }, |
| | | async getCategoryTree() { |
| | | // 获取物品分类列表 |
| | | const treeRes = await getTree(); |
| | | this.categoryOptions = this.removeEmptyChildren(treeRes); |
| | | if (this.setting.id) { |
| | | const detail = await procureDetail({ id:this.setting.id }); |
| | | this.formData = Object.assign(this.formData, detail); |
| | | if(this.formData.procureDoc) { |
| | | this.fileList = JSON.parse(this.formData.procureDoc) |
| | | } |
| | | this.$set(this.formData,'buyType',this.formData.buyType.toString()) |
| | | this.formData.procureTime = this.formData.procureTime.toString(); |
| | | this.formData.procureGoods.map((item, index) => { |
| | | // 根据子集ID拼接物品分类列表 |
| | | item.baseCategoryIds = this.findParentIds(this.categoryOptions, item.baseCategoryId); |
| | | this.$set(this.formData.procureGoods[index],'modelsIds',item.models.map((v) => v.baseGoodsModelsId)) |
| | | this.getgoodsTemplate(item.baseCategoryId, index); |
| | | this.getgoodsModel(item.baseGoodsTemplateId, index); |
| | | return item |
| | | }); |
| | | console.log('this.formData.procureGoods',this.formData.procureGoods) |
| | | } else { |
| | | this.formData.procureGoods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | } |
| | | this.visible = true; |
| | | }, |
| | | |
| | | // 获取报废仓库列表 |
| | |
| | | goodsTemplate({ categoryId: id || '' }).then((res) => { |
| | | if (index || index == 0) { |
| | | this.$set(this.formData.procureGoods[index], 'goodsOptions', res); |
| | | }else { |
| | | } else { |
| | | this.goodsTemplatelAll = res; |
| | | } |
| | | }); |
| | |
| | | |
| | | // 物品分类选择 |
| | | categoryChange(e, index) { |
| | | this.formData.procureGoods[index].goodsOptions = [] |
| | | this.formData.procureGoods[index].baseGoodsTemplateId = '' |
| | | this.formData.procureGoods[index].goodsTemplateName = '' |
| | | this.formData.procureGoods[index].modelsOptions = [] |
| | | this.formData.procureGoods[index].modelsIds = [] |
| | | this.formData.procureGoods[index].models = [] |
| | | this.formData.procureGoods[index].goodsOptions = []; |
| | | this.formData.procureGoods[index].baseGoodsTemplateId = ''; |
| | | this.formData.procureGoods[index].goodsTemplateName = ''; |
| | | this.formData.procureGoods[index].modelsOptions = []; |
| | | this.formData.procureGoods[index].modelsIds = []; |
| | | this.formData.procureGoods[index].models = []; |
| | | |
| | | this.formData.procureGoods[index].baseCategoryId = e[e.length - 1]; |
| | | // 根据选中分类请求物品名称列表 |
| | |
| | | |
| | | // 物品名称列表 |
| | | goodsTemplateChange(e, index) { |
| | | this.formData.procureGoods[index].modelsOptions = [] |
| | | this.formData.procureGoods[index].modelsIds = [] |
| | | this.formData.procureGoods[index].models = [] |
| | | this.formData.procureGoods[index].modelsOptions = []; |
| | | this.formData.procureGoods[index].modelsIds = []; |
| | | this.formData.procureGoods[index].models = []; |
| | | |
| | | this.formData.procureGoods[index].goodsTemplateName = this.getGoodsTemplateName(e) |
| | | this.formData.procureGoods[index].goodsTemplateName = this.getGoodsTemplateName(e); |
| | | // 根据选中物品名称id获取规格型号列表 |
| | | this.getgoodsModel(e, index); |
| | | }, |
| | |
| | | |
| | | // 上传 |
| | | uploadChange() { |
| | | let arr = this.$refs.uploadRef.fileList |
| | | this.formData.procureDoc = JSON.stringify(arr) |
| | | let arr = this.$refs.uploadRef.fileList; |
| | | this.formData.procureDoc = JSON.stringify(arr); |
| | | }, |
| | | |
| | | // 点击新增物品 |
| | |
| | | }, |
| | | |
| | | close() { |
| | | this.formData ={ |
| | | this.formData = { |
| | | warehouseId: '', // 报废仓库id |
| | | procureTime: '', // 报废时间 |
| | | procureGoods: [], |
| | | } |
| | | this.$emit('close') |
| | | }; |
| | | this.$emit('close'); |
| | | }, |
| | | |
| | | // 通过子集id查到所以相关父级id并返回数组 |
| | |
| | | <template> |
| | | <el-dialog |
| | | title="详情" |
| | | width="60%" |
| | | :modal="true" |
| | | :visible.sync="visible" |
| | | :top="'15vh'" |
| | | :close-on-click-modal="false" |
| | | :append-to-body="true" |
| | | :destroy-on-close="true" |
| | | @close="close" |
| | | class="stock-detail" |
| | | > |
| | | <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.agencyId }}</span> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" style="margin-top: 20px"> |
| | | <el-col :span="8"> |
| | | <span>状态:</span> |
| | | <span>{{ detail.states == 1 ? '待调拨' : '已调拨' }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>创建人:</span> |
| | | <span>{{ detail.buyerName }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>调拨时间:</span> |
| | | <span>{{ detail.incomeTime | formatTime }}</span> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" style="margin-top: 20px"> |
| | | <el-col class="img-row" :span="24"> |
| | | <span>调拨手续照片:</span> |
| | | <div class="img-box"></div> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="goods-card" v-for="(goodsItem, goodsIndex) in detail.procureGoods" :key="goodsIndex"> |
| | | <win-md class="stock-detail" :title="setting.title" @close="close" :width="'800px'"> |
| | | <div v-loading="loading"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <span>物品分类:</span> |
| | | <span>{{ goodsItem.baseCategoryId }}</span> |
| | | <span>调拨单号:</span> |
| | | <span>{{ detail.businessFormCode }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>物品名称:</span> |
| | | <span>{{ goodsItem.goodsTemplateName }}</span> |
| | | <span>调拨机构:</span> |
| | | <span>{{ detail.outAgencyName }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>供货商:</span> |
| | | <span>{{ goodsItem.supplier }}</span> |
| | | <span>接收机构:</span> |
| | | <span>{{ detail.inAgencyName }}</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="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> |
| | | <el-row :gutter="20" style="margin-top: 20px"> |
| | | <el-col :span="8"> |
| | | <span>申请调拨时间:</span> |
| | | <span>{{ detail.createTime | formatTime }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>状态:</span> |
| | | <span>{{ getStatesLabel(detail.states) }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>调拨时间:</span> |
| | | <span>{{ detail.outputTime | formatTime }}</span> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="fileList && fileList.length" :gutter="20" style="margin-top: 20px"> |
| | | <el-col class="img-row" :span="24"> |
| | | <span>调拨手续照片:</span> |
| | | <div class="img-box" v-for="(item, index) in fileList" :key="index" @click="handlePreview(item)"> |
| | | <img class="img" :src="getUrl(item.path)" alt="" /> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="goods-card" v-for="(goodsItem, goodsIndex) in detail.formTransferGoods" :key="goodsIndex"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <span>物品分类:</span> |
| | | <span>{{ goodsItem.categoryName }}</span> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <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="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> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | </win-md> |
| | | </template> |
| | | <script> |
| | | import { procureDetail } from '@/api/stock/procure/purchaseOrder'; |
| | | import { transferDetail } from '@/api/stock/transfer'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | import winMd from '@/components/win/win-md'; |
| | | import transfer from '../../../mixins/transfer'; |
| | | |
| | | export default { |
| | | mixins: [transfer], |
| | | components: { winMd }, |
| | | props: { |
| | | setting: { |
| | | type: Object, |
| | | default: () => {}, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | detail: { |
| | | businessFormCode: '', |
| | | goodsTemplateName: '', |
| | | agencyId: '', |
| | | states: '', |
| | | createName: '', |
| | | time: '', |
| | | procureGoods: [{}, {}], |
| | | }, |
| | | loading: false, |
| | | detail: {}, |
| | | fileList:[] |
| | | }; |
| | | }, |
| | | filters:{ |
| | | filters: { |
| | | formatTime(time) { |
| | | if(!time) return |
| | | return DateFormatter.LongToDateTime(time) |
| | | } |
| | | if (!time) return '-'; |
| | | return DateFormatter.LongToDateTime(time); |
| | | }, |
| | | }, |
| | | created() { |
| | | this.loading = true; |
| | | transferDetail({ id: this.setting.id }).then((res) => { |
| | | this.detail = res; |
| | | this.fileList = this.detail.procureDoc ? JSON.parse(this.detail.procureDoc) : []; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | methods: { |
| | | open(id) { |
| | | this.visible = true; |
| | | procureDetail({ id }).then((res) => { |
| | | this.detail = res; |
| | | }); |
| | | }, |
| | | close() { |
| | | this.visible = false; |
| | | this.$emit('close'); |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | <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-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-form-item label="调拨机构" prop="outAgencyId"> |
| | | <el-select v-model="formData.outAgencyId" placeholder="请选择" style="width: 100%"> |
| | | <el-option v-for="item in agencyOptions" :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="procureTime"> |
| | | <el-form-item label="调拨时间" prop="createTime"> |
| | | <el-date-picker |
| | | v-model="formData.procureTime" |
| | | v-model="formData.createTime" |
| | | type="datetime" |
| | | value="yyyy-MM-dd HH:mm:ss" |
| | | value-format="yyyyMMddHHmmss" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24" class="headerHeight"> |
| | | <el-col :span="12"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="调拨手续" prop="procureDoc"> |
| | | <upload :settings="uploadSettings" @on-change="uploadChange"></upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="goods-card" v-for="(goodsItem, goodsIndex) in formData.procureGoods" :key="goodsIndex"> |
| | | <div class="goods-card" v-for="(goodsItem, goodsIndex) in formData.transferGoods" :key="goodsIndex"> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="物品分类" |
| | | :prop="`procureGoods[${goodsIndex}].baseCategoryIds`" |
| | | :prop="`transferGoods[${goodsIndex}].baseCategoryIds`" |
| | | :rules="{ |
| | | required: true, |
| | | message: '请选择', |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="物品名称" |
| | | :prop="`procureGoods[${goodsIndex}].baseGoodsTemplateId`" |
| | | :prop="`transferGoods[${goodsIndex}].baseGoodsTemplateId`" |
| | | :rules="{ |
| | | required: true, |
| | | message: '请选择', |
| | |
| | | }" |
| | | > |
| | | <el-select |
| | | v-model="goodsItem.baseGoodsTemplateId" |
| | | :value="goodsItem.baseGoodsTemplateId" |
| | | placeholder="请先择物品分类" |
| | | filterable |
| | | :disabled="!goodsItem.baseCategoryId" |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="规格型号" |
| | | :prop="`procureGoods[${goodsIndex}].modelsIds`" |
| | | :prop="`transferGoods[${goodsIndex}].modelsIds`" |
| | | :rules="{ |
| | | required: true, |
| | | message: '请选择', |
| | |
| | | {{ scope.row.unit }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="price" label="现有库存" align="center"> |
| | | <template slot-scope="scope">{{ }} |
| | | <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"> |
| | | <el-table-column prop="counts" label="申请数量" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input |
| | | type="number" |
| | | v-model="scope.row.counts" |
| | | @change="countsChange($event, goodsIndex,scope.$index)" |
| | | ></el-input> |
| | | <el-form-item |
| | | label-width="0" |
| | | style="margin-bottom: 0" |
| | | :prop="`transferGoods[${goodsIndex}].models[${scope.$index}].counts`" |
| | | :rules="rules.counts" |
| | | > |
| | | <el-input |
| | | v-model.number="scope.row.counts" |
| | | placeholder="请输入" |
| | | @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.procureGoods.length > 1" |
| | | v-if="formData.transferGoods.length > 1" |
| | | name="移除" |
| | | type="danger" |
| | | plain |
| | |
| | | >移除</el-button |
| | | > |
| | | <el-button |
| | | v-if="formData.procureGoods.length - 1 == goodsIndex" |
| | | v-if="formData.transferGoods.length - 1 == goodsIndex" |
| | | name="新增物品" |
| | | type="primary" |
| | | plain |
| | |
| | | </win-md> |
| | | </template> |
| | | <script> |
| | | import { |
| | | goodsTemplate, |
| | | procureAdd, |
| | | procureEdit, |
| | | selectTenantWarehouse, |
| | | goodsModel, |
| | | procureDetail, |
| | | } from '@/api/stock/procure/purchaseOrder'; |
| | | import { getTree } from '@/api/foudation/classification'; |
| | | import { transferAdd } from '@/api/stock/transfer'; |
| | | import { getCategorySelectTree, getTree, goodsTemplate, goodsModel } from '@/api/baseSetting/finsystenant'; |
| | | import { getParentTenant,queryWarehouseGoods } from '@/api/stock/transfer'; |
| | | import MyButton from '@/components/myButton/myButton'; |
| | | import winMd from '@/components/win/win-md'; |
| | | import upload from '@/components/upload/index'; |
| | | import { getUploadUrl } from '@/utils/base'; |
| | | |
| | | import SettingIplatform from '../../../../../public/static/config'; |
| | | import { mapGetters } from 'vuex'; |
| | | |
| | | export default { |
| | | components: { MyButton, winMd, upload }, |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | loading: false, |
| | | buyTypeOptions: [ |
| | | { |
| | | label: '集采', |
| | | value: '1', |
| | | }, |
| | | { |
| | | label: '自采', |
| | | value: '2', |
| | | }, |
| | | ], |
| | | warehouses: [], // 调拨仓库列表 |
| | | agencyOptions: [], // 调拨机构 |
| | | categoryOptions: [], // 物品分类列表 |
| | | modelList: [], //型号列表 |
| | | formData: { |
| | | warehouseId: '', // 调拨仓库id |
| | | procureTime: '', // 调拨时间 |
| | | buyType: '2', // 调拨方式(1:集采;2=自采) |
| | | procureGoods: [], |
| | | transferBusinessType: 0, // 单据类型。0仓库调拨;1部门分发;2部门物品回退 |
| | | outAgencyId: '', // 调拨机构id |
| | | createTime: '', // 调拨时间 |
| | | transferGoods: [], |
| | | }, |
| | | goodsItem: { |
| | | whFormProcureId: '', // 调拨单ID |
| | | baseCategoryIds: '', // 分类编号数组 |
| | | baseCategoryId: '', // 分类编号 |
| | | baseGoodsTemplateId: '', // 物品模版编号 |
| | | goodsTemplateName: '', // 物品模版名称 |
| | | supplier: '', // 供应商 |
| | | sort: '', // 显示顺序 |
| | | goodsOptions: [], // 物品列表select |
| | | modelsOptions: [], //规格型号select |
| | | models: [], // 物品名称 |
| | |
| | | }, |
| | | modelsItem: { |
| | | baseGoodsModelsId: '', // 规格型号编号 |
| | | price: 0, // 单价(调拨需要,调拨不需要) |
| | | worehouseCount: 0, |
| | | counts: 0, // 操作数量 |
| | | supplier: '', // 供应商 |
| | | worehouseCount: 10, |
| | | counts: null, // 操作数量 |
| | | unit: null, //单位 |
| | | }, |
| | | rules: { |
| | | warehouseId: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | procureTime: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | buyType: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | createTime: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | |
| | | // procureDoc: [{ required: true, message: '请上传', trigger: 'change' }], |
| | | baseCategoryIds: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | baseGoodsTemplateId: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | modelsIds: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | counts: [ |
| | | { required: true, message: '请输入', trigger: 'change' }, |
| | | { type: 'number', message: '数量必须为整数' }, |
| | | ], |
| | | }, |
| | | |
| | | uploadSettings: { |
| | |
| | | }, |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(['userInfo']), |
| | | }, |
| | | created() { |
| | | this.init(); |
| | | }, |
| | | methods: { |
| | | async init() { |
| | | this.getWarehouseList(); |
| | | this.handegetParentTenant(); |
| | | this.getgoodsTemplate(); |
| | | this.getgoodsModel(); |
| | | // 获取物品分类列表 |
| | | const treeRes = await getTree(); |
| | | this.categoryOptions = this.removeEmptyChildren(treeRes); |
| | | if (this.setting.id) { |
| | | const detail = await procureDetail({ id: this.setting.id }); |
| | | this.formData = Object.assign(this.formData, detail); |
| | | this.$set(this.formData, 'buyType', this.formData.buyType.toString()); |
| | | this.formData.procureTime = this.formData.procureTime.toString(); |
| | | this.formData.procureGoods.map((item, index) => { |
| | | // 根据子集ID拼接物品分类列表 |
| | | let pIds = this.findParentIds(this.categoryOptions, item.baseCategoryId); |
| | | pIds = pIds.reverse(); |
| | | item.baseCategoryIds = [...pIds, item.baseCategoryId]; |
| | | this.$set( |
| | | this.formData.procureGoods[index], |
| | | 'modelsIds', |
| | | item.models.map((v) => v.baseGoodsModelsId), |
| | | ); |
| | | this.getgoodsTemplate(item.baseCategoryId, index); |
| | | this.getgoodsModel(item.baseGoodsTemplateId, index); |
| | | return item; |
| | | }); |
| | | } else { |
| | | this.formData.procureGoods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | } |
| | | this.visible = true; |
| | | this.getCategoryTree(); |
| | | this.formData.transferGoods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | }, |
| | | |
| | | // 获取调拨仓库列表 |
| | | getWarehouseList() { |
| | | selectTenantWarehouse() |
| | | .then((res) => { |
| | | this.warehouses = res; |
| | | if (this.warehouses.length && !this.formData.warehouseId) { |
| | | // 默认选中第一个仓库 |
| | | this.formData.warehouseId = this.warehouses[0].id; |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.log('err', err); |
| | | }); |
| | | // 获取上级机构 |
| | | handegetParentTenant() { |
| | | getParentTenant().then((res) => { |
| | | this.agencyOptions = [res]; |
| | | this.formData.outAgencyId = res.id; |
| | | }); |
| | | }, |
| | | |
| | | async getCategoryTree() { |
| | | // 获取物品分类列表 |
| | | const treeRes = await getCategorySelectTree(); |
| | | this.categoryOptions = this.removeEmptyChildren(treeRes); |
| | | }, |
| | | |
| | | removeEmptyChildren(arr) { |
| | |
| | | |
| | | // 获取物品名称列表 |
| | | getgoodsTemplate(id, index) { |
| | | goodsTemplate({ categoryId: id || '' }).then((res) => { |
| | | queryWarehouseGoods({ categoryId: id || '', agencyId: this.formData.outAgencyId }).then((res) => { |
| | | if (index || index == 0) { |
| | | this.$set(this.formData.procureGoods[index], 'goodsOptions', res); |
| | | this.$set(this.formData.transferGoods[index], 'goodsOptions', res); |
| | | } else { |
| | | this.goodsTemplatelAll = res; |
| | | } |
| | |
| | | getgoodsModel(id, index) { |
| | | goodsModel({ goodsTemplatesId: id || '' }).then((res) => { |
| | | if (index || index == 0) { |
| | | this.$set(this.formData.procureGoods[index], 'modelsOptions', res); |
| | | this.$set(this.formData.transferGoods[index], 'modelsOptions', res); |
| | | } else { |
| | | this.goodsModelAll = res; |
| | | } |
| | |
| | | |
| | | // 物品分类选择 |
| | | categoryChange(e, index) { |
| | | this.formData.procureGoods[index].goodsOptions = []; |
| | | this.formData.procureGoods[index].baseGoodsTemplateId = ''; |
| | | this.formData.procureGoods[index].goodsTemplateName = ''; |
| | | this.formData.procureGoods[index].modelsOptions = []; |
| | | this.formData.procureGoods[index].modelsIds = []; |
| | | this.formData.procureGoods[index].models = []; |
| | | this.formData.transferGoods[index].goodsOptions = []; |
| | | this.formData.transferGoods[index].baseGoodsTemplateId = ''; |
| | | this.formData.transferGoods[index].goodsTemplateName = ''; |
| | | this.formData.transferGoods[index].modelsOptions = []; |
| | | this.formData.transferGoods[index].modelsIds = []; |
| | | this.formData.transferGoods[index].models = []; |
| | | |
| | | this.formData.procureGoods[index].baseCategoryId = e[e.length - 1]; |
| | | this.formData.transferGoods[index].baseCategoryId = e[e.length - 1]; |
| | | // 根据选中分类请求物品名称列表 |
| | | this.getgoodsTemplate(e[e.length - 1], index); |
| | | }, |
| | | |
| | | // 物品名称列表 |
| | | // 物品名称列表选择 |
| | | goodsTemplateChange(e, index) { |
| | | this.formData.procureGoods[index].modelsOptions = []; |
| | | this.formData.procureGoods[index].modelsIds = []; |
| | | this.formData.procureGoods[index].models = []; |
| | | let temp = this.formData.transferGoods.find(v=>v.baseGoodsTemplateId==e) |
| | | if(temp) { |
| | | this.$message.warning('已选过此物品') |
| | | return |
| | | }else{ |
| | | this.formData.transferGoods[index].baseGoodsTemplateId = e |
| | | } |
| | | this.formData.transferGoods[index].modelsOptions = []; |
| | | this.formData.transferGoods[index].modelsIds = []; |
| | | this.formData.transferGoods[index].models = []; |
| | | |
| | | this.formData.procureGoods[index].goodsTemplateName = this.getGoodsTemplateName(e); |
| | | this.formData.transferGoods[index].goodsTemplateName = this.getGoodsTemplateName(e); |
| | | // 根据选中物品名称id获取规格型号列表 |
| | | this.getgoodsModel(e, index); |
| | | }, |
| | | |
| | | // 规格型号选择 |
| | | modelChange(e, index) { |
| | | let arr = [...this.formData.procureGoods[index].models]; |
| | | let arr = [...this.formData.transferGoods[index].models]; |
| | | let str = JSON.stringify(arr); |
| | | e.forEach((item) => { |
| | | if (str.indexOf(item) == -1) { |
| | |
| | | arr.push({ ...this.modelsItem, baseGoodsModelsId: item, unit: temp.unit }); |
| | | } |
| | | }); |
| | | this.formData.procureGoods[index].models = arr; |
| | | this.formData.transferGoods[index].models = arr; |
| | | }, |
| | | |
| | | // 规格型号移除 |
| | | modelRemoveTag(e, index) { |
| | | let arr = this.formData.procureGoods[index].models; |
| | | let arr = this.formData.transferGoods[index].models; |
| | | let delIndex = arr.findIndex((v) => v.baseGoodsModelsId == e); |
| | | this.formData.procureGoods[index].models.splice(delIndex, 1); |
| | | this.formData.transferGoods[index].models.splice(delIndex, 1); |
| | | }, |
| | | |
| | | // 上传 |
| | |
| | | |
| | | // 点击新增物品 |
| | | addGoods() { |
| | | this.formData.procureGoods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | this.formData.transferGoods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | }, |
| | | |
| | | // 点击移除 |
| | | removeGoods(index) { |
| | | this.formData.procureGoods.splice(index, 1); |
| | | this.formData.transferGoods.splice(index, 1); |
| | | }, |
| | | |
| | | // 调拨数量校验 |
| | | countsChange(e, goodsIndex,index) { |
| | | const curItem = this.formData.procureGoods[goodsIndex].models[index] |
| | | const worehouseCount = curItem.worehouseCount |
| | | countsChange(e, goodsIndex, index) { |
| | | const curItem = this.formData.transferGoods[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 |
| | | this.$message.warning('数量超过现有库存'); |
| | | curItem.counts = worehouseCount; |
| | | } |
| | | }, |
| | | |
| | |
| | | this.$refs['ruleForm'].validate((valid) => { |
| | | if (valid) { |
| | | console.log('this.formData', this.formData); |
| | | if (this.setting.id) { |
| | | procureAdd(this.formData) |
| | | .then((res) => { |
| | | this.$message.success('保存成功!'); |
| | | this.close(); |
| | | this.$emit('search'); |
| | | }) |
| | | .catch((err) => { |
| | | console.log('create err', err); |
| | | this.$message.error('保存失败'); |
| | | }); |
| | | } else { |
| | | procureEdit(this.formData) |
| | | .then((res) => { |
| | | this.$message.success('保存成功!'); |
| | | this.close(); |
| | | this.$emit('search'); |
| | | }) |
| | | .catch((err) => { |
| | | console.log('edit err', err); |
| | | this.$message.error('保存失败'); |
| | | }); |
| | | } |
| | | transferAdd(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('校验未通过,请检查。'); |
| | | } |
| | |
| | | this.formData = { |
| | | warehouseId: '', // 调拨仓库id |
| | | procureTime: '', // 调拨时间 |
| | | procureGoods: [], |
| | | transferGoods: [], |
| | | }; |
| | | this.$emit('close'); |
| | | }, |
| | | |
| | | // 通过子集id查到所以相关父级id并返回数组 |
| | | findParentIds(dataSource, nodeId) { |
| | | const parentIds = []; // 用于存储所有父节点ID的数组 |
| | | |
| | | // 定义一个递归函数,用于遍历整棵树并查找子节点的所有父节点 |
| | | function traverse(node, nodeId) { |
| | | if (node.id === nodeId) { |
| | | // 如果当前节点的ID等于子节点的ID,则表示已经找到了子节点,可以开始向上查找父节点 |
| | | return true; // 返回true表示已经找到了子节点 |
| | | } |
| | | |
| | | if (node.children) { |
| | | // 如果当前节点有子节点,则继续遍历子节点 |
| | | for (const childNode of node.children) { |
| | | if (traverse(childNode, nodeId)) { |
| | | // 如果在子节点中找到了子节点的父节点,则将当前节点的ID添加到父节点ID数组中,并返回true表示已经找到了子节点 |
| | | parentIds.push(node.id); |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; // 如果当前节点不是子节点的父节点,则返回false |
| | | } |
| | | |
| | | // 从根节点开始遍历整棵树,并调用递归函数查找子节点的所有父节点 |
| | | for (const node of dataSource) { |
| | | if (traverse(node, nodeId)) { |
| | | // 如果在当前节点的子树中找到了子节点的父节点,则直接退出循环 |
| | | break; |
| | | } |
| | | } |
| | | |
| | | return parentIds; // 返回所有父节点ID的数组 |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | <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 class="table-tool-bar" style="margin-bottom: 15px"> |
| | | <my-button name="调拨申请" icon="el-icon-plus" @click="handleAdd" site="tools" size="medium" /> |
| | | </div> |
| | | <div :style="{ 'overflow-y': 'auto', height: `${clientHeight - 320}px` }" v-loading="loading"> |
| | | <el-row class="card" :gutter="5"> |
| | | <el-row v-if="list.length" class="card" :gutter="5"> |
| | | <el-col v-for="(item, index) in list" :key="index" class="cm-item"> |
| | | <el-card class="card-data"> |
| | | <div class="card-container"> |
| | |
| | | <div class="card-header-left"> |
| | | <span>调拨单号:</span> |
| | | <span class="value">{{ item.businessFormCode }}</span> |
| | | <div v-if="item.states == 0" class="states states-warning">待出库</div> |
| | | <div v-if="item.states == 1" class="states states-warning">待接收</div> |
| | | <div v-if="item.states == 2" class="states states-success">已接收</div> |
| | | <div v-if="item.states == 4" class="states states-info">已撤销</div> |
| | | </div> |
| | | <div class="card-header-right"> |
| | | <el-button site="form" type="success" size="mini" @click="handleExport(item)" |
| | | >导出调拨单</el-button |
| | | > |
| | | <el-button |
| | | v-if="item.states == 1" |
| | | site="form" |
| | | type="success" |
| | | size="mini" |
| | | @click="handleIncome(item)" |
| | | >入库</el-button |
| | | > |
| | | <el-button |
| | | v-if="item.states == 0" |
| | | site="form" |
| | | type="danger" |
| | | size="mini" |
| | | @click="handleRevoke(item)" |
| | | >撤销</el-button |
| | | > |
| | | <el-button |
| | | v-if="item.states == 2" |
| | | site="form" |
| | | type="primary" |
| | | 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.agencyId }}</div> |
| | | <div class="box"><span class="span-two">操作人:</span>{{ item.buyerName }}</div> |
| | | <div class="box"><span class="span-two">接收机构:</span>{{ item.inAgencyName }}</div> |
| | | <div class="box"><span class="span-two">申请人:</span>{{ item.operatorName }}</div> |
| | | <div class="box"> |
| | | <span class="span-two">调拨时间:</span>{{ item.procureTime | formatTime }} |
| | | <span class="span-two">申请调拨时间:</span>{{ item.createTime | formatTime }} |
| | | </div> |
| | | <div class="box"> |
| | | <span class="span-two">接收时间:</span>{{ item.inTime | formatTime }} |
| | | </div> |
| | | </div> |
| | | <div class="one-hed"> |
| | | <div class="box"><span class="span-two">调拨机构:</span>{{ item.outAgencyName }}</div> |
| | | <div class="box"><span class="span-two">调拨人:</span>{{ item.outOperatorName }}</div> |
| | | <div class="box"> |
| | | <span class="span-two">调拨时间:</span>{{ item.outputTime | formatTime }} |
| | | </div> |
| | | </div> |
| | | <div class="card-end"> |
| | | <div v-for="(just, index) in item.fromProcureTemplateInfoList" :key="index" class="item"> |
| | | <div class="name">{{ just.goodsTemplateName }}</div> |
| | | <div v-for="(just, index) in item.fromTransferTemplateInfoList" :key="index" class="item"> |
| | | <div class="name">{{ just.goodsName }}</div> |
| | | <div class="value-box"> |
| | | <div class="value-box-item"> |
| | | <span class="label">数量:</span> |
| | |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="no-data" v-else>暂无数据</div> |
| | | </div> |
| | | <el-pagination |
| | | :small="false" |
| | |
| | | </el-card> |
| | | </el-container> |
| | | <!--添加/编辑弹窗--> |
| | | <edit v-if="editSetting.show" :setting="editSetting" ref="editRef" @close="editSetting.show=false" @search="refreshData"></edit> |
| | | <detail ref="detailRef"></detail> |
| | | <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 { procureList, procureDel, procureIncome } from '@/api/stock/procure/purchaseOrder'; |
| | | import { transferList, transferUpdStatus, transfeIncome, transferExport } from '@/api/stock/transfer'; |
| | | import MyButton from '@/components/myButton/myButton'; |
| | | import SettingIplatform from '@/utils/settingIplatform'; |
| | | import myImport from '@/views/components/myImport'; |
| | | import edit from './edit'; |
| | | import detail from './detail'; |
| | | import { getBaseUrl } from '@/utils/base'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | import listPage from '../../../mixins/listPage'; |
| | | import transfer from '../../../mixins/transfer'; |
| | | import { commonsApi } from '@/api/commonsApi'; |
| | | |
| | | export default { |
| | | name: 'index', |
| | | mixins: [listPage, transfer], |
| | | components: { MyButton, myImport, edit, detail }, |
| | | data() { |
| | | return { |
| | |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | dataIndex: 'agencyId', |
| | | dataIndex: 'outAgencyId', |
| | | label: '调拨机构', |
| | | placeholder: '请选择', |
| | | optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null }, |
| | | optionsConfig: { url: commonsApi.cascader_tree_fin_tenant, props: null }, |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | dataIndex: 'name', |
| | | dataIndex: 'inAgencyId', |
| | | label: '接收机构', |
| | | placeholder: '请选择', |
| | | optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null }, |
| | | optionsConfig: { url: commonsApi.cascader_tree_fin_tenant, props: null }, |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | |
| | | label: '状态', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [ |
| | | { |
| | | label: '全部', |
| | | value: '', |
| | | }, |
| | | { |
| | | label: '待调拨', |
| | | value: '1', |
| | | }, |
| | | { |
| | | label: '已调拨', |
| | | value: '2', |
| | | }, |
| | | ], |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val1', |
| | | dataIndex: 'createTimeStart', |
| | | label: '申请时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val2', |
| | | dataIndex: 'createTimeEnd', |
| | | label: '至', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val1', |
| | | dataIndex: 'startTime', |
| | | label: '接收时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val2', |
| | | dataIndex: 'endTime', |
| | | label: '至', |
| | | defaultValue: '', |
| | | }, |
| | | ], |
| | | // 树数据 |
| | | treeDataList: [], |
| | | // 搜索条件 |
| | | filterFrom: { |
| | | tenantId: null, |
| | | userName: null, |
| | | userPhone: null, |
| | | states: null, |
| | | }, |
| | | // 导入 |
| | | 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, |
| | | }, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | total: 0, |
| | | filterFrom:{ |
| | | } |
| | | }; |
| | | }, |
| | | computed: { |
| | | clientHeight() { |
| | | return document.documentElement.clientHeight; |
| | | }, |
| | | }, |
| | | filters: { |
| | | formatTime(time) { |
| | | if (!time) return; |
| | | return DateFormatter.LongToDateTime(time); |
| | | }, |
| | | }, |
| | | created() { |
| | | this.filterFrom = { |
| | | operatorId:this.userInfo.id |
| | | } |
| | | this.fetchData(); |
| | | this.items.map((v) => { |
| | | if (v.label == '状态') { |
| | | v.options = this.statesOptions; |
| | | } |
| | | return v; |
| | | }); |
| | | }, |
| | | methods: { |
| | | fetchData() { |
| | | this.loading = true; |
| | | procureList({ |
| | | transferList({ |
| | | pageNum: this.pageNum, |
| | | pageSize: this.pageSize, |
| | | ...this.filterFrom, |
| | |
| | | console.log(this.list); |
| | | }); |
| | | }, |
| | | //导入 |
| | | 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(); |
| | | }; |
| | | }, |
| | | // 导出 |
| | | handleExport() {}, |
| | | // 新增 |
| | | handleAdd() { |
| | | this.editSetting.id = null; |
| | | this.editSetting.info = null; |
| | | this.editSetting.title = '新增'; |
| | | this.editSetting.show = true; |
| | | }, |
| | | // 编辑 |
| | | handleEdit(row) { |
| | | this.editSetting.id = row.id; |
| | | this.editSetting.info = null; |
| | | this.editSetting.title = '编辑'; |
| | | this.editSetting.show = true; |
| | | }, |
| | | // 详情 |
| | | handleDetail(row) { |
| | | this.$refs.detailRef.open(row.id); |
| | | }, |
| | | // 调拨 |
| | | |
| | | // 入库 |
| | | handleIncome(row) { |
| | | this.$confirm(`您确定 单号:${row.businessFormCode} 调拨吗?`, '调拨调拨') |
| | | .then(function () { |
| | | procureIncome({ id: row.id }).then((res) => { |
| | | this.$message.success('调拨成功!'); |
| | | this.search(); |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | this.$confirm(`您确定 单号:${row.businessFormCode} 调拨出库吗?`, '调拨出库').then(() => { |
| | | transfeIncome({ id: row.id }) |
| | | .then((res) => { |
| | | this.$message.success('调拨出库成功!'); |
| | | this.search(1); |
| | | }) |
| | | }); |
| | | }, |
| | | del(row) { |
| | | this.$modal |
| | | .confirm('是否确认删除调拨单号为"' + row.businessFormCode + '"的数据吗?') |
| | | .then(function () { |
| | | procureDel({ id: row.id }).then((res) => {}); |
| | | }) |
| | | .then((res) => { |
| | | this.$message.success('删除成功!'); |
| | | this.search(); |
| | | }) |
| | | .catch(() => {}); |
| | | |
| | | // 导出 |
| | | handleExport(row) { |
| | | transferExport({id:row.id}).then(res=>{ |
| | | |
| | | }) |
| | | }, |
| | | // 分页 |
| | | handleSizeChange(pageSize) { |
| | | this.pageSize = pageSize; |
| | | this.search({ pageNum: 1 }); |
| | | }, |
| | | handleCurrentChange(pageNum) { |
| | | this.myTable.paging.page.pageNum = pageNum; |
| | | this.search({ pageNum: pageNum }); |
| | | }, |
| | | // 查询table列表 |
| | | search(pageNum) { |
| | | this.fetchData(); |
| | | }, |
| | | refreshData() { |
| | | this.pageNum = 1; |
| | | this.pageSize = 10; |
| | | this.search(); |
| | | |
| | | // 撤销 |
| | | handleRevoke(row) { |
| | | this.$confirm(`您确定撤销单号为"${row.businessFormCode}" 的数据吗?`, '撤销').then(() => { |
| | | transferUpdStatus({ id: row.id }) |
| | | .then((res) => { |
| | | this.$message.success('撤销成功!'); |
| | | this.search(1); |
| | | }) |
| | | }); |
| | | }, |
| | | fifterForm(params) { |
| | | this.filterFrom = Object.assign(this.filterFrom, params); |
| | | 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); |
| | | }, |
| | | }, |
| | |
| | | <template> |
| | | <el-dialog |
| | | title="详情" |
| | | width="60%" |
| | | :modal="true" |
| | | :visible.sync="visible" |
| | | :top="'15vh'" |
| | | :close-on-click-modal="false" |
| | | :append-to-body="true" |
| | | :destroy-on-close="true" |
| | | @close="close" |
| | | class="stock-detail" |
| | | > |
| | | <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.agencyId }}</span> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" style="margin-top: 20px"> |
| | | <el-col :span="8"> |
| | | <span>状态:</span> |
| | | <span>{{ detail.states == 1 ? '待调拨' : '已调拨' }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>创建人:</span> |
| | | <span>{{ detail.buyerName }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>调拨时间:</span> |
| | | <span>{{ detail.incomeTime | formatTime }}</span> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" style="margin-top: 20px"> |
| | | <el-col class="img-row" :span="24"> |
| | | <span>调拨手续照片:</span> |
| | | <div class="img-box"></div> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="goods-card" v-for="(goodsItem, goodsIndex) in detail.procureGoods" :key="goodsIndex"> |
| | | <win-md class="stock-detail" :title="setting.title" @close="close" :width="'1100px'"> |
| | | <div v-loading="loading"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <span>物品分类:</span> |
| | | <span>{{ goodsItem.baseCategoryId }}</span> |
| | | <el-col :span="6"> |
| | | <span>调拨单号:</span> |
| | | <span>{{ detail.businessFormCode }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>物品名称:</span> |
| | | <span>{{ goodsItem.goodsTemplateName }}</span> |
| | | <el-col :span="6"> |
| | | <span>调拨机构:</span> |
| | | <span>{{ detail.outAgencyName }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>供货商:</span> |
| | | <span>{{ goodsItem.supplier }}</span> |
| | | <el-col :span="6"> |
| | | <span>调拨人:</span> |
| | | <span>{{ detail.outOperatorName || '-' }}</span> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <span>接收机构:</span> |
| | | <span>{{ detail.inAgencyName }}</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="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> |
| | | <el-row :gutter="20" style="margin-top: 20px"> |
| | | <el-col :span="6"> |
| | | <span>申请人:</span> |
| | | <span>{{ detail.operatorName }}</span> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <span>申请调拨时间:</span> |
| | | <span>{{ detail.createTime | formatTime }}</span> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <span>状态:</span> |
| | | <span>{{ getStatesLabel(detail.states) }}</span> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <span>调拨时间:</span> |
| | | <span>{{ detail.outputTime | formatTime }}</span> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="fileList && fileList.length" :gutter="20" style="margin-top: 20px"> |
| | | <el-col class="img-row" :span="24"> |
| | | <span>调拨手续照片:</span> |
| | | <div class="img-box" v-for="(item, index) in fileList" :key="index" @click="handlePreview(item)"> |
| | | <img class="img" :src="getUrl(item.path)" alt="" /> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="goods-card" v-for="(goodsItem, goodsIndex) in detail.formTransferGoods" :key="goodsIndex"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <span>物品分类:</span> |
| | | <span>{{ goodsItem.categoryName }}</span> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <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="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> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | </win-md> |
| | | </template> |
| | | <script> |
| | | import { procureDetail } from '@/api/stock/procure/purchaseOrder'; |
| | | import { transferDetail } from '@/api/stock/transfer'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | import winMd from '@/components/win/win-md'; |
| | | import transfer from '../../../mixins/transfer'; |
| | | |
| | | export default { |
| | | mixins: [transfer], |
| | | components: { winMd }, |
| | | props: { |
| | | setting: { |
| | | type: Object, |
| | | default: () => {}, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | detail: { |
| | | businessFormCode: '', |
| | | goodsTemplateName: '', |
| | | agencyId: '', |
| | | states: '', |
| | | createName: '', |
| | | time: '', |
| | | procureGoods: [{}, {}], |
| | | }, |
| | | loading: false, |
| | | detail: {}, |
| | | fileList:[] |
| | | }; |
| | | }, |
| | | filters:{ |
| | | filters: { |
| | | formatTime(time) { |
| | | if(!time) return |
| | | return DateFormatter.LongToDateTime(time) |
| | | } |
| | | if (!time) return '-'; |
| | | return DateFormatter.LongToDateTime(time); |
| | | }, |
| | | }, |
| | | created() { |
| | | this.loading = true; |
| | | transferDetail({ id: this.setting.id }).then((res) => { |
| | | this.detail = res; |
| | | this.fileList = this.detail.procureDoc ? JSON.parse(this.detail.procureDoc) : []; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | methods: { |
| | | open(id) { |
| | | this.visible = true; |
| | | procureDetail({ id }).then((res) => { |
| | | this.detail = res; |
| | | }); |
| | | }, |
| | | close() { |
| | | this.visible = false; |
| | | this.$emit('close'); |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | <el-col> |
| | | <!--列表--> |
| | | <div :style="{ 'overflow-y': 'auto', height: `${clientHeight - 320}px` }" v-loading="loading"> |
| | | <el-row class="card" :gutter="5"> |
| | | <el-row v-if="list.length" class="card" :gutter="5"> |
| | | <el-col v-for="(item, index) in list" :key="index" class="cm-item"> |
| | | <el-card class="card-data"> |
| | | <div class="card-container"> |
| | |
| | | <div class="card-header-left"> |
| | | <span>调拨单号:</span> |
| | | <span class="value">{{ item.businessFormCode }}</span> |
| | | <div v-if="item.states == 0" class="states states-warning">待出库</div> |
| | | <div v-if="item.states == 1" class="states states-warning">待接收</div> |
| | | <div v-if="item.states == 2" class="states states-success">已接收</div> |
| | | <div v-if="item.states == 4" class="states states-info">已撤销</div> |
| | | </div> |
| | | <div class="card-header-right"> |
| | | <el-button site="form" type="success" size="mini" @click="handleExport(item)" |
| | | >导出调拨单</el-button |
| | | > |
| | | <el-button |
| | | v-if="item.states == 1" |
| | | site="form" |
| | | type="success" |
| | | size="mini" |
| | | >导出调拨出库单</el-button |
| | | > |
| | | <el-button |
| | | v-if="item.states == 0" |
| | | site="form" |
| | | type="success" |
| | | size="mini" |
| | | @click="handleOutput(item)" |
| | | >出库</el-button |
| | | > |
| | | <el-button |
| | | v-if="item.states == 2" |
| | | site="form" |
| | | type="primary" |
| | | size="mini" |
| | | >导出调拨入库单</el-button |
| | | > |
| | | <el-button name="查看详情" site="form" type="info" size="mini" @click="handleDetail(item)" |
| | | >查看详情</el-button |
| | | > |
| | | </div> |
| | | </div> |
| | | <div class="one-hed"> |
| | | <div class="box"><span class="span-two">接收机构:</span>{{ item.agencyId }}</div> |
| | | <div class="box"><span class="span-two">申请人:</span>{{ item.buyerName }}</div> |
| | | <div class="box"><span class="span-two">接收机构:</span>{{ item.inAgencyName }}</div> |
| | | <div class="box"><span class="span-two">申请人:</span>{{ item.operatorName }}</div> |
| | | <div class="box"> |
| | | <span class="span-two">申请调拨时间:</span>{{ item.procureTime | formatTime }} |
| | | <span class="span-two">申请调拨时间:</span>{{ item.createTime | formatTime }} |
| | | </div> |
| | | <div class="box"> |
| | | <span class="span-two">接收时间:</span>{{ item.procureTime | formatTime }} |
| | | </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.outAgencyName }}</div> |
| | | <div class="box"><span class="span-two">调拨人:</span>{{ item.outOperatorName }}</div> |
| | | <div class="box"> |
| | | <span class="span-two">调拨时间:</span>{{ item.procureTime | formatTime }} |
| | | </div> |
| | | </div> |
| | | <div class="card-end"> |
| | | <div v-for="(just, index) in item.fromProcureTemplateInfoList" :key="index" class="item"> |
| | | <div class="name">{{ just.goodsTemplateName }}</div> |
| | | <div v-for="(just, index) in item.fromTransferTemplateInfoList" :key="index" class="item"> |
| | | <div class="name">{{ just.goodsName }}</div> |
| | | <div class="value-box"> |
| | | <div class="value-box-item"> |
| | | <span class="label">数量:</span> |
| | |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="no-data" v-else>暂无数据</div> |
| | | </div> |
| | | <el-pagination |
| | | :small="false" |
| | |
| | | </el-row> |
| | | </el-card> |
| | | </el-container> |
| | | <!--添加/编辑弹窗--> |
| | | <edit v-if="editSetting.show" :setting="editSetting" ref="editRef" @close="editSetting.show=false" @search="refreshData"></edit> |
| | | <detail ref="detailRef"></detail> |
| | | <my-import |
| | | :import-setting="importSetting" |
| | | :dialog-show="importSetting.dialogShow" |
| | | :dialog-title="importSetting.dialogTitle" |
| | | /> |
| | | <detail |
| | | v-if="detailSetting.show" |
| | | :setting="detailSetting" |
| | | @close="detailSetting.show = false" |
| | | ref="detailRef" |
| | | ></detail> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { procureList, procureDel, procureIncome } from '@/api/stock/procure/purchaseOrder'; |
| | | import { transferList,transferOutput } from '@/api/stock/transfer'; |
| | | import MyButton from '@/components/myButton/myButton'; |
| | | import SettingIplatform from '@/utils/settingIplatform'; |
| | | import myImport from '@/views/components/myImport'; |
| | | import edit from './edit'; |
| | | import detail from './detail'; |
| | | import { getBaseUrl } from '@/utils/base'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | import listPage from '../../../mixins/listPage'; |
| | | import transfer from '../../../mixins/transfer'; |
| | | import { commonsApi } from '@/api/commonsApi'; |
| | | |
| | | export default { |
| | | name: 'index', |
| | | components: { MyButton, myImport, edit, detail }, |
| | | mixins: [listPage, transfer], |
| | | components: { MyButton, myImport, detail }, |
| | | data() { |
| | | return { |
| | | loading: false, |
| | |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'name', |
| | | label: '机构', |
| | | type: 'cascader', |
| | | dataIndex: 'outAgencyId', |
| | | label: '调拨机构', |
| | | placeholder: '请选择', |
| | | optionsConfig: { url: commonsApi.cascader_tree_fin_tenant, props: null }, |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'buyerName', |
| | | label: '创建人', |
| | | placeholder: '请输入', |
| | | type: 'cascader', |
| | | dataIndex: 'inAgencyId', |
| | | label: '接收机构', |
| | | placeholder: '请选择', |
| | | optionsConfig: { url: commonsApi.cascader_tree_fin_tenant, props: null }, |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | label: '状态', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [ |
| | | { |
| | | label: '全部', |
| | | value: '', |
| | | }, |
| | | { |
| | | label: '待调拨', |
| | | value: '1', |
| | | }, |
| | | { |
| | | label: '已调拨', |
| | | value: '2', |
| | | }, |
| | | ], |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val1', |
| | | label: '调拨时间', |
| | | dataIndex: 'createTimeStart', |
| | | label: '申请时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val2', |
| | | dataIndex: 'createTimeEnd', |
| | | label: '至', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'startTime', |
| | | label: '接收时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'endTime', |
| | | label: '至', |
| | | defaultValue: '', |
| | | }, |
| | | ], |
| | | // 树数据 |
| | | treeDataList: [], |
| | | // 搜索条件 |
| | | filterFrom: { |
| | | tenantId: null, |
| | | userName: null, |
| | | userPhone: null, |
| | | states: null, |
| | | }, |
| | | // 导入 |
| | | 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, |
| | | }, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | total: 0, |
| | | }; |
| | | }, |
| | | computed: { |
| | | clientHeight() { |
| | | return document.documentElement.clientHeight; |
| | | }, |
| | | }, |
| | | filters: { |
| | | formatTime(time) { |
| | | if (!time) return; |
| | | return DateFormatter.LongToDateTime(time); |
| | | }, |
| | | }, |
| | | created() { |
| | | this.fetchData(); |
| | | this.items.map((v) => { |
| | | if (v.label == '状态') { |
| | | v.options = this.statesOptions; |
| | | } |
| | | return v; |
| | | }); |
| | | }, |
| | | methods: { |
| | | fetchData() { |
| | | this.loading = true; |
| | | procureList({ |
| | | transferList({ |
| | | pageNum: this.pageNum, |
| | | pageSize: this.pageSize, |
| | | ...this.filterFrom, |
| | |
| | | console.log(this.list); |
| | | }); |
| | | }, |
| | | //导入 |
| | | 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(); |
| | | }; |
| | | }, |
| | | // 导出 |
| | | handleExport() {}, |
| | | // 新增 |
| | | handleAdd() { |
| | | this.editSetting.id = null; |
| | | this.editSetting.info = null; |
| | | this.editSetting.title = '新增'; |
| | | this.editSetting.show = true; |
| | | }, |
| | | // 编辑 |
| | | handleEdit(row) { |
| | | this.editSetting.id = row.id; |
| | | this.editSetting.info = null; |
| | | this.editSetting.title = '编辑'; |
| | | this.editSetting.show = true; |
| | | }, |
| | | // 详情 |
| | | handleDetail(row) { |
| | | this.$refs.detailRef.open(row.id); |
| | | }, |
| | | // 调拨 |
| | | handleIncome(row) { |
| | | this.$confirm(`您确定 单号:${row.businessFormCode} 调拨吗?`, '调拨调拨') |
| | | .then(function () { |
| | | procureIncome({ id: row.id }).then((res) => { |
| | | this.$message.success('调拨成功!'); |
| | | this.search(); |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | del(row) { |
| | | this.$modal |
| | | .confirm('是否确认删除调拨单号为"' + row.businessFormCode + '"的数据吗?') |
| | | .then(function () { |
| | | procureDel({ id: row.id }).then((res) => {}); |
| | | }) |
| | | .then((res) => { |
| | | this.$message.success('删除成功!'); |
| | | this.search(); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | // 分页 |
| | | handleSizeChange(pageSize) { |
| | | this.pageSize = pageSize; |
| | | this.search({ pageNum: 1 }); |
| | | }, |
| | | handleCurrentChange(pageNum) { |
| | | this.myTable.paging.page.pageNum = pageNum; |
| | | this.search({ pageNum: pageNum }); |
| | | }, |
| | | // 查询table列表 |
| | | search(pageNum) { |
| | | this.fetchData(); |
| | | }, |
| | | refreshData() { |
| | | this.pageNum = 1; |
| | | this.pageSize = 10; |
| | | this.search(); |
| | | handleOutput(row) { |
| | | this.$confirm(`您确定 单号:${row.businessFormCode} 调拨出库吗?`, '调拨出库').then(() => { |
| | | transferOutput({ id: row.id }) |
| | | .then((res) => { |
| | | this.$message.success('调拨出库成功!'); |
| | | this.search(1); |
| | | }) |
| | | }); |
| | | }, |
| | | fifterForm(params) { |
| | | this.filterFrom = Object.assign(this.filterFrom, params); |
| | | 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); |
| | | }, |
| | | }, |