|
@@ -58,30 +58,6 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8" style="padding-left: 20px">
|
|
|
- <el-form-item label="申请人" prop="applierId">
|
|
|
- <el-input v-if="display" v-model="dataForm.applierName" disabled></el-input>
|
|
|
- <el-select v-else
|
|
|
- v-model="dataForm.applierId"
|
|
|
- remote
|
|
|
- filterable
|
|
|
- :remote-method="remoteApplier"
|
|
|
- @change="onApplierChanged"
|
|
|
- placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in optionsApplier"
|
|
|
- :key="item.code"
|
|
|
- :label="item.value"
|
|
|
- :value="item.code">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8" style="padding-left: 20px">
|
|
|
- <el-form-item label="申请部门" prop="deptName">
|
|
|
- <el-input v-model="dataForm.deptName" disabled></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
</el-row>
|
|
|
<el-row class="my-row">
|
|
|
<el-form-item label="备注" prop="notes">
|
|
@@ -197,11 +173,13 @@
|
|
|
import Add from './add-material'
|
|
|
import { getDictList } from '@/api/dict'
|
|
|
import { getPurchaseDetail } from '@/api/sale'
|
|
|
- import { getUserList } from '@/api/user'
|
|
|
+ import { getUserInfo } from '@/api/user'
|
|
|
import { dealStepData, dealStepLogs } from '@/api/util'
|
|
|
+ import UserComponent from '../common/user-component'
|
|
|
export default {
|
|
|
name: 'purchase-add-or-update',
|
|
|
components: {
|
|
|
+ UserComponent,
|
|
|
Add
|
|
|
},
|
|
|
data () {
|
|
@@ -212,7 +190,6 @@
|
|
|
id: 0,
|
|
|
dataForm: {},
|
|
|
optionsType: [],
|
|
|
- optionsApplier: [],
|
|
|
materialDetails: [],
|
|
|
addMaterialVisible: false,
|
|
|
totalAmount: 0,
|
|
@@ -260,16 +237,6 @@
|
|
|
this.materialDetails = data.data.details
|
|
|
this.calTotal()
|
|
|
}
|
|
|
- // 获取申请人
|
|
|
- if (data.data.applierId) {
|
|
|
- this.optionsApplier = []
|
|
|
- this.optionsApplier.push({
|
|
|
- code: data.data.applierId,
|
|
|
- value: data.data.applierName,
|
|
|
- orgId: data.data.orgId,
|
|
|
- orgName: data.data.deptName
|
|
|
- })
|
|
|
- }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -285,7 +252,7 @@
|
|
|
this.$http({
|
|
|
url: !this.id ? this.$http.adornUrl(`/biz-service/purchase/save`) : this.$http.adornUrl(`/biz-service/purchase/update`),
|
|
|
method: 'post',
|
|
|
- data: this.$http.adornData(this.dataForm)
|
|
|
+ data: this.$http.adornData({...this.dataForm, applierId: this.$store.state.user.id, orgId: this.$store.state.user.orgId})
|
|
|
}).then(({data}) => {
|
|
|
if (data && data.code === '200') {
|
|
|
this.$message({
|
|
@@ -304,26 +271,6 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 获取申请人
|
|
|
- async remoteApplier (query) {
|
|
|
- if (!query) return
|
|
|
- const params = {
|
|
|
- name: query.trimStart()
|
|
|
- }
|
|
|
- await getUserList(params).then(({data}) => {
|
|
|
- if (data && data.code === '200') {
|
|
|
- this.optionsApplier = []
|
|
|
- data.data.records.forEach((item) => {
|
|
|
- this.optionsApplier.push({
|
|
|
- code: item.userId,
|
|
|
- value: item.name + ' (用户名: ' + item.username + ')',
|
|
|
- orgId: item.orgId,
|
|
|
- orgName: item.orgName
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
addMaterial () {
|
|
|
this.addMaterialVisible = true
|
|
|
this.$nextTick(() => {
|
|
@@ -365,13 +312,6 @@
|
|
|
let str = (Number(row.taxRate * 100)).toFixed(0)
|
|
|
str += '%'
|
|
|
return str
|
|
|
- },
|
|
|
- onApplierChanged (val) {
|
|
|
- if (!val) return
|
|
|
- let item1 = this.optionsApplier.find((item) => item.code === val)
|
|
|
- if (!item1) return
|
|
|
- this.dataForm.deptName = item1.orgName
|
|
|
- this.dataForm.orgId = item1.orgId
|
|
|
}
|
|
|
}
|
|
|
}
|