Commit 1cad66adaea2067205b401b2f658dfdbd842f417

Authored by wuxw
1 parent 48ea9c43

完成采购申请

src/api/resource/addPurchaseApplyApi.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +import { getCommunityId } from '@/api/community/communityApi'
  3 +
  4 +// 获取仓库列表
  5 +export function listStorehouses(params) {
  6 + return new Promise((resolve, reject) => {
  7 + request({
  8 + url: '/resourceStore.listStorehouses',
  9 + method: 'get',
  10 + params: {
  11 + ...params,
  12 + communityId: getCommunityId()
  13 + }
  14 + }).then(response => {
  15 + resolve(response.data)
  16 + }).catch(error => {
  17 + reject(error)
  18 + })
  19 + })
  20 +}
  21 +
  22 +// 获取物品类型列表
  23 +export function listResourceStoreTypes(params) {
  24 + return new Promise((resolve, reject) => {
  25 + request({
  26 + url: '/resourceStoreType.listResourceStoreTypes',
  27 + method: 'get',
  28 + params: {
  29 + ...params,
  30 + communityId: getCommunityId()
  31 + }
  32 + }).then(response => {
  33 + resolve(response.data)
  34 + }).catch(error => {
  35 + reject(error)
  36 + })
  37 + })
  38 +}
  39 +
  40 +// 获取供应商列表
  41 +export function listResourceSuppliers(params) {
  42 + return new Promise((resolve, reject) => {
  43 + request({
  44 + url: '/resourceSupplier.listResourceSuppliers',
  45 + method: 'get',
  46 + params: {
  47 + ...params,
  48 + communityId: getCommunityId()
  49 + }
  50 + }).then(response => {
  51 + resolve(response.data)
  52 + }).catch(error => {
  53 + reject(error)
  54 + })
  55 + })
  56 +}
  57 +
  58 +// 查询第一审批人
  59 +export function queryFirstAuditStaff(params) {
  60 + return new Promise((resolve, reject) => {
  61 + request({
  62 + url: '/oaWorkflow.queryFirstAuditStaff',
  63 + method: 'get',
  64 + params: {
  65 + ...params,
  66 + communityId: getCommunityId()
  67 + }
  68 + }).then(response => {
  69 + resolve(response.data)
  70 + }).catch(error => {
  71 + reject(error)
  72 + })
  73 + })
  74 +}
  75 +
  76 +// 查询员工信息
  77 +export function queryStaffInfos(params) {
  78 + return new Promise((resolve, reject) => {
  79 + request({
  80 + url: '/query.staff.infos',
  81 + method: 'get',
  82 + params: {
  83 + ...params,
  84 + communityId: getCommunityId()
  85 + }
  86 + }).then(response => {
  87 + resolve(response.data)
  88 + }).catch(error => {
  89 + reject(error)
  90 + })
  91 + })
  92 +}
  93 +
  94 +// 提交采购申请
  95 +export function purchaseApply(data) {
  96 + return new Promise((resolve, reject) => {
  97 + request({
  98 + url: '/purchase/purchaseApply',
  99 + method: 'post',
  100 + data: {
  101 + ...data,
  102 + communityId: getCommunityId()
  103 + }
  104 + }).then(response => {
  105 + resolve(response.data)
  106 + }).catch(error => {
  107 + reject(error)
  108 + })
  109 + })
  110 +}
0 111 \ No newline at end of file
... ...
src/api/resource/purchaseApplyDetailApi.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +import { getCommunityId } from '@/api/community/communityApi'
  3 +
  4 +// 获取采购申请详情列表
  5 +export function listPurchaseApplys(params) {
  6 + return new Promise((resolve, reject) => {
  7 + request({
  8 + url: '/purchaseApply.listPurchaseApplys',
  9 + method: 'get',
  10 + params: {
  11 + ...params,
  12 + communityId: getCommunityId()
  13 + }
  14 + }).then(response => {
  15 + const res = response.data
  16 + resolve(res)
  17 + }).catch(error => {
  18 + reject(error)
  19 + })
  20 + })
  21 +}
  22 +
  23 +// 审核采购申请
  24 +export function auditApplyOrder(data) {
  25 + return new Promise((resolve, reject) => {
  26 + request({
  27 + url: '/purchaseApply.auditApplyOrder',
  28 + method: 'post',
  29 + data
  30 + }).then(response => {
  31 + const res = response.data
  32 + resolve(res)
  33 + }).catch(error => {
  34 + reject(error)
  35 + })
  36 + })
  37 +}
  38 +
  39 +// 获取工作流审核信息
  40 +export function listWorkflowAuditInfo(params) {
  41 + return new Promise((resolve, reject) => {
  42 + request({
  43 + url: '/workflow.listWorkflowAuditInfo',
  44 + method: 'get',
  45 + params: {
  46 + ...params,
  47 + communityId: getCommunityId()
  48 + }
  49 + }).then(response => {
  50 + const res = response.data
  51 + resolve(res)
  52 + }).catch(error => {
  53 + reject(error)
  54 + })
  55 + })
  56 +}
  57 +
  58 +// 查询下一处理人
  59 +export function queryNextDealUser(params) {
  60 + return new Promise((resolve, reject) => {
  61 + request({
  62 + url: '/oaWorkflow.queryNextDealUser',
  63 + method: 'get',
  64 + params: {
  65 + ...params,
  66 + communityId: getCommunityId()
  67 + }
  68 + }).then(response => {
  69 + const res = response.data
  70 + resolve(res)
  71 + }).catch(error => {
  72 + reject(error)
  73 + })
  74 + })
  75 +}
  76 +
  77 +// 获取组织树
  78 +export function listOrgTree(params) {
  79 + return new Promise((resolve, reject) => {
  80 + request({
  81 + url: '/org.listOrgTree',
  82 + method: 'get',
  83 + params: {
  84 + ...params,
  85 + communityId: getCommunityId()
  86 + }
  87 + }).then(response => {
  88 + const res = response.data
  89 + resolve(res)
  90 + }).catch(error => {
  91 + reject(error)
  92 + })
  93 + })
  94 +}
  95 +
  96 +// 查询员工信息
  97 +export function queryStaffInfos(params) {
  98 + return new Promise((resolve, reject) => {
  99 + request({
  100 + url: '/query.staff.infos',
  101 + method: 'get',
  102 + params: {
  103 + ...params,
  104 + communityId: getCommunityId()
  105 + }
  106 + }).then(response => {
  107 + const res = response.data
  108 + resolve(res)
  109 + }).catch(error => {
  110 + reject(error)
  111 + })
  112 + })
  113 +}
0 114 \ No newline at end of file
... ...
src/api/resource/purchaseApplyManageApi.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +import { getCommunityId } from '@/api/community/communityApi'
  3 +
  4 +// 获取采购申请列表
  5 +export function listPurchaseApplys(params) {
  6 + return new Promise((resolve, reject) => {
  7 + request({
  8 + url: '/purchaseApply.listPurchaseApplys',
  9 + method: 'get',
  10 + params: {
  11 + ...params,
  12 + communityId: getCommunityId()
  13 + }
  14 + }).then(response => {
  15 + const res = response.data
  16 + resolve(res)
  17 + }).catch(error => {
  18 + reject(error)
  19 + })
  20 + })
  21 +}
  22 +
  23 +// 更新采购申请
  24 +export function updatePurchaseApply(data) {
  25 + return new Promise((resolve, reject) => {
  26 + request({
  27 + url: '/purchaseApply.updatePurchaseApply',
  28 + method: 'post',
  29 + data: {
  30 + ...data,
  31 + communityId: getCommunityId()
  32 + }
  33 + }).then(response => {
  34 + const res = response.data
  35 + resolve(res)
  36 + }).catch(error => {
  37 + reject(error)
  38 + })
  39 + })
  40 +}
  41 +
  42 +// 删除采购申请
  43 +export function deletePurchaseApply(data) {
  44 + return new Promise((resolve, reject) => {
  45 + request({
  46 + url: '/purchaseApply.deletePurchaseApply',
  47 + method: 'post',
  48 + data: {
  49 + ...data,
  50 + communityId: getCommunityId()
  51 + }
  52 + }).then(response => {
  53 + const res = response.data
  54 + resolve(res)
  55 + }).catch(error => {
  56 + reject(error)
  57 + })
  58 + })
  59 +}
  60 +
  61 +// 获取工作流图片
  62 +export function getWorkflowImage(params) {
  63 + return new Promise((resolve, reject) => {
  64 + request({
  65 + url: '/workflow.listRunWorkflowImage',
  66 + method: 'get',
  67 + params: {
  68 + ...params,
  69 + communityId: getCommunityId()
  70 + }
  71 + }).then(response => {
  72 + const res = response.data
  73 + resolve(res)
  74 + }).catch(error => {
  75 + reject(error)
  76 + })
  77 + })
  78 +}
  79 +
  80 +// 导出数据
  81 +export function exportData(params) {
  82 + return new Promise((resolve, reject) => {
  83 + request({
  84 + url: '/export.exportData',
  85 + method: 'get',
  86 + params: {
  87 + ...params,
  88 + communityId: getCommunityId()
  89 + }
  90 + }).then(response => {
  91 + const res = response.data
  92 + resolve(res)
  93 + }).catch(error => {
  94 + reject(error)
  95 + })
  96 + })
  97 +}
0 98 \ No newline at end of file
... ...
src/api/resource/resourceSupplierManageApi.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +// 获取供应商列表
  4 +export function listResourceSuppliers(params) {
  5 + return new Promise((resolve, reject) => {
  6 + request({
  7 + url: '/resourceSupplier.listResourceSuppliers',
  8 + method: 'get',
  9 + params
  10 + }).then(response => {
  11 + const res = response.data
  12 + if (res.code === 0) {
  13 + resolve(res)
  14 + } else {
  15 + reject(new Error(res.msg || '获取供应商列表失败'))
  16 + }
  17 + }).catch(error => {
  18 + reject(error)
  19 + })
  20 + })
  21 +}
  22 +
  23 +// 添加供应商
  24 +export function saveResourceSupplier(data) {
  25 + return new Promise((resolve, reject) => {
  26 + request({
  27 + url: '/resourceSupplier.saveResourceSupplier',
  28 + method: 'post',
  29 + data
  30 + }).then(response => {
  31 + const res = response.data
  32 + if (res.code === 0) {
  33 + resolve(res)
  34 + } else {
  35 + reject(new Error(res.msg || '添加供应商失败'))
  36 + }
  37 + }).catch(error => {
  38 + reject(error)
  39 + })
  40 + })
  41 +}
  42 +
  43 +// 更新供应商
  44 +export function updateResourceSupplier(data) {
  45 + return new Promise((resolve, reject) => {
  46 + request({
  47 + url: '/resourceSupplier.updateResourceSupplier',
  48 + method: 'post',
  49 + data
  50 + }).then(response => {
  51 + const res = response.data
  52 + if (res.code === 0) {
  53 + resolve(res)
  54 + } else {
  55 + reject(new Error(res.msg || '更新供应商失败'))
  56 + }
  57 + }).catch(error => {
  58 + reject(error)
  59 + })
  60 + })
  61 +}
  62 +
  63 +// 删除供应商
  64 +export function deleteResourceSupplier(data) {
  65 + return new Promise((resolve, reject) => {
  66 + request({
  67 + url: '/resourceSupplier.deleteResourceSupplier',
  68 + method: 'post',
  69 + data
  70 + }).then(response => {
  71 + const res = response.data
  72 + if (res.code === 0) {
  73 + resolve(res)
  74 + } else {
  75 + reject(new Error(res.msg || '删除供应商失败'))
  76 + }
  77 + }).catch(error => {
  78 + reject(error)
  79 + })
  80 + })
  81 +}
0 82 \ No newline at end of file
... ...
src/api/resource/urgentPurchaseApplyStepApi.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +// 获取仓库列表
  4 +export function listStorehouses(params) {
  5 + return new Promise((resolve, reject) => {
  6 + request({
  7 + url: '/resourceStore.listStorehouses',
  8 + method: 'get',
  9 + params
  10 + }).then(response => {
  11 + const res = response.data
  12 + resolve(res)
  13 + }).catch(error => {
  14 + reject(error)
  15 + })
  16 + })
  17 +}
  18 +
  19 +// 获取物品类型列表
  20 +export function listResourceStoreTypes(params) {
  21 + return new Promise((resolve, reject) => {
  22 + request({
  23 + url: '/resourceStoreType.listResourceStoreTypes',
  24 + method: 'get',
  25 + params
  26 + }).then(response => {
  27 + const res = response.data
  28 + resolve(res)
  29 + }).catch(error => {
  30 + reject(error)
  31 + })
  32 + })
  33 +}
  34 +
  35 +// 获取物品列表
  36 +export function listResourceStores(params) {
  37 + return new Promise((resolve, reject) => {
  38 + request({
  39 + url: '/resourceStore.listResourceStores',
  40 + method: 'get',
  41 + params
  42 + }).then(response => {
  43 + const res = response.data
  44 + resolve(res)
  45 + }).catch(error => {
  46 + reject(error)
  47 + })
  48 + })
  49 +}
  50 +
  51 +// 提交紧急采购申请
  52 +export function urgentPurchaseApply(data) {
  53 + return new Promise((resolve, reject) => {
  54 + request({
  55 + url: '/purchase/urgentPurchaseApply',
  56 + method: 'post',
  57 + data
  58 + }).then(response => {
  59 + const res = response.data
  60 + resolve(res)
  61 + }).catch(error => {
  62 + reject(error)
  63 + })
  64 + })
  65 +}
0 66 \ No newline at end of file
... ...
src/api/user/userApi.js 0 → 100644
  1 +export function getUserId() {
  2 + const userInfo = JSON.parse(localStorage.getItem('user'))
  3 +
  4 + return userInfo.userId
  5 +}
  6 +
  7 +export function getUserName() {
  8 + const userInfo = JSON.parse(localStorage.getItem('user'))
  9 +
  10 + return userInfo.name
  11 +}
  12 +
  13 +export function getUserTel() {
  14 + const userInfo = JSON.parse(localStorage.getItem('user'))
  15 +
  16 + return userInfo.tel
  17 +}
0 18 \ No newline at end of file
... ...
src/components/resource/AddResourceSupplier.vue 0 → 100644
  1 +<template>
  2 + <el-dialog
  3 + :title="$t('addResourceSupplier.title')"
  4 + :visible.sync="visible"
  5 + width="50%"
  6 + @close="handleClose"
  7 + >
  8 + <el-form ref="form" :model="form" :rules="rules" label-width="150px">
  9 + <el-form-item
  10 + :label="$t('addResourceSupplier.supplierName')"
  11 + prop="supplierName"
  12 + >
  13 + <el-input
  14 + v-model="form.supplierName"
  15 + :placeholder="$t('addResourceSupplier.required')"
  16 + />
  17 + </el-form-item>
  18 + <el-form-item
  19 + :label="$t('addResourceSupplier.supplierAddress')"
  20 + prop="address"
  21 + >
  22 + <el-input
  23 + v-model="form.address"
  24 + :placeholder="$t('addResourceSupplier.required')"
  25 + />
  26 + </el-form-item>
  27 + <el-form-item
  28 + :label="$t('addResourceSupplier.supplierContact')"
  29 + prop="tel"
  30 + >
  31 + <el-input
  32 + v-model="form.tel"
  33 + :placeholder="$t('addResourceSupplier.required')"
  34 + />
  35 + </el-form-item>
  36 + <el-form-item
  37 + :label="$t('addResourceSupplier.contactName')"
  38 + prop="contactName"
  39 + >
  40 + <el-input
  41 + v-model="form.contactName"
  42 + :placeholder="$t('addResourceSupplier.required')"
  43 + />
  44 + </el-form-item>
  45 + <el-form-item :label="$t('addResourceSupplier.bank')" prop="accountBank">
  46 + <el-input
  47 + v-model="form.accountBank"
  48 + :placeholder="$t('addResourceSupplier.optional')"
  49 + />
  50 + </el-form-item>
  51 + <el-form-item
  52 + :label="$t('addResourceSupplier.bankAccount')"
  53 + prop="bankAccountNumber"
  54 + >
  55 + <el-input
  56 + v-model="form.bankAccountNumber"
  57 + :placeholder="$t('addResourceSupplier.optional')"
  58 + />
  59 + </el-form-item>
  60 + <el-form-item :label="$t('addResourceSupplier.remark')" prop="remark">
  61 + <el-input
  62 + v-model="form.remark"
  63 + :placeholder="$t('addResourceSupplier.optional')"
  64 + />
  65 + </el-form-item>
  66 + </el-form>
  67 + <span slot="footer" class="dialog-footer">
  68 + <el-button @click="visible = false">
  69 + {{ $t('addResourceSupplier.cancel') }}
  70 + </el-button>
  71 + <el-button type="primary" @click="handleSubmit">
  72 + {{ $t('addResourceSupplier.save') }}
  73 + </el-button>
  74 + </span>
  75 + </el-dialog>
  76 +</template>
  77 +
  78 +<script>
  79 +import { saveResourceSupplier } from '@/api/resource/resourceSupplierManageApi'
  80 +import { getCommunityId } from '@/api/community/communityApi'
  81 +
  82 +export default {
  83 + name: 'AddResourceSupplier',
  84 + data() {
  85 + return {
  86 + visible: false,
  87 + form: {
  88 + supplierName: '',
  89 + address: '',
  90 + tel: '',
  91 + contactName: '',
  92 + accountBank: '',
  93 + bankAccountNumber: '',
  94 + remark: ''
  95 + },
  96 + rules: {
  97 + supplierName: [
  98 + { required: true, message: this.$t('addResourceSupplier.required'), trigger: 'blur' },
  99 + { max: 100, message: '长度不能超过100个字符', trigger: 'blur' }
  100 + ],
  101 + address: [
  102 + { required: true, message: this.$t('addResourceSupplier.required'), trigger: 'blur' },
  103 + { max: 100, message: '长度不能超过100个字符', trigger: 'blur' }
  104 + ],
  105 + tel: [
  106 + { required: true, message: this.$t('addResourceSupplier.required'), trigger: 'blur' }
  107 + ],
  108 + contactName: [
  109 + { required: true, message: this.$t('addResourceSupplier.required'), trigger: 'blur' },
  110 + { max: 50, message: '长度不能超过50个字符', trigger: 'blur' }
  111 + ],
  112 + accountBank: [
  113 + { max: 150, message: '长度不能超过150个字符', trigger: 'blur' }
  114 + ],
  115 + bankAccountNumber: [
  116 + { max: 200, message: '长度不能超过200个字符', trigger: 'blur' }
  117 + ],
  118 + remark: [
  119 + { max: 512, message: '长度不能超过512个字符', trigger: 'blur' }
  120 + ]
  121 + }
  122 + }
  123 + },
  124 + methods: {
  125 + open() {
  126 + this.visible = true
  127 + this.resetForm()
  128 + },
  129 + resetForm() {
  130 + this.form = {
  131 + supplierName: '',
  132 + address: '',
  133 + tel: '',
  134 + contactName: '',
  135 + accountBank: '',
  136 + bankAccountNumber: '',
  137 + remark: ''
  138 + }
  139 + this.$nextTick(() => {
  140 + this.$refs.form.clearValidate()
  141 + })
  142 + },
  143 + handleClose() {
  144 + this.resetForm()
  145 + },
  146 + handleSubmit() {
  147 + this.$refs.form.validate(async valid => {
  148 + if (valid) {
  149 + try {
  150 + const params = {
  151 + ...this.form,
  152 + communityId: getCommunityId()
  153 + }
  154 + await saveResourceSupplier(params)
  155 + this.$message.success(this.$t('common.success'))
  156 + this.visible = false
  157 + this.$emit('success')
  158 + } catch (error) {
  159 + this.$message.error(error.message)
  160 + }
  161 + }
  162 + })
  163 + }
  164 + }
  165 +}
  166 +</script>
0 167 \ No newline at end of file
... ...
src/components/resource/DeleteResourceSupplier.vue 0 → 100644
  1 +<template>
  2 + <el-dialog
  3 + :title="$t('deleteResourceSupplier.title')"
  4 + :visible.sync="visible"
  5 + width="30%"
  6 + @close="handleClose"
  7 + >
  8 + <div class="text-center">
  9 + <p>{{ $t('deleteResourceSupplier.confirmDelete') }}</p>
  10 + </div>
  11 + <span slot="footer" class="dialog-footer">
  12 + <el-button @click="visible = false">
  13 + {{ $t('deleteResourceSupplier.cancel') }}
  14 + </el-button>
  15 + <el-button type="primary" @click="handleConfirm">
  16 + {{ $t('deleteResourceSupplier.confirm') }}
  17 + </el-button>
  18 + </span>
  19 + </el-dialog>
  20 +</template>
  21 +
  22 +<script>
  23 +import { deleteResourceSupplier } from '@/api/resource/resourceSupplierManageApi'
  24 +import { getCommunityId } from '@/api/community/communityApi'
  25 +
  26 +export default {
  27 + name: 'DeleteResourceSupplier',
  28 + data() {
  29 + return {
  30 + visible: false,
  31 + form: {
  32 + rsId: ''
  33 + }
  34 + }
  35 + },
  36 + methods: {
  37 + open(row) {
  38 + this.visible = true
  39 + this.form.rsId = row.rsId
  40 + },
  41 + handleClose() {
  42 + this.form.rsId = ''
  43 + },
  44 + async handleConfirm() {
  45 + try {
  46 + const params = {
  47 + rsId: this.form.rsId,
  48 + communityId: getCommunityId()
  49 + }
  50 + await deleteResourceSupplier(params)
  51 + this.$message.success(this.$t('common.success'))
  52 + this.visible = false
  53 + this.$emit('success')
  54 + } catch (error) {
  55 + this.$message.error(error.message)
  56 + }
  57 + }
  58 + }
  59 +}
  60 +</script>
0 61 \ No newline at end of file
... ...
src/components/resource/EditResourceSupplier.vue 0 → 100644
  1 +<template>
  2 + <el-dialog
  3 + :title="$t('editResourceSupplier.title')"
  4 + :visible.sync="visible"
  5 + width="50%"
  6 + @close="handleClose"
  7 + >
  8 + <el-form ref="form" :model="form" :rules="rules" label-width="150px">
  9 + <el-form-item
  10 + :label="$t('editResourceSupplier.supplierName')"
  11 + prop="supplierName"
  12 + >
  13 + <el-input
  14 + v-model="form.supplierName"
  15 + :placeholder="$t('editResourceSupplier.required')"
  16 + />
  17 + </el-form-item>
  18 + <el-form-item
  19 + :label="$t('editResourceSupplier.supplierAddress')"
  20 + prop="address"
  21 + >
  22 + <el-input
  23 + v-model="form.address"
  24 + :placeholder="$t('editResourceSupplier.required')"
  25 + />
  26 + </el-form-item>
  27 + <el-form-item
  28 + :label="$t('editResourceSupplier.supplierContact')"
  29 + prop="tel"
  30 + >
  31 + <el-input
  32 + v-model="form.tel"
  33 + :placeholder="$t('editResourceSupplier.required')"
  34 + />
  35 + </el-form-item>
  36 + <el-form-item
  37 + :label="$t('editResourceSupplier.contactName')"
  38 + prop="contactName"
  39 + >
  40 + <el-input
  41 + v-model="form.contactName"
  42 + :placeholder="$t('editResourceSupplier.required')"
  43 + />
  44 + </el-form-item>
  45 + <el-form-item :label="$t('editResourceSupplier.bank')" prop="accountBank">
  46 + <el-input
  47 + v-model="form.accountBank"
  48 + :placeholder="$t('editResourceSupplier.optional')"
  49 + />
  50 + </el-form-item>
  51 + <el-form-item
  52 + :label="$t('editResourceSupplier.bankAccount')"
  53 + prop="bankAccountNumber"
  54 + >
  55 + <el-input
  56 + v-model="form.bankAccountNumber"
  57 + :placeholder="$t('editResourceSupplier.optional')"
  58 + />
  59 + </el-form-item>
  60 + <el-form-item :label="$t('editResourceSupplier.remark')" prop="remark">
  61 + <el-input
  62 + v-model="form.remark"
  63 + :placeholder="$t('editResourceSupplier.optional')"
  64 + />
  65 + </el-form-item>
  66 + </el-form>
  67 + <span slot="footer" class="dialog-footer">
  68 + <el-button @click="visible = false">
  69 + {{ $t('editResourceSupplier.cancel') }}
  70 + </el-button>
  71 + <el-button type="primary" @click="handleSubmit">
  72 + {{ $t('editResourceSupplier.save') }}
  73 + </el-button>
  74 + </span>
  75 + </el-dialog>
  76 +</template>
  77 +
  78 +<script>
  79 +import { updateResourceSupplier } from '@/api/resource/resourceSupplierManageApi'
  80 +import { getCommunityId } from '@/api/community/communityApi'
  81 +
  82 +export default {
  83 + name: 'EditResourceSupplier',
  84 + data() {
  85 + return {
  86 + visible: false,
  87 + form: {
  88 + rsId: '',
  89 + supplierName: '',
  90 + address: '',
  91 + tel: '',
  92 + contactName: '',
  93 + accountBank: '',
  94 + bankAccountNumber: '',
  95 + remark: ''
  96 + },
  97 + rules: {
  98 + rsId: [
  99 + { required: true, message: '供应商编号不能为空', trigger: 'blur' }
  100 + ],
  101 + supplierName: [
  102 + { required: true, message: this.$t('editResourceSupplier.required'), trigger: 'blur' },
  103 + { max: 100, message: '长度不能超过100个字符', trigger: 'blur' }
  104 + ],
  105 + address: [
  106 + { required: true, message: this.$t('editResourceSupplier.required'), trigger: 'blur' },
  107 + { max: 100, message: '长度不能超过100个字符', trigger: 'blur' }
  108 + ],
  109 + tel: [
  110 + { required: true, message: this.$t('editResourceSupplier.required'), trigger: 'blur' }
  111 + ],
  112 + contactName: [
  113 + { required: true, message: this.$t('editResourceSupplier.required'), trigger: 'blur' },
  114 + { max: 50, message: '长度不能超过50个字符', trigger: 'blur' }
  115 + ],
  116 + accountBank: [
  117 + { max: 150, message: '长度不能超过150个字符', trigger: 'blur' }
  118 + ],
  119 + bankAccountNumber: [
  120 + { max: 200, message: '长度不能超过200个字符', trigger: 'blur' }
  121 + ],
  122 + remark: [
  123 + { max: 512, message: '长度不能超过512个字符', trigger: 'blur' }
  124 + ]
  125 + }
  126 + }
  127 + },
  128 + methods: {
  129 + open(row) {
  130 + this.visible = true
  131 + this.form = { ...row }
  132 + this.$nextTick(() => {
  133 + this.$refs.form.clearValidate()
  134 + })
  135 + },
  136 + handleClose() {
  137 + this.form = {
  138 + rsId: '',
  139 + supplierName: '',
  140 + address: '',
  141 + tel: '',
  142 + contactName: '',
  143 + accountBank: '',
  144 + bankAccountNumber: '',
  145 + remark: ''
  146 + }
  147 + },
  148 + handleSubmit() {
  149 + this.$refs.form.validate(async valid => {
  150 + if (valid) {
  151 + try {
  152 + const params = {
  153 + ...this.form,
  154 + communityId: getCommunityId()
  155 + }
  156 + await updateResourceSupplier(params)
  157 + this.$message.success(this.$t('common.success'))
  158 + this.visible = false
  159 + this.$emit('success')
  160 + } catch (error) {
  161 + this.$message.error(error.message)
  162 + }
  163 + }
  164 + })
  165 + }
  166 + }
  167 +}
  168 +</script>
0 169 \ No newline at end of file
... ...
src/components/resource/auditDiv.vue 0 → 100644
  1 +<template>
  2 + <el-dialog :title="$t('auditDiv.workOrderProcessing')" :visible.sync="visible" width="50%" @close="handleClose">
  3 + <el-form ref="form" :model="formData" label-width="120px">
  4 + <el-form-item :label="$t('auditDiv.action')" prop="auditCode">
  5 + <el-select v-model="formData.auditCode" :placeholder="$t('auditDiv.pleaseSelect')" style="width: 100%">
  6 + <el-option value="" disabled :label="$t('auditDiv.pleaseSelect')"></el-option>
  7 + <el-option v-if="nextAudit.next || nextAudit.exit" value="1100" :label="$t('auditDiv.agree')"></el-option>
  8 + <el-option v-if="nextAudit.back" value="1200" :label="$t('auditDiv.return')"></el-option>
  9 + <el-option v-if="nextAudit.backIndex" value="1400" :label="$t('auditDiv.returnToSubmitter')"></el-option>
  10 + <el-option value="1300" :label="$t('auditDiv.transfer')"></el-option>
  11 + </el-select>
  12 + </el-form-item>
  13 +
  14 + <el-form-item :label="$t('auditDiv.workOrderDescription')" prop="auditMessage">
  15 + <el-input type="textarea" :placeholder="$t('auditDiv.requiredDescription')" v-model="formData.auditMessage"
  16 + :rows="4"></el-input>
  17 + </el-form-item>
  18 +
  19 + <el-form-item v-if="(formData.auditCode === '1100' && nextAudit.assignee === '-2') || formData.auditCode === '1300'"
  20 + :label="$t('auditDiv.nextHandler')" prop="staffName">
  21 + <el-input v-model="formData.staffName" :placeholder="$t('auditDiv.requiredNextHandler')" disabled
  22 + style="width: calc(100% - 100px); margin-right: 10px;"></el-input>
  23 + <el-button @click="chooseStaff">
  24 + <i class="el-icon-search"></i>
  25 + {{ $t('auditDiv.select') }}
  26 + </el-button>
  27 + </el-form-item>
  28 + </el-form>
  29 +
  30 + <span slot="footer" class="dialog-footer">
  31 + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button>
  32 + <el-button type="primary" @click="handleSubmit">{{ $t('common.submit') }}</el-button>
  33 + </span>
  34 + </el-dialog>
  35 +</template>
  36 +
  37 +<script>
  38 +import { queryNextDealUser,auditApplyOrder } from '@/api/resource/purchaseApplyDetailApi'
  39 +//import SelectStaff from '@/components/resource/selectStaff'
  40 +
  41 +export default {
  42 + name: 'AuditDiv',
  43 + components: {
  44 + // SelectStaff
  45 + },
  46 + data() {
  47 + return {
  48 + visible: false,
  49 + formData: {
  50 + auditCode: '',
  51 + auditMessage: '',
  52 + staffId: '',
  53 + staffName: '',
  54 + taskId: '',
  55 + flowId: '',
  56 + id: ''
  57 + },
  58 + nextAudit: {},
  59 + createUserId: ''
  60 + }
  61 + },
  62 + methods: {
  63 + open(data) {
  64 + this.formData.taskId = data.taskId
  65 + this.formData.flowId = data.flowId
  66 + this.formData.id = data.id
  67 + this.createUserId = data.createUserId
  68 + this.visible = true
  69 + this.loadNextAuditPerson()
  70 + },
  71 + async loadNextAuditPerson() {
  72 + try {
  73 + const params = {
  74 + taskId: this.formData.taskId,
  75 + startUserId: this.createUserId
  76 + }
  77 + const res = await queryNextDealUser(params)
  78 + if (res.code === '0') {
  79 + this.nextAudit = res.data[0]
  80 + }
  81 + } catch (error) {
  82 + console.error('获取下一处理人失败:', error)
  83 + }
  84 + },
  85 + chooseStaff() {
  86 + this.$refs.selectStaff.open({
  87 + from: 'purchase',
  88 + call: (staff) => {
  89 + this.formData.staffId = staff.staffId
  90 + this.formData.staffName = staff.staffName
  91 + }
  92 + })
  93 + },
  94 + async handleSubmit() {
  95 + if (!this.formData.auditCode) {
  96 + this.$message.warning(this.$t('auditDiv.pleaseSelectStatus'))
  97 + return
  98 + }
  99 + if (!this.formData.auditMessage) {
  100 + this.$message.warning(this.$t('auditDiv.pleaseFillDescription'))
  101 + return
  102 + }
  103 + if (this.formData.auditCode !== '1200' &&
  104 + this.formData.auditCode !== '1400' &&
  105 + !this.formData.staffId) {
  106 + this.$message.warning(this.$t('auditDiv.pleaseSelectNextHandler'))
  107 + return
  108 + }
  109 +
  110 + if (this.nextAudit.assignee !== '-2') {
  111 + this.formData.staffId = this.nextAudit.assignee
  112 + }
  113 +
  114 + try {
  115 + const res = await auditApplyOrder(this.formData)
  116 + if (res.code === 0) {
  117 + this.$message.success(this.$t('auditDiv.submitSuccess'))
  118 + this.visible = false
  119 + this.$emit('success')
  120 + } else {
  121 + this.$message.error(res.msg)
  122 + }
  123 + } catch (error) {
  124 + console.error('提交审核失败:', error)
  125 + this.$message.error(this.$t('auditDiv.submitFailed'))
  126 + }
  127 + },
  128 + handleClose() {
  129 + this.$refs.form.resetFields()
  130 + this.formData = {
  131 + auditCode: '',
  132 + auditMessage: '',
  133 + staffId: '',
  134 + staffName: '',
  135 + taskId: '',
  136 + flowId: '',
  137 + id: ''
  138 + }
  139 + this.nextAudit = {}
  140 + }
  141 + }
  142 +}
  143 +</script>
0 144 \ No newline at end of file
... ...
src/components/resource/chooseResourceStore2.vue 0 → 100644
  1 +<template>
  2 + <el-dialog :title="$t('chooseResourceStore2.title')" :visible.sync="visible" width="80%" @close="handleClose">
  3 + <el-row>
  4 + <el-col :span="24">
  5 +
  6 + <el-row :gutter="20">
  7 + <el-col :span="4">
  8 + <el-select v-model="chooseResourceStoreInfo2.shId" disabled style="width:100%">
  9 + <el-option selected value="" :label="$t('chooseResourceStore2.selectWarehouse')"></el-option>
  10 + <el-option v-for="(item, index) in chooseResourceStoreInfo2.storehouses" :key="index" :label="item.shName"
  11 + :value="item.shId">
  12 + </el-option>
  13 + </el-select>
  14 + </el-col>
  15 + <el-col :span="4">
  16 + <el-select v-model="chooseResourceStoreInfo2.parentRstId" @change="_listResourceStoreSonTypes"
  17 + style="width:100%">
  18 + <el-option selected value="" :label="$t('chooseResourceStore2.selectItemType')"></el-option>
  19 + <el-option v-for="(item, index) in chooseResourceStoreInfo2.resourceStoreTypes" :key="index"
  20 + :label="item.name" :value="item.rstId">
  21 + </el-option>
  22 + </el-select>
  23 + </el-col>
  24 + <el-col :span="4">
  25 + <el-select v-model="chooseResourceStoreInfo2.rstId" style="width:100%;margin-right:10px">
  26 + <el-option selected value="" :label="$t('chooseResourceStore2.selectSubType')"></el-option>
  27 + <el-option v-for="(item, index) in chooseResourceStoreInfo2.resourceStoreSonTypes" :key="index"
  28 + :label="item.name" :value="item.rstId">
  29 + </el-option>
  30 + </el-select>
  31 + </el-col>
  32 + <el-col :span="4">
  33 + <el-input :placeholder="$t('chooseResourceStore2.inputItemName')"
  34 + v-model.trim="chooseResourceStoreInfo2._currentResourceStoreName"></el-input>
  35 + </el-col>
  36 + <el-col :span="4" style="text-align:right">
  37 + <el-button type="primary" @click="queryResourceStores" style="margin-right:10px">
  38 + <i class="el-icon-search"></i>
  39 + {{ $t('common.search') }}
  40 + </el-button>
  41 + <el-button type="primary" @click="resetResourceStores">
  42 + <i class="el-icon-refresh"></i>
  43 + {{ $t('common.reset') }}
  44 + </el-button>
  45 + </el-col>
  46 + </el-row>
  47 +
  48 + </el-col>
  49 + </el-row>
  50 +
  51 + <el-row style="margin-top:15px">
  52 + <el-col :span="24">
  53 +
  54 + <el-table :data="chooseResourceStoreInfo2.resourceStores" border style="width:100%">
  55 + <el-table-column width="50">
  56 + <template slot-scope="scope">
  57 + <el-checkbox v-model="chooseResourceStoreInfo2.selectResourceStores"
  58 + :label="scope.row.resId"></el-checkbox>
  59 + </template>
  60 + </el-table-column>
  61 + <el-table-column prop="shName" :label="$t('chooseResourceStore2.warehouse')" align="center"></el-table-column>
  62 + <el-table-column prop="type" :label="$t('chooseResourceStore2.itemType')" align="center">
  63 + <template slot-scope="scope">
  64 + {{ scope.row.parentRstName ? scope.row.parentRstName : '-' }} >
  65 + {{ scope.row.rstName ? scope.row.rstName : '-' }}
  66 + </template>
  67 + </el-table-column>
  68 + <el-table-column prop="resName" :label="$t('chooseResourceStore2.itemName')" align="center"></el-table-column>
  69 + <el-table-column prop="rssName" :label="$t('chooseResourceStore2.itemSpec')" align="center">
  70 + <template slot-scope="scope">
  71 + {{ scope.row.rssName ? scope.row.rssName : '-' }}
  72 + </template>
  73 + </el-table-column>
  74 + <el-table-column prop="resCode" :label="$t('chooseResourceStore2.itemCode')" align="center"></el-table-column>
  75 + <el-table-column prop="isFixedName" :label="$t('chooseResourceStore2.fixedItem')"
  76 + align="center"></el-table-column>
  77 + <el-table-column prop="price" :label="$t('chooseResourceStore2.itemPrice')" align="center"></el-table-column>
  78 + <el-table-column prop="stock" :label="$t('chooseResourceStore2.itemStock')" align="center">
  79 + <template slot-scope="scope">
  80 + {{ scope.row.stock }}{{ scope.row.unitCodeName }}
  81 + </template>
  82 + </el-table-column>
  83 + </el-table>
  84 +
  85 + <el-pagination :current-page.sync="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size"
  86 + :total="page.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
  87 + @current-change="handleCurrentChange" style="margin-top:20px"></el-pagination>
  88 +
  89 + <div v-if="chooseResourceStoreInfo2.resourceStores.length > 0" style="margin-top:20px;text-align:right">
  90 + <el-button type="primary" @click="getSelectResourceStores">
  91 + <i class="el-icon-check"></i>
  92 + {{ $t('common.submit') }}
  93 + </el-button>
  94 + <el-button type="warning" @click="handleClose" style="margin-right:20px">
  95 + <i class="el-icon-close"></i>
  96 + {{ $t('common.cancel') }}
  97 + </el-button>
  98 + </div>
  99 + </el-col>
  100 + </el-row>
  101 + </el-dialog>
  102 +</template>
  103 +
  104 +<script>
  105 +import { listStorehouses, listResourceStoreTypes } from '@/api/resource/addPurchaseApplyApi'
  106 +import { listResourceStores } from '@/api/resource/resourceStoreManageApi'
  107 +
  108 +export default {
  109 + name: 'ChooseResourceStore2',
  110 + data() {
  111 + return {
  112 + visible: false,
  113 + chooseResourceStoreInfo2: {
  114 + resourceStores: [],
  115 + selectResourceStores: [],
  116 + _currentResourceStoreName: '',
  117 + parentRstId: '',
  118 + rstId: '',
  119 + shId: '',
  120 + resOrderType: '',
  121 + storehouses: [],
  122 + resourceStoreTypes: [],
  123 + resourceStoreSonTypes: []
  124 + },
  125 + page: {
  126 + current: 1,
  127 + size: 10,
  128 + total: 0
  129 + }
  130 + }
  131 + },
  132 + methods: {
  133 + open(params) {
  134 + this.visible = true
  135 + Object.assign(this.chooseResourceStoreInfo2, params)
  136 + this._listStorehouses()
  137 + this._listResourceStoreTypes()
  138 + this._loadAllResourceStoreInfo(this.page.current, this.page.size)
  139 + },
  140 + handleClose() {
  141 + this.visible = false
  142 + this.chooseResourceStoreInfo2 = {
  143 + resourceStores: [],
  144 + selectResourceStores: [],
  145 + _currentResourceStoreName: '',
  146 + parentRstId: '',
  147 + rstId: '',
  148 + shId: '',
  149 + resOrderType: '',
  150 + storehouses: [],
  151 + resourceStoreTypes: [],
  152 + resourceStoreSonTypes: []
  153 + }
  154 + },
  155 + async _loadAllResourceStoreInfo(_page, _row) {
  156 + const _resOrderType = this.chooseResourceStoreInfo2.resOrderType
  157 + let _shType = ''
  158 + if (_resOrderType == '20000') {
  159 + _shType = '2807'
  160 + }
  161 +
  162 + try {
  163 + const res = await listResourceStores({
  164 + page: _page,
  165 + row: _row,
  166 + communityId: "",
  167 + resOrderType: _resOrderType,
  168 + shType: _shType,
  169 + resName: this.chooseResourceStoreInfo2._currentResourceStoreName,
  170 + parentRstId: this.chooseResourceStoreInfo2.parentRstId,
  171 + rstId: this.chooseResourceStoreInfo2.rstId,
  172 + shId: this.chooseResourceStoreInfo2.shId
  173 + })
  174 + const _resourceStoreInfo = res
  175 + this.chooseResourceStoreInfo2.resourceStores = _resourceStoreInfo.resourceStores
  176 + this.page.total = _resourceStoreInfo.records
  177 + } catch (error) {
  178 + console.error('请求失败:', error)
  179 + }
  180 + },
  181 + async _listStorehouses() {
  182 + // const _resOrderType = this.chooseResourceStoreInfo2.resOrderType
  183 + // let _shType = ''
  184 + // if (_resOrderType == '20000') {
  185 + // _shType = '2807'
  186 + // }
  187 +
  188 + try {
  189 + const res = await listStorehouses({
  190 + page: 1,
  191 + row: 100,
  192 + communityId: "",
  193 + allowPurchase: 'ON'
  194 + })
  195 + this.chooseResourceStoreInfo2.storehouses = res.data
  196 + } catch (error) {
  197 + console.error('请求失败:', error)
  198 + }
  199 + },
  200 + async _listResourceStoreTypes() {
  201 + try {
  202 + const res = await listResourceStoreTypes({
  203 + page: 1,
  204 + row: 100,
  205 + communityId: "",
  206 + parentId: '0'
  207 + })
  208 + this.chooseResourceStoreInfo2.resourceStoreTypes = res.data
  209 + } catch (error) {
  210 + console.error('请求失败:', error)
  211 + }
  212 + },
  213 + async _listResourceStoreSonTypes() {
  214 + this.chooseResourceStoreInfo2.rstId = ''
  215 + this.chooseResourceStoreInfo2.resourceStoreSonTypes = []
  216 + if (this.chooseResourceStoreInfo2.parentRstId == '') {
  217 + return
  218 + }
  219 +
  220 + try {
  221 + const res = await listResourceStoreTypes({
  222 + page: 1,
  223 + row: 100,
  224 + communityId: "",
  225 + parentId: this.chooseResourceStoreInfo2.parentRstId
  226 + })
  227 + this.chooseResourceStoreInfo2.resourceStoreSonTypes = res.data
  228 + } catch (error) {
  229 + console.error('请求失败:', error)
  230 + }
  231 + },
  232 + queryResourceStores() {
  233 + this.page.current = 1
  234 + this._loadAllResourceStoreInfo(this.page.current, this.page.size)
  235 + },
  236 + resetResourceStores() {
  237 + this.chooseResourceStoreInfo2.parentRstId = ""
  238 + this.chooseResourceStoreInfo2.rstId = ""
  239 + this.chooseResourceStoreInfo2._currentResourceStoreName = ""
  240 + this._loadAllResourceStoreInfo(this.page.current, this.page.size)
  241 + },
  242 + getSelectResourceStores() {
  243 + const selectResourceStores = this.chooseResourceStoreInfo2.selectResourceStores
  244 + const resourceStores = this.chooseResourceStoreInfo2.resourceStores
  245 + if (selectResourceStores.length < 1) {
  246 + this.$message.warning(this.$t('chooseResourceStore2.selectItemsRequired'))
  247 + return
  248 + }
  249 +
  250 + let _resourceStores = []
  251 + for (let i = 0; i < selectResourceStores.length; i++) {
  252 + for (let j = 0; j < resourceStores.length; j++) {
  253 + if (selectResourceStores[i] == resourceStores[j].resId) {
  254 + resourceStores[j].remark = ''
  255 + _resourceStores.push(resourceStores[j])
  256 + }
  257 + }
  258 + }
  259 +
  260 + this.$emit('setSelectResourceStores', _resourceStores)
  261 + this.handleClose()
  262 + },
  263 + handleSizeChange(val) {
  264 + this.page.size = val
  265 + this._loadAllResourceStoreInfo(this.page.current, this.page.size)
  266 + },
  267 + handleCurrentChange(val) {
  268 + this.page.current = val
  269 + this._loadAllResourceStoreInfo(this.page.current, this.page.size)
  270 + }
  271 + }
  272 +}
  273 +</script>
  274 +
  275 +<style scoped>
  276 +.el-row {
  277 + margin-bottom: 20px;
  278 +}
  279 +</style>
0 280 \ No newline at end of file
... ...
src/components/resource/chooseResourceStore4.vue 0 → 100644
  1 +<template>
  2 + <el-dialog :title="$t('chooseResourceStore4.title')" :visible.sync="visible" width="80%" @close="handleClose">
  3 + <div class="filter-container">
  4 + <el-row :gutter="20">
  5 + <el-col :span="8">
  6 + <el-select v-model="chooseResourceStoreInfo4.shId" disabled style="width:100%">
  7 + <el-option value="" :label="$t('chooseResourceStore4.selectWarehouse')" />
  8 + <el-option v-for="(item, index) in chooseResourceStoreInfo4.storehouses" :key="index" :label="item.shName"
  9 + :value="item.shId" />
  10 + </el-select>
  11 + </el-col>
  12 +
  13 + <el-col :span="8">
  14 + <el-select v-model="chooseResourceStoreInfo4.parentRstId" @change="_listResourceStoreSonTypes"
  15 + style="width:100%">
  16 + <el-option value="" :label="$t('chooseResourceStore4.selectItemType')" />
  17 + <el-option v-for="(item, index) in chooseResourceStoreInfo4.resourceStoreTypes" :key="index" :label="item.name"
  18 + :value="item.rstId" />
  19 + </el-select>
  20 + </el-col>
  21 +
  22 + <el-col :span="8">
  23 + <el-select v-model="chooseResourceStoreInfo4.rstId" style="width:100%;margin-right:10px">
  24 + <el-option value="" :label="$t('chooseResourceStore4.selectSubType')" />
  25 + <el-option v-for="(item, index) in chooseResourceStoreInfo4.resourceStoreSonTypes" :key="index"
  26 + :label="item.name" :value="item.rstId" />
  27 + </el-select>
  28 + </el-col>
  29 + </el-row>
  30 +
  31 + <el-row :gutter="20" style="margin-top:10px">
  32 + <el-col :span="8">
  33 + <el-input v-model.trim="chooseResourceStoreInfo4._currentResourceStoreName"
  34 + :placeholder="$t('chooseResourceStore4.inputItemName')" />
  35 + </el-col>
  36 + <el-col :span="16" style="text-align:right">
  37 + <el-button type="primary" @click="queryResourceStores">
  38 + <i class="el-icon-search"></i>
  39 + {{ $t('common.search') }}
  40 + </el-button>
  41 + <el-button @click="resetResourceStores">
  42 + <i class="el-icon-refresh"></i>
  43 + {{ $t('common.reset') }}
  44 + </el-button>
  45 + </el-col>
  46 + </el-row>
  47 + </div>
  48 +
  49 + <el-table :data="chooseResourceStoreInfo4.resourceStores" border style="width:100%;margin-top:15px">
  50 + <el-table-column width="50">
  51 + <template slot-scope="scope">
  52 + <el-checkbox v-model="chooseResourceStoreInfo4.selectResourceStores" :label="scope.row.resId" />
  53 + </template>
  54 + </el-table-column>
  55 +
  56 + <el-table-column prop="shName" :label="$t('chooseResourceStore4.warehouse')" align="center" />
  57 +
  58 + <el-table-column :label="$t('chooseResourceStore4.itemType')" align="center">
  59 + <template slot-scope="scope">
  60 + {{ scope.row.parentRstName || '-' }} > {{ scope.row.rstName || '-' }}
  61 + </template>
  62 + </el-table-column>
  63 +
  64 + <el-table-column prop="resName" :label="$t('chooseResourceStore4.itemName')" align="center" />
  65 +
  66 + <el-table-column prop="rssName" :label="$t('chooseResourceStore4.spec')" align="center">
  67 + <template slot-scope="scope">
  68 + {{ scope.row.rssName || '-' }}
  69 + </template>
  70 + </el-table-column>
  71 +
  72 + <el-table-column prop="resCode" :label="$t('chooseResourceStore4.code')" align="center" />
  73 +
  74 + <el-table-column prop="isFixedName" :label="$t('chooseResourceStore4.fixedItem')" align="center" />
  75 +
  76 + <el-table-column prop="price" :label="$t('chooseResourceStore4.price')" align="center" />
  77 +
  78 + <el-table-column :label="$t('chooseResourceStore4.stock')" align="center">
  79 + <template slot-scope="scope">
  80 + {{ scope.row.stock }}{{ scope.row.unitCodeName }}
  81 + </template>
  82 + </el-table-column>
  83 + </el-table>
  84 +
  85 + <el-pagination :current-page.sync="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size"
  86 + :total="page.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
  87 + @current-change="handleCurrentChange" style="margin-top:20px" />
  88 +
  89 + <div slot="footer" class="dialog-footer">
  90 + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button>
  91 + <el-button type="primary" @click="getSelectResourceStores">
  92 + {{ $t('common.submit') }}
  93 + </el-button>
  94 + </div>
  95 + </el-dialog>
  96 +</template>
  97 +
  98 +<script>
  99 +import { getCommunityId } from '@/api/community/communityApi'
  100 +import * as api from '@/api/resource/urgentPurchaseApplyStepApi'
  101 +
  102 +export default {
  103 + name: 'ChooseResourceStore4',
  104 + props: {
  105 + resOrderType: {
  106 + type: String,
  107 + default: ''
  108 + }
  109 + },
  110 + data() {
  111 + return {
  112 + visible: false,
  113 + chooseResourceStoreInfo4: {
  114 + resourceStores: [],
  115 + selectResourceStores: [],
  116 + _currentResourceStoreName: '',
  117 + parentRstId: '',
  118 + rstId: '',
  119 + shId: '',
  120 + storehouses: [],
  121 + resourceStoreTypes: [],
  122 + resourceStoreSonTypes: [],
  123 + resOrderType: ''
  124 + },
  125 + page: {
  126 + current: 1,
  127 + size: 10,
  128 + total: 0
  129 + }
  130 + }
  131 + },
  132 + methods: {
  133 + open(params) {
  134 + this.visible = true
  135 + this.chooseResourceStoreInfo4.shId = params.shId
  136 + this.chooseResourceStoreInfo4.resOrderType = this.resOrderType
  137 + this._initData()
  138 + },
  139 + async _initData() {
  140 + this.chooseResourceStoreInfo4._currentResourceStoreName = ''
  141 + await this._listStorehouses()
  142 + await this._listResourceStoreTypes()
  143 + this._loadAllResourceStoreInfo(this.page.current, this.page.size)
  144 + },
  145 + handleClose() {
  146 + this.chooseResourceStoreInfo4.selectResourceStores = []
  147 + },
  148 + async _loadAllResourceStoreInfo(page, size) {
  149 + try {
  150 + let shType = ''
  151 + if (this.chooseResourceStoreInfo4.resOrderType === '20000') {
  152 + shType = '2807'
  153 + }
  154 +
  155 + const params = {
  156 + page,
  157 + row: size,
  158 + resOrderType: this.chooseResourceStoreInfo4.resOrderType,
  159 + shType,
  160 + resName: this.chooseResourceStoreInfo4._currentResourceStoreName,
  161 + parentRstId: this.chooseResourceStoreInfo4.parentRstId,
  162 + rstId: this.chooseResourceStoreInfo4.rstId,
  163 + shId: this.chooseResourceStoreInfo4.shId
  164 + }
  165 +
  166 + const { resourceStores, total } = await api.listResourceStores(params)
  167 + this.chooseResourceStoreInfo4.resourceStores = resourceStores
  168 + this.page.total = total
  169 + } catch (error) {
  170 + console.error('获取物品列表失败:', error)
  171 + }
  172 + },
  173 + async _listStorehouses() {
  174 + try {
  175 + const params = {
  176 + page: 1,
  177 + row: 100,
  178 + allowPurchase: 'ON'
  179 + }
  180 + const { data } = await api.listStorehouses(params)
  181 + this.chooseResourceStoreInfo4.storehouses = data
  182 + } catch (error) {
  183 + console.error('获取仓库列表失败:', error)
  184 + }
  185 + },
  186 + async _listResourceStoreTypes() {
  187 + try {
  188 + const communityId = await getCommunityId()
  189 + const params = {
  190 + page: 1,
  191 + row: 100,
  192 + communityId,
  193 + parentId: '0'
  194 + }
  195 + const { data } = await api.listResourceStoreTypes(params)
  196 + this.chooseResourceStoreInfo4.resourceStoreTypes = data
  197 + } catch (error) {
  198 + console.error('获取物品类型列表失败:', error)
  199 + }
  200 + },
  201 + async _listResourceStoreSonTypes() {
  202 + this.chooseResourceStoreInfo4.rstId = ''
  203 + if (!this.chooseResourceStoreInfo4.parentRstId) {
  204 + this.chooseResourceStoreInfo4.resourceStoreSonTypes = []
  205 + return
  206 + }
  207 +
  208 + try {
  209 + const communityId = await getCommunityId()
  210 + const params = {
  211 + page: 1,
  212 + row: 100,
  213 + communityId,
  214 + parentId: this.chooseResourceStoreInfo4.parentRstId
  215 + }
  216 + const { data } = await api.listResourceStoreTypes(params)
  217 + this.chooseResourceStoreInfo4.resourceStoreSonTypes = data
  218 + } catch (error) {
  219 + console.error('获取物品子类型列表失败:', error)
  220 + }
  221 + },
  222 + queryResourceStores() {
  223 + this.page.current = 1
  224 + this._loadAllResourceStoreInfo(this.page.current, this.page.size)
  225 + },
  226 + resetResourceStores() {
  227 + this.chooseResourceStoreInfo4._currentResourceStoreName = ''
  228 + this.chooseResourceStoreInfo4.parentRstId = ''
  229 + this.chooseResourceStoreInfo4.rstId = ''
  230 + this.queryResourceStores()
  231 + },
  232 + getSelectResourceStores() {
  233 + const selectResourceStores = this.chooseResourceStoreInfo4.selectResourceStores
  234 + const resourceStores = this.chooseResourceStoreInfo4.resourceStores
  235 +
  236 + if (selectResourceStores.length < 1) {
  237 + this.$message.warning(this.$t('chooseResourceStore4.selectItemsRequired'))
  238 + return
  239 + }
  240 +
  241 + const _resourceStores = []
  242 + selectResourceStores.forEach(resId => {
  243 + const item = resourceStores.find(r => r.resId === resId)
  244 + if (item) {
  245 + item.remark = ''
  246 + _resourceStores.push(item)
  247 + }
  248 + })
  249 +
  250 + this.$emit('setSelectResourceStores', _resourceStores)
  251 + this.visible = false
  252 + },
  253 + handleSizeChange(val) {
  254 + this.page.size = val
  255 + this._loadAllResourceStoreInfo(this.page.current, val)
  256 + },
  257 + handleCurrentChange(val) {
  258 + this.page.current = val
  259 + this._loadAllResourceStoreInfo(val, this.page.size)
  260 + }
  261 + }
  262 +}
  263 +</script>
  264 +
  265 +<style scoped>
  266 +.filter-container {
  267 + margin-bottom: 20px;
  268 +}
  269 +</style>
0 270 \ No newline at end of file
... ...
src/components/resource/deletePurchaseApply.vue 0 → 100644
  1 +<template>
  2 + <el-dialog
  3 + :title="$t('purchaseApplyManage.delete.title')"
  4 + :visible.sync="visible"
  5 + width="30%"
  6 + @close="handleClose"
  7 + >
  8 + <div class="text-center">
  9 + <p>{{ $t('purchaseApplyManage.delete.confirmText') }}</p>
  10 + </div>
  11 + <span slot="footer" class="dialog-footer">
  12 + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button>
  13 + <el-button type="primary" @click="handleConfirm">{{ $t('common.confirm') }}</el-button>
  14 + </span>
  15 + </el-dialog>
  16 +</template>
  17 +
  18 +<script>
  19 +import { deletePurchaseApply } from '@/api/resource/purchaseApplyManageApi'
  20 +import { getCommunityId } from '@/api/community/communityApi'
  21 +
  22 +export default {
  23 + name: 'DeletePurchaseApply',
  24 + data() {
  25 + return {
  26 + visible: false,
  27 + form: {
  28 + applyOrderId: '',
  29 + communityId: ''
  30 + }
  31 + }
  32 + },
  33 + methods: {
  34 + open(data) {
  35 + this.form = {
  36 + applyOrderId: data.applyOrderId,
  37 + communityId: getCommunityId()
  38 + }
  39 + this.visible = true
  40 + },
  41 + handleClose() {
  42 + this.form = {
  43 + applyOrderId: '',
  44 + communityId: ''
  45 + }
  46 + },
  47 + async handleConfirm() {
  48 + try {
  49 + await deletePurchaseApply(this.form)
  50 + this.$message.success(this.$t('purchaseApplyManage.delete.success'))
  51 + this.visible = false
  52 + this.$emit('success')
  53 + } catch (error) {
  54 + console.error('删除失败:', error)
  55 + this.$message.error(this.$t('purchaseApplyManage.delete.error'))
  56 + }
  57 + }
  58 + }
  59 +}
  60 +</script>
  61 +
  62 +<style scoped>
  63 +.text-center {
  64 + text-align: center;
  65 +}
  66 +</style>
0 67 \ No newline at end of file
... ...
src/components/resource/editPurchaseApply.vue 0 → 100644
  1 +<template>
  2 + <el-dialog
  3 + :title="$t('purchaseApplyManage.edit.title')"
  4 + :visible.sync="visible"
  5 + width="50%"
  6 + @close="handleClose"
  7 + >
  8 + <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  9 + <el-form-item :label="$t('purchaseApplyManage.edit.state')" prop="state">
  10 + <el-select v-model="form.state" style="width:100%">
  11 + <el-option
  12 + :label="$t('purchaseApplyManage.edit.stateRequired')"
  13 + value=""
  14 + disabled
  15 + ></el-option>
  16 + <el-option
  17 + :label="$t('purchaseApplyManage.edit.stateOption1')"
  18 + value="1001"
  19 + ></el-option>
  20 + <el-option
  21 + :label="$t('purchaseApplyManage.edit.stateOption2')"
  22 + value="2002"
  23 + ></el-option>
  24 + </el-select>
  25 + </el-form-item>
  26 + </el-form>
  27 +
  28 + <span slot="footer" class="dialog-footer">
  29 + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button>
  30 + <el-button type="primary" @click="handleSubmit">{{ $t('common.save') }}</el-button>
  31 + </span>
  32 + </el-dialog>
  33 +</template>
  34 +
  35 +<script>
  36 +import { updatePurchaseApply } from '@/api/resource/purchaseApplyManageApi'
  37 +import { getCommunityId } from '@/api/community/communityApi'
  38 +
  39 +export default {
  40 + name: 'EditPurchaseApply',
  41 + data() {
  42 + return {
  43 + visible: false,
  44 + form: {
  45 + applyOrderId: '',
  46 + state: '',
  47 + communityId: ''
  48 + },
  49 + rules: {
  50 + state: [
  51 + { required: true, message: this.$t('purchaseApplyManage.edit.stateRequired'), trigger: 'blur' },
  52 + { type: 'number', message: this.$t('purchaseApplyManage.edit.stateFormatError'), trigger: 'blur' }
  53 + ],
  54 + applyOrderId: [
  55 + { required: true, message: this.$t('purchaseApplyManage.edit.applyOrderIdRequired'), trigger: 'blur' }
  56 + ]
  57 + }
  58 + }
  59 + },
  60 + methods: {
  61 + open(data) {
  62 + this.form = {
  63 + ...data,
  64 + communityId: getCommunityId()
  65 + }
  66 + this.visible = true
  67 + },
  68 + handleClose() {
  69 + this.$refs.form.resetFields()
  70 + },
  71 + handleSubmit() {
  72 + this.$refs.form.validate(valid => {
  73 + if (valid) {
  74 + this.submitForm()
  75 + }
  76 + })
  77 + },
  78 + async submitForm() {
  79 + try {
  80 + await updatePurchaseApply(this.form)
  81 + this.$message.success(this.$t('common.saveSuccess'))
  82 + this.visible = false
  83 + this.$emit('success')
  84 + } catch (error) {
  85 + console.error('保存失败:', error)
  86 + }
  87 + }
  88 + }
  89 +}
  90 +</script>
0 91 \ No newline at end of file
... ...
src/components/resource/orgTreeShow.vue 0 → 100644
  1 +<template>
  2 + <div class="org-tree-container">
  3 + <el-tree
  4 + ref="orgTree"
  5 + :data="orgTreeShowInfo.orgs"
  6 + :props="defaultProps"
  7 + node-key="id"
  8 + default-expand-all
  9 + highlight-current
  10 + @node-click="handleNodeClick"
  11 + ></el-tree>
  12 + </div>
  13 +</template>
  14 +
  15 +<script>
  16 +export default {
  17 + name: 'OrgTreeShow',
  18 + props: {
  19 + callBackListener: {
  20 + type: String,
  21 + default: ''
  22 + }
  23 + },
  24 + data() {
  25 + return {
  26 + orgTreeShowInfo: {
  27 + orgs: [],
  28 + orgId: '',
  29 + curOrg: {}
  30 + },
  31 + defaultProps: {
  32 + children: 'children',
  33 + label: 'text'
  34 + }
  35 + }
  36 + },
  37 + created() {
  38 + this._loadOrgsShow()
  39 + },
  40 + methods: {
  41 + refreshTree() {
  42 + this._loadOrgsShow()
  43 + },
  44 + async _loadOrgsShow() {
  45 + try {
  46 + const res = await this.$http.get('/org.listOrgTree', {
  47 + params: {
  48 + communityId: this.$store.getters.communityId
  49 + }
  50 + })
  51 + this.orgTreeShowInfo.orgs = res.data.data
  52 + } catch (error) {
  53 + console.error('请求失败:', error)
  54 + }
  55 + },
  56 + handleNodeClick(data) {
  57 + this.orgTreeShowInfo.curOrg = data
  58 + this.orgTreeShowInfo.curOrg.orgId = data.id
  59 + this.$emit('switchOrg', {
  60 + orgId: data.id,
  61 + orgName: data.text
  62 + })
  63 + }
  64 + }
  65 +}
  66 +</script>
  67 +
  68 +<style scoped>
  69 +.org-tree-container {
  70 + padding: 10px;
  71 +}
  72 +</style>
0 73 \ No newline at end of file
... ...
src/components/resource/selectStaff.vue 0 → 100644
  1 +<template>
  2 + <el-dialog :title="$t('selectStaff.title')" :visible.sync="visible" width="80%" @close="handleClose">
  3 + <el-row>
  4 + <el-col :span="24">
  5 + <el-card>
  6 + <el-row>
  7 + <el-col :span="12" class="border-right">
  8 + <div class="text-center">
  9 + <span>{{ $t('selectStaff.orgInfo') }}</span>
  10 + </div>
  11 + <div class="padding">
  12 + <org-tree-show ref="orgTreeShow" @switchOrg="handleSwitchOrg"></org-tree-show>
  13 + </div>
  14 + </el-col>
  15 + <el-col :span="12">
  16 + <div class="text-center">
  17 + <span>{{ $t('selectStaff.staffInfo') }}</span>
  18 + </div>
  19 + <div class="padding">
  20 + <div v-for="(item, index) in selectStaffInfo.staffs" :key="index" @click="_changeStaff(item)"
  21 + :class="{ 'select': selectStaffInfo.curStaffId == item.staffId }"
  22 + style="cursor:pointer;padding:10px;margin-bottom:5px;border-radius:4px">
  23 + <div>
  24 + <i class="el-icon-user margin-right-xs"></i>
  25 + {{ item.name }}
  26 + </div>
  27 + <div>{{ item.tel }}</div>
  28 + </div>
  29 + </div>
  30 + </el-col>
  31 + </el-row>
  32 + </el-card>
  33 + </el-col>
  34 + </el-row>
  35 +
  36 + <div
  37 + v-if="selectStaffInfo.staff.from == 'bpmn' || selectStaffInfo.staff.from == 'purchase' || selectStaffInfo.staff.from == 'contract'"
  38 + style="text-align:right;margin-top:20px">
  39 + <el-button type="text" @click="_firstUser">
  40 + {{ $t('selectStaff.submitter') }}
  41 + </el-button>
  42 + <el-button type="text" @click="_customUser">
  43 + {{ $t('selectStaff.dynamicAssign') }}
  44 + </el-button>
  45 + </div>
  46 + </el-dialog>
  47 +</template>
  48 +
  49 +<script>
  50 +import OrgTreeShow from './orgTreeShow'
  51 +import { queryStaffInfos } from '@/api/resource/addPurchaseApplyApi'
  52 +
  53 +export default {
  54 + name: 'SelectStaff',
  55 + components: {
  56 + OrgTreeShow
  57 + },
  58 + data() {
  59 + return {
  60 + visible: false,
  61 + selectStaffInfo: {
  62 + flowId: '',
  63 + flowName: '',
  64 + describle: '',
  65 + staffs: [],
  66 + curStaffId: '',
  67 + curStaffName: '',
  68 + staff: {}
  69 + }
  70 + }
  71 + },
  72 + methods: {
  73 + open(staff) {
  74 + this.visible = true
  75 + this.selectStaffInfo.staff = staff
  76 + this.$refs.orgTreeShow.refreshTree()
  77 + },
  78 + handleClose() {
  79 + this.visible = false
  80 + this.selectStaffInfo = {
  81 + flowId: '',
  82 + flowName: '',
  83 + describle: '',
  84 + staffs: [],
  85 + curStaffId: '',
  86 + curStaffName: '',
  87 + staff: {}
  88 + }
  89 + },
  90 + async loadStaff(_org) {
  91 + try {
  92 + const res = await queryStaffInfos({
  93 + page: 1,
  94 + row: 50,
  95 + orgId: _org.orgId
  96 + })
  97 + this.selectStaffInfo.staffs = res.data.staffs
  98 + if (res.data.staffs.length > 0) {
  99 + this.selectStaffInfo.curStaffId = res.data.staffs[0].orgId
  100 + }
  101 + } catch (error) {
  102 + console.error('请求失败:', error)
  103 + }
  104 + },
  105 + _changeStaff(item) {
  106 + this.selectStaffInfo.curStaffId = item.staffId
  107 + this.$emit('change', {
  108 + userId: item.staffId,
  109 + userName: item.name,
  110 + tel: item.tel
  111 + })
  112 + this.handleClose()
  113 + },
  114 + _firstUser() {
  115 + this.$emit('change', {
  116 + userId: '${startUserId}',
  117 + userName: this.$t('selectStaff.submitter')
  118 + })
  119 + this.handleClose()
  120 + },
  121 + _customUser() {
  122 + this.$emit('change', {
  123 + userId: '${nextUserId}',
  124 + userName: this.$t('selectStaff.dynamicAssign')
  125 + })
  126 + this.handleClose()
  127 + },
  128 + handleSwitchOrg(org) {
  129 + this.loadStaff({
  130 + orgId: org.orgId,
  131 + orgName: org.orgName
  132 + })
  133 + }
  134 + }
  135 +}
  136 +</script>
  137 +
  138 +<style scoped>
  139 +.border-right {
  140 + border-right: 1px solid #eee;
  141 +}
  142 +
  143 +.padding {
  144 + padding: 15px;
  145 +}
  146 +
  147 +.text-center {
  148 + text-align: center;
  149 + padding: 10px 0;
  150 + font-weight: bold;
  151 +}
  152 +
  153 +.select {
  154 + background-color: #f5f7fa;
  155 +}
  156 +
  157 +.margin-right-xs {
  158 + margin-right: 5px;
  159 +}
  160 +</style>
0 161 \ No newline at end of file
... ...
src/i18n/index.js
... ... @@ -182,6 +182,12 @@ import { messages as resourceStoreSpecificationManageMessages } from &#39;../views/r
182 182 import { messages as resourceStoreManageMessages } from '../views/resource/resourceStoreManageLang'
183 183 import { messages as inspectionPointMessages } from '../views/inspection/inspectionPointLang'
184 184 import { messages as inspectionRouteMessages } from '../views/inspection/inspectionRouteLang'
  185 +import { messages as resourceSupplierManageMessages } from '../views/resource/resourceSupplierManageLang'
  186 +import { messages as purchaseApplyManageMessages } from '../views/resource/purchaseApplyManageLang'
  187 +import { messages as addPurchaseApplyMessages } from '../views/resource/addPurchaseApplyLang'
  188 +import { messages as urgentPurchaseApplyStepMessages } from '../views/resource/urgentPurchaseApplyStepLang'
  189 +import { messages as purchaseApplyDetailMessages } from '../views/resource/purchaseApplyDetailLang'
  190 +
185 191 Vue.use(VueI18n)
186 192  
187 193 // 合并所有语言配置
... ... @@ -367,6 +373,11 @@ const messages = {
367 373 ...resourceStoreManageMessages.en,
368 374 ...inspectionPointMessages.en,
369 375 ...inspectionRouteMessages.en,
  376 + ...resourceSupplierManageMessages.en,
  377 + ...purchaseApplyManageMessages.en,
  378 + ...addPurchaseApplyMessages.en,
  379 + ...urgentPurchaseApplyStepMessages.en,
  380 + ...purchaseApplyDetailMessages.en,
370 381 },
371 382 zh: {
372 383 ...loginMessages.zh,
... ... @@ -549,6 +560,11 @@ const messages = {
549 560 ...resourceStoreManageMessages.zh,
550 561 ...inspectionPointMessages.zh,
551 562 ...inspectionRouteMessages.zh,
  563 + ...resourceSupplierManageMessages.zh,
  564 + ...purchaseApplyManageMessages.zh,
  565 + ...addPurchaseApplyMessages.zh,
  566 + ...urgentPurchaseApplyStepMessages.zh,
  567 + ...purchaseApplyDetailMessages.zh,
552 568 }
553 569 }
554 570  
... ...
src/router/index.js
... ... @@ -892,15 +892,40 @@ const routes = [
892 892 component: () => import('@/views/resource/resourceStoreManageList.vue')
893 893 },
894 894 {
895   - path:'/pages/inspection/inspectionPoint',
896   - name:'/pages/inspection/inspectionPoint',
  895 + path: '/pages/inspection/inspectionPoint',
  896 + name: '/pages/inspection/inspectionPoint',
897 897 component: () => import('@/views/inspection/inspectionPointList.vue')
898   - },
899   - {
900   - path:'/pages/inspection/inspectionRoute',
901   - name:'/pages/inspection/inspectionRoute',
902   - component: () => import('@/views/inspection/inspectionRouteList.vue')
903   - },
  898 + },
  899 + {
  900 + path: '/pages/inspection/inspectionRoute',
  901 + name: '/pages/inspection/inspectionRoute',
  902 + component: () => import('@/views/inspection/inspectionRouteList.vue')
  903 + },
  904 + {
  905 + path: '/pages/property/resourceSupplierManage',
  906 + name: '/pages/property/resourceSupplierManage',
  907 + component: () => import('@/views/resource/resourceSupplierManageList.vue')
  908 + },
  909 + {
  910 + path: '/pages/common/purchaseApplyManage',
  911 + name: '/pages/common/purchaseApplyManage',
  912 + component: () => import('@/views/resource/purchaseApplyManageList.vue')
  913 + },
  914 + {
  915 + path: '/views/resource/addPurchaseApply',
  916 + name: '/views/resource/addPurchaseApply',
  917 + component: () => import('@/views/resource/addPurchaseApplyList.vue')
  918 + },
  919 + {
  920 + path: '/views/resource/urgentPurchaseApplyStep',
  921 + name: '/views/resource/urgentPurchaseApplyStep',
  922 + component: () => import('@/views/resource/urgentPurchaseApplyStepList.vue')
  923 + },
  924 + {
  925 + path: '/views/resource/purchaseApplyDetail',
  926 + name: '/views/resource/purchaseApplyDetail',
  927 + component: () => import('@/views/resource/purchaseApplyDetailList.vue')
  928 + },
904 929 // 其他子路由可以在这里添加
905 930 ]
906 931 },
... ...
src/views/resource/addPurchaseApplyLang.js 0 → 100644
  1 +export const messages = {
  2 + en: {
  3 + addPurchaseApply: {
  4 + purchaser: 'Purchaser',
  5 + return: 'Return',
  6 + warehouse: 'Warehouse',
  7 + requiredSelectWarehouse: 'Required, please select warehouse',
  8 + contact: 'Contact',
  9 + requiredContact: 'Required, please enter contact',
  10 + phone: 'Phone',
  11 + requiredPhone: 'Required, please enter phone',
  12 + applyDesc: 'Application Description',
  13 + requiredDesc: 'Required, please enter description',
  14 + purchaseItems: 'Purchase Items',
  15 + select: 'Select',
  16 + itemType: 'Item Type',
  17 + itemNameCode: 'Item Name(Code)',
  18 + itemSpec: 'Item Specification',
  19 + price: 'Price',
  20 + selectPrice: 'Please select price',
  21 + itemStock: 'Item Stock',
  22 + applyQuantity: 'Apply Quantity',
  23 + requiredQuantity: 'Required, please enter quantity',
  24 + remark: 'Remark',
  25 + optionalRemark: 'Optional, please enter remark',
  26 + operation: 'Operation',
  27 + remove: 'Remove',
  28 + approver: 'Approver',
  29 + requiredApprover: 'Required, please select approver',
  30 + submit: 'Submit',
  31 + noItemsSelected: 'No items selected!',
  32 + sameWarehouseRequired: 'Purchased items must come from the same warehouse!',
  33 + selectPriceRequired: 'Please select price!',
  34 + quantityRequired: 'Please enter quantity!',
  35 + selectWarehouseRequired: 'Please select warehouse!',
  36 + contactRequired: 'Please enter contact!',
  37 + phoneRequired: 'Please enter phone!',
  38 + descRequired: 'Please enter description!'
  39 + },
  40 + chooseResourceStore2: {
  41 + title: '[Item Collection/Purchase Application/Direct Outbound] Select Items',
  42 + selectWarehouse: 'Please select warehouse',
  43 + selectItemType: 'Please select item type',
  44 + selectSubType: 'Please select sub type',
  45 + inputItemName: 'Enter item management name',
  46 + warehouse: 'Warehouse',
  47 + itemType: 'Item Type',
  48 + itemName: 'Item Name',
  49 + itemSpec: 'Item Specification',
  50 + itemCode: 'Item Code',
  51 + fixedItem: 'Fixed Item',
  52 + itemPrice: 'Item Price',
  53 + itemStock: 'Item Stock',
  54 + selectItemsRequired: 'Please select items to purchase'
  55 + },
  56 + selectStaff: {
  57 + title: 'Select Staff',
  58 + orgInfo: 'Organization Information',
  59 + staffInfo: 'Staff Information',
  60 + submitter: 'Submitter',
  61 + dynamicAssign: 'Dynamic Assignment'
  62 + }
  63 + },
  64 + zh: {
  65 + addPurchaseApply: {
  66 + purchaser: '采购人',
  67 + return: '返回',
  68 + warehouse: '仓库',
  69 + requiredSelectWarehouse: '必填,请选择仓库',
  70 + contact: '联系人',
  71 + requiredContact: '必填,请填写联系人',
  72 + phone: '联系电话',
  73 + requiredPhone: '必填,请填写联系电话',
  74 + applyDesc: '申请说明',
  75 + requiredDesc: '必填,请填写申请说明',
  76 + purchaseItems: '采购物品',
  77 + select: '选择',
  78 + itemType: '物品类型',
  79 + itemNameCode: '物品名称(编码)',
  80 + itemSpec: '物品规格',
  81 + price: '价格',
  82 + selectPrice: '请选择价格',
  83 + itemStock: '物品库存',
  84 + applyQuantity: '申请数量',
  85 + requiredQuantity: '必填,请填写申请数量',
  86 + remark: '备注',
  87 + optionalRemark: '选填,请填写备注',
  88 + operation: '操作',
  89 + remove: '移除',
  90 + approver: '审批人',
  91 + requiredApprover: '必填,请选择审批人',
  92 + submit: '提交',
  93 + noItemsSelected: '未选择采购物品!',
  94 + sameWarehouseRequired: '采购商品需来自同一仓库!',
  95 + selectPriceRequired: '请选择价格!',
  96 + quantityRequired: '请填写申请数量!',
  97 + selectWarehouseRequired: '请选择仓库!',
  98 + contactRequired: '请填写联系人!',
  99 + phoneRequired: '请填写联系电话!',
  100 + descRequired: '请填写申请说明!'
  101 + },
  102 + chooseResourceStore2: {
  103 + title: '【物品领用/采购申请/直接出库】选择物品',
  104 + selectWarehouse: '请选择仓库',
  105 + selectItemType: '请选择物品类型',
  106 + selectSubType: '请选择二级分类',
  107 + inputItemName: '输入物品管理名称',
  108 + warehouse: '仓库',
  109 + itemType: '物品类型',
  110 + itemName: '物品名称',
  111 + itemSpec: '物品规格',
  112 + itemCode: '物品编码',
  113 + fixedItem: '固定物品',
  114 + itemPrice: '物品价格',
  115 + itemStock: '物品库存',
  116 + selectItemsRequired: '请选择需要采购的物品'
  117 + },
  118 + selectStaff: {
  119 + title: '选择员工',
  120 + orgInfo: '组织信息',
  121 + staffInfo: '员工信息',
  122 + submitter: '提交者',
  123 + dynamicAssign: '动态指定'
  124 + }
  125 + }
  126 +}
0 127 \ No newline at end of file
... ...
src/views/resource/addPurchaseApplyList.vue 0 → 100644
  1 +<template>
  2 + <div class="add-purchase-apply-container">
  3 + <el-card class="box-card">
  4 + <div slot="header" class="clearfix">
  5 + <span>{{ $t('addPurchaseApply.purchaser') }}</span>
  6 + <div class="card-tools">
  7 + <el-button type="primary" size="small" @click="goBack">
  8 + <i class="el-icon-close"></i>
  9 + {{ $t('common.back') }}
  10 + </el-button>
  11 + </div>
  12 + </div>
  13 + <div class="card-content">
  14 + <el-form label-width="120px">
  15 + <el-form-item :label="$t('addPurchaseApply.warehouse')">
  16 + <el-select v-model="addPurchaseApplyInfo.shId" @change="_computeFlow" style="width:100%">
  17 + <el-option disabled value="" :label="$t('addPurchaseApply.requiredSelectWarehouse')"></el-option>
  18 + <el-option v-for="(item, index) in addPurchaseApplyInfo.storehouses" :key="index" :label="item.shName"
  19 + :value="item.shId">
  20 + </el-option>
  21 + </el-select>
  22 + </el-form-item>
  23 +
  24 + <el-form-item :label="$t('addPurchaseApply.contact')">
  25 + <el-input :placeholder="$t('addPurchaseApply.requiredContact')"
  26 + v-model="addPurchaseApplyInfo.endUserName"></el-input>
  27 + </el-form-item>
  28 +
  29 + <el-form-item :label="$t('addPurchaseApply.phone')">
  30 + <el-input :placeholder="$t('addPurchaseApply.requiredPhone')"
  31 + v-model="addPurchaseApplyInfo.endUserTel"></el-input>
  32 + </el-form-item>
  33 +
  34 + <el-form-item :label="$t('addPurchaseApply.applyDesc')">
  35 + <el-input type="textarea" :placeholder="$t('addPurchaseApply.requiredDesc')"
  36 + v-model="addPurchaseApplyInfo.description"></el-input>
  37 + </el-form-item>
  38 + </el-form>
  39 + </div>
  40 + </el-card>
  41 +
  42 + <el-card class="box-card">
  43 + <div slot="header" class="clearfix">
  44 + <span>{{ $t('addPurchaseApply.purchaseItems') }}</span>
  45 + <div class="card-tools">
  46 + <el-button type="primary" size="small" style="margin-right:10px;" @click="_openSelectResourceStoreInfoModel">
  47 + <i class="el-icon-plus"></i>
  48 + {{ $t('addPurchaseApply.select') }}
  49 + </el-button>
  50 + </div>
  51 + </div>
  52 + <div class="card-content">
  53 + <el-table :data="addPurchaseApplyInfo.resourceStores" border style="width: 100%">
  54 + <el-table-column prop="type" :label="$t('addPurchaseApply.itemType')" align="center">
  55 + <template slot-scope="scope">
  56 + {{ scope.row.parentRstName ? scope.row.parentRstName : '-' }} >
  57 + {{ scope.row.rstName ? scope.row.rstName : '-' }}
  58 + </template>
  59 + </el-table-column>
  60 + <el-table-column prop="name" :label="$t('addPurchaseApply.itemNameCode')" align="center">
  61 + <template slot-scope="scope">
  62 + {{ scope.row.resName }}({{ scope.row.resCode }})
  63 + </template>
  64 + </el-table-column>
  65 + <el-table-column prop="spec" :label="$t('addPurchaseApply.itemSpec')" align="center">
  66 + <template slot-scope="scope">
  67 + {{ scope.row.rssName ? scope.row.rssName : '-' }}
  68 + </template>
  69 + </el-table-column>
  70 + <el-table-column prop="price" :label="$t('addPurchaseApply.price')" align="center">
  71 + <template slot-scope="scope">
  72 + <el-select v-model="scope.row.timesId" @change="_changeTimesId($event, scope.$index)" style="width:100%">
  73 + <el-option value="" :label="$t('addPurchaseApply.selectPrice')"></el-option>
  74 + <el-option v-for="time in scope.row.times" :key="time.timesId" :label="time.price" :value="time.timesId">
  75 + </el-option>
  76 + </el-select>
  77 + </template>
  78 + </el-table-column>
  79 + <el-table-column prop="stock" :label="$t('addPurchaseApply.itemStock')" align="center">
  80 + <template slot-scope="scope">
  81 + {{ _getTimesStock(scope.row) }}{{ scope.row.unitCodeName }}
  82 + </template>
  83 + </el-table-column>
  84 + <el-table-column prop="quantity" :label="$t('addPurchaseApply.applyQuantity')" align="center">
  85 + <template slot-scope="scope">
  86 + <el-input v-model="scope.row.quantity" type="number" :placeholder="$t('addPurchaseApply.requiredQuantity')"
  87 + style="width:70%;display:inline-block;margin:auto"></el-input>
  88 + &nbsp;&nbsp;{{ scope.row.unitCodeName }}
  89 + </template>
  90 + </el-table-column>
  91 + <el-table-column prop="remark" :label="$t('addPurchaseApply.remark')" align="center">
  92 + <template slot-scope="scope">
  93 + <el-input v-model="scope.row.remark" type="text"
  94 + :placeholder="$t('addPurchaseApply.optionalRemark')"></el-input>
  95 + </template>
  96 + </el-table-column>
  97 + <el-table-column prop="operation" :label="$t('addPurchaseApply.operation')" align="center">
  98 + <template slot-scope="scope">
  99 + <el-button type="danger" size="small" style="margin-right:10px;"
  100 + @click="_removeSelectResourceStoreItem(scope.row.resId)">
  101 + {{ $t('addPurchaseApply.remove') }}
  102 + </el-button>
  103 + </template>
  104 + </el-table-column>
  105 + </el-table>
  106 + </div>
  107 + </el-card>
  108 +
  109 + <el-row v-if="addPurchaseApplyInfo.audit.assignee == '-2'">
  110 + <el-col :span="24">
  111 + <el-card class="box-card">
  112 + <div slot="header" class="clearfix">
  113 + <span>{{ $t('addPurchaseApply.approver') }}</span>
  114 + </div>
  115 + <div class="card-content">
  116 + <el-form label-width="120px">
  117 + <el-form-item :label="$t('addPurchaseApply.approver')">
  118 + <el-col :span="18">
  119 + <el-input type="text" :placeholder="$t('addPurchaseApply.requiredApprover')" disabled
  120 + v-model="addPurchaseApplyInfo.audit.staffName"></el-input>
  121 + </el-col>
  122 + <el-col :span="6">
  123 + <el-button type="primary" @click="chooseStaff">
  124 + <i class="el-icon-search"></i>
  125 + {{ $t('common.select') }}
  126 + </el-button>
  127 + </el-col>
  128 + </el-form-item>
  129 + </el-form>
  130 + </div>
  131 + </el-card>
  132 + </el-col>
  133 + </el-row>
  134 +
  135 + <el-row>
  136 + <el-col :span="24" style="text-align:right">
  137 + <el-button type="primary" style="margin-left:10px;" @click="_applyPurchaseSummit">
  138 + {{ $t('addPurchaseApply.submit') }}
  139 + </el-button>
  140 + </el-col>
  141 + </el-row>
  142 +
  143 + <choose-resource-store2 ref="chooseResourceStore2"
  144 + @setSelectResourceStores="handleSetSelectResourceStores"></choose-resource-store2>
  145 +
  146 + <select-staff ref="selectStaff" @change="handleStaffChange"></select-staff>
  147 + </div>
  148 +</template>
  149 +
  150 +<script>
  151 +import { getCommunityId } from '@/api/community/communityApi'
  152 +import ChooseResourceStore2 from '@/components/resource/chooseResourceStore2'
  153 +import SelectStaff from '@/components/resource/selectStaff'
  154 +import { getUserName } from '@/api/user/userApi'
  155 +import {
  156 + listStorehouses,
  157 + listResourceSuppliers,
  158 + queryFirstAuditStaff,
  159 + purchaseApply
  160 +} from '@/api/resource/addPurchaseApplyApi'
  161 +import { getUserTel } from '../../api/user/userApi'
  162 +
  163 +export default {
  164 + name: 'AddPurchaseApply',
  165 + components: {
  166 + ChooseResourceStore2,
  167 + SelectStaff
  168 + },
  169 + data() {
  170 + return {
  171 + addPurchaseApplyInfo: {
  172 + resourceStores: [],
  173 + resourceSuppliers: [],
  174 + audit: {
  175 + assignee: '',
  176 + staffId: '',
  177 + staffName: '',
  178 + taskId: ''
  179 + },
  180 + description: '',
  181 + endUserName: '',
  182 + endUserTel: '',
  183 + file: '',
  184 + resOrderType: '10000',
  185 + staffId: '',
  186 + staffName: '',
  187 + communityId: '',
  188 + shId: '',
  189 + storehouses: [],
  190 + flowId: '',
  191 + purchaseSwitch: ''
  192 + }
  193 + }
  194 + },
  195 + created() {
  196 + this._reset()
  197 + this.communityId = getCommunityId()
  198 + this.addPurchaseApplyInfo.communityId = this.communityId
  199 + this.addPurchaseApplyInfo.endUserName = getUserName()
  200 + this.addPurchaseApplyInfo.endUserTel = getUserTel()
  201 + this.addPurchaseApplyInfo.purchaseSwitch = this.$route.query.purchaseSwitch
  202 + this._loadResourceSuppliers()
  203 + this._listPurchaseStorehouses()
  204 + },
  205 + methods: {
  206 + _reset() {
  207 + this.addPurchaseApplyInfo = {
  208 + resourceStores: [],
  209 + resourceSuppliers: [],
  210 + audit: {
  211 + assignee: '',
  212 + staffId: '',
  213 + staffName: '',
  214 + taskId: ''
  215 + },
  216 + description: '',
  217 + endUserName: '',
  218 + endUserTel: '',
  219 + file: '',
  220 + resOrderType: '10000',
  221 + staffId: '',
  222 + staffName: '',
  223 + communityId: this.communityId,
  224 + shId: '',
  225 + storehouses: [],
  226 + flowId: ''
  227 + }
  228 + },
  229 + _resourcesFromSameHouse(resourcesList) {
  230 + if (!resourcesList || resourcesList.length < 2) {
  231 + return true
  232 + }
  233 + let lastHouse = ''
  234 + let sign = true
  235 + for (let i = 0; i < resourcesList.length; i++) {
  236 + if (lastHouse == '') {
  237 + lastHouse = resourcesList[i].shId
  238 + continue
  239 + }
  240 + if (lastHouse == resourcesList[i].shId) {
  241 + continue
  242 + } else {
  243 + sign = false
  244 + break
  245 + }
  246 + }
  247 + return sign
  248 + },
  249 + async _applyPurchaseSummit() {
  250 + const _resourceStores = this.addPurchaseApplyInfo.resourceStores
  251 + if (!_resourceStores || _resourceStores.length < 1) {
  252 + this.$message.error(this.$t('addPurchaseApply.noItemsSelected'))
  253 + return
  254 + }
  255 + if (!this._resourcesFromSameHouse(_resourceStores)) {
  256 + this.$message.error(this.$t('addPurchaseApply.sameWarehouseRequired'))
  257 + return
  258 + }
  259 + let isFlag = true
  260 + let _quantity = true
  261 + this.addPurchaseApplyInfo.resourceStores.forEach(item => {
  262 + if (item.timesId == null || item.timesId == '' || item.timesId == undefined) {
  263 + isFlag = false
  264 + }
  265 + if (item.quantity == null || item.quantity == '' || item.quantity == undefined) {
  266 + _quantity = false
  267 + }
  268 + })
  269 + if (!isFlag) {
  270 + this.$message.error(this.$t('addPurchaseApply.selectPriceRequired'))
  271 + return
  272 + }
  273 + if (!_quantity) {
  274 + this.$message.error(this.$t('addPurchaseApply.quantityRequired'))
  275 + return
  276 + }
  277 +
  278 + try {
  279 + const res = await purchaseApply(this.addPurchaseApplyInfo)
  280 + if (res.code === 0) {
  281 + this.$router.go(-1)
  282 + this.$message.success(this.$t('common.operationSuccess'))
  283 + } else {
  284 + this.$message.error(res.msg)
  285 + }
  286 + } catch (error) {
  287 + this.$message.error(error)
  288 + }
  289 + },
  290 + async _loadResourceSuppliers() {
  291 + try {
  292 + const res = await listResourceSuppliers({ page: 1, row: 50 })
  293 + this.addPurchaseApplyInfo.resourceSuppliers = res.data
  294 + } catch (error) {
  295 + console.error('请求失败:', error)
  296 + }
  297 + },
  298 + _openSelectResourceStoreInfoModel() {
  299 + const _shId = this.addPurchaseApplyInfo.shId
  300 + const endUserName = this.addPurchaseApplyInfo.endUserName
  301 + const endUserTel = this.addPurchaseApplyInfo.endUserTel
  302 + const description = this.addPurchaseApplyInfo.description
  303 + if (!_shId) {
  304 + this.$message.error(this.$t('addPurchaseApply.selectWarehouseRequired'))
  305 + return
  306 + }
  307 + if (!endUserName) {
  308 + this.$message.error(this.$t('addPurchaseApply.contactRequired'))
  309 + return
  310 + }
  311 + if (!endUserTel) {
  312 + this.$message.error(this.$t('addPurchaseApply.phoneRequired'))
  313 + return
  314 + }
  315 + if (!description) {
  316 + this.$message.error(this.$t('addPurchaseApply.descRequired'))
  317 + return
  318 + }
  319 + this.$refs.chooseResourceStore2.open({ shId: _shId })
  320 + },
  321 + _removeSelectResourceStoreItem(resId) {
  322 + this.addPurchaseApplyInfo.resourceStores.forEach((item, index) => {
  323 + if (item.resId == resId) {
  324 + this.addPurchaseApplyInfo.resourceStores.splice(index, 1)
  325 + }
  326 + })
  327 + },
  328 + _changeTimesId(e, index) {
  329 + const timeId = e
  330 + const times = this.addPurchaseApplyInfo.resourceStores[index].times
  331 + times.forEach((item) => {
  332 + if (item.timesId == timeId) {
  333 + this.addPurchaseApplyInfo.resourceStores[index].selectedStock = item.stock
  334 + }
  335 + })
  336 + },
  337 + _getTimesStock(_resourceStore) {
  338 + if (!_resourceStore.timesId) {
  339 + return "-"
  340 + }
  341 + let _stock = 0
  342 + _resourceStore.times.forEach(_item => {
  343 + if (_item.timesId == _resourceStore.timesId) {
  344 + _stock = _item.stock
  345 + }
  346 + })
  347 + if (!_resourceStore.quantity) {
  348 + _resourceStore.quantity = ''
  349 + }
  350 + return _stock
  351 + },
  352 + async _loadStaffOrg(_flowId) {
  353 + try {
  354 + const res = await queryFirstAuditStaff({
  355 + communityId: this.communityId,
  356 + flowId: _flowId
  357 + })
  358 + if (res.code != 0) return
  359 + const _data = res.data[0]
  360 + Object.assign(this.addPurchaseApplyInfo.audit, _data)
  361 + if (!_data.assignee.startsWith('-')) {
  362 + this.addPurchaseApplyInfo.audit.staffId = this.addPurchaseApplyInfo.audit.assignee
  363 + }
  364 + } catch (error) {
  365 + console.error('请求失败:', error)
  366 + }
  367 + },
  368 + chooseStaff() {
  369 + this.$refs.selectStaff.open(this.addPurchaseApplyInfo.audit)
  370 + },
  371 + async _listPurchaseStorehouses() {
  372 + try {
  373 + const res = await listStorehouses({
  374 + page: 1,
  375 + row: 100,
  376 + communityId: "",
  377 + allowPurchase: 'ON'
  378 + })
  379 + this.addPurchaseApplyInfo.storehouses = res.data
  380 + } catch (error) {
  381 + console.error('请求失败:', error)
  382 + }
  383 + },
  384 + _computeFlow() {
  385 + this.addPurchaseApplyInfo.resourceStores = []
  386 +
  387 + const _storehouses = this.addPurchaseApplyInfo.storehouses
  388 + let _flowId = ""
  389 + _storehouses.forEach(item => {
  390 + if (this.addPurchaseApplyInfo.shId == item.shId) {
  391 + _flowId = item.purchaseFlowId
  392 + }
  393 + })
  394 + this.addPurchaseApplyInfo.flowId = _flowId
  395 + if (!_flowId) return
  396 + this._loadStaffOrg(_flowId)
  397 + },
  398 + handleSetSelectResourceStores(resourceStores) {
  399 + const oldList = this.addPurchaseApplyInfo.resourceStores
  400 + resourceStores.forEach((newItem, newIndex) => {
  401 + newItem.rsId = ''
  402 + newItem.timesId = ''
  403 + if (newItem.times && newItem.times.length > 0) {
  404 + newItem.timesId = newItem.times[0].timesId
  405 + }
  406 + oldList.forEach((oldItem) => {
  407 + if (oldItem.resId == newItem.resId && newItem.times && newItem.times.length < 2) {
  408 + delete resourceStores[newIndex]
  409 + }
  410 + })
  411 + })
  412 + resourceStores.push.apply(resourceStores, oldList)
  413 + resourceStores = resourceStores.filter((s) => {
  414 + return s['resId']
  415 + })
  416 + this.addPurchaseApplyInfo.resourceStores = resourceStores
  417 + },
  418 + handleStaffChange(staff) {
  419 + this.addPurchaseApplyInfo.audit.staffId = staff.userId
  420 + this.addPurchaseApplyInfo.audit.staffName = staff.userName
  421 + },
  422 + goBack() {
  423 + this.$router.go(-1)
  424 + }
  425 + }
  426 +}
  427 +</script>
  428 +
  429 +<style lang="scss" scoped>
  430 +.add-purchase-apply-container {
  431 + padding: 20px;
  432 +
  433 + .box-card {
  434 + margin-bottom: 20px;
  435 +
  436 + .clearfix {
  437 + display: flex;
  438 + justify-content: space-between;
  439 + align-items: center;
  440 + }
  441 +
  442 + .card-content {
  443 + padding: 20px;
  444 + }
  445 + }
  446 +
  447 + .el-form-item {
  448 + margin-bottom: 22px;
  449 + }
  450 +}
  451 +</style>
0 452 \ No newline at end of file
... ...
src/views/resource/purchaseApplyDetailLang.js 0 → 100644
  1 +export const messages = {
  2 + en: {
  3 + purchaseApplyDetail: {
  4 + applyInfo: 'Application Information',
  5 + print: 'Print',
  6 + back: 'Back',
  7 + applyNo: 'Application No:',
  8 + applicant: 'Applicant:',
  9 + endUser: 'End User:',
  10 + contactPhone: 'Contact Phone:',
  11 + applyTime: 'Application Time:',
  12 + referenceTotalPrice: 'Reference Total Price:',
  13 + approvalStatus: 'Approval Status:',
  14 + storageMethod: 'Storage Method',
  15 + outboundMethod: 'Outbound Method',
  16 + directStorage: 'Direct Storage',
  17 + purchaseStorage: 'Purchase Storage',
  18 + emergencyPurchase: 'Emergency Purchase',
  19 + directOutbound: 'Direct Outbound',
  20 + auditOutbound: 'Audit Outbound',
  21 + description: 'Description:',
  22 + referencePurchaseTotalPrice: 'Reference Purchase Total Price:',
  23 + actualPurchaseTotalPrice: 'Actual Purchase Total Price:',
  24 + applyMaterials: 'Application Materials',
  25 + itemType: 'Item Type',
  26 + itemName: 'Item Name',
  27 + warehouse: 'Warehouse',
  28 + itemSpec: 'Item Specification',
  29 + supplier: 'Supplier',
  30 + itemCode: 'Item Code',
  31 + fixedItem: 'Fixed Item',
  32 + referencePrice: 'Reference Price',
  33 + originalStock: 'Original Stock',
  34 + currentStock: 'Current Stock',
  35 + applyQuantity: 'Apply Quantity',
  36 + applyRemark: 'Apply Remark',
  37 + purchasePrice: 'Purchase Price',
  38 + purchaseQuantity: 'Purchase Quantity',
  39 + receiveQuantity: 'Receive Quantity',
  40 + purchaseRemark: 'Purchase Remark',
  41 + receiveRemark: 'Receive Remark',
  42 + workOrderFlow: 'Work Order Flow',
  43 + serialNumber: 'No.',
  44 + handler: 'Handler',
  45 + status: 'Status',
  46 + handleTime: 'Handle Time',
  47 + timeConsuming: 'Time Consuming',
  48 + opinion: 'Opinion'
  49 + },
  50 + auditDiv: {
  51 + workOrderProcessing: 'Work Order Processing',
  52 + action: 'Action',
  53 + pleaseSelect: 'Please Select',
  54 + agree: 'Agree',
  55 + return: 'Return',
  56 + returnToSubmitter: 'Return to Submitter',
  57 + transfer: 'Transfer',
  58 + workOrderDescription: 'Work Order Description',
  59 + requiredDescription: 'Required, please fill in the work order description',
  60 + nextHandler: 'Next Handler',
  61 + requiredNextHandler: 'Required, please select the next handler',
  62 + select: 'Select',
  63 + pleaseSelectStatus: 'Please select status',
  64 + pleaseFillDescription: 'Please fill in the description',
  65 + pleaseSelectNextHandler: 'Please select next handler',
  66 + submitSuccess: 'Submit successfully',
  67 + submitFailed: 'Submit failed'
  68 + },
  69 + selectStaff: {
  70 + selectStaff: 'Select Staff',
  71 + orgInfo: 'Organization Information',
  72 + staffInfo: 'Staff Information',
  73 + submitter: 'Submitter',
  74 + dynamicAssign: 'Dynamic Assign'
  75 + }
  76 + },
  77 + zh: {
  78 + purchaseApplyDetail: {
  79 + applyInfo: '申请信息',
  80 + print: '打印',
  81 + back: '返回',
  82 + applyNo: '申请单号:',
  83 + applicant: '申请人:',
  84 + endUser: '使用人:',
  85 + contactPhone: '联系电话:',
  86 + applyTime: '申请时间:',
  87 + referenceTotalPrice: '参考总价:',
  88 + approvalStatus: '审批状态:',
  89 + storageMethod: '入库方式',
  90 + outboundMethod: '出库方式',
  91 + directStorage: '直接入库',
  92 + purchaseStorage: '采购入库',
  93 + emergencyPurchase: '紧急采购',
  94 + directOutbound: '直接出库',
  95 + auditOutbound: '审核出库',
  96 + description: '说明:',
  97 + referencePurchaseTotalPrice: '参考采购总价:',
  98 + actualPurchaseTotalPrice: '实际采购总价:',
  99 + applyMaterials: '申请物资',
  100 + itemType: '物品类型',
  101 + itemName: '物品名称',
  102 + warehouse: '所属仓库',
  103 + itemSpec: '物品规格',
  104 + supplier: '供应商',
  105 + itemCode: '物品编码',
  106 + fixedItem: '固定物品',
  107 + referencePrice: '参考单价',
  108 + originalStock: '原有库存',
  109 + currentStock: '现有库存',
  110 + applyQuantity: '申请数量',
  111 + applyRemark: '申请备注',
  112 + purchasePrice: '采购单价',
  113 + purchaseQuantity: '采购数量',
  114 + receiveQuantity: '领用数量',
  115 + purchaseRemark: '采购备注',
  116 + receiveRemark: '领用备注',
  117 + workOrderFlow: '工单流转',
  118 + serialNumber: '序号',
  119 + handler: '处理人',
  120 + status: '状态',
  121 + handleTime: '处理时间',
  122 + timeConsuming: '耗时',
  123 + opinion: '意见'
  124 + },
  125 + auditDiv: {
  126 + workOrderProcessing: '工单办理',
  127 + action: '动作',
  128 + pleaseSelect: '请选择',
  129 + agree: '同意',
  130 + return: '退回',
  131 + returnToSubmitter: '退回至提交者',
  132 + transfer: '转单',
  133 + workOrderDescription: '工单说明',
  134 + requiredDescription: '必填,请填写工单说明',
  135 + nextHandler: '下一处理人',
  136 + requiredNextHandler: '必填,请选择下一处理人',
  137 + select: '选择',
  138 + pleaseSelectStatus: '请选择状态',
  139 + pleaseFillDescription: '请填写说明',
  140 + pleaseSelectNextHandler: '请选择下一节点处理人',
  141 + submitSuccess: '提交成功',
  142 + submitFailed: '提交失败'
  143 + },
  144 + selectStaff: {
  145 + selectStaff: '选择员工',
  146 + orgInfo: '组织信息',
  147 + staffInfo: '员工信息',
  148 + submitter: '提交者',
  149 + dynamicAssign: '动态指定'
  150 + }
  151 + }
  152 +}
0 153 \ No newline at end of file
... ...
src/views/resource/purchaseApplyDetailList.vue 0 → 100644
  1 +<template>
  2 + <div class="purchase-apply-detail-container">
  3 + <!-- 申请信息 -->
  4 + <el-card class="box-card">
  5 + <div slot="header" class="clearfix">
  6 + <span>{{ $t('purchaseApplyDetail.applyInfo') }}</span>
  7 + <div class="card-header-actions">
  8 + <el-button type="primary" size="small" @click="_printPurchaseApply">
  9 + <i class="el-icon-printer"></i>
  10 + {{ $t('purchaseApplyDetail.print') }}
  11 + </el-button>
  12 + <el-button type="primary" size="small" @click="_callBackListPurchaseApply">
  13 + <i class="el-icon-close"></i>
  14 + {{ $t('purchaseApplyDetail.back') }}
  15 + </el-button>
  16 + </div>
  17 + </div>
  18 + <div class="card-content">
  19 + <el-row :gutter="20">
  20 + <el-col :span="6">
  21 + <div class="form-item">
  22 + <label>{{ $t('purchaseApplyDetail.applyNo') }}</label>
  23 + <div>{{ purchaseApplyDetailInfo.applyOrderId }}</div>
  24 + </div>
  25 + </el-col>
  26 + <el-col :span="6">
  27 + <div class="form-item">
  28 + <label>{{ $t('purchaseApplyDetail.applicant') }}</label>
  29 + <div>{{ purchaseApplyDetailInfo.userName }}</div>
  30 + </div>
  31 + </el-col>
  32 + <el-col :span="6">
  33 + <div class="form-item">
  34 + <label>{{ $t('purchaseApplyDetail.endUser') }}</label>
  35 + <div>{{ purchaseApplyDetailInfo.endUserName }}</div>
  36 + </div>
  37 + </el-col>
  38 + </el-row>
  39 + <el-row :gutter="20">
  40 + <el-col :span="6">
  41 + <div class="form-item">
  42 + <label>{{ $t('purchaseApplyDetail.contactPhone') }}</label>
  43 + <div>{{ purchaseApplyDetailInfo.endUserTel }}</div>
  44 + </div>
  45 + </el-col>
  46 + <el-col :span="6">
  47 + <div class="form-item">
  48 + <label>{{ $t('purchaseApplyDetail.applyTime') }}</label>
  49 + <div>{{ purchaseApplyDetailInfo.createTime }}</div>
  50 + </div>
  51 + </el-col>
  52 + <el-col v-if="purchaseApplyDetailInfo.resOrderType == 10000 && purchaseApplyDetailInfo.warehousingWay == 20000"
  53 + :span="6">
  54 + <div class="form-item">
  55 + <label>{{ $t('purchaseApplyDetail.referenceTotalPrice') }}</label>
  56 + <div>¥{{ purchaseApplyDetailInfo.totalPrice }}</div>
  57 + </div>
  58 + </el-col>
  59 + <el-col :span="6">
  60 + <div class="form-item">
  61 + <label>{{ $t('purchaseApplyDetail.approvalStatus') }}</label>
  62 + <div>{{ purchaseApplyDetailInfo.stateName }}</div>
  63 + </div>
  64 + </el-col>
  65 + <el-col :span="6">
  66 + <div class="form-item">
  67 + <label>{{ purchaseApplyDetailInfo.resOrderType == 10000 ? $t('purchaseApplyDetail.storageMethod') :
  68 + $t('purchaseApplyDetail.outboundMethod') }}</label>
  69 + <div>
  70 + {{ purchaseApplyDetailInfo.resOrderType == 10000 ?
  71 + (purchaseApplyDetailInfo.warehousingWay == 10000 ? $t('purchaseApplyDetail.directStorage') :
  72 + purchaseApplyDetailInfo.warehousingWay == 20000 ? $t('purchaseApplyDetail.purchaseStorage') :
  73 + $t('purchaseApplyDetail.emergencyPurchase')) :
  74 + (purchaseApplyDetailInfo.warehousingWay == 10000 ? $t('purchaseApplyDetail.directOutbound') :
  75 + $t('purchaseApplyDetail.auditOutbound')) }}
  76 + </div>
  77 + </div>
  78 + </el-col>
  79 + <el-col :span="6">
  80 + <div class="form-item">
  81 + <label>{{ $t('purchaseApplyDetail.description') }}</label>
  82 + <div>{{ purchaseApplyDetailInfo.description }}</div>
  83 + </div>
  84 + </el-col>
  85 + </el-row>
  86 + <el-row v-if="purchaseApplyDetailInfo.resOrderType == 10000" :gutter="20">
  87 + <el-col :span="6">
  88 + <div class="form-item">
  89 + <label>{{ $t('purchaseApplyDetail.referencePurchaseTotalPrice') }}</label>
  90 + <div>{{ purchaseApplyDetailInfo.totalPrice > 0 ? '¥' + purchaseApplyDetailInfo.totalPrice : '-' }}</div>
  91 + </div>
  92 + </el-col>
  93 + <el-col :span="6">
  94 + <div class="form-item">
  95 + <label>{{ $t('purchaseApplyDetail.actualPurchaseTotalPrice') }}</label>
  96 + <div>{{ purchaseApplyDetailInfo.purchaseTotalPrice > 0 ? '¥' + purchaseApplyDetailInfo.purchaseTotalPrice :
  97 + '-' }}</div>
  98 + </div>
  99 + </el-col>
  100 + </el-row>
  101 + </div>
  102 + </el-card>
  103 +
  104 + <!-- 申请物资 -->
  105 + <el-card class="box-card">
  106 + <div slot="header" class="clearfix">
  107 + <span>{{ $t('purchaseApplyDetail.applyMaterials') }}</span>
  108 + </div>
  109 + <div class="card-content">
  110 + <el-table :data="purchaseApplyDetailInfo.purchaseApplyDetailVo" border style="width: 100%">
  111 + <el-table-column prop="parentRstName" :label="$t('purchaseApplyDetail.itemType')" align="center">
  112 + <template slot-scope="scope">
  113 + {{ scope.row.parentRstName }} > {{ scope.row.rstName }}
  114 + </template>
  115 + </el-table-column>
  116 + <el-table-column prop="resName" :label="$t('purchaseApplyDetail.itemName')" align="center"></el-table-column>
  117 + <el-table-column prop="shName" :label="$t('purchaseApplyDetail.warehouse')" align="center"></el-table-column>
  118 + <el-table-column prop="specName" :label="$t('purchaseApplyDetail.itemSpec')" align="center">
  119 + <template slot-scope="scope">
  120 + {{ scope.row.specName || '-' }}
  121 + </template>
  122 + </el-table-column>
  123 + <el-table-column prop="supplierName" :label="$t('purchaseApplyDetail.supplier')" align="center">
  124 + <template slot-scope="scope">
  125 + {{ scope.row.supplierName || '-' }}
  126 + </template>
  127 + </el-table-column>
  128 + <el-table-column prop="resCode" :label="$t('purchaseApplyDetail.itemCode')" align="center"></el-table-column>
  129 + <el-table-column prop="isFixedName" :label="$t('purchaseApplyDetail.fixedItem')"
  130 + align="center"></el-table-column>
  131 + <el-table-column prop="consultPrice" :label="$t('purchaseApplyDetail.referencePrice')" align="center">
  132 + <template slot-scope="scope">
  133 + {{ scope.row.consultPrice ? '¥' + scope.row.consultPrice : '-' }}
  134 + </template>
  135 + </el-table-column>
  136 + <el-table-column prop="originalStock" :label="$t('purchaseApplyDetail.originalStock')" align="center">
  137 + <template slot-scope="scope">
  138 + {{ scope.row.originalStock }}{{ scope.row.unitCodeName }}
  139 + </template>
  140 + </el-table-column>
  141 + <el-table-column prop="stock" :label="$t('purchaseApplyDetail.currentStock')" align="center">
  142 + <template slot-scope="scope">
  143 + {{ scope.row.stock ? scope.row.stock : '0' }}{{ scope.row.unitCodeName }}
  144 + </template>
  145 + </el-table-column>
  146 + <el-table-column prop="quantity" :label="$t('purchaseApplyDetail.applyQuantity')" align="center">
  147 + <template slot-scope="scope">
  148 + {{ scope.row.quantity }}{{ scope.row.unitCodeName }}
  149 + </template>
  150 + </el-table-column>
  151 + <el-table-column prop="remark" :label="$t('purchaseApplyDetail.applyRemark')" align="center"></el-table-column>
  152 + <el-table-column v-if="purchaseApplyDetailInfo.resOrderType == 10000" prop="purchasePrice"
  153 + :label="$t('purchaseApplyDetail.purchasePrice')" align="center">
  154 + <template slot-scope="scope">
  155 + {{ scope.row.purchasePrice ? '¥' + scope.row.purchasePrice : '-' }}
  156 + </template>
  157 + </el-table-column>
  158 + <el-table-column prop="purchaseQuantity"
  159 + :label="purchaseApplyDetailInfo.resOrderType == 10000 ? $t('purchaseApplyDetail.purchaseQuantity') : $t('purchaseApplyDetail.receiveQuantity')"
  160 + align="center">
  161 + <template slot-scope="scope">
  162 + {{ scope.row.purchaseQuantity ? scope.row.purchaseQuantity + scope.row.unitCodeName : '-' }}
  163 + </template>
  164 + </el-table-column>
  165 + <el-table-column prop="purchaseRemark"
  166 + :label="purchaseApplyDetailInfo.resOrderType == 10000 ? $t('purchaseApplyDetail.purchaseRemark') : $t('purchaseApplyDetail.receiveRemark')"
  167 + align="center">
  168 + <template slot-scope="scope">
  169 + {{ scope.row.purchaseRemark || '-' }}
  170 + </template>
  171 + </el-table-column>
  172 + </el-table>
  173 + </div>
  174 + </el-card>
  175 +
  176 + <!-- 工单流转 -->
  177 + <el-card v-if="purchaseApplyDetailInfo.warehousingWay == 20000" class="box-card">
  178 + <div slot="header" class="clearfix">
  179 + <span>{{ $t('purchaseApplyDetail.workOrderFlow') }}</span>
  180 + </div>
  181 + <div class="card-content">
  182 + <el-table :data="purchaseApplyDetailInfo.auditUsers" border style="width: 100%">
  183 + <el-table-column type="index" :label="$t('purchaseApplyDetail.serialNumber')" align="center"
  184 + width="80"></el-table-column>
  185 + <el-table-column prop="userName" :label="$t('purchaseApplyDetail.handler')" align="center">
  186 + <template slot-scope="scope">
  187 + {{ scope.row.userName || scope.row.auditName }}
  188 + </template>
  189 + </el-table-column>
  190 + <el-table-column prop="stateName" :label="$t('purchaseApplyDetail.status')" align="center"></el-table-column>
  191 + <el-table-column prop="auditTime" :label="$t('purchaseApplyDetail.handleTime')"
  192 + align="center"></el-table-column>
  193 + <el-table-column prop="duration" :label="$t('purchaseApplyDetail.timeConsuming')"
  194 + align="center"></el-table-column>
  195 + <el-table-column prop="message" :label="$t('purchaseApplyDetail.opinion')" align="center"></el-table-column>
  196 + </el-table>
  197 + </div>
  198 + </el-card>
  199 +
  200 + <!-- 审核组件 -->
  201 + <audit-div v-if="purchaseApplyDetailInfo.action == 'audit'" ref="auditDiv"></audit-div>
  202 + </div>
  203 +</template>
  204 +
  205 +<script>
  206 +import { listPurchaseApplys, listWorkflowAuditInfo } from '@/api/resource/purchaseApplyDetailApi'
  207 +import { getCommunityId } from '@/api/community/communityApi'
  208 +import AuditDiv from '@/components/resource/auditDiv'
  209 +
  210 +export default {
  211 + name: 'PurchaseApplyDetailList',
  212 + components: {
  213 + AuditDiv
  214 + },
  215 + data() {
  216 + return {
  217 + purchaseApplyDetailInfo: {
  218 + resourceNames: '',
  219 + state: '',
  220 + totalPrice: '',
  221 + purchaseTotalPrice: '',
  222 + applyOrderId: '',
  223 + description: '',
  224 + createTime: '',
  225 + userName: '',
  226 + endUserName: '',
  227 + endUserTel: '',
  228 + stateName: '',
  229 + resOrderType: '',
  230 + purchaseApplyDetailVo: [],
  231 + auditUsers: [],
  232 + warehousingWay: '',
  233 + action: '',
  234 + taskId: ''
  235 + },
  236 + communityId: ''
  237 + }
  238 + },
  239 + created() {
  240 + this.communityId = getCommunityId()
  241 + this.purchaseApplyDetailInfo.applyOrderId = this.$route.query.applyOrderId
  242 + this.purchaseApplyDetailInfo.resOrderType = this.$route.query.resOrderType
  243 + this.purchaseApplyDetailInfo.action = this.$route.query.action
  244 + this.purchaseApplyDetailInfo.taskId = this.$route.query.taskId
  245 + this._listPurchaseApply()
  246 + },
  247 + methods: {
  248 + async _listPurchaseApply() {
  249 + try {
  250 + const params = {
  251 + applyOrderId: this.purchaseApplyDetailInfo.applyOrderId,
  252 + resOrderType: this.purchaseApplyDetailInfo.resOrderType,
  253 + page: 1,
  254 + row: 1,
  255 + communityId: this.communityId
  256 + }
  257 + const res = await listPurchaseApplys(params)
  258 + const purchaseApply = res.purchaseApplys[0]
  259 + Object.assign(this.purchaseApplyDetailInfo, purchaseApply)
  260 +
  261 + if (this.purchaseApplyDetailInfo.warehousingWay == 20000) {
  262 + this._loadAuditUser()
  263 + }
  264 +
  265 + if (this.purchaseApplyDetailInfo.action == 'audit') {
  266 + this.$refs.auditDiv.open({
  267 + createUserId: purchaseApply.createUserId,
  268 + action: this.purchaseApplyDetailInfo.action,
  269 + taskId: this.purchaseApplyDetailInfo.taskId,
  270 + url: '/purchaseApply.auditApplyOrder',
  271 + id: purchaseApply.applyOrderId,
  272 + })
  273 + }
  274 + } catch (error) {
  275 + console.error('获取采购申请详情失败:', error)
  276 + }
  277 + },
  278 + async _loadAuditUser() {
  279 + try {
  280 + const params = {
  281 + businessKey: this.purchaseApplyDetailInfo.applyOrderId,
  282 + communityId: this.communityId
  283 + }
  284 + const res = await listWorkflowAuditInfo(params)
  285 + this.purchaseApplyDetailInfo.auditUsers = res.data
  286 + } catch (error) {
  287 + console.error('获取审核流程信息失败:', error)
  288 + }
  289 + },
  290 + _callBackListPurchaseApply() {
  291 + this.$router.go(-1)
  292 + },
  293 + _printPurchaseApply() {
  294 + if (this.purchaseApplyDetailInfo.resOrderType == '10000') {
  295 + window.open(`/print.html#/pages/property/printPurchaseApply?applyOrderId=${this.purchaseApplyDetailInfo.applyOrderId}&resOrderType=${this.purchaseApplyDetailInfo.resOrderType}`)
  296 + } else if (this.purchaseApplyDetailInfo.resOrderType == '20000') {
  297 + window.open(`/print.html#/pages/property/printPurchaseOutApply?applyOrderId=${this.purchaseApplyDetailInfo.applyOrderId}&resOrderType=${this.purchaseApplyDetailInfo.resOrderType}`)
  298 + }
  299 + }
  300 + }
  301 +}
  302 +</script>
  303 +
  304 +<style lang="scss" scoped>
  305 +.purchase-apply-detail-container {
  306 + padding: 20px;
  307 +
  308 + .box-card {
  309 + margin-bottom: 20px;
  310 +
  311 + .clearfix {
  312 + display: flex;
  313 + justify-content: space-between;
  314 + align-items: center;
  315 + }
  316 +
  317 + .card-content {
  318 +
  319 + .form-item {
  320 + margin-bottom: 15px;
  321 + display: flex;
  322 + justify-self: start;
  323 +
  324 + label {
  325 + margin-bottom: 5px;
  326 + }
  327 +
  328 + div {
  329 + margin-left: 5px;
  330 + }
  331 + }
  332 + }
  333 + }
  334 +
  335 + .el-table {
  336 + margin-top: 20px;
  337 + }
  338 +}</style>
0 339 \ No newline at end of file
... ...
src/views/resource/purchaseApplyManageLang.js 0 → 100644
  1 +export const messages = {
  2 + en: {
  3 + purchaseApplyManage: {
  4 + search: {
  5 + title: 'Search Conditions',
  6 + applyOrderId: 'Please enter application order number',
  7 + name: 'Please enter applicant name',
  8 + resName: 'Please enter item name',
  9 + startTime: 'Please select start time',
  10 + endTime: 'Please select end time'
  11 + },
  12 + list: {
  13 + title: 'Purchase Application'
  14 + },
  15 + table: {
  16 + applyOrderId: 'Application Order No.',
  17 + userName: 'Applicant',
  18 + endUserName: 'User',
  19 + createUserName: 'Operator',
  20 + resourceNames: 'Item(Specification)',
  21 + createTime: 'Application Time',
  22 + warehousingWay: 'Purchase Method',
  23 + stateName: 'Approval Status'
  24 + },
  25 + button: {
  26 + purchase: 'Purchase',
  27 + urgentPurchase: 'Urgent Purchase',
  28 + flowChart: 'Flow Chart',
  29 + cancelApply: 'Cancel Application',
  30 + export: 'Export'
  31 + },
  32 + warehousingWay: {
  33 + direct: 'Direct Storage',
  34 + purchase: 'Purchase Storage',
  35 + urgent: 'Urgent Purchase'
  36 + },
  37 + edit: {
  38 + title: 'Edit Purchase Application',
  39 + state: 'Order Status',
  40 + stateRequired: 'Required, please select order status',
  41 + stateOption1: 'Area*Unit Price+Surcharge',
  42 + stateOption2: 'Fixed Fee',
  43 + stateFormatError: 'Order status format error',
  44 + applyOrderIdRequired: 'Order number cannot be empty'
  45 + },
  46 + delete: {
  47 + title: 'Please confirm your operation',
  48 + confirmText: 'Are you sure to cancel the application?',
  49 + success: 'Cancel application successfully',
  50 + error: 'Failed to cancel application'
  51 + }
  52 + }
  53 + },
  54 + zh: {
  55 + purchaseApplyManage: {
  56 + search: {
  57 + title: '查询条件',
  58 + applyOrderId: '请输入申请单号',
  59 + name: '请填写申请人姓名',
  60 + resName: '请填写物品名称',
  61 + startTime: '请选择开始时间',
  62 + endTime: '请选择结束时间'
  63 + },
  64 + list: {
  65 + title: '采购申请'
  66 + },
  67 + table: {
  68 + applyOrderId: '申请单号',
  69 + userName: '申请人',
  70 + endUserName: '使用人',
  71 + createUserName: '操作人',
  72 + resourceNames: '物品(规格)',
  73 + createTime: '申请时间',
  74 + warehousingWay: '采购方式',
  75 + stateName: '审批状态'
  76 + },
  77 + button: {
  78 + purchase: '采购',
  79 + urgentPurchase: '紧急采购',
  80 + flowChart: '流程图',
  81 + cancelApply: '取消申请',
  82 + export: '导出'
  83 + },
  84 + warehousingWay: {
  85 + direct: '直接入库',
  86 + purchase: '采购入库',
  87 + urgent: '紧急采购'
  88 + },
  89 + edit: {
  90 + title: '修改采购申请',
  91 + state: '订单状态',
  92 + stateRequired: '必填,请选择订单状态',
  93 + stateOption1: '面积*单价+附加费',
  94 + stateOption2: '固定费用',
  95 + stateFormatError: '订单状态格式错误',
  96 + applyOrderIdRequired: '订单号不能为空'
  97 + },
  98 + delete: {
  99 + title: '请确认您的操作',
  100 + confirmText: '确定取消申请?',
  101 + success: '取消申请成功',
  102 + error: '取消申请失败'
  103 + }
  104 + }
  105 + }
  106 +}
0 107 \ No newline at end of file
... ...
src/views/resource/purchaseApplyManageList.vue 0 → 100644
  1 +<template>
  2 + <div class="purchase-apply-manage-container">
  3 +
  4 + <div class="wrapper wrapper-content animated fadeInRight ecommerce">
  5 + <el-row :gutter="20">
  6 + <el-col :span="4" class="padding-r-0">
  7 + <el-card>
  8 + <div class="border-radius">
  9 + <div class="margin-xs-r treeview attendance-staff">
  10 + <ul class="list-group text-center border-radius">
  11 + <li class="list-group-item node-orgTree" v-for="(item, index) in purchaseApplyManageInfo.states"
  12 + :key="index" @click="swatchState(item)" :class="{
  13 + 'vc-node-selected':
  14 + purchaseApplyManageInfo.conditions.state === item.statusCd,
  15 + }">
  16 + {{ item.name }}
  17 + </li>
  18 + </ul>
  19 + </div>
  20 + </div>
  21 + </el-card>
  22 + </el-col>
  23 + <el-col :span="20">
  24 + <el-card>
  25 + <div slot="header" class="flex justify-between">
  26 + <span>{{ $t('purchaseApplyManage.search.title') }}</span>
  27 + </div>
  28 + <el-row :gutter="20">
  29 + <el-col :span="4">
  30 + <el-input :placeholder="$t('purchaseApplyManage.search.applyOrderId')"
  31 + v-model.trim="purchaseApplyManageInfo.conditions.applyOrderId" clearable />
  32 + </el-col>
  33 + <el-col :span="4">
  34 + <el-input :placeholder="$t('purchaseApplyManage.search.name')"
  35 + v-model.trim="purchaseApplyManageInfo.conditions.name" clearable />
  36 + </el-col>
  37 + <el-col :span="4">
  38 + <el-input :placeholder="$t('purchaseApplyManage.search.resName')"
  39 + v-model.trim="purchaseApplyManageInfo.conditions.resName" clearable />
  40 + </el-col>
  41 + <el-col :span="4">
  42 + <el-date-picker v-model="purchaseApplyManageInfo.conditions.startTime" type="datetime"
  43 + :placeholder="$t('purchaseApplyManage.search.startTime')" style="width: 100%" />
  44 + </el-col>
  45 + <el-col :span="4">
  46 + <el-date-picker v-model="purchaseApplyManageInfo.conditions.endTime" type="datetime"
  47 + :placeholder="$t('purchaseApplyManage.search.endTime')" style="width: 100%" />
  48 + </el-col>
  49 + <el-col :span="4">
  50 + <el-button type="primary" @click="_queryPurchaseApplyMethod()" icon="el-icon-search">
  51 + {{ $t('common.search') }}
  52 + </el-button>
  53 + <el-button type="default" @click="_resetInspectionPlanMethod()" icon="el-icon-refresh">
  54 + {{ $t('common.reset') }}
  55 + </el-button>
  56 + </el-col>
  57 + </el-row>
  58 + </el-card>
  59 +
  60 + <el-card class="margin-top">
  61 + <div slot="header" class="flex justify-between">
  62 + <div>{{ $t('purchaseApplyManage.list.title') }}</div>
  63 + <div class="ibox-tools" style="top: 10px">
  64 + <el-button type="primary" size="small" @click="_openAddPurchaseApplyModal()" icon="el-icon-plus">
  65 + {{ $t('purchaseApplyManage.button.purchase') }}
  66 + </el-button>
  67 + <el-button type="primary" size="small" v-if="hasPrivilege('502021071043650029')"
  68 + @click="_openUrgentPurchaseApplyModal()" icon="el-icon-plus">
  69 + {{ $t('purchaseApplyManage.button.urgentPurchase') }}
  70 + </el-button>
  71 + <el-button type="primary" size="small" @click="_exportExcel()" icon="el-icon-download">
  72 + {{ $t('common.export') }}
  73 + </el-button>
  74 + </div>
  75 + </div>
  76 + <el-table :data="purchaseApplyManageInfo.purchaseApplys" border style="width: 100%" v-loading="loading">
  77 + <el-table-column prop="applyOrderId" :label="$t('purchaseApplyManage.table.applyOrderId')" align="center" />
  78 + <el-table-column prop="userName" :label="$t('purchaseApplyManage.table.userName')" align="center" />
  79 + <el-table-column prop="endUserName" :label="$t('purchaseApplyManage.table.endUserName')" align="center" />
  80 + <el-table-column prop="createUserName" :label="$t('purchaseApplyManage.table.createUserName')"
  81 + align="center" />
  82 + <el-table-column prop="resourceNames" :label="$t('purchaseApplyManage.table.resourceNames')"
  83 + align="center" />
  84 + <el-table-column prop="createTime" :label="$t('purchaseApplyManage.table.createTime')" align="center" />
  85 + <el-table-column :label="$t('purchaseApplyManage.table.warehousingWay')" align="center">
  86 + <template slot-scope="scope">
  87 + {{
  88 + scope.row.warehousingWay == 10000
  89 + ? $t('purchaseApplyManage.warehousingWay.direct')
  90 + : scope.row.warehousingWay == 20000
  91 + ? $t('purchaseApplyManage.warehousingWay.purchase')
  92 + : $t('purchaseApplyManage.warehousingWay.urgent')
  93 + }}
  94 + </template>
  95 + </el-table-column>
  96 + <el-table-column prop="stateName" :label="$t('purchaseApplyManage.table.stateName')" align="center" />
  97 + <el-table-column :label="$t('common.operation')" align="center" width="300">
  98 + <template slot-scope="scope">
  99 + <el-button size="mini" @click="_openDetailPurchaseApplyModel(scope.row)">
  100 + {{ $t('common.view') }}
  101 + </el-button>
  102 + <el-button size="mini" v-if="scope.row.warehousingWay != 10000 &&
  103 + scope.row.warehousingWay != 30000
  104 + " @click="_openRunWorkflowImage(scope.row)">
  105 + {{ $t('purchaseApplyManage.button.flowChart') }}
  106 + </el-button>
  107 + <el-button size="mini" type="danger" v-if="scope.row.state == '1000' &&
  108 + purchaseApplyManageInfo.currentUserId ==
  109 + scope.row.createUserId
  110 + " @click="_openDeletePurchaseApplyModel(scope.row)">
  111 + {{ $t('purchaseApplyManage.button.cancelApply') }}
  112 + </el-button>
  113 + <el-button size="mini" type="danger" v-else-if="scope.row.state == '1000' &&
  114 + hasPrivilege('502022032383620003')
  115 + " @click="_openDeletePurchaseApplyModel(scope.row)">
  116 + {{ $t('purchaseApplyManage.button.cancelApply') }}
  117 + </el-button>
  118 + </template>
  119 + </el-table-column>
  120 + </el-table>
  121 + <el-pagination class="margin-top" :current-page.sync="page.current" :page-sizes="[10, 20, 30, 50]"
  122 + :page-size="page.size" :total="page.total" layout="total, sizes, prev, pager, next, jumper"
  123 + @size-change="handleSizeChange" @current-change="handleCurrentChange" />
  124 + </el-card>
  125 + </el-col>
  126 + </el-row>
  127 + </div>
  128 +
  129 + <view-image ref="viewImage" />
  130 + <edit-purchase-apply ref="editPurchaseApply" />
  131 + <delete-purchase-apply ref="deletePurchaseApply" />
  132 + </div>
  133 +</template>
  134 +
  135 +<script>
  136 +import { listPurchaseApplys, exportData, getWorkflowImage } from '@/api/resource/purchaseApplyManageApi'
  137 +import { getDict } from '@/api/community/communityApi'
  138 +import { getCommunityId } from '@/api/community/communityApi'
  139 +import ViewImage from '@/components/system/viewImage'
  140 +import EditPurchaseApply from '@/components/resource/editPurchaseApply'
  141 +import DeletePurchaseApply from '@/components/resource/deletePurchaseApply'
  142 +
  143 +export default {
  144 + name: 'PurchaseApplyManageList',
  145 + components: {
  146 + ViewImage,
  147 + EditPurchaseApply,
  148 + DeletePurchaseApply
  149 + },
  150 + data() {
  151 + return {
  152 + loading: false,
  153 + purchaseApplyManageInfo: {
  154 + purchaseApplys: [],
  155 + total: 0,
  156 + records: 1,
  157 + moreCondition: false,
  158 + states: [],
  159 + currentUserId: '',
  160 + conditions: {
  161 + state: '',
  162 + applyOrderId: '',
  163 + userName: '',
  164 + name: '',
  165 + resOrderType: '10000',
  166 + resName: '',
  167 + startTime: '',
  168 + endTime: '',
  169 + userId: '',
  170 + communityId: ''
  171 + }
  172 + },
  173 + page: {
  174 + current: 1,
  175 + size: 10,
  176 + total: 0
  177 + }
  178 + }
  179 + },
  180 + created() {
  181 + this.purchaseApplyManageInfo.currentUserId = ''
  182 + this.purchaseApplyManageInfo.conditions.userId = ''
  183 + this.purchaseApplyManageInfo.conditions.communityId = getCommunityId()
  184 + this._listPurchaseApplys(this.page.current, this.page.size)
  185 + this.getDictData()
  186 + },
  187 + methods: {
  188 + async getDictData() {
  189 + try {
  190 + const data = await getDict('purchase_apply', 'state')
  191 + this.purchaseApplyManageInfo.states = [
  192 + {
  193 + statusCd: '',
  194 + name: this.$t('common.all')
  195 + },
  196 + ...data
  197 + ]
  198 + } catch (error) {
  199 + console.error('获取字典数据失败:', error)
  200 + }
  201 + },
  202 + async _listPurchaseApplys(page, size) {
  203 + this.loading = true
  204 + try {
  205 + const params = {
  206 + ...this.purchaseApplyManageInfo.conditions,
  207 + page,
  208 + row: size
  209 + }
  210 + const { purchaseApplys, total } = await listPurchaseApplys(params)
  211 + this.purchaseApplyManageInfo.purchaseApplys = purchaseApplys
  212 + this.page.total = total
  213 + } catch (error) {
  214 + console.error('获取采购申请列表失败:', error)
  215 + } finally {
  216 + this.loading = false
  217 + }
  218 + },
  219 + _openAddPurchaseApplyModal() {
  220 + this.$router.push({
  221 + path: '/views/resource/addPurchaseApply',
  222 + query: {
  223 + resOrderType: this.purchaseApplyManageInfo.conditions.resOrderType
  224 + }
  225 + })
  226 + },
  227 + _openUrgentPurchaseApplyModal() {
  228 + this.$router.push({
  229 + path: '/views/resource/urgentPurchaseApplyStep',
  230 + query: {
  231 + resOrderType: this.purchaseApplyManageInfo.conditions.resOrderType
  232 + }
  233 + })
  234 + },
  235 + _openDetailPurchaseApplyModel(purchaseApply) {
  236 + this.$router.push({
  237 + path: '/views/resource/purchaseApplyDetail',
  238 + query: {
  239 + applyOrderId: purchaseApply.applyOrderId,
  240 + resOrderType: '10000'
  241 + }
  242 + })
  243 + },
  244 + _openDeletePurchaseApplyModel(purchaseApply) {
  245 + this.$refs.deletePurchaseApply.open(purchaseApply)
  246 + },
  247 + _queryPurchaseApplyMethod() {
  248 + this.page.current = 1
  249 + this._listPurchaseApplys(this.page.current, this.page.size)
  250 + },
  251 + _resetInspectionPlanMethod() {
  252 + this.purchaseApplyManageInfo.conditions = {
  253 + ...this.purchaseApplyManageInfo.conditions,
  254 + applyOrderId: '',
  255 + name: '',
  256 + resName: '',
  257 + startTime: '',
  258 + endTime: ''
  259 + }
  260 + this._listPurchaseApplys(this.page.current, this.page.size)
  261 + },
  262 + async _openRunWorkflowImage(purchaseApply) {
  263 + try {
  264 + const params = {
  265 + businessKey: purchaseApply.applyOrderId,
  266 + communityId: getCommunityId()
  267 + }
  268 + const { data } = await getWorkflowImage(params)
  269 + this.$refs.viewImage.open({
  270 + url: 'data:image/png;base64,' + data
  271 + })
  272 + } catch (error) {
  273 + console.error('获取流程图失败:', error)
  274 + }
  275 + },
  276 + async _exportExcel() {
  277 + try {
  278 + const params = {
  279 + ...this.purchaseApplyManageInfo.conditions,
  280 + pagePath: 'purchaseApplyManage'
  281 + }
  282 + await exportData(params)
  283 + this.$message.success(this.$t('common.exportSuccess'))
  284 + this.$router.push('/resource/downloadTempFile?tab=downloadCenter')
  285 + } catch (error) {
  286 + console.error('导出失败:', error)
  287 + }
  288 + },
  289 + swatchState(item) {
  290 + this.purchaseApplyManageInfo.conditions.state = item.statusCd
  291 + this._listPurchaseApplys(this.page.current, this.page.size)
  292 + },
  293 + handleSizeChange(val) {
  294 + this.page.size = val
  295 + this._listPurchaseApplys(this.page.current, this.page.size)
  296 + },
  297 + handleCurrentChange(val) {
  298 + this.page.current = val
  299 + this._listPurchaseApplys(this.page.current, this.page.size)
  300 + },
  301 +
  302 + }
  303 +}
  304 +</script>
  305 +
  306 +<style lang="scss" scoped>
  307 +.purchase-apply-manage-container {
  308 + padding: 20px;
  309 +
  310 + .margin-top {
  311 + margin-top: 20px;
  312 + }
  313 +
  314 + .padding-r-0 {
  315 + padding-right: 0;
  316 + }
  317 +
  318 + .border-radius {
  319 + border-radius: 4px;
  320 + }
  321 +
  322 + .margin-xs-r {
  323 + margin-right: 5px;
  324 + }
  325 +
  326 + .list-group {
  327 + padding: 0;
  328 + margin: 0;
  329 + list-style: none;
  330 +
  331 + .list-group-item {
  332 + padding: 10px;
  333 + border: 1px solid #ebeef5;
  334 + cursor: pointer;
  335 +
  336 + &:hover {
  337 + background-color: #f5f7fa;
  338 + }
  339 +
  340 + &.vc-node-selected {
  341 + background-color: #409eff;
  342 + color: #fff;
  343 + }
  344 + }
  345 + }
  346 +}
  347 +</style>
0 348 \ No newline at end of file
... ...
src/views/resource/resourceSupplierManageLang.js 0 → 100644
  1 +export const messages = {
  2 + en: {
  3 + resourceSupplierManage: {
  4 + searchTitle: 'Search Conditions',
  5 + supplierNo: 'Supplier No',
  6 + supplierName: 'Supplier Name',
  7 + phone: 'Phone',
  8 + search: 'Search',
  9 + reset: 'Reset',
  10 + supplier: 'Supplier',
  11 + add: 'Add',
  12 + no: 'No',
  13 + name: 'Name',
  14 + address: 'Address',
  15 + contact: 'Contact',
  16 + contactName: 'Contact Name',
  17 + bank: 'Bank',
  18 + account: 'Account',
  19 + remark: 'Remark',
  20 + operation: 'Operation',
  21 + edit: 'Edit',
  22 + delete: 'Delete'
  23 + },
  24 + addResourceSupplier: {
  25 + title: 'Add Supplier',
  26 + supplierName: 'Supplier Name',
  27 + supplierAddress: 'Supplier Address',
  28 + supplierContact: 'Supplier Contact',
  29 + contactName: 'Contact Name',
  30 + bank: 'Bank',
  31 + bankAccount: 'Bank Account',
  32 + remark: 'Remark',
  33 + required: 'Required',
  34 + optional: 'Optional',
  35 + save: 'Save',
  36 + cancel: 'Cancel'
  37 + },
  38 + editResourceSupplier: {
  39 + title: 'Edit Supplier',
  40 + supplierName: 'Supplier Name',
  41 + supplierAddress: 'Supplier Address',
  42 + supplierContact: 'Supplier Contact',
  43 + contactName: 'Contact Name',
  44 + bank: 'Bank',
  45 + bankAccount: 'Bank Account',
  46 + remark: 'Remark',
  47 + required: 'Required',
  48 + optional: 'Optional',
  49 + save: 'Save',
  50 + cancel: 'Cancel'
  51 + },
  52 + deleteResourceSupplier: {
  53 + title: 'Confirm Operation',
  54 + confirmDelete: 'Confirm to delete supplier',
  55 + cancel: 'Cancel',
  56 + confirm: 'Confirm'
  57 + }
  58 + },
  59 + zh: {
  60 + resourceSupplierManage: {
  61 + searchTitle: '查询条件',
  62 + supplierNo: '供应商编号',
  63 + supplierName: '供应商名称',
  64 + phone: '手机号',
  65 + search: '查询',
  66 + reset: '重置',
  67 + supplier: '供应商',
  68 + add: '添加',
  69 + no: '编号',
  70 + name: '名称',
  71 + address: '地址',
  72 + contact: '联系方式',
  73 + contactName: '联系人姓名',
  74 + bank: '开户行',
  75 + account: '账号',
  76 + remark: '备注',
  77 + operation: '操作',
  78 + edit: '修改',
  79 + delete: '删除'
  80 + },
  81 + addResourceSupplier: {
  82 + title: '添加供应商',
  83 + supplierName: '供应商名称',
  84 + supplierAddress: '供应商地址',
  85 + supplierContact: '供应商联系方式',
  86 + contactName: '联系人姓名',
  87 + bank: '开户行',
  88 + bankAccount: '开户行账号',
  89 + remark: '备注',
  90 + required: '必填',
  91 + optional: '选填',
  92 + save: '保存',
  93 + cancel: '取消'
  94 + },
  95 + editResourceSupplier: {
  96 + title: '修改供应商',
  97 + supplierName: '供应商名称',
  98 + supplierAddress: '供应商地址',
  99 + supplierContact: '供应商联系方式',
  100 + contactName: '联系人姓名',
  101 + bank: '开户行',
  102 + bankAccount: '开户行账号',
  103 + remark: '备注',
  104 + required: '必填',
  105 + optional: '选填',
  106 + save: '保存',
  107 + cancel: '取消'
  108 + },
  109 + deleteResourceSupplier: {
  110 + title: '请确认您的操作',
  111 + confirmDelete: '确定删除供应商',
  112 + cancel: '点错了',
  113 + confirm: '确认删除'
  114 + }
  115 + }
  116 +}
0 117 \ No newline at end of file
... ...
src/views/resource/resourceSupplierManageList.vue 0 → 100644
  1 +<template>
  2 + <div class="resource-supplier-container">
  3 + <!-- 查询条件 -->
  4 + <el-card class="search-wrapper">
  5 + <div slot="header" class="flex justify-between">
  6 + <span>{{ $t('resourceSupplierManage.searchTitle') }}</span>
  7 + </div>
  8 + <el-row :gutter="20">
  9 + <el-col :span="6">
  10 + <el-input v-model="searchForm.rsId" :placeholder="$t('resourceSupplierManage.supplierNo')" clearable />
  11 + </el-col>
  12 + <el-col :span="6">
  13 + <el-input v-model="searchForm.supplierName" :placeholder="$t('resourceSupplierManage.supplierName')"
  14 + clearable />
  15 + </el-col>
  16 + <el-col :span="6">
  17 + <el-input v-model="searchForm.tel" :placeholder="$t('resourceSupplierManage.phone')" clearable />
  18 + </el-col>
  19 + <el-col :span="6">
  20 + <el-button type="primary" @click="handleSearch">
  21 + <i class="el-icon-search"></i>
  22 + {{ $t('resourceSupplierManage.search') }}
  23 + </el-button>
  24 + <el-button @click="handleReset">
  25 + <i class="el-icon-refresh"></i>
  26 + {{ $t('resourceSupplierManage.reset') }}
  27 + </el-button>
  28 + </el-col>
  29 + </el-row>
  30 + </el-card>
  31 +
  32 + <!-- 供应商列表 -->
  33 + <el-card class="list-wrapper">
  34 + <div slot="header" class="flex justify-between">
  35 + <span>{{ $t('resourceSupplierManage.supplier') }}</span>
  36 + <el-button type="primary" size="small" @click="handleAdd">
  37 + <i class="el-icon-plus"></i>
  38 + {{ $t('resourceSupplierManage.add') }}
  39 + </el-button>
  40 + </div>
  41 +
  42 + <el-table v-loading="loading" :data="tableData" border style="width: 100%">
  43 + <el-table-column prop="rsId" :label="$t('resourceSupplierManage.no')" align="center" />
  44 + <el-table-column prop="supplierName" :label="$t('resourceSupplierManage.name')" align="center" />
  45 + <el-table-column prop="address" :label="$t('resourceSupplierManage.address')" align="center" />
  46 + <el-table-column prop="tel" :label="$t('resourceSupplierManage.contact')" align="center" />
  47 + <el-table-column prop="contactName" :label="$t('resourceSupplierManage.contactName')" align="center" />
  48 + <el-table-column prop="accountBank" :label="$t('resourceSupplierManage.bank')" align="center" />
  49 + <el-table-column prop="bankAccountNumber" :label="$t('resourceSupplierManage.account')" align="center" />
  50 + <el-table-column prop="remark" :label="$t('resourceSupplierManage.remark')" align="center" />
  51 + <el-table-column :label="$t('resourceSupplierManage.operation')" align="center" width="180">
  52 + <template slot-scope="scope">
  53 + <el-button size="mini" type="primary" @click="handleEdit(scope.row)">
  54 + {{ $t('resourceSupplierManage.edit') }}
  55 + </el-button>
  56 + <el-button size="mini" type="danger" @click="handleDelete(scope.row)">
  57 + {{ $t('resourceSupplierManage.delete') }}
  58 + </el-button>
  59 + </template>
  60 + </el-table-column>
  61 + </el-table>
  62 +
  63 + <el-pagination :current-page="pagination.current" :page-sizes="[10, 20, 30, 50]" :page-size="pagination.size"
  64 + :total="pagination.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
  65 + @current-change="handleCurrentChange" />
  66 + </el-card>
  67 +
  68 + <!-- 组件 -->
  69 + <add-resource-supplier ref="addDialog" @success="handleSuccess" />
  70 + <edit-resource-supplier ref="editDialog" @success="handleSuccess" />
  71 + <delete-resource-supplier ref="deleteDialog" @success="handleSuccess" />
  72 + </div>
  73 +</template>
  74 +
  75 +<script>
  76 +import { listResourceSuppliers } from '@/api/resource/resourceSupplierManageApi'
  77 +import AddResourceSupplier from '@/components/resource/AddResourceSupplier'
  78 +import EditResourceSupplier from '@/components/resource/EditResourceSupplier'
  79 +import DeleteResourceSupplier from '@/components/resource/DeleteResourceSupplier'
  80 +import { getCommunityId } from '@/api/community/communityApi'
  81 +
  82 +export default {
  83 + name: 'ResourceSupplierManageList',
  84 + components: {
  85 + AddResourceSupplier,
  86 + EditResourceSupplier,
  87 + DeleteResourceSupplier
  88 + },
  89 + data() {
  90 + return {
  91 + loading: false,
  92 + searchForm: {
  93 + rsId: '',
  94 + supplierName: '',
  95 + tel: ''
  96 + },
  97 + tableData: [],
  98 + pagination: {
  99 + current: 1,
  100 + size: 10,
  101 + total: 0
  102 + }
  103 + }
  104 + },
  105 + created() {
  106 + this.getList()
  107 + },
  108 + methods: {
  109 + async getList() {
  110 + try {
  111 + this.loading = true
  112 + const params = {
  113 + page: this.pagination.current,
  114 + row: this.pagination.size,
  115 + ...this.searchForm,
  116 + communityId: getCommunityId()
  117 + }
  118 + const { data, total } = await listResourceSuppliers(params)
  119 + this.tableData = data
  120 + this.pagination.total = total
  121 + } catch (error) {
  122 + this.$message.error(error.message)
  123 + } finally {
  124 + this.loading = false
  125 + }
  126 + },
  127 + handleSearch() {
  128 + this.pagination.current = 1
  129 + this.getList()
  130 + },
  131 + handleReset() {
  132 + this.searchForm = {
  133 + rsId: '',
  134 + supplierName: '',
  135 + tel: ''
  136 + }
  137 + this.handleSearch()
  138 + },
  139 + handleAdd() {
  140 + this.$refs.addDialog.open()
  141 + },
  142 + handleEdit(row) {
  143 + this.$refs.editDialog.open(row)
  144 + },
  145 + handleDelete(row) {
  146 + this.$refs.deleteDialog.open(row)
  147 + },
  148 + handleSuccess() {
  149 + this.getList()
  150 + },
  151 + handleSizeChange(val) {
  152 + this.pagination.size = val
  153 + this.getList()
  154 + },
  155 + handleCurrentChange(val) {
  156 + this.pagination.current = val
  157 + this.getList()
  158 + }
  159 + }
  160 +}
  161 +</script>
  162 +
  163 +<style lang="scss" scoped>
  164 +.resource-supplier-container {
  165 + padding: 20px;
  166 +
  167 + .search-wrapper {
  168 + margin-bottom: 20px;
  169 +
  170 + .el-input {
  171 + width: 100%;
  172 + }
  173 + }
  174 +
  175 + .list-wrapper {
  176 + .el-pagination {
  177 + margin-top: 20px;
  178 + text-align: right;
  179 + }
  180 + }
  181 +}
  182 +</style>
0 183 \ No newline at end of file
... ...
src/views/resource/urgentPurchaseApplyStepLang.js 0 → 100644
  1 +export const messages = {
  2 + en: {
  3 + urgentPurchaseApplyStep: {
  4 + applyInfo: 'Application Information',
  5 + warehouse: 'Warehouse',
  6 + requiredSelectWarehouse: 'Required, please select warehouse',
  7 + contact: 'Contact',
  8 + requiredContact: 'Required, please fill in contact',
  9 + phone: 'Phone',
  10 + requiredPhone: 'Required, please fill in phone number',
  11 + applyDesc: 'Application Description',
  12 + requiredDesc: 'Required, please fill in application description',
  13 + purchaseItems: 'Purchase Items',
  14 + select: 'Select',
  15 + itemType: 'Item Type',
  16 + nameCode: 'Name(Code)',
  17 + spec: 'Specification',
  18 + referencePrice: 'Reference Price',
  19 + stock: 'Stock',
  20 + applyQuantity: 'Apply Quantity',
  21 + requiredQuantity: 'Required, please fill in quantity',
  22 + purchasePrice: 'Purchase Price',
  23 + requiredPrice: 'Required, please fill in price',
  24 + targetWarehouse: 'Target Warehouse',
  25 + requiredTargetWarehouse: 'Required, please select target warehouse',
  26 + remark: 'Remark',
  27 + optionalRemark: 'Optional, please fill in remark',
  28 + operation: 'Operation',
  29 + remove: 'Remove',
  30 + submit: 'Submit',
  31 + requiredSelectItems: 'Please select purchase items',
  32 + sameWarehouseRequired: 'Purchased items must come from the same warehouse!'
  33 + },
  34 + chooseResourceStore4: {
  35 + title: '[Urgent Purchase] Select Items',
  36 + selectWarehouse: 'Please select warehouse',
  37 + selectItemType: 'Please select item type',
  38 + selectSubType: 'Please select sub category',
  39 + inputItemName: 'Input item name',
  40 + warehouse: 'Warehouse',
  41 + itemType: 'Item Type',
  42 + itemName: 'Item Name',
  43 + spec: 'Specification',
  44 + code: 'Code',
  45 + fixedItem: 'Fixed Item',
  46 + price: 'Price',
  47 + stock: 'Stock',
  48 + selectItemsRequired: 'Please select items to purchase'
  49 + }
  50 + },
  51 + zh: {
  52 + urgentPurchaseApplyStep: {
  53 + applyInfo: '申请信息',
  54 + warehouse: '仓库',
  55 + requiredSelectWarehouse: '必填,请选择仓库',
  56 + contact: '联系人',
  57 + requiredContact: '必填,请填写联系人',
  58 + phone: '联系电话',
  59 + requiredPhone: '必填,请填写联系电话',
  60 + applyDesc: '申请说明',
  61 + requiredDesc: '必填,请填写申请说明',
  62 + purchaseItems: '采购物品',
  63 + select: '选择',
  64 + itemType: '物品类型',
  65 + nameCode: '名称(编码)',
  66 + spec: '物品规格',
  67 + referencePrice: '参考价格',
  68 + stock: '物品库存',
  69 + applyQuantity: '申请数量',
  70 + requiredQuantity: '必填,请填写申请数量',
  71 + purchasePrice: '采购单价',
  72 + requiredPrice: '必填,请填写采购单价',
  73 + targetWarehouse: '目标仓库',
  74 + requiredTargetWarehouse: '必填,请选择目标仓库',
  75 + remark: '备注',
  76 + optionalRemark: '选填,请填写备注',
  77 + operation: '操作',
  78 + remove: '移除',
  79 + submit: '提交',
  80 + requiredSelectItems: '请选择采购物品',
  81 + sameWarehouseRequired: '采购商品需来自同一仓库!'
  82 + },
  83 + chooseResourceStore4: {
  84 + title: '【紧急采购】选择物品',
  85 + selectWarehouse: '请选择仓库',
  86 + selectItemType: '请选择物品类型',
  87 + selectSubType: '请选择二级分类',
  88 + inputItemName: '输入物品管理名称',
  89 + warehouse: '仓库',
  90 + itemType: '物品类型',
  91 + itemName: '物品名称',
  92 + spec: '物品规格',
  93 + code: '物品编码',
  94 + fixedItem: '固定物品',
  95 + price: '物品价格',
  96 + stock: '物品库存',
  97 + selectItemsRequired: '请选择需要采购的物品'
  98 + }
  99 + }
  100 +}
0 101 \ No newline at end of file
... ...
src/views/resource/urgentPurchaseApplyStepList.vue 0 → 100644
  1 +<template>
  2 + <div class="urgent-purchase-apply-step-container">
  3 + <!-- 申请信息 -->
  4 + <el-card class="box-card">
  5 + <div slot="header" class="clearfix">
  6 + <span>{{ $t('urgentPurchaseApplyStep.applyInfo') }}</span>
  7 + </div>
  8 + <el-form label-width="120px">
  9 + <el-form-item :label="$t('urgentPurchaseApplyStep.warehouse')">
  10 + <el-select v-model="urgentPurchaseApplyStepInfo.shId" @change="_computeFlow" style="width:100%">
  11 + <el-option disabled value="" :label="$t('urgentPurchaseApplyStep.requiredSelectWarehouse')" />
  12 + <el-option v-for="(item, index) in urgentPurchaseApplyStepInfo.storehouses" :key="index" :label="item.shName"
  13 + :value="item.shId" />
  14 + </el-select>
  15 + </el-form-item>
  16 +
  17 + <el-form-item :label="$t('urgentPurchaseApplyStep.contact')">
  18 + <el-input v-model.trim="urgentPurchaseApplyStepInfo.endUserName"
  19 + :placeholder="$t('urgentPurchaseApplyStep.requiredContact')" />
  20 + </el-form-item>
  21 +
  22 + <el-form-item :label="$t('urgentPurchaseApplyStep.phone')">
  23 + <el-input v-model.trim="urgentPurchaseApplyStepInfo.endUserTel"
  24 + :placeholder="$t('urgentPurchaseApplyStep.requiredPhone')" />
  25 + </el-form-item>
  26 +
  27 + <el-form-item :label="$t('urgentPurchaseApplyStep.applyDesc')">
  28 + <el-input type="textarea" v-model.trim="urgentPurchaseApplyStepInfo.description"
  29 + :placeholder="$t('urgentPurchaseApplyStep.requiredDesc')" />
  30 + </el-form-item>
  31 + </el-form>
  32 + </el-card>
  33 +
  34 + <!-- 采购物品 -->
  35 + <el-card class="box-card">
  36 + <div slot="header" class="clearfix">
  37 + <div class="card-header">
  38 + <span>{{ $t('urgentPurchaseApplyStep.purchaseItems') }}</span>
  39 + <el-button type="primary" size="small" @click="_openSelectResourceStoreInfoModel">
  40 + <i class="el-icon-search"></i>
  41 + {{ $t('urgentPurchaseApplyStep.select') }}
  42 + </el-button>
  43 + </div>
  44 + </div>
  45 +
  46 + <el-table :data="urgentPurchaseApplyStepInfo.resourceStores" border style="width: 100%">
  47 + <el-table-column prop="parentRstName" :label="$t('urgentPurchaseApplyStep.itemType')" align="center">
  48 + <template slot-scope="scope">
  49 + {{ scope.row.parentRstName || '-' }} > {{ scope.row.rstName || '-' }}
  50 + </template>
  51 + </el-table-column>
  52 +
  53 + <el-table-column prop="resName" :label="$t('urgentPurchaseApplyStep.nameCode')" align="center">
  54 + <template slot-scope="scope">
  55 + {{ scope.row.resName }}({{ scope.row.resCode }})
  56 + </template>
  57 + </el-table-column>
  58 +
  59 + <el-table-column prop="rssName" :label="$t('urgentPurchaseApplyStep.spec')" align="center">
  60 + <template slot-scope="scope">
  61 + {{ scope.row.rssName || '-' }}
  62 + </template>
  63 + </el-table-column>
  64 +
  65 + <el-table-column prop="price" :label="$t('urgentPurchaseApplyStep.referencePrice')" align="center" />
  66 +
  67 + <el-table-column prop="stock" :label="$t('urgentPurchaseApplyStep.stock')" align="center">
  68 + <template slot-scope="scope">
  69 + {{ scope.row.stock }}{{ scope.row.unitCodeName }}
  70 + </template>
  71 + </el-table-column>
  72 +
  73 + <el-table-column :label="$t('urgentPurchaseApplyStep.applyQuantity')" align="center" width="150">
  74 + <template slot-scope="scope">
  75 + <el-input-number v-model="scope.row.quantity" :min="1"
  76 + :placeholder="$t('urgentPurchaseApplyStep.requiredQuantity')" style="width: 80%" />
  77 + {{ scope.row.unitCodeName }}
  78 + </template>
  79 + </el-table-column>
  80 +
  81 + <el-table-column :label="$t('urgentPurchaseApplyStep.purchasePrice')" align="center" width="150">
  82 + <template slot-scope="scope">
  83 + <el-input-number v-model="scope.row.urgentPrice" :min="0.01"
  84 + :placeholder="$t('urgentPurchaseApplyStep.requiredPrice')" style="width: 100%" />
  85 + </template>
  86 + </el-table-column>
  87 +
  88 + <el-table-column :label="$t('urgentPurchaseApplyStep.targetWarehouse')" align="center" width="150">
  89 + <template slot-scope="scope">
  90 + <el-select v-model="scope.row.shzId" @change="storeHousesChange($event, scope.$index)" style="width:100%">
  91 + <el-option value="" :label="$t('urgentPurchaseApplyStep.requiredTargetWarehouse')" />
  92 + <el-option v-for="(item, index) in urgentPurchaseApplyStepInfo.storehousesB" :key="index"
  93 + :label="item.shName" :value="item.shId" />
  94 + </el-select>
  95 + </template>
  96 + </el-table-column>
  97 +
  98 + <el-table-column :label="$t('urgentPurchaseApplyStep.remark')" align="center" width="150">
  99 + <template slot-scope="scope">
  100 + <el-input v-model="scope.row.remark" :placeholder="$t('urgentPurchaseApplyStep.optionalRemark')" />
  101 + </template>
  102 + </el-table-column>
  103 +
  104 + <el-table-column :label="$t('urgentPurchaseApplyStep.operation')" align="center" fixed="right">
  105 + <template slot-scope="scope">
  106 + <el-button type="danger" size="mini" @click="_removeSelectResourceStoreItem(scope.row.resId)">
  107 + <i class="el-icon-delete"></i>
  108 + {{ $t('urgentPurchaseApplyStep.remove') }}
  109 + </el-button>
  110 + </template>
  111 + </el-table-column>
  112 + </el-table>
  113 + </el-card>
  114 +
  115 + <div class="footer-buttons">
  116 + <el-button type="primary" @click="_finishStep">
  117 + {{ $t('urgentPurchaseApplyStep.submit') }}
  118 + </el-button>
  119 + </div>
  120 +
  121 + <choose-resource-store4 ref="chooseResourceStore4" @setSelectResourceStores="handleSetSelectResourceStores" />
  122 + </div>
  123 +</template>
  124 +
  125 +<script>
  126 +import { getCommunityId } from '@/api/community/communityApi'
  127 +import ChooseResourceStore4 from '@/components/resource/chooseResourceStore4'
  128 +import * as api from '@/api/resource/urgentPurchaseApplyStepApi'
  129 +import {getUserName,getUserTel} from '@/api/user/userApi'
  130 +
  131 +export default {
  132 + name: 'UrgentPurchaseApplyStepList',
  133 + components: {
  134 + ChooseResourceStore4
  135 + },
  136 + data() {
  137 + return {
  138 + urgentPurchaseApplyStepInfo: {
  139 + resourceStores: [],
  140 + description: '',
  141 + endUserName: '',
  142 + endUserTel: '',
  143 + file: '',
  144 + resOrderType: '',
  145 + staffId: '',
  146 + shId: '',
  147 + staffName: '',
  148 + communityId: '',
  149 + storehouses: [],
  150 + storehousesB: []
  151 + }
  152 + }
  153 + },
  154 + created() {
  155 + this._initData()
  156 + },
  157 + methods: {
  158 + async _initData() {
  159 + this.urgentPurchaseApplyStepInfo.communityId = await getCommunityId()
  160 + this.urgentPurchaseApplyStepInfo.resOrderType = this.$route.query.resOrderType
  161 + this.urgentPurchaseApplyStepInfo.endUserName = getUserName()
  162 + this.urgentPurchaseApplyStepInfo.endUserTel = getUserTel()
  163 + this._listAllocationStorehouse()
  164 + this._listAllocationStorehouseB()
  165 + },
  166 + async _listAllocationStorehouse() {
  167 + try {
  168 + const params = {
  169 + page: 1,
  170 + row: 100,
  171 + allowPurchase: 'ON'
  172 + }
  173 + const { data } = await api.listStorehouses(params)
  174 + this.urgentPurchaseApplyStepInfo.storehouses = data
  175 + } catch (error) {
  176 + console.error('获取仓库列表失败:', error)
  177 + }
  178 + },
  179 + async _listAllocationStorehouseB() {
  180 + try {
  181 + const params = {
  182 + page: 1,
  183 + row: 100,
  184 + communityId: this.urgentPurchaseApplyStepInfo.communityId
  185 + }
  186 + const { data } = await api.listStorehouses(params)
  187 + this.urgentPurchaseApplyStepInfo.storehousesB = data
  188 + } catch (error) {
  189 + console.error('获取目标仓库列表失败:', error)
  190 + }
  191 + },
  192 + _openSelectResourceStoreInfoModel() {
  193 + if (!this.urgentPurchaseApplyStepInfo.shId) {
  194 + this.$message.error(this.$t('urgentPurchaseApplyStep.requiredSelectWarehouse'))
  195 + return
  196 + }
  197 + if (!this.urgentPurchaseApplyStepInfo.endUserName) {
  198 + this.$message.error(this.$t('urgentPurchaseApplyStep.requiredContact'))
  199 + return
  200 + }
  201 + if (!this.urgentPurchaseApplyStepInfo.endUserTel) {
  202 + this.$message.error(this.$t('urgentPurchaseApplyStep.requiredPhone'))
  203 + return
  204 + }
  205 + if (!this.urgentPurchaseApplyStepInfo.description) {
  206 + this.$message.error(this.$t('urgentPurchaseApplyStep.requiredDesc'))
  207 + return
  208 + }
  209 + this.$refs.chooseResourceStore4.open({
  210 + shId: this.urgentPurchaseApplyStepInfo.shId
  211 + })
  212 + },
  213 + handleSetSelectResourceStores(resourceStores) {
  214 + let oldList = this.urgentPurchaseApplyStepInfo.resourceStores
  215 + // 过滤重复选择的商品
  216 + resourceStores.forEach((newItem, newIndex) => {
  217 + newItem.rsId = ''
  218 + newItem.shzId = ''
  219 + oldList.forEach((oldItem) => {
  220 + if (oldItem.resId === newItem.resId) {
  221 + delete resourceStores[newIndex]
  222 + }
  223 + })
  224 + })
  225 + // 合并已有商品和新添加商品
  226 + resourceStores.push.apply(resourceStores, oldList)
  227 + // 过滤空元素
  228 + resourceStores = resourceStores.filter((s) => {
  229 + return s['resId']
  230 + })
  231 + this.urgentPurchaseApplyStepInfo.resourceStores = resourceStores
  232 + },
  233 + _resourcesFromSameHouse(resourcesList) {
  234 + if (!resourcesList || resourcesList.length < 2) {
  235 + return true
  236 + }
  237 + let lastHouse = ''
  238 + let sign = true
  239 + for (let i = 0; i < resourcesList.length; i++) {
  240 + if (lastHouse === '') {
  241 + lastHouse = resourcesList[i].shId
  242 + continue
  243 + }
  244 + if (lastHouse === resourcesList[i].shId) {
  245 + continue
  246 + } else {
  247 + sign = false
  248 + break
  249 + }
  250 + }
  251 + return sign
  252 + },
  253 + async _finishStep() {
  254 + const _resourceStores = this.urgentPurchaseApplyStepInfo.resourceStores
  255 + if (!_resourceStores || _resourceStores.length < 1) {
  256 + this.$message.error(this.$t('urgentPurchaseApplyStep.requiredSelectItems'))
  257 + return
  258 + }
  259 + if (!this._resourcesFromSameHouse(_resourceStores)) {
  260 + this.$message.error(this.$t('urgentPurchaseApplyStep.sameWarehouseRequired'))
  261 + return
  262 + }
  263 + let _saveFlag = true
  264 + _resourceStores.forEach(item => {
  265 + if (!item.shzId) {
  266 + this.$message.error(`${item.resName}${this.$t('urgentPurchaseApplyStep.requiredTargetWarehouse')}`)
  267 + _saveFlag = false
  268 + return
  269 + }
  270 + if (!item.quantity || item.quantity <= 0) {
  271 + this.$message.error(`${item.resName}${this.$t('urgentPurchaseApplyStep.requiredQuantity')}`)
  272 + _saveFlag = false
  273 + return
  274 + }
  275 + if (!item.urgentPrice || item.urgentPrice <= 0) {
  276 + this.$message.error(`${item.resName}${this.$t('urgentPurchaseApplyStep.requiredPrice')}`)
  277 + _saveFlag = false
  278 + return
  279 + }
  280 + })
  281 + if (!_saveFlag) {
  282 + return
  283 + }
  284 + try {
  285 + const res = await api.urgentPurchaseApply(this.urgentPurchaseApplyStepInfo)
  286 + if (res.code === 0) {
  287 + this.$message.success(this.$t('common.operationSuccess'))
  288 + this.$router.go(-1)
  289 + } else {
  290 + this.$message.error(res.msg)
  291 + }
  292 + } catch (error) {
  293 + console.error('提交失败:', error)
  294 + this.$message.error(this.$t('common.operationFailed'))
  295 + }
  296 + },
  297 + storeHousesChange(e, i) {
  298 + const shId = e
  299 + this.urgentPurchaseApplyStepInfo.storehouses.forEach((item) => {
  300 + if (item.shId === shId) {
  301 + this.urgentPurchaseApplyStepInfo.resourceStores[i].shzName = item.shName
  302 + }
  303 + })
  304 + },
  305 + _removeSelectResourceStoreItem(resId) {
  306 + this.urgentPurchaseApplyStepInfo.resourceStores.forEach((item, index) => {
  307 + if (item.resId === resId) {
  308 + this.urgentPurchaseApplyStepInfo.resourceStores.splice(index, 1)
  309 + }
  310 + })
  311 + },
  312 + _computeFlow() {
  313 + this.urgentPurchaseApplyStepInfo.resourceStores = []
  314 + }
  315 + }
  316 +}
  317 +</script>
  318 +
  319 +<style lang="scss" scoped>
  320 +.urgent-purchase-apply-step-container {
  321 + padding: 20px;
  322 +
  323 + .box-card {
  324 + margin-bottom: 20px;
  325 +
  326 + .card-header {
  327 + display: flex;
  328 + justify-content: space-between;
  329 + align-items: center;
  330 + }
  331 + }
  332 +
  333 + .footer-buttons {
  334 + text-align: right;
  335 + margin-top: 20px;
  336 + }
  337 +}
  338 +</style>
0 339 \ No newline at end of file
... ...