Commit 22065a4e authored by daywrite's avatar daywrite

费用报销新建

parent 1b759ef8
...@@ -48,6 +48,11 @@ export default { ...@@ -48,6 +48,11 @@ export default {
reimbursementCarbonCopyRels () { reimbursementCarbonCopyRels () {
let ret = this.getArrayByKey('Reimbursements', 'form_reimbursementCarbonCopyRels') let ret = this.getArrayByKey('Reimbursements', 'form_reimbursementCarbonCopyRels')
return ret && [].concat(ret.value) return ret && [].concat(ret.value)
},
reimbursementSettleAccountsAt () {
let ret = this.getArrayByKey('Reimbursements', 'settle_accounts_at')
return ret && [].concat(ret.value)
} }
}, },
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
@update:item="val => {model.form_type = val}"> @update:item="val => {model.form_type = val}">
</single-radio> </single-radio>
</el-form-item> </el-form-item>
<el-form-item label="费用类型:" prop="cost_type" class="ec-clear-left is-required"> <el-form-item label="费用类型:" prop="form_costType" class="ec-clear-left is-required">
<single-radio <single-radio
:form-item="model.cost_type" :form-item="model.form_costType"
:options-list="reimCostTypeArray" :options-list="reimCostTypeArray"
@update:item="val => {model.cost_type = val}"> @update:item="val => {model.form_costType = val}">
</single-radio> </single-radio>
</el-form-item> </el-form-item>
<el-form-item label="发生时间:" prop="occurrence_at" class="ec-clear-left is-required"> <el-form-item label="发生时间:" prop="occurrence_at" class="ec-clear-left is-required">
...@@ -23,6 +23,14 @@ ...@@ -23,6 +23,14 @@
placeholder="选择日期时间"> placeholder="选择日期时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="结算时间:" prop="settle_accounts_at" class="ec-clear-left is-required">
<el-date-picker
size="small"
v-model="model.settle_accounts_at"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<el-form-item label="费用金额:" prop="amount" class="ec-clear-left ec-form-item-lg is-required"> <el-form-item label="费用金额:" prop="amount" class="ec-clear-left ec-form-item-lg is-required">
<el-input <el-input
class="ec-input-normal" class="ec-input-normal"
...@@ -54,21 +62,23 @@ ...@@ -54,21 +62,23 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="审核人:" prop="form_reimbursementVerifyRels" class="ec-clear-left ec-form-item-lg is-required"> <el-form-item label="审核人:" prop="form_reimbursementVerifyRels" class="ec-clear-left ec-form-item-lg is-required">
<el-select v-model="model.form_reimbursementVerifyRels" size="small" multiple placeholder="请选择"> <el-select v-model="model.form_reimbursementVerifyRels" size="small" multiple placeholder="点击选择或输入关键字查询">
<el-option v-for="(option, optKey) in reimbursementVerifyRels" <el-option v-for="(option, optKey) in reimbursementVerifyRels"
:key="optKey" :key="optKey"
:label="option.name" :label="option.name"
:value="option.key"></el-option> :value="option.key"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="结算人:" prop="actName" class="ec-clear-left is-required"> <el-form-item label="结算人:" prop="settle_accounts_by" class="ec-clear-left is-required">
<settle-account-select <el-select v-model="model.settle_accounts_by" size="small" filterable placeholder="点击选择或输入关键字查询">
:query="model" <el-option v-for="(option, optKey) in reimbursementSettleAccountsAt"
:inputWidth="340" :key="optKey"
:startLoadInitial="false"/> :label="option.name"
:value="option.key"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="抄送:" prop="form_reimbursementCarbonCopyRels" class="ec-clear-left ec-form-item-lg"> <el-form-item label="抄送:" prop="form_reimbursementCarbonCopyRels" class="ec-clear-left ec-form-item-lg">
<el-select v-model="model.form_reimbursementCarbonCopyRels" size="small" multiple placeholder="请选择"> <el-select v-model="model.form_reimbursementCarbonCopyRels" size="small" multiple placeholder="点击选择或输入关键字查询">
<el-option v-for="(option, optKey) in reimbursementCarbonCopyRels" <el-option v-for="(option, optKey) in reimbursementCarbonCopyRels"
:key="optKey" :key="optKey"
:label="option.name" :label="option.name"
...@@ -87,7 +97,6 @@ ...@@ -87,7 +97,6 @@
</section> </section>
</template> </template>
<script> <script>
import settleAccountSelect from './settleAccountSelect'
import singleRadio from '../common/singleRadio' import singleRadio from '../common/singleRadio'
import settingMixin from '../common/settingMixin' import settingMixin from '../common/settingMixin'
import depSelect from '../schedule/depSelect' import depSelect from '../schedule/depSelect'
...@@ -105,7 +114,6 @@ export default { ...@@ -105,7 +114,6 @@ export default {
}, },
components: { components: {
settleAccountSelect,
singleRadio, singleRadio,
depSelect depSelect
}, },
......
...@@ -30,8 +30,9 @@ export default { ...@@ -30,8 +30,9 @@ export default {
diaVis: false, diaVis: false,
model: { model: {
form_type: '', form_type: '',
cost_type: '', form_costType: '',
occurrence_at: '', occurrence_at: '',
settle_accounts_at: '',
amount: '', amount: '',
client_id: '', client_id: '',
client_name: '', // 客户 client_name: '', // 客户
...@@ -52,8 +53,8 @@ export default { ...@@ -52,8 +53,8 @@ export default {
handleClose () { handleClose () {
Object.keys(this.model).forEach(item => { Object.keys(this.model).forEach(item => {
if (Array.isArray(item)) { if (item === 'form_reimbursementVerifyRels' || item === 'form_reimbursementCarbonCopyRels') {
this.model[item] = '' this.model[item] = []
} else { } else {
this.model[item] = '' this.model[item] = ''
} }
...@@ -62,10 +63,10 @@ export default { ...@@ -62,10 +63,10 @@ export default {
}, },
save () { save () {
console.log(this.model)
let _params = Object.assign({}, setModule(this.model, 'Reimbursements')) let _params = Object.assign({}, setModule(this.model, 'Reimbursements'))
let _apiUrl = !this.model.id ? api.saveNewReim : api.saveEditReim let _apiUrl = !this.model.id ? api.saveNewReim : api.saveEditReim
!this.model.id && delete _params['Reimbursements[id]'] !this.model.id && delete _params['Reimbursements[id]']
console.log(_params)
requestAPI(Object.assign(_apiUrl, { method: 'POST' }), _params) requestAPI(Object.assign(_apiUrl, { method: 'POST' }), _params)
.then((res) => { .then((res) => {
this.$refs.scheduleSidePopup.close() this.$refs.scheduleSidePopup.close()
......
...@@ -24,14 +24,9 @@ export function removeEmptyMemberArray (arr) { ...@@ -24,14 +24,9 @@ export function removeEmptyMemberArray (arr) {
export let setModule = (obj, key) => { export let setModule = (obj, key) => {
let ob = {} let ob = {}
Object.keys(obj).forEach((item) => { Object.keys(obj).forEach((item) => {
// ob[key + '[' + item + ']'] = obj[item]
if (Array.isArray(obj[item])) { if (Array.isArray(obj[item])) {
obj[item].forEach(arr => { ob[key + '[' + item + ']'] = obj[item]
if (arr.key === 'new') {
ob[key + '[' + item + '][' + arr.key + '][]'] = arr.name
} else {
ob[key + '[' + item + '][' + arr.key + ']'] = arr.name
}
})
} else { } else {
ob[key + '[' + item + ']'] = obj[item] ob[key + '[' + item + ']'] = obj[item]
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment