| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659 |
- <template>
- <ele-modal
- custom-class="ele-dialog-form long-dialog-form"
- :centered="true"
- v-if="visible"
- :visible.sync="visible"
- :title="title"
- :close-on-click-modal="false"
- width="70%"
- @close="cancel"
- :maxable="true"
- :resizable="true"
- append-to-body
- >
- <el-form
- ref="form"
- :model="form"
- :rules="rules"
- class="el-form-box"
- label-width="120px"
- >
- <headerTitle title="订单信息"></headerTitle>
- <el-row>
- <el-col :span="12">
- <el-form-item label="订单类型" prop="sourceType">
- <el-select
- v-model="form.sourceType"
- placeholder="请选择"
- style="width: 100%"
- @change="sourceTypeChange"
- :disabled="isFlag"
- clearable
- >
- <el-option
- v-for="item in requirementSourceType"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="来源类型" prop="relationType">
- <el-select
- v-model="form.relationType"
- filterable
- clearable
- style="width: 100%"
- @change="handleChangeRelationType"
- >
- <el-option :value="1" label="采购需求单"></el-option>
- <el-option :value="2" label="采购计划单"></el-option>
- <el-option :value="3" label="采购核价单"></el-option>
- <el-option :value="4" label="采购合同"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item
- prop="outsourceScene"
- label="委外场景"
- v-if="
- orderSourceType.includes(form.sourceType) && form.outsourceScene
- "
- >
- <el-select
- v-model="form.outsourceScene"
- disabled
- style="width: 100%"
- >
- <el-option
- :value="item.value"
- :label="item.label"
- v-for="item in outsourceSceneList"
- :key="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item
- v-if="form.relationType == 1"
- label="采购需求单"
- prop="relationName"
- >
- <el-input
- @click.native="handPurchaseNeed"
- v-model="form.relationName"
- placeholder="请选择"
- ></el-input>
- </el-form-item>
- <el-form-item
- v-if="form.relationType == 2"
- label="采购计划单"
- prop="relationName"
- >
- <el-input
- @click.native="handPurchasePlan"
- v-model="form.relationName"
- placeholder="请选择"
- ></el-input>
- </el-form-item>
- <el-form-item
- v-if="form.relationType == 3"
- label="采购核价单"
- prop="relationName"
- >
- <el-input
- @click.native="handInquiry"
- v-model="form.relationName"
- placeholder="请选择"
- ></el-input>
- </el-form-item>
- <el-form-item
- v-if="form.relationType == 4"
- label="选择合同"
- prop="contractName"
- >
- <el-input
- clearable
- v-model="form.contractName"
- @click.native="handleContractBtn"
- @clear="clearContrcat"
- placeholder="请输入"
- />
- </el-form-item>
- <el-form-item label="需求部门" prop="requireDeptId">
- <ele-tree-select
- clearable
- :data="groupTreeData"
- v-model="form.requireDeptId"
- valueKey="id"
- labelKey="name"
- placeholder="请选择"
- @change="change_principalDep"
- default-expand-all
- />
- </el-form-item>
- <el-form-item prop="orderFiles" label="附件">
- <fileMain v-model="form.orderFiles"></fileMain>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="项目名称" prop="projectName">
- <el-input
- clearable
- v-model="form.projectName"
- placeholder="请输入"
- />
- </el-form-item>
- <el-form-item label="结算方式" prop="settlementMode">
- <DictSelection
- dictName="结算方式"
- clearable
- @itemChange="settlementModeChange"
- v-model="form.settlementMode"
- >
- </DictSelection>
- </el-form-item>
- <el-form-item label="需求人" prop="requireUserId">
- <personSelect
- ref="directorRef"
- v-model="form.requireUserId"
- @selfChange="salesmanChange"
- :init="false"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <headerTitle title="基本信息"></headerTitle>
- <el-row>
- <el-col :span="12">
- <el-form-item label="采购方名称" prop="partaName">
- <el-select
- style="width: 100%"
- v-model="form.partaName"
- placeholder="请选择"
- @change="getEnterprise()"
- >
- <el-option
- v-for="item in enterprisePage"
- :key="item.id"
- :label="item.name"
- :value="item.name"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item
- label="采购方统一社会信用代码"
- class="form_item_label"
- prop="partaUnifiedSocialCreditCode"
- >
- <el-input
- clearable
- v-model="form.partaUnifiedSocialCreditCode"
- placeholder="请输入"
- />
- </el-form-item>
- <el-form-item label="采购方联系人" prop="partaLinkName">
- <el-input
- clearable
- v-model="form.partaLinkName"
- @click.native="handHead"
- placeholder="请输入"
- />
- </el-form-item>
- <el-form-item label="采购方电话" prop="partaTel">
- <el-input
- clearable
- :maxlength="20"
- v-model="form.partaTel"
- placeholder="请输入"
- />
- </el-form-item>
- <el-form-item label="采购方传真" prop="partaFax">
- <el-input clearable v-model="form.partaFax" placeholder="请输入" />
- </el-form-item>
- <el-form-item label=" 采购方Email" prop="partaEmail">
- <el-input
- clearable
- v-model="form.partaEmail"
- placeholder="请输入"
- />
- </el-form-item>
- <el-form-item label="采购方地址" prop="partaAddress">
- <el-input
- clearable
- v-model="form.partaAddress"
- placeholder="请输入"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="供应商名称" prop="partbName">
- <el-row>
- <el-col :span="form.partbName ? 19 : 24">
- <el-input
- clearable
- v-model="form.partbName"
- @click.native="handParent"
- :disabled="!!form.contractId"
- placeholder="请选择"
- >
- </el-input>
- </el-col>
- <el-col :span="5">
- <el-button
- v-if="form.partbName"
- style="color: #fff; background: #1890ff"
- @click.native="handleGoodsList"
- >供货列表
- </el-button>
- </el-col>
- </el-row>
- </el-form-item>
- <el-form-item
- label="供应商统一社会信用代码"
- prop="partbUnifiedSocialCreditCode"
- class="form_item_label"
- >
- <el-input
- clearable
- v-model="form.partbUnifiedSocialCreditCode"
- placeholder="请输入"
- />
- </el-form-item>
- <el-form-item label="供应商联系人" prop="partbLinkName">
- <el-select
- style="width: 100%"
- v-model="form.partbLinkName"
- placeholder="请选择"
- @change="onchangeLink"
- >
- <el-option
- v-for="item in linkNameOptions"
- :key="item.id"
- :label="item.linkName"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="partbTel" label="供应商联系电话">
- <el-input clearable v-model="form.partbTel" placeholder="请输入" />
- </el-form-item>
- <el-form-item prop="partbFax" label="供应商传真">
- <el-input clearable v-model="form.partbFax" placeholder="请输入" />
- </el-form-item>
- <el-form-item label="供应商Email" prop="partbEmail">
- <el-input
- clearable
- v-model="form.partbEmail"
- placeholder="请输入"
- />
- </el-form-item>
- <el-form-item label="供应商地址" prop="partbAddress">
- <el-input
- clearable
- v-model="form.partbAddress"
- placeholder="请输入"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <!-- <headerTitle title="产品清单" style="margin-top: 30px"></headerTitle> -->
- <el-tabs v-model="activeName" style="margin-top: 15px" type="border-card">
- <el-tab-pane label="物品清单" name="1">
- <inventoryTable
- ref="inventoryTable"
- @orderDiscountAmount="orderDiscountAmount"
- :pricingWay="form.pricingWay"
- :supplierMark="form.supplierMark"
- :is-show-supplier-mark="true"
- :isContractId="
- !!form.contractId && !OutValidate.includes(form.sourceType)
- "
- >
- </inventoryTable>
- </el-tab-pane>
- <el-tab-pane
- label="带料清单"
- name="2"
- v-if="orderSourceType.includes(form.sourceType)"
- >
- <inventoryTable
- ref="rawDetailListRef"
- :detailType="1"
- :pricingWay="form.pricingWay"
- :supplierMark="form.supplierMark"
- :is-show-supplier-mark="true"
- :isContractId="
- !!form.contractId && !OutValidate.includes(form.sourceType)
- "
- ></inventoryTable>
- </el-tab-pane>
- <el-tab-pane
- label="产出清单"
- name="3"
- v-if="orderSourceType.includes(form.sourceType)"
- >
- <inventoryTable
- ref="outputDetailListRef"
- :detailType="2"
- :pricingWay="form.pricingWay"
- :supplierMark="form.supplierMark"
- :is-show-supplier-mark="true"
- :isContractId="
- !!form.contractId && !OutValidate.includes(form.sourceType)
- "
- ></inventoryTable>
- </el-tab-pane>
- </el-tabs>
- <el-row style="margin-top: 20px">
- <el-col :span="12">
- <el-form-item label="总金额" prop="totalAmount">
- {{ allcountAmount || 0 }}元
- </el-form-item>
- <el-form-item label="备注" prop="remark">
- <el-input
- clearable
- type="textarea"
- v-model="form.remark"
- placeholder="请输入"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="优惠后总金额" prop="payAmount">
- <el-input
- clearable
- v-model="form.payAmount"
- :disabled="
- (!!form.contractId && !OutValidate.includes(form.sourceType)) ||
- !allcountAmount
- "
- type="number"
- @blur="discountInput"
- placeholder="请输入"
- >
- <template slot="append">元</template>
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="footer">
- <el-button type="primary" @click="save" v-click-once>保存</el-button>
- <el-button type="primary" @click="save('sub')" v-click-once
- >提交</el-button
- >
- <el-button @click="cancel">返回</el-button>
- </div>
- <parentList
- ref="parentRef"
- @changeParent="changeParent"
- :classType="2"
- ></parentList>
- <head-list ref="headRef" @changeParent="changePersonel"></head-list>
- <contractListDialog
- :hasGeneratedOrder="
- this.OutValidate.includes(this.form.sourceType) ? 3 : 0
- "
- ref="selectContractRef"
- @changeParent="changeContract"
- :type="2"
- :sourceType="form.sourceType"
- ></contractListDialog>
- <inquiryManageList
- ref="inquiryManageRef"
- @changeInquiryManageList="changeInquiryManageList"
- ></inquiryManageList>
- <process-submit-dialog
- :isNotNeedProcess="false"
- :processSubmitDialogFlag.sync="processSubmitDialogFlag"
- v-if="processSubmitDialogFlag"
- ref="processSubmitDialogRef"
- @reload="reload"
- ></process-submit-dialog>
- <purchaseNeedList
- ref="purchaseNeedList"
- @changeParent="changePurchaseNeedList"
- ></purchaseNeedList>
- <inquiryList
- ref="inquiryListRef"
- @changeParent="changeInquiryList"
- ></inquiryList>
- <supplier-goods-list-dialog
- @changeParent="changeValue"
- :supplier-goods-list-dialog-flag.sync="supplierGoodsListDialogFlag"
- v-if="supplierGoodsListDialogFlag"
- ref="supplierGoodsListDialogRef"
- ></supplier-goods-list-dialog>
- <planTableList
- ref="planTableListRef"
- @success="putTableValue"
- @contractSuccess="contractSuccess"
- ></planTableList>
- <ele-modal
- custom-class="ele-dialog-form long-dialog-form"
- :visible.sync="supplierListShow"
- title="选择供应商"
- :close-on-click-modal="false"
- width="600px"
- append-to-body
- >
- <el-select style="width: 100%" v-model="supplierId" placeholder="请选择">
- <el-option
- v-for="item in supplierList"
- :key="item.supplierId"
- :label="item.supplierName"
- :value="item.supplierId"
- >
- </el-option>
- </el-select>
- <div slot="footer" class="footer">
- <el-button
- type="primary"
- @click="
- changeParent({ id: supplierId });
- supplierListShow = false;
- "
- >确认</el-button
- >
- <el-button @click="supplierListShow = false">返回</el-button>
- </div>
- </ele-modal>
- </ele-modal>
- </template>
- <script>
- import { emailReg, telReg } from 'ele-admin';
- import inventoryTable from './inventoryTable.vue';
- import planTableList from './planTableList.vue';
- import fileUpload from '@/components/upload/fileUpload';
- import dictMixins from '@/mixins/dictMixins';
- import deptSelect from '@/components/CommomSelect/dept-select.vue';
- import personSelect from '@/components/CommomSelect/person-select.vue';
- import parentList from '@/views/purchasingManage/supplierManage/components/parentList.vue';
- import {
- enterprisePage,
- getDetail,
- updateContractStatus
- } from '@/api/contractManage/contractBook';
- import supplierGoodsListDialog from '@/views/purchasingManage/purchaseOrder/components/supplierGoodsListDialog.vue';
- import {
- addInformation,
- getProductsBySource,
- getPurchaseinquiryAPI,
- getpurchaseorderDetail,
- getPurchasePlanByContractIdAPI,
- UpdateInformation
- } from '@/api/purchasingManage/purchaseOrder';
- import { getplanDetail } from '@/api/purchasingManage/purchasePlanManage';
- import { getpurchaseinquiry } from '@/api/purchasingManage/inquiryManage';
- import { getcontactlink } from '@/api/saleManage/businessFollow';
- import headList from '@/BIZComponents/user-select/user-select.vue';
- import contractListDialog from '@/views/saleManage/saleOrder/components/contractListDialog.vue';
- import { listOrganizations } from '@/api/system/organization';
- import { copyObj } from '@/utils/util';
- import inquiryManageList from '@/views/purchasingManage/inquiryManage/components/inquiryManage-list.vue';
- // import fileMain from '@/components/addDoc/index.vue';
- import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
- import purchaseNeedList from '@/views/purchasingManage/purchasePlanManage/components/purchaseNeed-list.vue';
- import inquiryList from './inquiryList.vue';
- import {
- contactDetail,
- updateRelationStatus
- } from '@/api/saleManage/contact';
- import {
- requirementSourceType,
- acceptUnpackoptions,
- orderSourceType,
- outsourceSceneList
- } from '@/enum/dict.js';
- export default {
- mixins: [dictMixins],
- props: {
- isRequired: {
- type: Boolean,
- default: true
- }
- },
- components: {
- inquiryList,
- purchaseNeedList,
- processSubmitDialog,
- // fileMain,
- inquiryManageList,
- fileUpload,
- headList,
- contractListDialog,
- inventoryTable,
- deptSelect,
- parentList,
- personSelect,
- supplierGoodsListDialog,
- planTableList
- },
- data() {
- let formDef = {
- id: '',
- contractId: '',
- relationType: '',
- relationName: '',
- orderFiles: [],
- contractName: '',
- deliveryDate: '',
- payAmount: '',
- projectName: '',
- projectId: '',
- receiveAddress: '',
- sourceType: '',
- sourceTypeName: '',
- pricingWay: 1,
- remark: '',
- saleType: '',
- saleTypeName: '',
- totalAmount: '',
- settlementMode: '4',
- settlementModeName: '分期付款',
- partaUnifiedSocialCreditCode: '',
- partbUnifiedSocialCreditCode: '',
- partaAddress: '',
- partaEmail: '',
- partaFax: '',
- partaId: '',
- partaLinkId: '',
- partaLinkName: '',
- partaName: '',
- partaTel: '',
- partbAddress: '',
- partbEmail: '',
- partbFax: '',
- partbId: '',
- partbLinkId: '',
- partbLinkName: '',
- partbName: '',
- partbTel: '',
- purchasePlanId: '',
- purchasePlanNo: '',
- purchasePlanName: '',
- isFirstProcess: 0
- };
- return {
- supplierListShow: false,
- supplierList: [],
- supplierId: '',
- orderSourceType,
- outsourceSceneList,
- requirementSourceType,
- processList: [
- {
- label: '是',
- value: 1
- },
- {
- label: '否',
- value: 0
- }
- ],
- isFlag: false, //订单类型是否不可修改
- clearing: false, //是否清除合同
- payWayOptions: [],
- delDetailIds: [],
- linkNameOptions: [],
- acceptUnpackoptions,
- visible: false,
- fullscreen: false,
- processSubmitDialogFlag: false,
- supplierGoodsListDialogFlag: false,
- title: '',
- row: {},
- activeName: '1',
- pricingWayList: [
- { id: 1, name: '按数量计价' },
- { id: 2, name: '按重量计价' }
- ],
- formDef,
- form: copyObj(formDef),
- enterprisePage: [],
- tableBankData: [],
- tableLinkData: [],
- // 组织机构树形结构数据
- groupTreeData: [],
- groupData: [],
- OutValidate: ['3', '4'],
- // 提交状态
- loading: false,
- // 是否是修改
- isUpdate: false,
- businessId: '',
- winnerSuppleIds: ''
- };
- },
- computed: {
- allcountAmount() {
- return this.$store.state.order.allcountAmount;
- },
- rules() {
- let isRequired = this.isRequired;
- // console.log(this.isRequired);
- return {
- deliveryDate: [
- { required: true, message: '请选择交货日期', trigger: 'change' }
- ],
- purchasePlanName: [
- {
- required: this.OutValidate.includes(this.form.sourceType),
- message: '请选择采购计划单',
- trigger: ['change', 'blur']
- }
- ],
- relationName: [
- {
- required: true,
- message: '请选择',
- trigger: ['change', 'blur']
- }
- ],
- contractName: [
- {
- required: true,
- message: '请选择合同',
- trigger: ['change', 'blur']
- }
- ],
- // purchaseType: [
- // {required: true, message: '请选择采购订单类型', trigger: 'change'}
- // ],
- settlementMode: [
- { required: true, message: '请选择结算方式', trigger: 'change' }
- ],
- partaName: [
- {
- required: true,
- message: '请选择供应商名称',
- trigger: 'change'
- }
- ],
- partaLinkName: [
- {
- required: isRequired,
- message: '请选择供应商联系人',
- trigger: 'change'
- }
- ],
- acceptUnpack: [
- { required: true, message: '请选择是否接受', trigger: 'change' }
- ],
- sourceType: [
- { required: true, message: '请选择订单类型', trigger: 'change' }
- ],
- payAmount: [{ required: true, message: '请输入', trigger: 'blur' }],
- partbAddress: [
- { required: true, message: '请输入', trigger: 'blur' }
- ],
- partaTel: [
- {
- required: isRequired,
- pattern: telReg,
- message: '请输入供应商联系电话',
- trigger: 'blur'
- }
- ],
- partbName: [
- { required: true, message: '请输入供采购方名称', trigger: 'change' }
- ],
- partbLinkName: [
- {
- required: isRequired,
- message: '请输入供采购方联系人',
- trigger: 'change'
- }
- ],
- partbTel: [
- {
- required: isRequired,
- pattern: telReg,
- message: '请输入供采购方联系电话',
- trigger: 'blur'
- }
- ],
- partaEmail: [
- { pattern: emailReg, message: '邮箱格式不正确', trigger: 'blur' }
- ]
- };
- }
- },
- created() {
- console.log(this);
- this.getGroupAll();
- this.getEnterprisePage();
- this.changePersonel();
- },
- methods: {
- // 选择负责人部门
- change_principalDep(id) {
- const info = this.groupData.find((e) => e.id == id);
- this.form.requireDeptName = info.name;
- // this.form.requireUserId = '';
- // this.form.requireUserName = '';
- this.$set(this.form, 'requireUserId', '');
- this.$set(this.form, 'requireUserName', '');
- // 根据部门获取人员
- this.getrequireUser(id);
- },
- //选择采购需求
- handPurchaseNeed() {
- this.$refs.purchaseNeedList.open(
- this.form.relationCode,
- this.form.sourceType
- );
- },
- //选择采购需求回调
- async changePurchaseNeedList(data) {
- this.form.relationId = data.id;
- this.form.relationCode = data.requirementCode;
- this.form.relationName = data.requirementName;
- this.$set(this.form, 'relationName', data.requirementName);
- this.$set(this.form, 'relationId', data.id);
- this.$set(this.form, 'relationCode', data.requirementCode);
- this.$set(this.form, 'requireDeptId', data.requireDeptId);
- this.$set(this.form, 'requireDeptName', data.requireDeptName);
- this.$set(this.form, 'requireUserId', data.requireUserId);
- this.$set(this.form, 'requireUserName', data.requireUserName);
- this.getrequireUser(data.requireDeptId);
- let info = await getProductsBySource({
- relationId: this.form.relationId,
- relationType: this.form.relationType
- });
- let form = {
- contractVO: {
- ...this.form
- },
- productList: info.productList || []
- };
- this.$refs.inventoryTable &&
- this.$refs.inventoryTable.putTableValue(form.productList);
- },
- //选择采购计划
- handPurchasePlan() {
- this.$refs.inquiryManageRef.open(
- this.form.planCode,
- this.form.sourceType
- );
- },
- //选择采购计划回调
- async changeInquiryManageList(data) {
- this.form.purchasePlanId = data.id;
- this.form.purchasePlanNo = data.planCode;
- this.form.purchasePlanName = data.planName;
- this.form.relationId = data.id;
- this.form.relationCode = data.planCode;
- this.form.relationName = data.planName;
- this.form.requireDeptId = data.requireDeptId;
- this.form.requireDeptName = data.requireDeptName;
- this.form.requireUserId = data.requireUserId;
- this.form.requireUserName = data.requireUserName;
- this.$set(this.form, 'requireDeptId', data.requireDeptId);
- this.$set(this.form, 'requireDeptName', data.requireDeptName);
- this.$set(this.form, 'requireUserId', data.requireUserId);
- this.$set(this.form, 'requireUserName', data.requireUserName);
- this.getrequireUser(data.requireDeptId);
- // let cusInfo = {}
- this.$set(this.form, 'purchasePlanName', data.planName);
- this.$set(this.form, 'purchasePlanId', data.id);
- this.$set(this.form, 'purchasePlanNo', data.planCode);
- this.$set(this.form, 'relationName', data.planName);
- this.$set(this.form, 'relationId', data.id);
- this.$set(this.form, 'relationCode', data.planCode);
- const res = await getplanDetail(data.id);
- this.$set(this.form, 'isFirstProcess', res.isFirstProcess);
- let info = await getProductsBySource({
- relationId: this.form.relationId,
- relationType: this.form.relationType
- });
- info['rawDetailList'] = info.rawList;
- info['outputDetailList'] = info.outputList;
- // if (info.productList.length > 1) {
- // this.$refs.planTableListRef.open(info);
- // } else {
- // }
- let supplierList = res.detailList
- .filter((item) => item.supplierId)
- .map((item) => {
- return {
- supplierId: item.supplierId,
- supplierName: item.supplierName
- };
- });
- if (supplierList?.length > 0) {
- this.supplierList = Array.from(
- new Set(supplierList.map((obj) => JSON.stringify(obj)))
- ).map((str) => JSON.parse(str));
- this.$nextTick(() => {
- this.putTableValue(info);
- });
- if (
- this.supplierList.length == 1 &&
- this.supplierList[0]?.supplierId
- ) {
- await this.changeParent({ id: this.supplierList[0]?.supplierId });
- } else {
- this.supplierListShow = true;
- }
- }else{
- this.putTableValue(info);
- }
- // let form = {
- // contractVO: {
- // ...this.form
- // },
- // productList: info.productList || []
- // }
- // const codeList = form.productList.map((item) => item.productCode);
- // let inventoryTotalList = await getInventoryTotalAPI(codeList);
- // form.productList.forEach((item) => {
- // let find =
- // inventoryTotalList.find((key) => key.code == item.productCode) || {};
- // item.availableCountBase = find.availableCountBase;
- // });
- // this.$refs.inventoryTable &&
- // this.$refs.inventoryTable.putTableValue(form.productList);
- },
- //选择核价单
- handInquiry(e) {
- this.$refs.inquiryListRef.open(this.form.sourceType);
- },
- //选择采购核价回调
- async changeInquiryList(data) {
- console.log(data, '=======');
- this.form.relationId = data.id;
- this.form.relationCode = data.inquiryCode;
- this.form.relationName = data.inquiryName;
- this.winnerSuppleIds = data.winnerSuppleIds;
- this.$set(this.form, 'relationName', data.inquiryName);
- this.$set(this.form, 'relationId', data.id);
- this.$set(this.form, 'relationCode', data.inquiryCode);
- const res = await getpurchaseinquiry(data.id);
- this.$set(this.form, 'isFirstProcess', res.isFirstProcess);
- let info = await getProductsBySource({
- relationId: this.form.relationId,
- relationType: this.form.relationType,
- supplierId: this.winnerSuppleIds
- });
- info['rawDetailList'] = info.rawList;
- info['outputDetailList'] = info.outputList;
- info.productList.forEach((item) => {
- item['discountSinglePrice'] = item.singlePrice;
- item['discountTotalPrice'] = item.totalPrice;
- });
- if (info.productList.length > 1) {
- this.$refs.planTableListRef.open(info);
- } else {
- this.$nextTick(() => {
- this.putTableValue(info);
- });
- }
- this.form = {
- ...this.form,
- partbId: info.partbId,
- partbName: info.partbName,
- partbAddress: info.partaAddress,
- partbLinkId: info.partaAddress,
- partbLinkName: info.partbLinkName,
- partbEmail: info.partbEmail,
- partbTel: info.partbTel
- };
- await this.getLinkInfo(info.partbId);
- this.$nextTick(() => {
- let firstLink =
- this.linkNameOptions.find((item) => item.ifChief == 1) || {};
- this.form = Object.assign({}, this.form, {
- partbLinkId: firstLink.id || this.linkNameOptions[0]?.id,
- partbLinkName:
- firstLink.linkName || this.linkNameOptions[0]?.linkName,
- partbTel:
- firstLink.mobilePhone || this.linkNameOptions[0]?.mobilePhone
- });
- this.setProductInfo();
- });
- await this.changeParent({ id: info.partbId });
- },
- async putTableValue({ productList, rawDetailList, outputDetailList }) {
- let totalPrice = 0;
- productList.forEach((item) => {
- totalPrice += item.totalPrice;
- });
- this.$store.commit('order/setAllcountAmount', totalPrice);
- this.$set(this.form, 'totalPrice', totalPrice);
- if (this.form.relationType == 3) {
- this.$set(this.form, 'payAmount', totalPrice);
- }
- this.$refs.inventoryTable &&
- this.$refs.inventoryTable.putTableValue(productList);
- this.$refs.rawDetailListRef &&
- this.$refs.rawDetailListRef.putTableValue(rawDetailList); //原料
- this.$refs.outputDetailListRef &&
- this.$refs.outputDetailListRef.putTableValue(outputDetailList);
- },
- getrequireUser(groupId) {
- if (groupId) {
- this.$refs.directorRef.getList({ groupId });
- }
- },
- salesmanChange(val, info) {
- this.$set(this.form, 'requireUserId', val);
- this.$set(this.form, 'requireUserName', info.name);
- // this.form.requireUserName = info.name;
- },
- // 获取公司数据
- getGroupAll() {
- listOrganizations().then((list) => {
- this.groupData = list;
- this.groupTreeData = this.$util.toTreeData({
- data: list,
- idField: 'id',
- parentIdField: 'parentId'
- });
- });
- },
- discountInput() {
- this.$refs.inventoryTable.discountInputByOrder(this.form.payAmount);
- },
- //产品清单修改单价或者数量重置优惠金额
- orderDiscountAmount(val = 0) {
- this.form.payAmount = val;
- //this.form.payAmount = undefined
- },
- //选择合同获取合同的详情
- async getDetailData(id) {
- this.loading = true;
- const data = await getDetail(id);
- let info = await getProductsBySource({
- relationId: this.form.relationId,
- relationType: this.form.relationType
- });
- this.loading = false;
- if (data) {
- // if (data.contractVO.sourceType == 3 && data.contractVO.sourceId) {
- // //获取需求部门
- // const res = await getplanDetail(data.contractVO.sourceId);
- // this.$nextTick(() => {
- // this.form.requireDeptId = res.requireDeptId;
- // this.form.requireDeptName = res.requireDeptName;
- // this.form.requireUserId = res.requireUserId;
- // this.form.requireUserName = res.requireUserName;
- // });
- // }
- this.$set(this.form, 'requireDeptId', data.contractVO?.requireDeptId);
- this.$set(
- this.form,
- 'requireDeptName',
- data.contractVO?.requireDeptName
- );
- this.$set(this.form, 'requireUserId', data.contractVO?.requireUserId);
- this.$set(
- this.form,
- 'requireUserName',
- data.contractVO?.requireUserName
- );
- this.getrequireUser(data.contractVO?.requireDeptId);
- this.$nextTick(() => {
- let { contractVO } = data;
- // this.form=contractVOform.receiveAddress
- let {
- partaAddress,
- partaEmail,
- partaFax,
- partaId,
- partaLinkId,
- partaLinkName,
- partaName,
- partaTel,
- partbAddress,
- partbEmail,
- partbFax,
- partbId,
- partbLinkId,
- partbLinkName,
- partbName,
- partbTel,
- totalPrice,
- discountTotalPrice,
- partaUnifiedSocialCreditCode,
- partbUnifiedSocialCreditCode,
- settlementMode,
- settlementModeName,
- pricingWay,
- isFirstProcess,
- requireSourceType,
- requireSourceTypeName
- } = contractVO;
- this.form = Object.assign({}, this.form, {
- partaAddress,
- partaEmail,
- partaFax,
- partaId,
- partaLinkId,
- partaLinkName,
- partaName,
- partaTel,
- partbAddress,
- partbEmail,
- partbFax,
- partbId,
- partbLinkId,
- partbLinkName,
- partbName,
- partbTel,
- totalPrice,
- settlementMode,
- settlementModeName,
- discountTotalPrice,
- partaUnifiedSocialCreditCode,
- partbUnifiedSocialCreditCode,
- pricingWay,
- totalAmount: totalPrice,
- payAmount: discountTotalPrice,
- receiveAddress: partaAddress,
- isFirstProcess,
- sourceType: requireSourceType || '1',
- sourceTypeName: requireSourceTypeName
- });
- this.getLinkInfo(partaId);
- if (info.productList.length > 1) {
- this.$refs.planTableListRef.contractOpen(
- info.productList,
- contractVO.contractStartDate
- );
- } else {
- this.contractSuccess({
- productList: info.productList,
- contractStartDate: contractVO.contractStartDate
- });
- }
- this.$refs.rawDetailListRef &&
- this.$refs.rawDetailListRef.putTableValue(contractVO.rawList); //原料
- this.$refs.outputDetailListRef &&
- this.$refs.outputDetailListRef.putTableValue(
- contractVO.outputList
- );
- this.$store.commit('order/setAllcountAmount', totalPrice);
- });
- }
- },
- contractSuccess({ productList, contractStartDate }) {
- this.$nextTick(() => {
- this.$refs.inventoryTable &&
- this.$refs.inventoryTable.putTableValue(
- productList,
- contractStartDate
- );
- });
- },
- //获取订单详情
- async getpurchaseorderDetail(id) {
- this.businessId = id;
- this.loading = true;
- const data = await getpurchaseorderDetail(id);
- this.loading = false;
- if (data) {
- this.$nextTick(() => {
- this.form = data;
- this.$store.commit('order/setAllcountAmount', data.totalAmount);
- this.$refs.inventoryTable &&
- this.$refs.inventoryTable.putTableValue(data.productList);
- this.$refs.rawDetailListRef &&
- this.$refs.rawDetailListRef.putTableValue(data.rawList); //原料
- this.$refs.outputDetailListRef &&
- this.$refs.outputDetailListRef.putTableValue(data.outputList); //产成品
- this.getLinkInfo(data.partaId);
- this.getrequireUser(this.form.requireDeptId);
- this.$store.commit('order/setContractId', data.contractId);
- });
- }
- },
- //更新联系人数据
- async getLinkInfo(contactId) {
- const data = await getcontactlink({ contactId });
- if (data && data?.length) {
- this.linkNameOptions = data;
- }
- },
- sourceTypeChange() {
- this.valueChange();
- },
- handleChangeRelationType(val) {
- this.valueChange();
- },
- valueChange() {
- this.form.purchasePlanId = '';
- this.form.purchasePlanNo = '';
- this.form.purchasePlanName = '';
- this.form.relationId = '';
- this.form.relationCode = '';
- this.form.relationName = '';
- this.$nextTick(() => {
- this.$refs.inventoryTable &&
- this.$refs.inventoryTable.putTableValue([]);
- });
- },
- //选择下拉框
- onchangeLink(selectedOptions) {
- const option = this.linkNameOptions.find(
- (opt) => opt.id === selectedOptions
- );
- this.form = Object.assign({}, this.form, {
- partbEmail: option?.email,
- partbLinkName: option?.linkName || '',
- partbTel: option?.mobilePhone || option?.phone || '',
- partbLinkId: option?.id
- });
- },
- handHead() {
- let item = {
- id: this.form.partaLinkId
- };
- this.$refs.headRef.open(item);
- },
- //选择供采购方人回调
- changePersonel(obj) {
- if (!obj) {
- obj = this.$store.getters.user.info;
- obj.id = obj.userId;
- }
- this.$set(this.form, 'partaLinkId', obj.id);
- this.$set(this.form, 'partaLinkName', obj.name);
- this.$set(this.form, 'partaTel', obj.phone);
- this.$set(this.form, 'partaEmail', obj.email);
- },
- //选择供应商回调
- async changeParent(obj) {
- if (!obj.id) {
- return;
- }
- const { base, other } = await contactDetail(obj.id);
- this.form = Object.assign({}, this.form, {
- partbId: base.id,
- partbName: base.name,
- partbAddress: other.addressName
- ? other.addressName + other.address
- : base.addressName + other.address,
- partbLinkId: '',
- partbLinkName: '',
- partbEmail: '',
- partbTel: '',
- supplierMark: base.serialNo,
- partbUnifiedSocialCreditCode: base.unifiedSocialCreditCode
- });
- await this.getLinkInfo(obj.id);
- // this.form.productList=productList
- this.$nextTick(() => {
- let firstLink =
- this.linkNameOptions.find((item) => item.ifChief == 1) || {};
- this.form = Object.assign({}, this.form, {
- partbLinkId: firstLink.id || this.linkNameOptions[0]?.id,
- partbLinkName:
- firstLink.linkName || this.linkNameOptions[0]?.linkName,
- partbTel:
- firstLink.mobilePhone || this.linkNameOptions[0]?.mobilePhone
- });
- this.setProductInfo();
- });
- },
- setProductInfo() {
- this.$refs.inventoryTable.setCustomerMark(this.form.supplierMark);
- },
- //选择合同回调
- async changeContract(obj) {
- this.form = Object.assign({}, this.form, {
- contractId: obj.id,
- contractName: obj.contractName,
- contractNo: obj.contractNo,
- relationId: obj.id,
- relationName: obj.contractName,
- relationCode: obj.contractNo
- });
- await this.getPlanInfo(this.form.contractId);
- await this.getDetailData(obj.id);
- // //采购询价表
- // if(obj.sourceType==2){
- // obj.sourceId && this.getPurchaseinquiry(obj.sourceId);
- // }
- // //采购计划
- // if(obj.sourceType==3){
- // obj.sourceId && this.getPlanInfo(this.form.contractId);
- // }
- this.$store.commit('order/setContractId', obj.id);
- //获取合同采购计划
- },
- async getPlanInfo(id) {
- let res = await getPurchasePlanByContractIdAPI(id);
- if (!res.data?.id) return;
- this.form = Object.assign({}, this.form, {
- purchasePlanId: res.data?.id,
- purchasePlanName: res.data?.planName,
- purchasePlanNo: res.data?.planCode,
- sourceType: res.data?.sourceType,
- sourceTypeName: res.data?.sourceTypeName
- });
- },
- //选择合同弹框
- handleContractBtn() {
- if (this.clearing) return;
- let item = {
- id: this.form.contractId
- };
- this.$refs.selectContractRef.open(item, this.form.sourceType);
- },
- //清除合同
- clearContrcat() {
- this.clearing = true;
- this.isFlag = false;
- let {
- sourceType,
- sourceTypeName,
- requireDeptId,
- requireDeptName,
- requireUserId,
- requireUserName,
- settlementMode,
- settlementModeName,
- id,
- projectName,
- saleType,
- saleTypeName,
- deliveryDate,
- orderFiles,
- remark
- } = this.form;
- this.form = Object.assign({}, copyObj(this.formDef), {
- id,
- projectName,
- saleType,
- saleTypeName,
- deliveryDate,
- orderFiles,
- remark,
- sourceType,
- sourceTypeName,
- requireDeptId,
- requireDeptName,
- requireUserId,
- requireUserName,
- settlementMode,
- settlementModeName
- });
- this.$store.commit('order/setContractId', '');
- this.$store.commit('order/setAllcountAmount', 0);
- this.$refs.inventoryTable.putTableValue([]);
- this.$refs.rawDetailListRef &&
- this.$refs.rawDetailListRef.putTableValue([]);
- this.$refs.outputDetailListRef &&
- this.$refs.outputDetailListRef.putTableValue([]);
- setTimeout(() => {
- this.clearing = false;
- }, 500);
- },
- handParent() {
- if (this.form.contractId) {
- return this.$message.error('选择了合同不能更改供应商名称');
- }
- let item = {
- id: this.form.contactId
- };
- this.$refs.parentRef.open(item);
- },
- //通过合同获取订单类型
- async getPurchaseinquiry(sourceId) {
- let data = await getPurchaseinquiryAPI(sourceId);
- this.isFlag = !!data.sourceType;
- this.form = Object.assign({}, this.form, {
- sourceType: data.sourceType,
- sourceTypeName: data.sourceTypeName
- });
- },
- //打开新增编辑弹框
- async open(type, row, contactCategoryId) {
- this.title = type === 'add' ? '新增' : '修改';
- this.activeName = '1';
- this.row = row;
- this.visible = true;
- if (this.enterprisePage.length == 0) {
- await this.getEnterprisePage();
- }
- if (type == 'add') {
- this.isUpdate = false;
- if (this.enterprisePage.length > 0) {
- this.form.partaName = this.enterprisePage[0]?.name;
- this.form.partaUnifiedSocialCreditCode =
- this.enterprisePage[0]?.unifiedSocialCreditCode;
- this.form.partaFax = this.enterprisePage[0]?.fax;
- this.form.partaAddress = this.enterprisePage[0]?.address;
- }
- } else {
- this.isUpdate = true;
- await this.getpurchaseorderDetail(row.id);
- }
- },
- getEnterprisePage() {
- enterprisePage({
- pageNum: 1,
- size: 100
- }).then((res) => {
- this.enterprisePage = [];
- this.enterprisePage.push(...res.list);
- });
- },
- getEnterprise() {
- let data = this.enterprisePage.find(
- (item) => item.name == this.form.quoteName
- );
- this.form.partaName = data.name;
- this.form.partaUnifiedSocialCreditCode = data.unifiedSocialCreditCode;
- this.form.partaFax = data.fax;
- this.form.partaAddress = data.address;
- },
- //从合同页面新增订单
- contractOpen(row) {
- this.title = '新增';
- this.visible = true;
- this.isUpdate = false;
- this.form.relationType = 4;
- this.changeContract(row);
- },
- handleGoodsList() {
- console.log(11111);
- this.supplierGoodsListDialogFlag = true;
- this.$nextTick(() => {
- this.$refs.supplierGoodsListDialogRef.open(this.form.partbId);
- });
- },
- changeValue(val = []) {
- this.$refs.inventoryTable &&
- this.$refs.inventoryTable.getGoodsListData(val);
- },
- settlementModeChange(info) {
- this.form.settlementModeName = info.dictValue;
- },
- ifChiefChange(value, idx) {
- if (value === 1) {
- this.tableLinkData.forEach((e) => (e.ifChief = 0));
- this.tableLinkData[idx].ifChief = 1;
- }
- },
- getValidate() {
- return Promise.all([
- new Promise((resolve, reject) => {
- this.$refs.form.validate((valid) => {
- if (!valid) {
- reject(false);
- } else {
- resolve(true);
- }
- });
- }),
- new Promise((resolve, reject) => {
- this.$refs.inventoryTable.validateForm((valid) => {
- if (!valid) {
- reject(false);
- } else {
- resolve(true);
- }
- });
- })
- ]);
- },
- async save(type) {
- let is = false;
- try {
- await this.getValidate();
- // 表单验证通过,执行保存操作
- this.loading = true;
- let isTemporary = [];
- if (!this.isUpdate) {
- delete this.form.id;
- }
- if (!this.form.contractId) {
- this.form.totalAmount = this.allcountAmount;
- }
- const rawDetailList =
- (this.$refs.rawDetailListRef &&
- this.$refs.rawDetailListRef.getTableValue()) ||
- [];
- const outputDetailList =
- (this.$refs.outputDetailListRef &&
- this.$refs.outputDetailListRef.getTableValue()) ||
- [];
- const tabList =
- (this.$refs.inventoryTable &&
- this.$refs.inventoryTable.getTableValue()) ||
- [];
- tabList.forEach((v, i) => {
- if (!v.productCode) {
- isTemporary.push(v.productName);
- }
- // tabList.forEach((v2, j) => {
- // if (
- // v.productCode == v2.productCode &&
- // v.taskId == v2.taskId &&
- // v.batchNo == v2.batchNo &&
- // i != j
- // ) {
- // is = true;
- // }
- // });
- });
- if (isTemporary.length > 0) {
- this.$message.error(
- isTemporary.toString() +
- '是临时产品,无法创建订单,请先去主数据维护!'
- );
- return;
- }
- // if (is) {
- // this.$message.error('同产品,工序、批次号不能完全一致!');
- // return;
- // }
- let productList = [
- ...tabList,
- ...rawDetailList.map((item) => {
- item.singlePrice = item.singlePrice || 0;
- item.discountSinglePrice = item.discountSinglePrice || 0;
- item.totalPrice = item.totalPrice || 0;
- item.discountTotalPrice = item.discountTotalPrice || 0;
- return item;
- }),
- ...outputDetailList.map((item) => {
- item.singlePrice = item.singlePrice || 0;
- item.discountSinglePrice = item.discountSinglePrice || 0;
- item.discountTotalPrice = item.discountTotalPrice || 0;
- item.totalPrice = item.totalPrice || 0;
- return item;
- })
- ];
- let commitData = Object.assign({}, this.form, {
- productList,
- // purchaseTypeName: this.getDictValue(
- // '采购订单类型',
- // this.form.purchaseType
- // ),
- sourceTypeName: this.requirementSourceType.find(
- (val) => val.value == this.form.sourceType
- )?.label
- });
- if (this.isUpdate) {
- UpdateInformation(commitData)
- .then((res) => {
- this.loading = false;
- this.$message.success('修改成功');
- updateRelationStatus([this.form.partbId]);
- if (this.form.contractId) {
- updateContractStatus([this.form.contractId]);
- }
- if (type === 'sub') {
- this.sub(res);
- return;
- }
- this.cancel();
- this.$emit('done');
- })
- .catch((e) => {
- //this.loading = false;
- });
- } else {
- addInformation(commitData)
- .then((res) => {
- this.loading = false;
- this.$message.success('新增成功');
- updateRelationStatus([this.form.partbId]);
- if (type === 'sub') {
- this.sub(res);
- return;
- }
- this.cancel();
- this.$emit('done');
- })
- .catch((e) => {
- //this.loading = false;
- });
- }
- } catch (error) {
- console.log(error);
- // 表单验证未通过,不执行保存操作
- }
- },
- async sub(res) {
- const data = await getpurchaseorderDetail(this.businessId || res);
- this.processSubmitDialogFlag = true;
- this.$nextTick(() => {
- let params = {
- businessId: data.id,
- businessKey: 'purchase_order_approve',
- formCreateUserId: data.createUserId,
- variables: {
- businessCode: data.orderNo,
- businessName: data.partaName,
- businessType: data.sourceTypeName
- }
- // callBackMethodType : '1',
- // callBackMethod : 'proTargetPlanApproveApiImpl.updatePlanApprovalStatus',
- // pcHandle : '/bpm/handleTask/components/project-manage/plan-manage/submit.vue',
- // pcView : '/bpm/handleTask/components/project-manage/plan-manage/detailDialog.vue',
- // miniHandle : '',
- // miniView : '',
- };
- this.$refs.processSubmitDialogRef.init(params);
- });
- // submit({
- // businessId: this.businessId || res
- // }).then((res) => {
- // this.cancel();
- // this.$emit('done');
- // });
- },
- reload() {
- this.cancel();
- this.$emit('done');
- },
- cancel() {
- this.$nextTick(() => {
- this.isFlag = false;
- // 关闭后,销毁所有的表单数据
- this.$refs['otherForm'] && this.$refs['otherForm'].resetFields();
- this.$refs['formRef'] && this.$refs['formRef'].resetFields();
- this.$store.commit('order/clearUserData');
- this.form = copyObj(this.formDef);
- this.visible = false;
- });
- },
- //查找合同分类对应name
- findNameById(tree, targetId) {
- for (let i = 0; i < tree.length; i++) {
- const node = tree[i];
- if (node.id === targetId) {
- return node.name;
- }
- if (node.children && node.children.length > 0) {
- const name = this.findNameById(node.children, targetId);
- if (name) {
- return name;
- }
- }
- }
- return null;
- }
- }
- };
- </script>
- <style scoped lang="scss">
- .TotalAmount {
- font-size: 16px;
- padding-right: 30px;
- }
- </style>
|