Showing
4 changed files
with
102 additions
and
3 deletions
| @@ -56,3 +56,12 @@ export function supplierQuotationProjectUpdateStatusApi(params) { | @@ -56,3 +56,12 @@ export function supplierQuotationProjectUpdateStatusApi(params) { | ||
| 56 | params | 56 | params |
| 57 | }) | 57 | }) |
| 58 | } | 58 | } |
| 59 | + | ||
| 60 | +// 获取供应商部门列表 | ||
| 61 | +export function getSupplierDeptApi() { | ||
| 62 | + return request({ | ||
| 63 | + url: '/system/dept/getChildDeptsByCode', | ||
| 64 | + method: 'get', | ||
| 65 | + params: { code: 'GYSBM' } | ||
| 66 | + }) | ||
| 67 | +} |
| @@ -12,6 +12,14 @@ | @@ -12,6 +12,14 @@ | ||
| 12 | </template> | 12 | </template> |
| 13 | </uni-list-item> | 13 | </uni-list-item> |
| 14 | 14 | ||
| 15 | + <!-- 供应商部门 --> | ||
| 16 | + <uni-list-item class="select-item" :class="form.supplierDepartmentId ? 'is-filled' : 'is-empty'" clickable | ||
| 17 | + @click="openSupplierDeptSheet" :rightText="form.supplierDepartmentName || '请选择供应商部门'" showArrow> | ||
| 18 | + <template v-slot:body> | ||
| 19 | + <view class="item-title"><text>供应商部门</text></view> | ||
| 20 | + </template> | ||
| 21 | + </uni-list-item> | ||
| 22 | + | ||
| 15 | <!-- 品种 --> | 23 | <!-- 品种 --> |
| 16 | <uni-list-item class="select-item" :class="form.productId ? 'is-filled' : 'is-empty'" clickable | 24 | <uni-list-item class="select-item" :class="form.productId ? 'is-filled' : 'is-empty'" clickable |
| 17 | @click="openProductSheet" :rightText="form.productName || '请选择品种'" showArrow> | 25 | @click="openProductSheet" :rightText="form.productName || '请选择品种'" showArrow> |
| @@ -92,7 +100,7 @@ | @@ -92,7 +100,7 @@ | ||
| 92 | 100 | ||
| 93 | <script> | 101 | <script> |
| 94 | import SingleSelectSheet from '@/components/single-select/index.vue' | 102 | import SingleSelectSheet from '@/components/single-select/index.vue' |
| 95 | -import { supplierQuotationProjectSaveApi } from '@/api/procure-manage/supplierQuotationProject.js' | 103 | +import { supplierQuotationProjectSaveApi, getSupplierDeptApi } from '@/api/procure-manage/supplierQuotationProject.js' |
| 96 | import { breedRelationshipQueryApi } from '@/api/procure-manage/salesmanQuotation.js' | 104 | import { breedRelationshipQueryApi } from '@/api/procure-manage/salesmanQuotation.js' |
| 97 | import { getDicByCodes } from '@/utils/dic.js' | 105 | import { getDicByCodes } from '@/utils/dic.js' |
| 98 | 106 | ||
| @@ -103,6 +111,8 @@ export default { | @@ -103,6 +111,8 @@ export default { | ||
| 103 | return { | 111 | return { |
| 104 | form: { | 112 | form: { |
| 105 | name: '', | 113 | name: '', |
| 114 | + supplierDepartmentId: '', | ||
| 115 | + supplierDepartmentName: '', | ||
| 106 | productId: '', | 116 | productId: '', |
| 107 | productName: '', | 117 | productName: '', |
| 108 | quantity: '', | 118 | quantity: '', |
| @@ -113,6 +123,7 @@ export default { | @@ -113,6 +123,7 @@ export default { | ||
| 113 | purchaseRule: '' | 123 | purchaseRule: '' |
| 114 | }, | 124 | }, |
| 115 | productList: [], | 125 | productList: [], |
| 126 | + supplierDeptOptions: [], | ||
| 116 | dictData: {}, | 127 | dictData: {}, |
| 117 | sheet: { | 128 | sheet: { |
| 118 | visible: false, | 129 | visible: false, |
| @@ -136,6 +147,7 @@ export default { | @@ -136,6 +147,7 @@ export default { | ||
| 136 | onLoad() { | 147 | onLoad() { |
| 137 | this.loadDictData() | 148 | this.loadDictData() |
| 138 | this.loadProducts() | 149 | this.loadProducts() |
| 150 | + this.loadSupplierDeptList() | ||
| 139 | }, | 151 | }, |
| 140 | methods: { | 152 | methods: { |
| 141 | async loadDictData() { | 153 | async loadDictData() { |
| @@ -150,6 +162,19 @@ export default { | @@ -150,6 +162,19 @@ export default { | ||
| 150 | const data = this.dictData[dictCode] | 162 | const data = this.dictData[dictCode] |
| 151 | return (data && data.data) ? data.data : (Array.isArray(data) ? data : []) | 163 | return (data && data.data) ? data.data : (Array.isArray(data) ? data : []) |
| 152 | }, | 164 | }, |
| 165 | + async loadSupplierDeptList() { | ||
| 166 | + try { | ||
| 167 | + const res = await getSupplierDeptApi() | ||
| 168 | + const raw = res && res.data != null ? res.data : [] | ||
| 169 | + const list = Array.isArray(raw) ? raw : [] | ||
| 170 | + this.supplierDeptOptions = list.map(it => ({ | ||
| 171 | + label: it.deptName || it.name || '', | ||
| 172 | + value: it.deptId || it.id || '' | ||
| 173 | + })) | ||
| 174 | + } catch (e) { | ||
| 175 | + this.supplierDeptOptions = [] | ||
| 176 | + } | ||
| 177 | + }, | ||
| 153 | async loadProducts() { | 178 | async loadProducts() { |
| 154 | try { | 179 | try { |
| 155 | const res = await breedRelationshipQueryApi({ pageIndex: 1, pageSize: 9999 }) | 180 | const res = await breedRelationshipQueryApi({ pageIndex: 1, pageSize: 9999 }) |
| @@ -181,6 +206,19 @@ export default { | @@ -181,6 +206,19 @@ export default { | ||
| 181 | isDict: false | 206 | isDict: false |
| 182 | } | 207 | } |
| 183 | }, | 208 | }, |
| 209 | + openSupplierDeptSheet() { | ||
| 210 | + const opts = (this.supplierDeptOptions || []).map(p => ({ label: p.label, value: p.value })) | ||
| 211 | + const cur = this.form.supplierDepartmentId | ||
| 212 | + const match = opts.find(o => String(o.value) === String(cur)) | ||
| 213 | + this.sheet = { | ||
| 214 | + visible: true, | ||
| 215 | + title: '请选择供应商部门', | ||
| 216 | + options: opts, | ||
| 217 | + value: match ? match.value : '', | ||
| 218 | + field: 'supplierDepartmentId', | ||
| 219 | + isDict: false | ||
| 220 | + } | ||
| 221 | + }, | ||
| 184 | openDictSheet(field, dictCode, title) { | 222 | openDictSheet(field, dictCode, title) { |
| 185 | const raw = this.getDictOptions(dictCode) || [] | 223 | const raw = this.getDictOptions(dictCode) || [] |
| 186 | const opts = raw.map(o => ({ label: o.name || o.label || '', value: o.code != null ? o.code : (o.value != null ? o.value : '') })) | 224 | const opts = raw.map(o => ({ label: o.name || o.label || '', value: o.code != null ? o.code : (o.value != null ? o.value : '') })) |
| @@ -203,6 +241,10 @@ export default { | @@ -203,6 +241,10 @@ export default { | ||
| 203 | const m = (this.productList || []).find(p => String(p.value) === String(value)) | 241 | const m = (this.productList || []).find(p => String(p.value) === String(value)) |
| 204 | this.form.productName = m ? m.label : '' | 242 | this.form.productName = m ? m.label : '' |
| 205 | } | 243 | } |
| 244 | + if (field === 'supplierDepartmentId') { | ||
| 245 | + const m = (this.supplierDeptOptions || []).find(p => String(p.value) === String(value)) | ||
| 246 | + this.form.supplierDepartmentName = m ? m.label : '' | ||
| 247 | + } | ||
| 206 | // 切换项目类型时,若不再是集中开标则清空开标时间 | 248 | // 切换项目类型时,若不再是集中开标则清空开标时间 |
| 207 | if (field === 'projectType' && !this.isConcentratedBid) { | 249 | if (field === 'projectType' && !this.isConcentratedBid) { |
| 208 | this.form.bidTime = '' | 250 | this.form.bidTime = '' |
| @@ -281,6 +323,8 @@ export default { | @@ -281,6 +323,8 @@ export default { | ||
| 281 | } | 323 | } |
| 282 | const payload = clean({ | 324 | const payload = clean({ |
| 283 | name: this.form.name, | 325 | name: this.form.name, |
| 326 | + supplierDepartmentId: this.form.supplierDepartmentId, | ||
| 327 | + supplierDepartmentName: this.form.supplierDepartmentName, | ||
| 284 | productId: this.form.productId, | 328 | productId: this.form.productId, |
| 285 | productName: this.form.productName, | 329 | productName: this.form.productName, |
| 286 | quantity: this.form.quantity, | 330 | quantity: this.form.quantity, |
| @@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
| 5 | <view class="section"> | 5 | <view class="section"> |
| 6 | <text class="row company">{{ safeText(form.name) }}</text> | 6 | <text class="row company">{{ safeText(form.name) }}</text> |
| 7 | <view class="row"><text class="label">编号</text><text class="value">{{ safeText(form.code) }}</text></view> | 7 | <view class="row"><text class="label">编号</text><text class="value">{{ safeText(form.code) }}</text></view> |
| 8 | + <view class="row"><text class="label">供应商部门</text><text class="value">{{ safeText(form.supplierDepartmentName) }}</text></view> | ||
| 8 | <view class="row"><text class="label">品种</text><text class="value">{{ safeText(form.productName) }}</text></view> | 9 | <view class="row"><text class="label">品种</text><text class="value">{{ safeText(form.productName) }}</text></view> |
| 9 | <view class="row"><text class="label">数量(吨)</text><text class="value">{{ safeText(form.quantity) }}</text></view> | 10 | <view class="row"><text class="label">数量(吨)</text><text class="value">{{ safeText(form.quantity) }}</text></view> |
| 10 | <view class="row"><text class="label">开始时间</text><text class="value">{{ formatDateTimeMinute(form.startTime) }}</text></view> | 11 | <view class="row"><text class="label">开始时间</text><text class="value">{{ formatDateTimeMinute(form.startTime) }}</text></view> |
| @@ -12,6 +12,14 @@ | @@ -12,6 +12,14 @@ | ||
| 12 | </template> | 12 | </template> |
| 13 | </uni-list-item> | 13 | </uni-list-item> |
| 14 | 14 | ||
| 15 | + <!-- 供应商部门 --> | ||
| 16 | + <uni-list-item class="select-item" :class="form.supplierDepartmentId ? 'is-filled' : 'is-empty'" clickable | ||
| 17 | + @click="openSupplierDeptSheet" :rightText="form.supplierDepartmentName || '请选择供应商部门'" showArrow> | ||
| 18 | + <template v-slot:body> | ||
| 19 | + <view class="item-title"><text>供应商部门</text></view> | ||
| 20 | + </template> | ||
| 21 | + </uni-list-item> | ||
| 22 | + | ||
| 15 | <!-- 品种 --> | 23 | <!-- 品种 --> |
| 16 | <uni-list-item class="select-item" :class="form.productId ? 'is-filled' : 'is-empty'" clickable | 24 | <uni-list-item class="select-item" :class="form.productId ? 'is-filled' : 'is-empty'" clickable |
| 17 | @click="openProductSheet" :rightText="form.productName || '请选择品种'" showArrow> | 25 | @click="openProductSheet" :rightText="form.productName || '请选择品种'" showArrow> |
| @@ -92,7 +100,7 @@ | @@ -92,7 +100,7 @@ | ||
| 92 | 100 | ||
| 93 | <script> | 101 | <script> |
| 94 | import SingleSelectSheet from '@/components/single-select/index.vue' | 102 | import SingleSelectSheet from '@/components/single-select/index.vue' |
| 95 | -import { supplierQuotationProjectDetailApi, supplierQuotationProjectUpdateApi } from '@/api/procure-manage/supplierQuotationProject.js' | 103 | +import { supplierQuotationProjectDetailApi, supplierQuotationProjectUpdateApi, getSupplierDeptApi } from '@/api/procure-manage/supplierQuotationProject.js' |
| 96 | import { breedRelationshipQueryApi } from '@/api/procure-manage/salesmanQuotation.js' | 104 | import { breedRelationshipQueryApi } from '@/api/procure-manage/salesmanQuotation.js' |
| 97 | import { getDicByCodes } from '@/utils/dic.js' | 105 | import { getDicByCodes } from '@/utils/dic.js' |
| 98 | 106 | ||
| @@ -106,6 +114,8 @@ export default { | @@ -106,6 +114,8 @@ export default { | ||
| 106 | id: '', | 114 | id: '', |
| 107 | name: '', | 115 | name: '', |
| 108 | code: '', | 116 | code: '', |
| 117 | + supplierDepartmentId: '', | ||
| 118 | + supplierDepartmentName: '', | ||
| 109 | productId: '', | 119 | productId: '', |
| 110 | productName: '', | 120 | productName: '', |
| 111 | quantity: '', | 121 | quantity: '', |
| @@ -116,6 +126,7 @@ export default { | @@ -116,6 +126,7 @@ export default { | ||
| 116 | purchaseRule: '' | 126 | purchaseRule: '' |
| 117 | }, | 127 | }, |
| 118 | productList: [], | 128 | productList: [], |
| 129 | + supplierDeptOptions: [], | ||
| 119 | dictData: {}, | 130 | dictData: {}, |
| 120 | sheet: { | 131 | sheet: { |
| 121 | visible: false, | 132 | visible: false, |
| @@ -139,7 +150,9 @@ export default { | @@ -139,7 +150,9 @@ export default { | ||
| 139 | this.id = (options && options.id) ? options.id : '' | 150 | this.id = (options && options.id) ? options.id : '' |
| 140 | this.loadDictData().then(() => { | 151 | this.loadDictData().then(() => { |
| 141 | this.loadProducts().then(() => { | 152 | this.loadProducts().then(() => { |
| 142 | - if (this.id) this.loadDetail() | 153 | + this.loadSupplierDeptList().then(() => { |
| 154 | + if (this.id) this.loadDetail() | ||
| 155 | + }) | ||
| 143 | }) | 156 | }) |
| 144 | }) | 157 | }) |
| 145 | }, | 158 | }, |
| @@ -156,6 +169,19 @@ export default { | @@ -156,6 +169,19 @@ export default { | ||
| 156 | const data = this.dictData[dictCode] | 169 | const data = this.dictData[dictCode] |
| 157 | return (data && data.data) ? data.data : (Array.isArray(data) ? data : []) | 170 | return (data && data.data) ? data.data : (Array.isArray(data) ? data : []) |
| 158 | }, | 171 | }, |
| 172 | + async loadSupplierDeptList() { | ||
| 173 | + try { | ||
| 174 | + const res = await getSupplierDeptApi() | ||
| 175 | + const raw = res && res.data != null ? res.data : [] | ||
| 176 | + const list = Array.isArray(raw) ? raw : [] | ||
| 177 | + this.supplierDeptOptions = list.map(it => ({ | ||
| 178 | + label: it.deptName || it.name || '', | ||
| 179 | + value: it.deptId || it.id || '' | ||
| 180 | + })) | ||
| 181 | + } catch (e) { | ||
| 182 | + this.supplierDeptOptions = [] | ||
| 183 | + } | ||
| 184 | + }, | ||
| 159 | async loadProducts() { | 185 | async loadProducts() { |
| 160 | try { | 186 | try { |
| 161 | const res = await breedRelationshipQueryApi({ pageIndex: 1, pageSize: 9999 }) | 187 | const res = await breedRelationshipQueryApi({ pageIndex: 1, pageSize: 9999 }) |
| @@ -187,6 +213,19 @@ export default { | @@ -187,6 +213,19 @@ export default { | ||
| 187 | isDict: false | 213 | isDict: false |
| 188 | } | 214 | } |
| 189 | }, | 215 | }, |
| 216 | + openSupplierDeptSheet() { | ||
| 217 | + const opts = (this.supplierDeptOptions || []).map(p => ({ label: p.label, value: p.value })) | ||
| 218 | + const cur = this.form.supplierDepartmentId | ||
| 219 | + const match = opts.find(o => String(o.value) === String(cur)) | ||
| 220 | + this.sheet = { | ||
| 221 | + visible: true, | ||
| 222 | + title: '请选择供应商部门', | ||
| 223 | + options: opts, | ||
| 224 | + value: match ? match.value : '', | ||
| 225 | + field: 'supplierDepartmentId', | ||
| 226 | + isDict: false | ||
| 227 | + } | ||
| 228 | + }, | ||
| 190 | openDictSheet(field, dictCode, title) { | 229 | openDictSheet(field, dictCode, title) { |
| 191 | const raw = this.getDictOptions(dictCode) || [] | 230 | const raw = this.getDictOptions(dictCode) || [] |
| 192 | const opts = raw.map(o => ({ label: o.name || o.label || '', value: o.code != null ? o.code : (o.value != null ? o.value : '') })) | 231 | const opts = raw.map(o => ({ label: o.name || o.label || '', value: o.code != null ? o.code : (o.value != null ? o.value : '') })) |
| @@ -209,6 +248,10 @@ export default { | @@ -209,6 +248,10 @@ export default { | ||
| 209 | const m = (this.productList || []).find(p => String(p.value) === String(value)) | 248 | const m = (this.productList || []).find(p => String(p.value) === String(value)) |
| 210 | this.form.productName = m ? m.label : '' | 249 | this.form.productName = m ? m.label : '' |
| 211 | } | 250 | } |
| 251 | + if (field === 'supplierDepartmentId') { | ||
| 252 | + const m = (this.supplierDeptOptions || []).find(p => String(p.value) === String(value)) | ||
| 253 | + this.form.supplierDepartmentName = m ? m.label : '' | ||
| 254 | + } | ||
| 212 | if (field === 'projectType' && !this.isConcentratedBid) { | 255 | if (field === 'projectType' && !this.isConcentratedBid) { |
| 213 | this.form.bidTime = '' | 256 | this.form.bidTime = '' |
| 214 | } | 257 | } |
| @@ -297,6 +340,8 @@ export default { | @@ -297,6 +340,8 @@ export default { | ||
| 297 | const payload = clean({ | 340 | const payload = clean({ |
| 298 | id: this.form.id, | 341 | id: this.form.id, |
| 299 | name: this.form.name, | 342 | name: this.form.name, |
| 343 | + supplierDepartmentId: this.form.supplierDepartmentId, | ||
| 344 | + supplierDepartmentName: this.form.supplierDepartmentName, | ||
| 300 | productId: this.form.productId, | 345 | productId: this.form.productId, |
| 301 | productName: this.form.productName, | 346 | productName: this.form.productName, |
| 302 | quantity: this.form.quantity, | 347 | quantity: this.form.quantity, |