| | |
| | | }); |
| | | } |
| | | |
| | | // 编辑 |
| | | // 盘点详情 |
| | | export function inventoryDetail(params) { |
| | | return request({ |
| | | url: '/pc/l/wh/form/inventory/detail', |
| | |
| | | params, |
| | | }); |
| | | } |
| | | |
| | | // 查询盘点单物品 |
| | | export function inventoryGoodsList(params) { |
| | | return request({ |
| | | url: '/pc/l/wh/form/inventory/goods/list', |
| | | method: 'get', |
| | | params, |
| | | }); |
| | | } |
| | |
| | | function stockType(str, selStr,color) { |
| | | color=color||'#F3595A' |
| | | //str为要改变颜色的字符(传入的参数) |
| | | //selStr是指定的字符串 |
| | | let res = new RegExp('(' + str + ')', 'g'); |
| | | return selStr.replace(res, `<span style='color:${color}'>${str}</span>`); |
| | | function stockType(row) { |
| | | let result = ''; |
| | | let arr = ['采购入库', '调拨', '其他出库', '部门分发', '报废出库', '部门物品回退仓库', '物品盘点']; |
| | | if (row.businessType == 7) { |
| | | if (row.thisType == 1) { |
| | | result = '盘盈入库'; |
| | | } else { |
| | | result = '盘亏出库'; |
| | | } |
| | | } else if (row.businessType == 2) { |
| | | if (row.thisType == 1) { |
| | | result = '调拨入库'; |
| | | } else { |
| | | result = '调拨出库'; |
| | | } |
| | | } else if (row.businessType == 4) { |
| | | if (row.thisType == 1) { |
| | | result = '退还入库'; |
| | | } else { |
| | | result = '申领出库'; |
| | | } |
| | | } else { |
| | | result = arr[row.businessType - 1]; |
| | | } |
| | | export default stockType; |
| | | |
| | | return result |
| | | } |
| | | export default stockType; |
| | |
| | | import edit from './edit'; |
| | | import detail from './detail'; |
| | | import listPage from '../../../mixins/listPage' |
| | | import SettingIplatform from '@/utils/settingIplatform'; |
| | | |
| | | export default { |
| | | name: 'index', |
| | |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'goodsName', |
| | | type: 'select', |
| | | dataIndex: 'goodsTemplateId', |
| | | label: '物品名称', |
| | | placeholder: '可模糊搜索', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | options: [], |
| | | optionsConfig: { |
| | | label: 'goodsName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate', |
| | | }, |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | |
| | | ], |
| | | }; |
| | | }, |
| | | created(){ |
| | | this.fetchData() |
| | | }, |
| | | methods: { |
| | | fetchData() { |
| | | this.loading = true; |
| | |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'thisType', |
| | | dataIndex: 'flowType', |
| | | label: '类型', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [ |
| | | { |
| | | label: '采购入库', |
| | | value: 1, |
| | | }, |
| | | { |
| | | label: '退还入库', |
| | | value: 2, |
| | | }, |
| | | ], |
| | | options: [], |
| | | optionsConfig: { |
| | | label: 'dict_label', |
| | | value: 'dict_value', |
| | | url: SettingIplatform.apiBaseURL + '/permit/dict/data/type/FLOW_TYPE', |
| | | }, |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | cascader: [{ key: 'baseGoodsModelsId', queryKey: 'goodsTemplatesId' }], |
| | | optionsConfig: { |
| | | label: 'goodsName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate', |
| | | }, |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | optionsConfig: { |
| | | label: 'modelName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/goods/models/query/goodsModel', |
| | | }, |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | |
| | | }; |
| | | }, |
| | | created() { |
| | | this.initSearch(); |
| | | }, |
| | | methods: { |
| | | 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; |
| | | }); |
| | | } |
| | | 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; |
| | | this.detailSetting.info = JSON.stringify(row); |
| | |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant'; |
| | | import { getBaseUrl } from '@/utils/base'; |
| | | import { mapGetters } from 'vuex'; |
| | | import { selectTenantWarehouse,goodsModel } from '@/api/baseSetting/finsystenant'; |
| | | import { selectTenantWarehouse, goodsModel } from '@/api/baseSetting/finsystenant'; |
| | | import { getDicts } from '@/api/system/dict/data'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | |
| | | export default { |
| | | name: 'index', |
| | |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'goodsTemplateName', |
| | | label: '物品名称', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | optionsConfig: { |
| | | label: 'warehouseName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/warehouse/select/tenant_warehouse', |
| | | }, |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'warehouseId', |
| | | label: '规格型号', |
| | | placeholder: '请选择', |
| | | dataIndex: 'goodsTemplateId', |
| | | label: '物品名称', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | options: [], |
| | | cascader: [{ key: 'baseGoodsModelsId', queryKey: 'goodsTemplatesId' }], |
| | | optionsConfig: { |
| | | label: 'goodsName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate', |
| | | }, |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'baseGoodsModelsId', |
| | | label: '规格型号', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | options: [], |
| | | optionsConfig: { |
| | | label: 'modelName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/goods/models/query/goodsModel', |
| | | }, |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | label: '类型', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [{ |
| | | label:'全部', |
| | | value:'' |
| | | },{ |
| | | label:'盘盈', |
| | | value:'1' |
| | | },{ |
| | | label:'盘亏', |
| | | value:'2' |
| | | }], |
| | | options: [ |
| | | { |
| | | label: '全部', |
| | | value: '', |
| | | }, |
| | | { |
| | | label: '盘盈', |
| | | value: '1', |
| | | }, |
| | | { |
| | | label: '盘亏', |
| | | value: '2', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | label: '出入库类型', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [{ |
| | | label:'全部', |
| | | value:'' |
| | | },{ |
| | | label:'盘盈入库', |
| | | value:'1' |
| | | },{ |
| | | label:'盘亏出库', |
| | | value:'2' |
| | | }], |
| | | options: [ |
| | | { |
| | | label: '全部', |
| | | value: '', |
| | | }, |
| | | { |
| | | label: '盘盈入库', |
| | | value: '1', |
| | | }, |
| | | { |
| | | label: '盘亏出库', |
| | | value: '2', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'baseGoodsModelsId', |
| | | dataIndex: 'businessFormCode', |
| | | label: '单号', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | |
| | | treeDataList: [], |
| | | // 搜索条件 |
| | | filterFrom: { |
| | | tenantId: null, |
| | | userName: null, |
| | | userPhone: null, |
| | | status: 1, |
| | | }, |
| | | // 表格数据 |
| | | table: { |
| | |
| | | }, |
| | | // 列信息 |
| | | columns: [ |
| | | { title: '仓库', field: 'warehouseFormCode', align: 'left' }, |
| | | { title: '仓库', field: 'warehouseName', align: 'left' }, |
| | | { title: '物品名称', field: 'goodsTemplateName', 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: 'baseGoodsModelsName', align: 'center' }, |
| | | { title: '类型', field: 'inventoryResultType', align: 'center' }, |
| | | { title: '库存数量', field: 'initCounts', align: 'left' }, |
| | | { title: '盘点数量', field: 'inventoryCounts', align: 'left' }, |
| | | { title: '异常数量', field: 'errorCounts', align: 'left' }, |
| | | { |
| | | title: '出入库类型', |
| | | field: 'inventoryType', |
| | | align: 'left', |
| | | formatter: (row) => { |
| | | return { value: row.inventoryType, type: row.inventoryType && row.inventoryType.includes('盘盈') ? 'success' : 'danger' }; |
| | | }, |
| | | }, |
| | | { title: '出入库单号', field: 'warehouseFormCode', align: 'left' }, |
| | | { title: '机构', field: 'agencyName', align: 'left' }, |
| | | { title: '操作人', field: 'operatorName', align: 'left' }, |
| | | { title: '操作时间', field: 'summary', align: 'left' }, |
| | | { |
| | | title: '操作时间', |
| | | field: 'operatorTime', |
| | | align: 'center', |
| | | formatter: (row) => { |
| | | return { value: row.operatorTime ? DateFormatter.LongToDateTime(row.operatorTime) : '-' }; |
| | | }, |
| | | }, |
| | | ], |
| | | // 操作信息 |
| | | operation: { |
| | |
| | | computed: { |
| | | ...mapGetters(['userInfo']), |
| | | }, |
| | | created() { |
| | | this.initQuery(); |
| | | }, |
| | | created() {}, |
| | | methods: { |
| | | initQuery() { |
| | | selectTenantWarehouse({ agencyId: this.userInfo.tenantId }).then((res) => { |
| | | this.items.forEach((v) => { |
| | | if (v.label == '盘点仓库') { |
| | | v.options = res.map((item) => { |
| | | item.label = item.warehouseName; |
| | | item.value = item.id; |
| | | return item; |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | goodsModel().then((res) => { |
| | | this.items.forEach((v) => { |
| | | if (v.label == '规格型号') { |
| | | v.options = res.map((item) => { |
| | | item.label = item.modelName; |
| | | item.value = item.id; |
| | | return item; |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | }, |
| | | showAudit(row) { |
| | | this.editSetting.id = row.id; |
| | | this.editSetting.info = JSON.stringify(row); |
| | |
| | | <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-col :span="6">盘点任务:{{ formData.businessFormName }}</el-col> |
| | | <el-col :span="6">盘点仓库:{{ formData.warehouseName }}</el-col> |
| | | </el-row> |
| | | <el-table v-loading="loading" :data="formData.tableData" height="100%" :stripe="true" class="the-table"> |
| | | <el-table v-loading="loading" :data="formData.formInventoryGoodsList" height="500" :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="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-column prop="baseGoodsModelsName" label="型号" align="center"> </el-table-column> |
| | | <el-table-column prop="inventoryCount" label="应盘数量" align="center"></el-table-column> |
| | | <el-table-column prop="realNum" label="实盘数量" align="center"></el-table-column> |
| | | <el-table-column prop="states" 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'; |
| | | import { inventoryDetail } from '@/api/stock/inventory'; |
| | | export default { |
| | | components: { winMd, myButton }, |
| | | props: { |
| | |
| | | loading: false, |
| | | formData: { |
| | | businessFormCode: '2023080812', |
| | | businessTaskCode: '2023年9月盘点单', |
| | | warehouseId: '开封市仓库', |
| | | tableData: [], |
| | | businessFormName: '2023年9月盘点单', |
| | | warehouseName: '开封市仓库', |
| | | formInventoryGoodsList: [], |
| | | }, |
| | | }; |
| | | }, |
| | | 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, |
| | | }); |
| | | } |
| | | inventoryDetail({ id: this.setting.id }).then((res) => { |
| | | this.formData = res; |
| | | }); |
| | | }, |
| | | methods: { |
| | | close() { |
| | |
| | | @close="inventorySetting.show = false" |
| | | @search="search" |
| | | /> |
| | | <detail v-if="inventoryDetail.show" :setting="inventoryDetail" @close="inventoryDetail.show = false" @search="search" /> |
| | | </el-card> |
| | | </el-container> |
| | | </el-container> |
| | |
| | | import SettingIplatform from '@/utils/settingIplatform'; |
| | | import edit from './edit'; |
| | | import inventory from './inventory'; |
| | | import detail from './detail'; |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant'; |
| | | import myImport from '@/views/components/myImport'; |
| | | import { getBaseUrl } from '@/utils/base'; |
| | |
| | | |
| | | export default { |
| | | name: 'index', |
| | | components: { MyButton, MyTableV2, edit, myImport, inventory }, |
| | | components: { MyButton, MyTableV2, edit, myImport, inventory,detail }, |
| | | data() { |
| | | return { |
| | | // 搜索框 |
| | |
| | | show: false, |
| | | }, |
| | | inventorySetting: { |
| | | title: '', |
| | | id: '', |
| | | orgId: '', |
| | | show: false, |
| | | }, |
| | | inventoryDetail:{ |
| | | title: '', |
| | | id: '', |
| | | orgId: '', |
| | |
| | | showInventory(row) { |
| | | this.inventorySetting.id = row.id; |
| | | this.inventorySetting.info = JSON.stringify(row); |
| | | this.inventorySetting.title = '盘点'; |
| | | this.inventorySetting.title = '盘点任务'; |
| | | this.inventorySetting.show = true; |
| | | }, |
| | | showInventoryDetail(row) { |
| | | this.inventorySetting.id = row.id; |
| | | this.inventorySetting.info = JSON.stringify(row); |
| | | this.inventorySetting.title = '盘点'; |
| | | this.inventorySetting.show = true; |
| | | this.inventoryDetail.id = row.id; |
| | | this.inventoryDetail.info = JSON.stringify(row); |
| | | this.inventoryDetail.title = '盘点详情'; |
| | | this.inventoryDetail.show = true; |
| | | }, |
| | | // 查询table列表 |
| | | search(pageNum) { |
| | |
| | | v-loading="loading" |
| | | :data="formData.formInventoryGoodsList" |
| | | :rules="rules" |
| | | height="400" |
| | | height="500" |
| | | :stripe="true" |
| | | class="the-table" |
| | | > |
| | |
| | | <script> |
| | | import winMd from '@/components/win/win-md'; |
| | | import myButton from '@/components/myButton/myButton'; |
| | | import { inventoryQuery, inventoryTemporaryStorage, inventoryFinish } from '@/api/stock/inventory'; |
| | | import { inventoryQuery, inventoryTemporaryStorage, inventoryFinish, inventoryDetail } from '@/api/stock/inventory'; |
| | | export default { |
| | | components: { winMd, myButton }, |
| | | props: { |
| | |
| | | console.log('info', info); |
| | | if (info.states == 1) { |
| | | // 继续盘点 |
| | | |
| | | inventoryDetail({ id: this.setting.id }).then((res) => { |
| | | this.formData = res; |
| | | this.formData.id = this.setting.id; |
| | | }); |
| | | } else { |
| | | inventoryQuery({ id: this.setting.id }).then((res) => { |
| | | this.formData = res; |
| | | this.formData.id = this.setting.id; |
| | | }); |
| | | } |
| | | inventoryQuery({ id: this.setting.id }).then((res) => { |
| | | this.formData = res; |
| | | this.formData.id = this.setting.id; |
| | | }); |
| | | }, |
| | | methods: { |
| | | close() { |
| | | this.$emit('close'); |
| | | }, |
| | | staging() { |
| | | this.$refs['ruleForm'].validate((valid) => { |
| | | if (valid) { |
| | | const params = { |
| | | ...this.formData, |
| | | inventoryGoodsList: this.formData.formInventoryGoodsList, |
| | | }; |
| | | inventoryTemporaryStorage(params).then(() => { |
| | | this.$message.success('暂存成功!'); |
| | | this.close(); |
| | | this.$emit('search'); |
| | | }); |
| | | } |
| | | const params = { |
| | | id: this.formData.id, |
| | | inventoryGoodsList: this.formData.formInventoryGoodsList, |
| | | }; |
| | | inventoryTemporaryStorage(params).then(() => { |
| | | this.$message.success('暂存成功!'); |
| | | this.close(); |
| | | this.$emit('search'); |
| | | }); |
| | | }, |
| | | save() { |
| | |
| | | label: '类别', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | optionsConfig: { |
| | | label: 'dict_label', |
| | | value: 'dict_value', |
| | | url: SettingIplatform.apiBaseURL + '/permit/dict/data/type/GOODS_PRICE', |
| | | }, |
| | | options: [{ |
| | | label:'A', |
| | | value:'1' |
| | | },{ |
| | | label:'B', |
| | | value:'2' |
| | | },{ |
| | | label:'C', |
| | | value:'3' |
| | | }], |
| | | }, |
| | | ], |
| | | // 树数据 |
| | |
| | | > |
| | | <el-input v-model.number="scope.row.lowerLimit"></el-input> |
| | | </el-form-item> |
| | | <el-input v-else v-model.number="scope.row.lowerLimit"></el-input> |
| | | <el-input v-else v-model.number="scope.row.lowerLimit" style="margin-bottom: 18px;"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="upperLimit" label="封顶库存" align="center"> |
| | |
| | | > |
| | | <el-input v-model.number="scope.row.upperLimit"></el-input> |
| | | </el-form-item> |
| | | <el-input v-else v-model.number="scope.row.upperLimit"></el-input> |
| | | <el-input v-else v-model.number="scope.row.upperLimit" style="margin-bottom: 18px;"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </el-card> |
| | | </el-container> |
| | | </el-container> |
| | | <my-import |
| | | :import-setting="importSetting" |
| | | :dialog-show="importSetting.dialogShow" |
| | | :dialog-title="importSetting.dialogTitle" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import myImport from '@/views/components/myImport'; |
| | | import { getBaseUrl } from '@/utils/base'; |
| | | import { selectTenantWarehouse, treeList } from '@/api/baseSetting/finsystenant'; |
| | | import {warningConfigGetDel} from '@/api/stock/ledger' |
| | | import { warningConfigGetDel } from '@/api/stock/ledger'; |
| | | import { getDicts } from '@/api/system/dict/data'; |
| | | import { mapGetters } from 'vuex'; |
| | | |
| | | export default { |
| | | name: 'index', |
| | | components: { MyButton, MyTableV2, edit }, |
| | | components: { MyButton, MyTableV2, edit,myImport }, |
| | | data() { |
| | | return { |
| | | // 搜索框 |
| | |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | cascader: [{key:'warehouseId',queryKey: 'agencyId'},{key:'goodsTemplateId',queryKey: 'agencyId'}], |
| | | cascader: [ |
| | | { key: 'warehouseId', queryKey: 'agencyId' }, |
| | | { key: 'goodsTemplateId', queryKey: 'agencyId' }, |
| | | ], |
| | | optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null }, |
| | | }, |
| | | { |
| | |
| | | optionsConfig: { |
| | | label: 'warehouseName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/warehouse/select/tenant_warehouse' |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/warehouse/select/tenant_warehouse', |
| | | }, |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'goodsTemplateId', |
| | | dataIndex: 'baseGoodsTemplateId', |
| | | label: '物品名称', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | options: [], |
| | | cascader: [{key:'categoryId',queryKey: 'goodsTemplatesId'}], |
| | | cascader: [{ key: 'categoryId', queryKey: 'goodsTemplatesId' }], |
| | | optionsConfig: { |
| | | label: 'goodsName', |
| | | value: 'id', |
| | |
| | | }, |
| | | }, |
| | | { |
| | | type: 'select', |
| | | type: 'cascader', |
| | | dataIndex: 'categoryId', |
| | | label: '分类', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | optionsConfig: { |
| | | label: 'modelName', |
| | | label: 'label', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/goods/models/query/goodsModel' |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/category/select/tree', |
| | | props: { checkStrictly: false }, |
| | | }, |
| | | }, |
| | | { |
| | |
| | | label: '类别', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | optionsConfig: { |
| | | label: 'dict_label', |
| | | value: 'dict_value', |
| | | url: SettingIplatform.apiBaseURL + '/permit/dict/data/type/GOODS_PRICE', |
| | | }, |
| | | options: [{ |
| | | label:'A', |
| | | value:'1' |
| | | },{ |
| | | label:'B', |
| | | value:'2' |
| | | },{ |
| | | label:'C', |
| | | value:'3' |
| | | }], |
| | | }, |
| | | ], |
| | | // 树数据 |
| | | treeDataList: [], |
| | | // 导入 |
| | | 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 |
| | | }, |
| | | // 搜索条件 |
| | | filterFrom: { |
| | | warehouseType: 0, |
| | |
| | | }, |
| | | }, |
| | | { |
| | | name: '导出', |
| | | name: '导入', |
| | | click: () => { |
| | | this.handleExport(); |
| | | this.importOrg(); |
| | | }, |
| | | }, |
| | | ], |
| | |
| | | computed: { |
| | | ...mapGetters(['userInfo']), |
| | | }, |
| | | created() { |
| | | }, |
| | | created() {}, |
| | | methods: { |
| | | del(row) { |
| | | this.$modal.confirm('是否确认删除此条的数据吗?').then(() => { |
| | |
| | | this.editSetting.title = '编辑'; |
| | | this.editSetting.show = true; |
| | | }, |
| | | // 导入 |
| | | 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(); |
| | | }; |
| | | }, |
| | | // 查询table列表 |
| | | search(pageNum) { |
| | | if (pageNum != undefined) { |
| | |
| | | }, |
| | | }, |
| | | { |
| | | type: 'select', |
| | | type: 'cascader', |
| | | dataIndex: 'categoryId', |
| | | label: '分类', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | optionsConfig: { |
| | | label: 'modelName', |
| | | label: 'label', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/goods/models/query/goodsModel' |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/category/select/tree', |
| | | props:{checkStrictly:false} |
| | | }, |
| | | }, |
| | | { |
| | |
| | | label: '类别', |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | optionsConfig: { |
| | | label: 'dict_label', |
| | | value: 'dict_value', |
| | | url: SettingIplatform.apiBaseURL + '/permit/dict/data/type/GOODS_PRICE', |
| | | }, |
| | | options: [{ |
| | | label:'A', |
| | | value:'1' |
| | | },{ |
| | | label:'B', |
| | | value:'2' |
| | | },{ |
| | | label:'C', |
| | | value:'3' |
| | | }], |
| | | }, |
| | | ], |
| | | // 树数据 |
| | |
| | | }; |
| | | }, |
| | | created() { |
| | | // this.initQuery(); |
| | | }, |
| | | methods: { |
| | | // 导出 |
| | |
| | | import { getCategorySelectTree, goodsModel } from '@/api/baseSetting/finsystenant'; |
| | | import { getDicts } from '@/api/system/dict/data'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | import stockType from '@/utils/stockType' |
| | | |
| | | export default { |
| | | name: 'index', |
| | |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | options: [], |
| | | cascader: [{ key: 'categoryId', queryKey: 'goodsTemplatesId' }], |
| | | cascader: [{ key: 'baseGoodsModelsId', queryKey: 'goodsTemplatesId' }], |
| | | optionsConfig: { |
| | | label: 'goodsName', |
| | | value: 'id', |
| | |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | dataIndex: 'businessFormCode', |
| | | label: '单号', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val1', |
| | | dataIndex: 'dealTimeStart', |
| | | label: '时间', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | | dataIndex: 'val2', |
| | | dataIndex: 'dealTimeEnd', |
| | | label: '至', |
| | | defaultValue: '', |
| | | }, |
| | |
| | | field: 'summary', |
| | | align: 'left', |
| | | formatter: (row) => { |
| | | let result = ''; |
| | | let arr = ['采购入库', '调拨', '其他出库', '部门分发', '报废出库', '部门物品回退仓库', '物品盘点']; |
| | | if (row.businessType == 7) { |
| | | if (this.thisType == 1) { |
| | | result = '盘盈入库'; |
| | | } else { |
| | | result = '盘亏出库'; |
| | | } |
| | | }else if(this.businessType == 2) { |
| | | if (this.thisType == 1) { |
| | | result = '调拨入库'; |
| | | } else { |
| | | result = '调拨出库'; |
| | | } |
| | | }else { |
| | | result = arr[row.businessType - 1]; |
| | | } |
| | | let result = stockType(row) |
| | | return { value: result }; |
| | | }, |
| | | }, |
| | |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | }, |
| | | // { |
| | | // type: 'text', |
| | | // dataIndex: 'goodsTemplateName', |
| | | // label: '物品名称', |
| | | // placeholder: '可模糊搜索', |
| | | // defaultValue: '', |
| | | // }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'goodsTemplateName', |
| | | type: 'select', |
| | | dataIndex: 'goodsTemplateId', |
| | | label: '物品名称', |
| | | placeholder: '可模糊搜索', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | options: [], |
| | | optionsConfig: { |
| | | label: 'goodsName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate', |
| | | }, |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | |
| | | }, |
| | | }; |
| | | }, |
| | | created(){ |
| | | this.fetchData() |
| | | }, |
| | | methods: { |
| | | fetchData() { |
| | | this.loading = true; |
| | |
| | | } |
| | | if (this.filterFrom.incomeTimeEnd) { |
| | | this.filterFrom.incomeTimeEnd = this.filterFrom.incomeTimeEnd.replace(/\-/g, ''); |
| | | } |
| | | if (this.filterFrom.agencyId && this.filterFrom.agencyId.length) { |
| | | this.filterFrom.agencyId = this.filterFrom.agencyId[this.filterFrom.agencyId.length - 1]; |
| | | } |
| | | this.search(1); |
| | | }, |
| | |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'goodsTemplateName', |
| | | type: 'select', |
| | | dataIndex: 'goodsTemplateId', |
| | | label: '物品名称', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | options: [], |
| | | cascader: [{ key: 'baseGoodsModelsId', queryKey: 'goodsTemplatesId' }], |
| | | optionsConfig: { |
| | | label: 'goodsName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate', |
| | | }, |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'baseGoodsModelsId', |
| | | label: '规格型号', |
| | | placeholder: '请选择', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | options: [], |
| | | optionsConfig: { |
| | | label: 'modelName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/goods/models/query/goodsModel', |
| | | }, |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | |
| | | }; |
| | | }, |
| | | created() { |
| | | // 搜索框规格型号 |
| | | goodsModel().then((res) => { |
| | | this.items.forEach((v) => { |
| | | if (v.label == '规格型号') { |
| | | v.options = res.map((item) => { |
| | | (item.label = item.modelName), (item.value = item.id); |
| | | return item; |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | methods: { |
| | | //导入 |
| | |
| | | } |
| | | if (this.filterFrom.incomeTimeEnd) { |
| | | this.filterFrom.incomeTimeEnd = this.filterFrom.incomeTimeEnd.replace(/\-/g, ''); |
| | | } |
| | | if (params.agencyId && params.agencyId.length) { |
| | | this.filterFrom.agencyId = params.agencyId[params.agencyId.length - 1]; |
| | | } |
| | | this.search(1); |
| | | }, |
| | |
| | | <span>{{ detail.businessFormCode }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>报废仓库:</span> |
| | | <span>仓库:</span> |
| | | <span>{{ detail.warehouseName }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | |
| | | </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> |
| | | <span>{{ detail.operatorName }}</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="12"> |
| | | <span>报废类型:</span> |
| | | <span>{{ detail.buyType == 1 ? '集采' : '自采' }}</span> |
| | | <span>{{ detail.dealTime | formatTime }}</span> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" style="margin-top: 20px"> |
| | | <el-col class="img-row" :span="24"> |
| | | <span>报废手续照片:</span> |
| | | <span>报废手续:</span> |
| | | <div class="img-box" v-for="(item, index) in fileList" :key="index" @click="handlePreview(item)"> |
| | | <img class="img" :src="getUrl(item.path)" alt="" /> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="goods-card" v-for="(goodsItem, goodsIndex) in detail.procureGoods" :key="goodsIndex"> |
| | | <div class="goods-card" v-for="(goodsItem, goodsIndex) in detail.scrappedGoodsInfo" :key="goodsIndex"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <span>物品分类:</span> |
| | |
| | | <span>物品名称:</span> |
| | | <span>{{ goodsItem.goodsTemplateName }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>供货商:</span> |
| | | <span>{{ goodsItem.supplier }}</span> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="goodsItem.models" :stripe="true" style="margin-top: 20px"> |
| | | <el-table :data="goodsItem.scrappedGoodsInfo" :stripe="true" style="margin-top: 20px"> |
| | | <el-table-column prop="baseGoodsModelsName" label="规格型号" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.baseGoodsModelsName }} |
| | |
| | | {{ scope.row.unit }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="price" label="单价" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.price }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="counts" label="报废数量" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.counts }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="counts" label="金额" align="center"> |
| | | <el-table-column prop="scrappedCode" label="报废原因" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ (scope.row.price * scope.row.counts).toFixed(2) }} |
| | | {{ getDictName(scope.row.scrappedCode) }} |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </win-md> |
| | | </template> |
| | | <script> |
| | | import { procureDetail } from '@/api/stock/procure/purchaseOrder'; |
| | | import { scrappedDetail } from '@/api/stock/scrap'; |
| | | import winMd from '@/components/win/win-md'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | import { getDownUrl } from '@/utils/base'; |
| | | import Viewer from 'viewerjs'; |
| | | import 'viewerjs/dist/viewer.css'; |
| | | import { getDicts } from '@/api/system/dict/data'; |
| | | |
| | | let viewer = null; |
| | | |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | scrapReasonOptions: [], |
| | | fileList: [], |
| | | detail: { |
| | | baseCategoryName: '', |
| | |
| | | states: '', |
| | | createName: '', |
| | | time: '', |
| | | procureGoods: [{}, {}], |
| | | fileKey: Math.random(), |
| | | scrappedGoodsInfo: [], |
| | | }, |
| | | }; |
| | | }, |
| | |
| | | }, |
| | | }, |
| | | created() { |
| | | procureDetail({ id: this.setting.id }).then((res) => { |
| | | scrappedDetail({ id: this.setting.id }).then((res) => { |
| | | this.detail = res; |
| | | this.fileList = this.detail.procureDoc ? JSON.parse(this.detail.procureDoc) : []; |
| | | this.$nextTick(() => { |
| | | this.initPreviewImg(); |
| | | }); |
| | | }); |
| | | getDicts('SCRAP_REASON').then((res) => { |
| | | this.scrapReasonOptions = res; |
| | | }); |
| | | }, |
| | | methods: { |
| | | getDictName(code) { |
| | | let item = this.scrapReasonOptions.find(v=>v.dict_value==code) |
| | | return item ? item.dict_label : '' |
| | | }, |
| | | initPreviewImg() { |
| | | if (viewer != null) { |
| | | viewer.destroy(); |
| | |
| | | index++; |
| | | } |
| | | } |
| | | // this.fileList.forEach((f, i) => { |
| | | // if (file.uid == f.uid) { |
| | | // index = i |
| | | // } |
| | | // }) |
| | | // document.querySelector('#uploadPreviewImages').children[0].click() |
| | | viewer.view(index); |
| | | }, |
| | | checkImg(name) { |
| | |
| | | <template> |
| | | <win-md class="stock-edit" :title="`${setting.title}报废报废`" @close="close" :width="'800px'"> |
| | | <win-md class="stock-edit" :title="`${setting.title}报废`" @close="close" :width="'800px'"> |
| | | <el-form class="form" ref="ruleForm" :model="formData" :rules="rules" label-width="120px"> |
| | | <div class="main-w"> |
| | | <el-row :gutter="24" class="headerHeight"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="机构" prop="warehouseId"> |
| | | <el-form-item label="机构" prop="agencyName"> |
| | | <el-input :value="formData.agencyName" disabled></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="报废仓库" prop="warehouseId"> |
| | | <el-input :value="formData.warehouseName" disabled></el-input> |
| | | <el-select v-model="formData.warehouseId" placeholder="请选择" style="width: 100%"> |
| | | <el-option v-for="item in warehouses" :key="item.id" :label="item.warehouseName" :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24" class="headerHeight"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="报废人" prop="buyType"> |
| | | <el-form-item label="报废人" prop="operatorName"> |
| | | <el-input :value="formData.operatorName" disabled></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="报废时间" prop="procureTime"> |
| | | <el-form-item label="报废时间" prop="dealTime"> |
| | | <el-date-picker |
| | | v-model="formData.procureTime" |
| | | v-model="formData.dealTime" |
| | | type="datetime" |
| | | value="yyyy-MM-dd HH:mm:ss" |
| | | value-format="yyyyMMddHHmmss" |
| | |
| | | </el-row> |
| | | <el-row :gutter="24" class="headerHeight"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="报废审批手续" prop="procureDoc"> |
| | | <el-form-item label="报废审批手续" prop="uploadFiles"> |
| | | <upload ref="uploadRef" :values="fileList" :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.scrappedGoodsInfo" :key="goodsIndex"> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="物品分类" |
| | | :prop="`procureGoods[${goodsIndex}].baseCategoryIds`" |
| | | :prop="`scrappedGoodsInfo[${goodsIndex}].baseCategoryIds`" |
| | | :rules="{ |
| | | required: true, |
| | | message: '请选择', |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="物品名称" |
| | | :prop="`procureGoods[${goodsIndex}].baseGoodsTemplateId`" |
| | | :rules="{ |
| | | required: true, |
| | | message: '请选择', |
| | | trigger: 'change', |
| | | }" |
| | | :prop="`scrappedGoodsInfo[${goodsIndex}].baseGoodsTemplateId`" |
| | | :rules="rules.baseGoodsTemplateId" |
| | | > |
| | | <el-select |
| | | v-model="goodsItem.baseGoodsTemplateId" |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="规格型号" |
| | | :prop="`procureGoods[${goodsIndex}].modelsIds`" |
| | | :prop="`scrappedGoodsInfo[${goodsIndex}].modelsIds`" |
| | | :rules="{ |
| | | required: true, |
| | | message: '请选择', |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="goodsItem.models" :stripe="true"> |
| | | <el-table :data="goodsItem.scrappedGoodsList" :stripe="true"> |
| | | <el-table-column prop="baseGoodsModelsId" label="型号" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ getGoodsModelsName(scope.row.baseGoodsModelsId) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="price" label="剩余数量" align="center"> |
| | | <el-table-column prop="total" label="剩余数量" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input type="number" v-model="scope.row.price"></el-input> |
| | | {{ scope.row.total }} |
| | | </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-input v-model.number="scope.row.counts"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="counts" label="报废原因" align="center"> |
| | | <el-table-column prop="scrappedCode" 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 v-model="scope.row.scrappedCode" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in scrapReasonOptions" |
| | | :key="item.dict_value" |
| | | :label="item.dict_label" |
| | | :value="item.dict_value" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="btn-group"> |
| | | <el-button |
| | | v-if="formData.procureGoods.length > 1" |
| | | v-if="formData.scrappedGoodsInfo.length > 1" |
| | | name="移除" |
| | | type="danger" |
| | | plain |
| | |
| | | >移除</el-button |
| | | > |
| | | <el-button |
| | | v-if="formData.procureGoods.length - 1 == goodsIndex" |
| | | v-if="formData.scrappedGoodsInfo.length - 1 == goodsIndex" |
| | | name="新增物品" |
| | | type="primary" |
| | | plain |
| | |
| | | </win-md> |
| | | </template> |
| | | <script> |
| | | import { scrappedAdd } from '@/api/stock/scrap'; |
| | | import { |
| | | goodsTemplate, |
| | | procureAdd, |
| | | procureEdit, |
| | | selectTenantWarehouse, |
| | | goodsModel, |
| | | procureDetail, |
| | | } from '@/api/stock/procure/purchaseOrder'; |
| | | warehouseSelectNumber, |
| | | } from '@/api/baseSetting/finsystenant'; |
| | | import { getTree } from '@/api/foudation/classification'; |
| | | 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 } from '@/utils/base'; |
| | | import { mapGetters } from 'vuex'; |
| | | import SettingIplatform from '../../../../../public/static/config'; |
| | | import { getDicts } from '@/api/system/dict/data'; |
| | | |
| | | export default { |
| | | components: { MyButton, winMd, upload }, |
| | |
| | | }, |
| | | }, |
| | | data() { |
| | | // 自定义校验 |
| | | // 物品重复校验 |
| | | var checkGoodsTemplateId = (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(new Error('请选择')); |
| | | } |
| | | let temp = this.formData.scrappedGoodsInfo.filter((v) => v.baseGoodsTemplateId == value); |
| | | if (!temp || temp.length != 1) { |
| | | return callback(new Error('已选过此物品')); |
| | | } |
| | | callback(); |
| | | }; |
| | | return { |
| | | visible: false, |
| | | loading: false, |
| | | buyTypeOptions: [ |
| | | { |
| | | label: '集采', |
| | | value: '1', |
| | | }, |
| | | { |
| | | label: '自采', |
| | | value: '2', |
| | | }, |
| | | ], |
| | | fileList: [], |
| | | warehouses: [], // 报废仓库列表 |
| | | categoryOptions: [], // 物品分类列表 |
| | | modelList: [], //型号列表 |
| | | scrapReasonOptions: [], // 报废原因列表 |
| | | formData: { |
| | | procureDoc: '', |
| | | uploadFiles: '', |
| | | warehouseId: '', // 报废仓库id |
| | | procureTime: '', // 报废时间 |
| | | buyType: '2', // 报废方式(1:集采;2=自采) |
| | | procureGoods: [], |
| | | dealTime: '', // 报废时间 |
| | | scrappedGoodsInfo: [], |
| | | }, |
| | | goodsItem: { |
| | | baseCategoryIds: '', // 分类编号数组 |
| | |
| | | sort: '', // 显示顺序 |
| | | goodsOptions: [], // 物品列表select |
| | | modelsOptions: [], //规格型号select |
| | | models: [], // 物品名称 |
| | | scrappedGoodsList: [], // 物品名称 |
| | | modelsIds: [], //规格型号 |
| | | }, |
| | | modelsItem: { |
| | | baseGoodsModelsId: '', // 规格型号编号 |
| | | counts: 0, // 操作数量 |
| | | }, |
| | | rules: { |
| | | warehouseId: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | procureTime: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | dealTime: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | buyType: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | |
| | | procureDoc: [{ required: true, message: '请上传', trigger: 'change' }], |
| | | uploadFiles: [{ 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' }], |
| | | }, |
| | | |
| | |
| | | this.getgoodsTemplate(); |
| | | this.getgoodsModel(); |
| | | this.getCategoryTree(); |
| | | this.formData.procureGoods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | this.formData.operatorId = this.userInfo.userCode; |
| | | this.formData.scrappedGoodsInfo.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | this.formData.operatorId = this.userInfo.id; |
| | | this.formData.operatorName = this.userInfo.userName; |
| | | 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.warehouseType = 0; |
| | | getDicts('SCRAP_REASON').then((res) => { |
| | | this.scrapReasonOptions = res; |
| | | }); |
| | | }, |
| | | async getCategoryTree() { |
| | | // 获取物品分类列表 |
| | |
| | | getgoodsTemplate(id, index) { |
| | | goodsTemplate({ categoryId: id || '' }).then((res) => { |
| | | if (index || index == 0) { |
| | | this.$set(this.formData.procureGoods[index], 'goodsOptions', res); |
| | | this.$set(this.formData.scrappedGoodsInfo[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.scrappedGoodsInfo[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.scrappedGoodsInfo[index].goodsOptions = []; |
| | | this.formData.scrappedGoodsInfo[index].baseGoodsTemplateId = ''; |
| | | this.formData.scrappedGoodsInfo[index].goodsTemplateName = ''; |
| | | this.formData.scrappedGoodsInfo[index].modelsOptions = []; |
| | | this.formData.scrappedGoodsInfo[index].modelsIds = []; |
| | | this.formData.scrappedGoodsInfo[index].scrappedGoodsList = []; |
| | | |
| | | this.formData.procureGoods[index].baseCategoryId = e[e.length - 1]; |
| | | this.formData.scrappedGoodsInfo[index].baseCategoryId = e[e.length - 1]; |
| | | // 根据选中分类请求物品名称列表 |
| | | this.getgoodsTemplate(e[e.length - 1], index); |
| | | }, |
| | | |
| | | // 物品名称列表 |
| | | goodsTemplateChange(e, index) { |
| | | this.formData.procureGoods[index].modelsOptions = []; |
| | | this.formData.procureGoods[index].modelsIds = []; |
| | | this.formData.procureGoods[index].models = []; |
| | | this.formData.scrappedGoodsInfo[index].modelsOptions = []; |
| | | this.formData.scrappedGoodsInfo[index].modelsIds = []; |
| | | this.formData.scrappedGoodsInfo[index].scrappedGoodsList = []; |
| | | |
| | | this.formData.procureGoods[index].goodsTemplateName = this.getGoodsTemplateName(e); |
| | | this.formData.scrappedGoodsInfo[index].goodsTemplateName = this.getGoodsTemplateName(e); |
| | | // 根据选中物品名称id获取规格型号列表 |
| | | this.getgoodsModel(e, index); |
| | | }, |
| | | |
| | | // 规格型号选择 |
| | | modelChange(e, index) { |
| | | let arr = [...this.formData.procureGoods[index].models]; |
| | | async modelChange(e, index) { |
| | | let arr = [...this.formData.scrappedGoodsInfo[index].scrappedGoodsList]; |
| | | let str = JSON.stringify(arr); |
| | | e.forEach((item) => { |
| | | for (let item of e) { |
| | | if (str.indexOf(item) == -1) { |
| | | let temp = this.goodsModelAll.find((v) => v.id == item); |
| | | arr.push({ ...this.modelsItem, baseGoodsModelsId: item, unit: temp.unit }); |
| | | // 获取库存 |
| | | let num = await warehouseSelectNumber({ |
| | | warehouseId: this.formData.warehouseId, |
| | | baseGoodsModelsId: item, |
| | | warehouseType: 0, |
| | | states: 1, |
| | | buyType: null, |
| | | }); |
| | | arr.push({ baseGoodsModelsId: item, total: num, counts: null, scrappedCode: null }); |
| | | } |
| | | }); |
| | | this.formData.procureGoods[index].models = arr; |
| | | } |
| | | this.formData.scrappedGoodsInfo[index].scrappedGoodsList = arr; |
| | | }, |
| | | |
| | | // 规格型号移除 |
| | | modelRemoveTag(e, index) { |
| | | let arr = this.formData.procureGoods[index].models; |
| | | let arr = this.formData.scrappedGoodsInfo[index].scrappedGoodsList; |
| | | let delIndex = arr.findIndex((v) => v.baseGoodsModelsId == e); |
| | | this.formData.procureGoods[index].models.splice(delIndex, 1); |
| | | this.formData.scrappedGoodsInfo[index].scrappedGoodsList.splice(delIndex, 1); |
| | | }, |
| | | |
| | | // 上传 |
| | | uploadChange() { |
| | | let arr = this.$refs.uploadRef.fileList; |
| | | this.formData.procureDoc = JSON.stringify(arr); |
| | | this.formData.uploadFiles = JSON.stringify(arr); |
| | | }, |
| | | |
| | | // 点击新增物品 |
| | | addGoods() { |
| | | this.formData.procureGoods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | this.formData.scrappedGoodsInfo.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | }, |
| | | |
| | | // 点击移除 |
| | | removeGoods(index) { |
| | | this.formData.procureGoods.splice(index, 1); |
| | | this.formData.scrappedGoodsInfo.splice(index, 1); |
| | | }, |
| | | |
| | | // 提交 |
| | |
| | | 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('保存失败'); |
| | | }); |
| | | } |
| | | scrappedAdd(this.formData) |
| | | .then((res) => { |
| | | this.$message.success('保存成功!'); |
| | | this.close(); |
| | | this.$emit('search'); |
| | | }) |
| | | .catch((err) => { |
| | | console.log('create err', err); |
| | | this.$message.error('保存失败'); |
| | | }); |
| | | } else { |
| | | this.$message.error('校验未通过,请检查。'); |
| | | } |
| | |
| | | close() { |
| | | this.formData = { |
| | | warehouseId: '', // 报废仓库id |
| | | procureTime: '', // 报废时间 |
| | | procureGoods: [], |
| | | dealTime: '', // 报废时间 |
| | | scrappedGoodsInfo: [], |
| | | }; |
| | | 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的数组 |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | <div class="card-header-left"> |
| | | <span>报废单号:</span> |
| | | <span class="value">{{ item.businessFormCode }}</span> |
| | | <div class="states" :class="item.states == 1 ? '' : 'states-success'"> |
| | | {{ item.states == 1 ? '待报废' : '已报废' }} |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="card-header-right"> |
| | | <el-button site="form" type="success" size="mini" @click="handleExport(item)" |
| | |
| | | </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.goodTemplateInfo" :key="index" class="item"> |
| | | <div class="name">{{ just.goodsName }}</div> |
| | | <div class="value-box"> |
| | | <div class="value-box-item"> |
| | | <span class="label">数量:</span> |
| | |
| | | @close="detailSetting.show = false" |
| | | ref="detailRef" |
| | | ></detail> |
| | | <my-import |
| | | :import-setting="importSetting" |
| | | :dialog-show="importSetting.dialogShow" |
| | | :dialog-title="importSetting.dialogTitle" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { procureList, procureDel, procureIncome } from '@/api/stock/procure/purchaseOrder'; |
| | | import { scrappedList, } from '@/api/stock/scrap'; |
| | | 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'; |
| | |
| | | |
| | | export default { |
| | | name: 'index', |
| | | components: { MyButton, myImport, edit, detail }, |
| | | components: { MyButton, edit, detail }, |
| | | data() { |
| | | return { |
| | | loading: false, |
| | |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'goodsTemplateName', |
| | | type: 'select', |
| | | dataIndex: 'goodsTemplateId', |
| | | label: '物品名称', |
| | | placeholder: '可模糊搜索', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | options: [], |
| | | optionsConfig: { |
| | | label: 'goodsName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate', |
| | | }, |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | |
| | | 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: '', |
| | |
| | | methods: { |
| | | fetchData() { |
| | | this.loading = true; |
| | | procureList({ |
| | | scrappedList({ |
| | | pageNum: this.pageNum, |
| | | pageSize: this.pageSize, |
| | | ...this.filterFrom, |
| | |
| | | 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(() => { |
| | | procureIncome({ id: row.id }) |
| | | .then((res) => { |
| | | this.$message.success('报废成功!'); |
| | | this.search(); |
| | | }) |
| | | .catch(() => {}); |
| | | }); |
| | | }, |
| | | del(row) { |
| | | this.$modal.confirm('是否确认删除报废单号为"' + row.businessFormCode + '"的数据吗?').then(() => { |
| | | procureDel({ id: row.id }) |
| | | .then((res) => { |
| | | this.$message.success('删除成功!'); |
| | | this.search(); |
| | | }) |
| | | .catch(() => {}); |
| | | }); |
| | | }, |
| | | // 分页 |
| | | handleSizeChange(pageSize) { |
| | |
| | | } |
| | | if (this.filterFrom.incomeTimeEnd) { |
| | | this.filterFrom.incomeTimeEnd = this.filterFrom.incomeTimeEnd.replace(/\-/g, ''); |
| | | } |
| | | if (this.filterFrom.agencyId.length) { |
| | | this.filterFrom.agencyId = this.filterFrom.agencyId[this.filterFrom.agencyId.length - 1]; |
| | | } |
| | | this.search(1); |
| | | }, |
| | |
| | | <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> |
| | | </el-card> |
| | |
| | | </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 * as finsystenant from '@/api/baseSetting/finsystenant' |
| | | import myImport from '@/views/components/myImport' |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant'; |
| | | import myImport from '@/views/components/myImport'; |
| | | import detail from '../itemScrapping/detail'; |
| | | import {getBaseUrl} from '@/utils/base'; |
| | | import { getBaseUrl } from '@/utils/base'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | |
| | | export default { |
| | | name: "index", |
| | | components: {MyButton, MyTableV2, myImport,detail}, |
| | | name: 'index', |
| | | components: { MyButton, MyTableV2, myImport, detail }, |
| | | data() { |
| | | return { |
| | | // 搜索框 |
| | |
| | | dataIndex: 'name', |
| | | label: '单号', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'name', |
| | | type: 'select', |
| | | dataIndex: 'goodsTemplateId', |
| | | label: '物品名称', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | options: [], |
| | | cascader: [{ key: 'baseGoodsModelsId', queryKey: 'goodsTemplatesId' }], |
| | | optionsConfig: { |
| | | label: 'goodsName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate', |
| | | }, |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'warehouseId', |
| | | dataIndex: 'baseGoodsModelsId', |
| | | label: '规格型号', |
| | | placeholder: '请选择', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | options: [], |
| | | optionsConfig: { |
| | | label: 'modelName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/goods/models/query/goodsModel', |
| | | }, |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | |
| | | dataIndex: 'name', |
| | | label: '创建人', |
| | | placeholder: '请输入', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'date-picker', |
| | |
| | | tenantId: null, |
| | | userName: null, |
| | | userPhone: null, |
| | | status: 1 |
| | | status: 1, |
| | | }, |
| | | // 导入 |
| | | importSetting: { |
| | | dialogTitle: '导入', |
| | | dialogShow: false, |
| | | fileSettings: { |
| | | data: {}, |
| | | uploadUrl: getBaseUrl()+"/pc/fin/sys/tenant/import", // 上传地址 |
| | | accept: '.xls', // 格式 |
| | | type: 'text', // 回显形式 |
| | | loading: false // 导入效果 |
| | | }, |
| | | /* 模板下载 */ |
| | | templateSettings: { |
| | | templateName: '导入模板.xls', // 名称 |
| | | templateUrl: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/getImportTemplate' // 下载地址 |
| | | }, |
| | | onSuccess: null |
| | | dialogTitle: '导入', |
| | | dialogShow: false, |
| | | fileSettings: { |
| | | data: {}, |
| | | uploadUrl: getBaseUrl() + '/pc/fin/sys/tenant/import', // 上传地址 |
| | | accept: '.xls', // 格式 |
| | | type: 'text', // 回显形式 |
| | | loading: false, // 导入效果 |
| | | }, |
| | | /* 模板下载 */ |
| | | templateSettings: { |
| | | templateName: '导入模板.xls', // 名称 |
| | | templateUrl: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/getImportTemplate', // 下载地址 |
| | | }, |
| | | onSuccess: null, |
| | | }, |
| | | editSetting: { |
| | | title: '', |
| | |
| | | table: { |
| | | showIndex: true, // 是否显示序号 |
| | | expand: false, // 是否显示详情数据 |
| | | url: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/select/list', // 请求地址 |
| | | url: SettingIplatform.apiBaseURL + '/pc/l/wh/form/scrapped/list/detailList', // 请求地址 |
| | | // 工具条 |
| | | 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: 'businessFormCode', align: 'left' }, |
| | | { title: '物品名称', field: 'goodsTemplateName', align: 'center' }, |
| | | { title: '规格型号', field: 'baseGoodsModelsName', align: 'center' }, |
| | | { title: '报废数量', field: 'lv', align: 'center' }, |
| | | { title: '所属机构', field: 'agencyName', align: 'left' }, |
| | | { title: '创建人', field: 'operatorName', align: 'left' }, |
| | | { |
| | | title: '操作时间', |
| | | field: 'dealTime', |
| | | align: 'left', |
| | | formatter: (row) => { |
| | | return { value: DateFormatter.LongToDateTime(row.dealTime) }; |
| | | }, |
| | | }, |
| | | ], |
| | | // 操作信息 |
| | | operation: { |
| | |
| | | small: false, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | total: 0 |
| | | } |
| | | } |
| | | total: 0, |
| | | }, |
| | | }, |
| | | }, |
| | | detailSetting: { |
| | | title: '详情', |
| | | id: '', |
| | | show: false, |
| | | }, |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | }, |
| | | created() {}, |
| | | methods: { |
| | | 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> |
| | |
| | | <el-form-item |
| | | label="物品名称" |
| | | :prop="`transferGoods[${goodsIndex}].baseGoodsTemplateId`" |
| | | :rules="{ |
| | | required: true, |
| | | message: '请选择', |
| | | trigger: 'change', |
| | | }" |
| | | :rules="rules.baseGoodsTemplateId" |
| | | > |
| | | <el-select |
| | | :value="goodsItem.baseGoodsTemplateId" |
| | | v-model="goodsItem.baseGoodsTemplateId" |
| | | placeholder="请先择物品分类" |
| | | filterable |
| | | :disabled="!goodsItem.baseCategoryId" |
| | |
| | | }, |
| | | }, |
| | | data() { |
| | | // 自定义校验 |
| | | // 物品重复校验 |
| | | var checkGoodsTemplateId = (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(new Error('请选择')); |
| | | } |
| | | let temp = this.formData.transferGoods.filter((v) => v.baseGoodsTemplateId == value); |
| | | if (!temp || temp.length != 1) { |
| | | return callback(new Error('已选过此物品')); |
| | | } |
| | | callback(); |
| | | }; |
| | | return { |
| | | loading: false, |
| | | agencyOptions: [], // 调拨机构 |
| | |
| | | createTime: [{ 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' }, |
| | |
| | | this.agencyOptions = [res]; |
| | | this.formData.outAgencyId = res.id; |
| | | this.formData.transferGoods.push(JSON.parse(JSON.stringify(this.goodsItem))); |
| | | }else{ |
| | | this.$message.warning('无上级机构') |
| | | } else { |
| | | this.$message.warning('无上级机构'); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | |
| | | // 物品名称列表选择 |
| | | goodsTemplateChange(e, index) { |
| | | 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 = []; |
| | |
| | | import listPage from '../../../mixins/listPage'; |
| | | import transfer from '../../../mixins/transfer'; |
| | | import { commonsApi } from '@/api/commonsApi'; |
| | | import SettingIplatform from '@/utils/settingIplatform'; |
| | | |
| | | export default { |
| | | name: 'index', |
| | |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'goodsTemplateName', |
| | | type: 'select', |
| | | dataIndex: 'goodsTemplateId', |
| | | label: '物品名称', |
| | | placeholder: '可模糊搜索', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | options: [], |
| | | optionsConfig: { |
| | | label: 'goodsName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate', |
| | | }, |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'goodsName', |
| | | type: 'select', |
| | | dataIndex: 'goodsTemplateId', |
| | | label: '物品名称', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | options: [], |
| | | cascader: [{ key: 'baseGoodsModelsId', queryKey: 'goodsTemplatesId' }], |
| | | optionsConfig: { |
| | | label: 'goodsName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate', |
| | | }, |
| | | }, |
| | | { |
| | | type: 'select', |
| | | dataIndex: 'baseGoodsModelsId', |
| | | label: '规格型号', |
| | | placeholder: '请选择', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | options: [], |
| | | optionsConfig: { |
| | | label: 'modelName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/goods/models/query/goodsModel', |
| | | }, |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | |
| | | }; |
| | | }, |
| | | created() { |
| | | this.initSearch(); |
| | | }, |
| | | methods: { |
| | | initSearch() { |
| | | this.items.map(async (item) => { |
| | | if (item.label == '规格型号') { |
| | | let res = await goodsModel(); |
| | | item.options = res.map((v) => { |
| | | v.label = v.modelName; |
| | | v.value = v.id; |
| | | return v; |
| | | }); |
| | | } |
| | | return item; |
| | | }); |
| | | }, |
| | | showDetail(row) { |
| | | this.detailSetting.id = row.id; |
| | | this.detailSetting.info = JSON.stringify(row); |
| | |
| | | }, |
| | | fifterForm(params) { |
| | | this.filterFrom = Object.assign(this.filterFrom, params); |
| | | if (this.filterFrom.outAgencyId && this.filterFrom.outAgencyId.length) { |
| | | this.filterFrom.outAgencyId = this.filterFrom.outAgencyId[this.filterFrom.outAgencyId.length - 1]; |
| | | } |
| | | if (this.filterFrom.inAgencyId && this.filterFrom.inAgencyId.length) { |
| | | this.filterFrom.inAgencyId = this.filterFrom.inAgencyId[this.filterFrom.inAgencyId.length - 1]; |
| | | } |
| | | if (this.filterFrom.createTimeStart) { |
| | | this.filterFrom.createTimeStart = this.filterFrom.createTimeStart.replace(/\-/g, ''); |
| | | } |
| | |
| | | import listPage from '../../../mixins/listPage'; |
| | | import transfer from '../../../mixins/transfer'; |
| | | import { commonsApi } from '@/api/commonsApi'; |
| | | import SettingIplatform from '@/utils/settingIplatform'; |
| | | |
| | | export default { |
| | | name: 'index', |
| | |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'goodsTemplateName', |
| | | type: 'select', |
| | | dataIndex: 'goodsTemplateId', |
| | | label: '物品名称', |
| | | placeholder: '可模糊搜索', |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | options: [], |
| | | cascader: [{ key: 'baseGoodsModelsId', queryKey: 'goodsTemplatesId' }], |
| | | optionsConfig: { |
| | | label: 'goodsName', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate', |
| | | }, |
| | | }, |
| | | { |
| | | type: 'cascader', |