|
@@ -6,14 +6,25 @@
|
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
|
|
|
<el-row class="my-row">
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="合同编码" prop="contractCode">
|
|
|
- <el-input v-model="dataForm.contractCode" disabled placeholder="合同编码由系统生成"></el-input>
|
|
|
+ <el-form-item label="委外编码" prop="purchaseCode">
|
|
|
+ <el-input v-model="dataForm.purchaseCode" disabled placeholder="委外编码由系统生成"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-form-item label="付款方式" prop="payType">
|
|
|
+ <el-radio-group v-model="dataForm.payType">
|
|
|
+ <el-radio :label='"1"'>对公转账</el-radio>
|
|
|
+ <el-radio :label='"2"'>先行垫付</el-radio>
|
|
|
+ <el-radio :label='"3"'>财务预支</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="my-row">
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="合同类别" prop="contractType">
|
|
|
+ <el-form-item label="委外类别" prop="commissionType">
|
|
|
<el-select
|
|
|
- v-model="dataForm.contractType"
|
|
|
+ v-model="dataForm.commissionType"
|
|
|
remote
|
|
|
placeholder="请选择">
|
|
|
<el-option
|
|
@@ -25,31 +36,6 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="采购/委外单据" prop="contractNumber">
|
|
|
- <el-input v-model="dataForm.contractNumber" placeholder="合同号"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row class="my-row">
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="合同号" prop="contractNumber">
|
|
|
- <el-input v-model="dataForm.contractNumber" placeholder="合同号"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="合同金额" prop="actualDeliveryTime">
|
|
|
- <el-input-number v-model="dataForm.actualDeliveryTime" :step="1" :min="0" :precision="1"></el-input-number>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row class="my-row" style="margin-top: 20px">
|
|
|
- <el-form-item label="备注" prop="notes">
|
|
|
- <el-input type="textarea" v-model="dataForm.notes"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-row>
|
|
|
- <el-row class="my-row">
|
|
|
- <upload-component :title="'附件'" :accept="'*'" :file-obj-list="fileList" @uploadSuccess="uploadSuccess"/>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
@@ -62,9 +48,10 @@
|
|
|
<script>
|
|
|
import UploadComponent from '../common/upload-component'
|
|
|
import { getOutsourceDetail, getOutsourceDetailByProId } from '@/api/sale'
|
|
|
+ import { getDictList } from '@/api/dict'
|
|
|
|
|
|
export default {
|
|
|
- name: 'contract-add-or-update',
|
|
|
+ name: 'outsource-add-or-update',
|
|
|
components: {
|
|
|
UploadComponent
|
|
|
},
|
|
@@ -96,6 +83,8 @@ export default {
|
|
|
this.fileList = []
|
|
|
this.dataForm = {}
|
|
|
this.id = id || 0
|
|
|
+ // 获取委外类别列表
|
|
|
+ this.getType()
|
|
|
// 详情
|
|
|
if (!id) return
|
|
|
await (this.idType === 1 ? getOutsourceDetail(this.id) : getOutsourceDetailByProId(this.id)).then(({data}) => {
|
|
@@ -114,6 +103,14 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 获取类别
|
|
|
+ getType () {
|
|
|
+ getDictList({type: 'commission_type'}).then(({data}) => {
|
|
|
+ if (data) {
|
|
|
+ this.optionsType = data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
uploadSuccess (fileList) {
|
|
|
this.fileList = fileList
|
|
|
},
|
|
@@ -124,25 +121,12 @@ export default {
|
|
|
dataFormSubmit () {
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- // 附件
|
|
|
- let fList = this.fileList
|
|
|
- if (fList.length > 0) {
|
|
|
- this.dataForm.attachList = []
|
|
|
- for (let i = 0; i < fList.length; i++) {
|
|
|
- this.dataForm.attachList.push({
|
|
|
- fileName: fList[i].name,
|
|
|
- url: fList[i].url
|
|
|
- })
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.$message.error('请上传文件')
|
|
|
- return
|
|
|
- }
|
|
|
// 产品明细
|
|
|
+ //
|
|
|
this.$http({
|
|
|
- url: this.$http.adornUrl(`/biz-service/purPurchaseContract/${!this.id ? 'save' : 'update'}`),
|
|
|
+ url: this.$http.adornUrl(`/biz-service/purCommDetail/${!this.id ? 'save' : 'update'}`),
|
|
|
method: 'post',
|
|
|
- data: this.$http.adornData({...this.dataForm, orgId: this.orgId})
|
|
|
+ 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({
|