1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887 |
- <template>
- <div>
- <div class="customer-head">
- <div class="customer-back">
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
- @click="backToList(0)">返回列表
- </el-button>
- </div>
- <div class="add-customer-btn">
- <el-button class="el-button--small-yh" :disabled="isEditButton" style="margin-left: 6px;"
- type="primary" size="small" v-if="editButton" @click="confirmEditing">编 辑
- </el-button>
- <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
- :disabled="isSaveBtn" @click="editCustomer">保 存
- </el-button>
- <el-button class="el-button--small-yh" style="margin-left: 6px;" :type="buttonColor" size="small"
- :disabled="isDisabledTask" @click="generateOutbound" v-if="form.taskWhetherAdopt != '审核提交'">
- {{ buttonText }}
- </el-button>
- <el-button class="el-button--small-yh" style="margin-left: 6px;" :type="buttonColor" size="small"
- v-if="form.taskWhetherAdopt == '审核提交'" @click="revokeTask">
- 撤销出库任务审批
- </el-button>
- <el-button class="el-button--small-yh" style="margin-left: 6px;" type="info" size="small"
- :disabled="form.status != '已发货' || form.returnsNumber == form.goodsTotalNum || editButton"
- @click="getReturns">
- 销售退货
- </el-button>
- <el-dropdown style="padding: 0 6px;line-height: 0">
- <el-button v-show="!(!form.id || viewDisabled)" type="danger" :loading="buttonLoading"
- :disabled="!form.id || viewDisabled" size="small">
- 售 后<i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item @click.native="applySettlement('申请')" :disabled="isApplySettlement">申请退款
- </el-dropdown-item>
- <!-- <el-dropdown-item @click.native="confirmRefundBtn('确认')" :disabled="isConfirmRefundBtn">确认退款
- </el-dropdown-item>-->
- <el-dropdown-item @click.native="revocationRequest('撤销')" :disabled="isRevocationRequest">撤销请核
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <el-dropdown style="line-height: 0">
- <el-button type="warning" :loading="buttonLoading" :disabled="!form.id || viewDisabled"
- size="small">
- 审 批<i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item @click.native="examineBtn('审批')"
- :disabled="isExamineBtn && !detailData.check||form.checkStatus=='审核完成'">审批
- </el-dropdown-item>
- <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">审核进度
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </div>
- </div>
- <div style="margin-top: 50px">
- <trade-card title="基础信息">
- <avue-form :option="optionForm" v-model="form" ref="form">
- <tempalte slot="customerName" slot-scope="{ row }">
- <search-query :datalist="customerData" :selectValue="form.customerName" :clearable="true"
- :buttonIf="false" :filterable="true" :remote="true"
- :disabled="findObject(optionForm.column, 'customerName').disabled || form.businessSource == '外部销售' || isDisabledTask"
- placeholder="请选择客户" :forParameter="{ key: 'id', label: 'cname', value: 'cname' }"
- @corpFocus="KHgetListfun" @remoteMethod="KHgetListfun" @corpChange="KHcorpChange"
- @corpClear="KHClear">
- </search-query>
- </tempalte>
- <template slot-scope="{row,index}" slot="contacts">
- <el-select v-model="form.contacts" placeholder="请选择" size="small" style="width:60%" clearable
- filterable allow-create default-first-option @change="contactsChange($event)"
- :disabled=isContacts>
- <el-option v-for="item in contactsOption" :key="item.id" :label="item.contacts"
- :value="item.contacts" />
- </el-select>
- </template>
- </avue-form>
- </trade-card>
- <trade-card title="明细信息">
- <el-tabs v-model="activeName" type="card">
- <el-tab-pane label="销售明细" name="sale_detail">
- <avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts"
- :data="form.orderItemsList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
- @row-close="rowClose" :before-close="beforeClose" @selection-change="selectionContacts"
- @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)"
- @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)">
- <template slot-scope="{scope,row}" slot="menuLeft">
- <el-button type="primary" icon="el-icon-plus" size="small" :disabled="isAddBtn"
- @click="rowAdd(row)">添加商品</el-button>
- <el-button type="success" size="small" :disabled="isAddBtn" icon="el-icon-bottom"
- @click="excelDialogfun('名称')">按名称导入
- </el-button>
- <el-button type="success" size="small" :disabled="isAddBtn" icon="el-icon-bottom"
- @click="excelDialogfun('code')">按Code导入
- </el-button>
- <el-button type="primary" icon="el-icon-printer" size="small"
- @click="handlePrint">打印</el-button>
- <el-button type="danger" plain size="small" @click="batchDelete"
- :disabled="form.generateTask == '已生成' || form.businessSource == '外部销售'">一键删除</el-button>
- <el-button type="primary" plain size="small" @click="quickCopy">快捷复制</el-button>
- </template>
- <template slot="goodsId" slot-scope="{ row }">
- {{ row.goodsName }}
- </template>
- <template slot="goodsNum" slot-scope="{ row }">
- <el-input v-if="!mingxibaocun && form.businessSource != '外部销售'" size="small"
- v-model="row.goodsNum" style="width: 100%" @blur="goodsNumblurfun(row)"></el-input>
- <span v-else>{{ row.goodsNum }}</span>
- </template>
- <template slot="price" slot-scope="{ row }">
- <el-input v-if="!mingxibaocun && form.businessSource != '外部销售'" size="small"
- v-model="row.price" style="width: 100%"></el-input>
- <span v-else>{{ row.price }}</span>
- </template>
- <template slot="dot" slot-scope="{ row }">
- <el-select v-if="!mingxibaocun" v-model="row.dot" filterable default-first-option
- @focus="picihaolistfun(row.goodsId)" @change="dotchangefun($event, row)">
- <el-option v-for="(item, index) in picihaolist" :key="index" :label="item.dot"
- :value="item.dot"></el-option>
- </el-select>
- <span v-else>{{ row.dot }}</span>
- </template>
- <template slot="subTotalMoney" slot-scope="{ row }">{{ row.goodsNum * row.price
- }}</template>
- <template slot="remarks" slot-scope="{ row }">
- <el-input v-if="!mingxibaocun" size="small" v-model="row.remarks"
- style="width: 100%"></el-input>
- <span v-else>{{ row.remarks }}</span>
- </template>
- <!-- <template slot-scope="{scope,row}" slot="goodsNum">
- <el-input size="small" v-model="formContacts.goodsNum" style="width: 100%">
- <template slot="inventory">{{ inventory }}吨</template>
- </el-input>
- </template> -->
- <!--<template slot="goodsId" slot-scope="{ row, index }">-->
- <!-- <span v-if="!mingxibaocun" style="display:flex">-->
- <!-- <el-select v-model="row.goodsId" placeholder="请选择" size="small" filterable-->
- <!-- style="width:60%">-->
- <!-- <el-option v-for="item in goodsListShow" :key="item.id" :label="item.cname"-->
- <!-- :value="item.id">-->
- <!-- </el-option>-->
- <!-- </el-select>-->
- <!-- <!–<el-button icon="el-icon-search" size="small" @click="canmefalse()"></el-button>–>-->
- <!-- </span>-->
- <!-- <span v-else>{{row.goodsName}}</span>-->
- <!--</template>-->
- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
- <el-button v-if="mingxibaocun" :size="size" :disabled="disabled || isAdd" :type="type"
- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
- @click="hangeditBtn(row, index)">编辑
- </el-button>
- <el-button v-else :size="size" :disabled="disabled || isAdd" :type="type"
- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
- @click="hangbaocun(row, index)">保存
- </el-button>
- <el-button icon="el-icon-delete" :size="size" :disabled="disabled || isDisabled"
- :type="type" @click="rowDelBox(row, index, 'orderItemsList')">删除
- </el-button>
- </template>
- </avue-crud>
- <el-dialog title="导入明细" append-to-body :visible.sync="excelBox" v-if="excelBox" width="555px"
- :close-on-click-modal="false" v-dialog-drag>
- <avue-form :option="excelOption" v-model="excelForm" table-loading="excelLoading"
- :upload-before="uploadBefore" :upload-after="uploadAfter">
- <template slot="excelTemplate">
- <el-button type="primary" @click="derivation">
- 点击下载<i class="el-icon-download el-icon--right"></i>
- </el-button>
- </template>
- </avue-form>
- <p style="text-align: center;color: #DC0505">
- 温馨提示 第一次导入时请先下载模板
- </p>
- </el-dialog>
- </el-tab-pane>
- <el-tab-pane label="支付明细" name="payment_details">
- <avue-crud :option="optionPaymentDetails" v-model="formContacts" ref="payment_details"
- :data="dataList" @row-save="rowSave" @row-update="rowUpdate"
- @resetColumn="resetColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 269.2)"
- @saveColumn="saveColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 269.2)">
- <!-- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
- <el-button :size="size" :disabled="disabled" :type="type"
- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
- @click="$refs.formContacts.rowCell(row, index)">{{ row.$cellEdit ? '确认' : '修改' }}
- </el-button>
- <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
- @click="rowDelBox(row, index, 'paymentRecordsList')">删除
- </el-button>
- </template> -->
- </avue-crud>
- </el-tab-pane>
- <el-tab-pane label="出库记录" name="outbound_records">
- <avue-crud :option="optionOutboundRecords" v-model="formContacts" ref="outbound_records"
- :data="form.outboundRecordsList" @row-save="rowSave" @row-update="rowUpdate"
- @resetColumn="resetColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 269.3)"
- @saveColumn="saveColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 269.3)">
- <!-- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
- <el-button :size="size" :disabled="disabled" :type="type"
- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
- @click="$refs.formContacts.rowCell(row, index)">{{ row.$cellEdit ? '确认' : '修改' }}
- </el-button>
- <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
- @click="rowDelBox(row, index)">删除
- </el-button>
- </template> -->
- </avue-crud>
- </el-tab-pane>
- </el-tabs>
- </trade-card>
- <report-dialog :switchDialog="switchDialog" :reportName="reportName" :reportId="form.id"
- @onClose="onClose()"></report-dialog>
- <el-dialog append-to-body title="审批" class="el-dialogDeep" :visible.sync="checkDialog" width="50%"
- :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
- <check :checkData="checkData" :checkDetail="true" :idList="[]" @operationType="operationType"
- @choceCheckFun="choceCheckFun">
- </check>
- </el-dialog>
- <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
- :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
- <check-schedule :checkId="checkId" :batchNo="batchNo"
- @choceScheduleFun="choceScheduleFun"></check-schedule>
- </el-dialog>
- </div>
- <el-dialog title="选择商品" append-to-body class="el-dialogDeep" :visible.sync="dialogVisible" width="80%"
- :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" @close="closeGoods">
- <el-row :style="{ height: rowHeight }">
- <el-col :span="5" style="height: 100%;overflow-y: auto">
- <div>
- <el-scrollbar>
- <basic-container>
- <avue-tree :option="treeOption" :data="treeDataGoods" @node-click="nodeClick" />
- </basic-container>
- </el-scrollbar>
- </div>
- </el-col>
- <el-col :span="19">
- <basic-container>
- <avue-crud :option="optionTwo" :table-loading="loading" :data="goodsListShow" ref="crud"
- :search.sync="SelectSearch" @refresh-change="refreshChange"
- @selection-change="selectionChange" @search-change="goodsSearch" :page.sync="page"
- @on-load="onLoadfun" @resetColumn="resetCrud" @saveColumn="saveCrud">
- <template slot="menuLeft">
- <el-tabs v-model="activeNameTabs" @tab-click="tabHandle">
- <el-tab-pane label="查询结果" name="searchList" />
- <el-tab-pane label="已选定数据" name="importStaging" />
- </el-tabs>
- </template>
- <template slot="goodsNum" slot-scope="{row}">
- <el-input-number v-model="row.goodsNum" size="small" :controls="false" :precision="0"
- @input="amountChange($event, row)" style="width: 100%" />
- </template>
- <template slot="dot" slot-scope="{row}">
- <!--使用allow-create属性即可通过在输入框中输入文字来创建新的条目。注意此时filterable必须为真。-->
- <!--本例还使用了default-first-option属性, 在该属性打开的情况下,按下回车就可以选中当前选项列表中的第一个选项,-->
- <!--无需使用鼠标或键盘方向键进行定位。-->
- <!--allow-create filterable default-first-option-->
- <el-select v-model="row.dot" filterable default-first-option
- @focus="picihaolistfun(row.id)" @change="dotchangefun($event, row)">
- <el-option v-for="(item, index) in picihaolist" :key="index" :label="item.dot"
- :value="item.dot"></el-option>
- </el-select>
- <!--<span v-else>{{ row.dot }}</span>-->
- </template>
- <template slot="price" slot-scope="{row}">
- <el-input-number v-model="row.price" size="small" :controls="false"
- style="width: 100%" />
- </template>
- <template slot-scope="scope" slot="menu">
- <el-button type="text" icon="el-icon-edit" size="small"
- @click.stop="importStagList(scope.row, scope.index)"
- v-if="activeNameTabs == 'searchList'"
- :disabled="goodsListSave.findIndex(item => item.id == scope.row.id) !== -1">选择
- </el-button>
- <el-button type="text" icon="el-icon-delete" size="small"
- @click.stop="removeStagList(scope.row, scope.index)" v-else>移除
- </el-button>
- </template>
- <template slot="inventory" slot-scope="scope">
- <span style="color: #489fef">{{ scope.row.inventory.slice(0,
- scope.row.inventory.indexOf('.')) }}</span>
- </template>
- </avue-crud>
- </basic-container>
- </el-col>
- </el-row>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false" :loading="saveLoading">取 消</el-button>
- <el-button type="primary" @click="importGoods" v-if="commodityData !== true"
- :loading="saveLoading">导入</el-button>
- <!--<el-button type="primary" @click="importChoice" v-if="commodityData === true" :loading="saveLoading"-->
- <!-- :disabled="tableData.length !== 1">导入</el-button>-->
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import { getDetails as getCustom } from "@/api/tirePartsMall/basicData/customerInformation"
- import { getDetails as getDetailsGods } from '@/api/tirePartsMall/basicData/commodityInformation'
- import {
- getDetails,
- submit,
- generateShipTask,
- tradingBox,
- delOrderItem,
- checkOrder,
- confirmRefund,
- revokeCheckOrder,
- goodsListXs,
- revokeGenerateShipTask, goodsPageXs,
- generateReturns,
- whetherExistenceFinancing,
- checkOrderRW,
- revokeCheckOrderRW,
- getParamservice
- } from "@/api/tirePartsMall/salesManagement/saleOrder";
- import { dotList, goodsDetail } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
- import reportDialog from "@/components/report-dialog/main";
- import { dateFormat } from "@/util/date";
- import checkSchedule from "@/components/checkL/checkSchedule";
- import check from "@/components/checkL/check";
- import { getList, listAll } from "@/api/tirePartsMall/basicData/listingManagement"
- import commodityxsho from '../../configuration/commodityxsho.json'
- import TicketDistribution from "../../../oceanShipping/maritimeExport/components/ticketDistribution.vue";
- import M from "minimatch";
- import da from "element-ui/src/locale/lang/da";
- import { number } from "echarts";
- import { getCorpTypes } from "@/api/tirePartsMall/basicData/commodityInformation";
- import { getWorkDicts } from "../../../../api/system/dictbiz";
- import losbfeestemplate from "@/views/iosBasicData/losbfeestemplate/index.vue";
- import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
- import {
- getList as KHgetList
- } from "@/api/tirePartsMall/basicData/customerInformation";
- import { getToken } from "@/util/auth";
- export default {
- name: "detailsPage",
- data() {
- return {
- excelBox: false,
- reportName: '', // 打印传的名字
- SelectSearch: {}, // 添加商品检索
- // 编辑还是保存
- mingxibaocun: true,
- // 批次号请求到的数据
- picihaolist: [],
- // 添加商品弹窗
- dialogVisible: false,
- // 弹窗高度
- rowHeight: '',
- // 左侧选择搜索
- treeDataGoods: [],
- treeDeptId: '',
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
- pageSizes: [10, 50, 100, 300, 500]
- },
- pageList: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- // 左侧选择
- treeOption: {
- addBtn: false,
- menu: false,
- size: "small",
- props: {
- labelText: "标题",
- label: "title",
- value: "id",
- }
- },
- templateUrl: '', // 模板url
- // 表格需要的配置
- optionTwo: commodityxsho,
- loading: false,
- // 商品列表数据合计
- goodsListShow: [],
- // 商品列表暂存
- goodsListSave: [],
- saveLoading: false,
- commodityData: false,
- surplusRouteQuantityOption: [],
- tableData: [],
- // tabs切换
- activeNameTabs: 'searchList',
- data: [],
- courierCompaniesList: [],
- inventory: 0,
- isStatus: 1,
- goodsIdoptions: [],
- dataList: [],
- dicUrlWithCustomId: '',
- sharedCompanyId: 0,
- isAddBtn: true, // 添加商品的是否禁用
- isSaveBtn: false, // 大保存的是否禁用
- viewDisabled: false, // 大审批的是否禁用
- isAdd: false, // 表格按钮的是否点击
- editButton: true, // 大编辑大隐藏显示
- isEditButton: false, // 大编辑是否禁用
- goods: [],
- isDisabled: false, // 表格删除的是否禁用
- isDisabledTask: false, // 撤销任务和生成任务的是否禁用
- contactsOption: [],
- isContacts: false, // 表单的联系人是否禁用
- checkData: {},
- buttonText: '生成任务', // 生成任务和撤销任务文本
- buttonColor: 'success', // 初始颜色为success 生成任务和撤销任务颜色状态
- checkScheduleDialog: false, // 审批进度的弹窗开启关闭
- isApplySettlement: true, // 申请退款的是否禁用
- isConfirmRefundBtn: true, // 确认退款的是否禁用
- isExamineBtn: true, // 审批是否禁用
- isRevocationRequest: true, // 撤销审核是否禁用
- checkDialog: false, // 审核弹窗的开启关闭
- checkId: '',
- batchNo: '',
- switchDialog: false, // 打印弹窗的开启和关闭
- activeName: "sale_detail",
- disabled: false, // 表格按钮的禁用
- key: 0,
- form: {
- orderItemsList: [],
- paymentRecordsList: [],
- outboundRecordsList: []
- },
- excelOption: {
- submitBtn: false,
- emptyBtn: false,
- column: [
- {
- label: "模板下载",
- prop: "excelTemplate",
- formslot: true,
- span: 24
- },
- {
- label: "导入明细",
- prop: "excelFile",
- type: "upload",
- drag: true,
- loadText: "上传中,请稍等",
- accept: '.xls,.xlsx',
- span: 24,
- propsHttp: {
- res: "data"
- },
- tip: "请上传 .xls,.xlsx 标准格式文件",
- action: "/api/blade-sales-part/ship/import-item"
- }
- ]
- },
- customerData: [], // 客户数据
- optionForm: {
- menuBtn: false,
- span: 8,
- disabled: false,
- column: [{
- label: '客户',
- prop: "customerName",
- disabled: false,
- formslot: true,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- },
- // {
- // label: '客户',
- // prop: "customerId",
- // disabled: false,
- // remote: true,
- // type: 'select',
- // props: {
- // label: 'cname',
- // value: 'id',
- // res:'data.records'
- // },
- // cascader: ['recAddress'],
- // click: () => {
- // this.$refs.form.dicInit()
- // },
- // change: (data) => {
- // if (!this.onLoad.id) {
- // // this.$set(this.optionContactsBack, "addBtn", true)
- // // this['optionContacts'] = this['optionContactsBack'];
- // // this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
- // }
- // if (this.$refs.form.DIC.customerId || !this.onLoad.id) {
- // getCustom({ id: data.value }).then(res => {
- // if (res.data.data) {
- // this.dicUrlWithCustomId = res.data.data.id ? res.data.data.id : ''
- // // this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
- // // this.form.storageId = res.data.data.deliveryWarehouseId
- // this.form.storageId = this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
- // this.form.contacts = res.data.data.corpsAttnList[0].cname
- // this.form.phone = res.data.data.corpsAttnList[0].tel
- // this.contactsOption = res.data.data.corpsAddrList
- // this.form.recAddress = res.data.data.corpsAddrList[0].belongtoarea + res.data.data.corpsAddrList[0].detailedAddress
- // this.form.salerId = res.data.data.salesmanId?res.data.data.salesmanId:''
- // }
- // })
- // }
- //
- // // if (this.$refs.form.DIC.customerId || data.value) {
- // // for (let item of this.$refs.form.DIC.customerId) {
- // // if (item.id == data.value) {
- // // console.log(data);
- // // console.log(this.$refs.form);
- // // console.log(item);
- // // // 后端返回数据暂无联系人、地址等数据,无法下拉默认
- // // this.form.phone = item.tel
- // // }
- // // }
- // // }
- // },
- // // dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=KH&enableOrNot=1',
- // dicUrl: '/api/blade-sales-part/corpsDesc/list?cname={{key}}&corpType=KH',
- // rules: [{
- // required: true,
- // message: " ",
- // trigger: "blur"
- // }]
- // },
- {
- label: '业务员',
- disabled: false,
- prop: "salerId",
- type: "select",
- props: {
- label: "name",
- value: "id"
- },
- dicUrl: "/api/blade-user/salerList",
- filterable: true,
- // rules: [{
- // required: true,
- // message: " ",
- // trigger: "blur"
- // }]
- }, {
- label: '仓库',
- prop: "storageId",
- type: 'select',
- disabled: false,
- placeholder: '仓库为空即为异地销售',
- props: {
- label: 'cname',
- value: 'id'
- },
- dicUrl: '/api/blade-sales-part/storageDesc/listAll',
- // rules: [{
- // required: true,
- // message: " ",
- // trigger: "blur"
- // }]
- },
- {
- label: '联系人',
- type: "select",
- prop: "contacts",
- disabled: false,
- allowCreate: true,
- filterable: true,
- dicData: [],
- props: {
- label: 'address',
- value: 'id'
- },
- dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
- }, {
- label: '电话',
- disabled: false,
- prop: "phone",
- }, {
- label: '收货地址',
- prop: "recAddress",
- type: 'select',
- allowCreate: true,
- filterable: true,
- disabled: false,
- props: {
- label: 'address',
- value: 'address'
- },
- dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
- }, {
- label: '业务日期',
- prop: "businesDate",
- searchProp: "businesDateList",
- disabled: false,
- type: "datetime",
- value: dateFormat(new Date(), 'yyyy-MM-dd'),
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd",
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ]
- }, {
- label: '收款方式',
- prop: "receivableType",
- type: "select",
- disabled: false,
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=receivableType",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- value: '网络支付'
- },
- {
- label: '业务来源',
- prop: "businessSource",
- disabled: true
- }, {
- label: '配送方式',
- type: 'select',
- prop: "shipType",
- disabled: false,
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=deliveryMethod",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- value: '物流',
- }, {
- label: '货运公司',
- type: 'select',
- prop: "logisticsCorpName",
- allowCreate: true,
- filterable: true,
- disabled: false,
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=tyre_express_company",
- props: {
- label: "dictValue",
- value: "dictValue"
- }
- },
- {
- label: '货运单号',
- disabled: false,
- prop: "expressNo"
- },
- {
- label: '成本',
- prop: "cost",
- display: false,
- disabled: true
- }, {
- label: '毛利',
- prop: "grossProfit",
- display: false,
- disabled: true
- }, {
- label: '销售金额',
- prop: "salesAmount",
- disabled: true
- }, {
- label: '运费',
- prop: "freight",
- disabled: true
- }, {
- label: '总金额',
- prop: "totalMoney",
- disabled: true
- }, {
- label: '已收金额',
- prop: "paymentAmountTl",
- disabled: true
- }, {
- label: '单据编号',
- prop: "ordNo",
- disabled: true
- }, {
- label: '来源单号',
- prop: "srcOrdNo",
- disabled: true
- }, {
- label: '退货数量',
- prop: "returnsNumber",
- disabled: true
- }, {
- label: '退货金额',
- prop: "returnsAmount",
- disabled: true
- }, {
- label: '备注',
- prop: "remarks",
- type: 'textarea',
- disabled: false,
- span: 16,
- minRows: 1
- }]
- },
- formContacts: {},
- optionContacts: {},
- optionContactsBack: {
- disabled: false,
- goodsId: '',
- border: true,
- align: 'center',
- index: true,
- addBtnText: "添加商品",
- updateBtnText: '保存',
- refreshBtn: false,
- dialogDrag: true,
- addBtn: false,
- // 航编辑开启
- cellBtn: true,
- span: 8,
- height: 500,
- addRowBtn: false,
- editBtn: false,
- delBtn: false,
- menuWidth: 140,
- dialogTop: 25,
- dialogWidth: "80%",
- summaryText: "合计",
- showSummary: true,
- selection: true,
- sumColumnList: [{
- name: "goodsNum",
- type: "sum"
- }, {
- name: "sendNum",
- type: "sum"
- }, {
- name: "profit",
- type: "sum"
- }, {
- name: "subTotalMoney",
- type: "sum"
- }, {
- name: "thisAmount",
- type: "sum"
- }, {
- name: "costprie",
- type: "sum"
- }, {
- name: "grossProfit",
- type: "sum"
- }, {
- name: "returnsNumber",
- type: "sum"
- }, {
- name: "returnsAmount",
- type: "sum"
- }],
- column: [{
- label: '商品名称',
- prop: 'goodsId',
- width: 250,
- disabled: false,
- remote: true,
- overHidden: true,
- hide: true,
- type: 'select',
- dicData: [],
- props: {
- label: 'goodsName',
- value: 'goodsId'
- },
- // dicUrl: '/api/blade-sales-part/goodsDesc/goodsListAll?cname={{key}}'
- dicUrl: `/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}&customId=&enableOrNot=1&stock=${this.goodsId}`
- // dicUrl: "/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}"
- }, {
- label: '商品名称',
- prop: 'goodsName',
- width: 250,
- disabled: false,
- remote: true,
- overHidden: true,
- }, {
- label: '库存',
- prop: 'inventory',
- width: 250,
- disabled: false,
- remote: true,
- overHidden: true,
- }, {
- label: '数量',
- prop: 'goodsNum',
- overHidden: true,
- disabled: false,
- cell: true,
- width: 100,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }, {
- validator: (rule, value, callback) => {
- console.log(this.formContacts.inventory);
- if (value < 0) {
- callback(new Error("数量不能小于0"));
- } else if (Number(value) > Number(this.formContacts.inventory)) {
- callback(new Error("数量不能大于库存"));
- } else {
- callback();
- }
- },
- trigger: "blur"
- }]
- },
- {
- label: '价格',
- prop: 'price',
- overHidden: true,
- width: 100,
- disabled: false,
- cell: true,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }, {
- validator: (rule, value, callback) => {
- if (value < 0) {
- callback(new Error("价格不能小于0"));
- } else {
- callback();
- }
- },
- trigger: "blur"
- }]
- },
- {
- label: '库存',
- prop: 'inventory',
- overHidden: true,
- hide: true,
- width: 100
- }, {
- label: '批次号',
- prop: 'dot',
- cell: true,
- type: "select",
- width: 120,
- disabled: true,
- allowCreate: true,
- filterable: true,
- dicData: [],
- props: {
- label: "dot",
- value: "dot"
- },
- dicUrl: "/api/blade-sales-part/stockDesc/dotList",
- overHidden: true,
- },
- // {
- // label: '单号',
- // prop: 'poNo',
- // overHidden: true,
- // disabled: false,
- // width: 100
- // },
- {
- label: '商品编码',
- prop: 'goodsNo',
- overHidden: true,
- disabled: false,
- width: 100
- },
- {
- label: '品牌',
- prop: 'brandId',
- disabled: false,
- width: 100,
- overHidden: true,
- type: 'select',
- props: {
- label: 'cname',
- value: 'id'
- },
- dicUrl: '/api/blade-sales-part/brandDesc/listAll?type=PP&enableOrNot=1'
- },
- {
- label: '规格型号',
- prop: 'propertyName',
- overHidden: true,
- disabled: false,
- width: 100
- }, {
- label: '花纹',
- prop: 'pattern',
- overHidden: true,
- disabled: false,
- width: 100
- }, {
- label: '商品描述',
- prop: 'goodsDescription',
- disabled: false,
- overHidden: true,
- width: 100
- },
- {
- label: '单位',
- prop: 'units',
- type: "select",
- disabled: false,
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
- overHidden: true,
- width: 100
- },
- {
- label: '发货数量',
- prop: 'sendNum',
- overHidden: true,
- width: 100,
- disabled: true,
- editDisplay: false,
- addDisplay: false
- },
- // {
- // label: '利润',
- // prop: 'profit',
- // overHidden: true,
- // width: 100
- // },
- {
- label: '小计',
- prop: 'subTotalMoney',
- overHidden: true,
- width: 100,
- disabled: true,
- editDisplay: false,
- addDisplay: false
- },
- // {
- // label: '返利',
- // prop: 'thisAmount',
- // overHidden: true,
- // width: 100
- // },
- {
- label: '成本',
- prop: 'costprie',
- overHidden: true,
- width: 100,
- disabled: true,
- editDisplay: false,
- addDisplay: false
- },
- {
- label: '毛利',
- prop: 'grossProfit',
- overHidden: true,
- width: 100,
- disabled: true,
- editDisplay: false,
- addDisplay: false
- },
- {
- label: '返利后单价',
- prop: 'rebatePrice',
- overHidden: true,
- width: 100,
- disabled: true,
- editDisplay: false,
- addDisplay: false
- },
- {
- label: '返利后成本价',
- prop: 'rebateCostprie',
- overHidden: true,
- width: 100,
- disabled: true,
- editDisplay: false,
- addDisplay: false
- },
- {
- label: '返利后利润',
- prop: 'rebateProfit',
- overHidden: true,
- width: 100,
- disabled: true,
- editDisplay: false,
- addDisplay: false
- },
- {
- label: '退货数量',
- prop: "returnsNumber",
- overHidden: true,
- width: 100,
- disabled: true,
- },
- {
- label: '退货金额',
- prop: "returnsAmount",
- overHidden: true,
- width: 100,
- disabled: true,
- },
- {
- label: '备注',
- prop: "remarks",
- overHidden: true,
- width: 100,
- disabled: false,
- }
- ]
- },
- selectionMultilist: [], // 多选数据
- optionPaymentDetails: {},
- optionPaymentDetailsBack: {
- align: 'center',
- index: true,
- addBtnText: "录入明细",
- menu: false,
- refreshBtn: false,
- dialogDrag: true,
- addBtn: false,
- span: 8,
- height: 600,
- addRowBtn: false,
- editBtn: false,
- delBtn: false,
- menuWidth: 140,
- dialogTop: 25,
- dialogWidth: "80%",
- column: [{
- label: '支付编号',
- prop: 'serialNumber'
- }, {
- label: '金额',
- prop: 'amount'
- }, {
- label: '类型',
- prop: 'type'
- }, {
- label: '支付时间',
- prop: 'createTime'
- }]
- },
- optionOutboundRecords: {},
- optionOutboundRecordsBack: {
- align: 'center',
- index: true,
- menu: false,
- addBtnText: "录入明细",
- refreshBtn: false,
- dialogDrag: true,
- addBtn: false,
- span: 8,
- height: 600,
- addRowBtn: false,
- editBtn: false,
- delBtn: false,
- // menuWidth: 140,
- dialogTop: 25,
- dialogWidth: "80%",
- column: [{
- label: '出库单号',
- prop: 'billno'
- },
- // {
- // label: '来源单号',
- // prop: 'ordNo'
- // },
- {
- label: '数量',
- prop: 'goodsTotalNum'
- }, {
- label: '实际数量',
- prop: 'sendTotalNum'
- }, {
- label: '业务类型',
- prop: 'bizTypeName'
- }, {
- label: '状态',
- prop: 'statusName'
- }, {
- label: '业务时间',
- prop: 'createTime'
- }]
- }
- }
- },
- components: { SearchQuery, reportDialog, check, checkSchedule },
- props: {
- onLoad: Object,
- detailData: Object
- },
- async created() {
- console.log(this.detailData.id)
- console.log(JSON.parse(localStorage.getItem('saber-tenantId')).content, 959)
- if (JSON.parse(localStorage.getItem('saber-tenantId')).content == '069164') {
- this.reportName = '轮胎商城-玉玲珑销售单'
- } else {
- this.reportName = '轮胎商城-销售订单'
- }
- // console.log(this.$route);
- // if(this.$route.query.check.actId){
- // this.isExamineBtn = false
- // }
- getWorkDicts("tyre_express_company").then(res => {
- this.courierCompaniesList = res.data.data;
- })
- this.findObject(this.optionContactsBack.column, "goodsId").change = ({ value, column }) => {
- if (this.formContacts.goodsId !== value) {
- goodsDetail({ id: value, customId: this.dicUrlWithCustomId, stock: this.form.storageId ? this.form.storageId : '' }).then(res => {
- this.goods = res.data.data
- this.formContacts.goodsNo = res.data.data.code
- this.formContacts.brandId = res.data.data.brandId
- this.formContacts.inventory = res.data.data.inventory
- // this.formContacts.brandId = res.data.data.brandName
- // this.formContacts.brandName = res.data.data.brandId
- this.formContacts.propertyName = res.data.data.specificationAndModel
- this.formContacts.pattern = res.data.data.brandItem
- this.formContacts.goodsDescription = res.data.data.goodsDescription
- this.formContacts.units = res.data.data.unit
- this.formContacts.price = res.data.data.price
- //
- this.formContacts.sharedCompanyId = res.data.data.sharedCompanyId
- console.log(res.data.data.sharedCompanyId);
- console.log(res.data.data.sharedCompanyName);
- this.form.sharedCompanyId = res.data.data.sharedCompanyId
- this.form.sharedCompanyName = res.data.data.sharedCompanyName
- this.sharedCompanyId = res.data.data.sharedCompanyId
- console.log(res.data.data.sharedCompanyId);
- console.log(this.form.orderItemsList);
- for (let i = 0; i < this.form.orderItemsList.length; i++) {
- console.log(Number(this.form.orderItemsList[i].sharedCompanyId));
- if (Number(this.form.orderItemsList[i].sharedCompanyId) != Number(res.data.data.sharedCompanyId)) {
- this.isStatus = 0
- }
- }
- if (res.data.data.whether == 0) {
- this.findObject(this.optionContactsBack.column, "dot").disabled = true
- } else {
- this.findObject(this.optionContactsBack.column, "dot").disabled = false
- dotList({
- storageId: this.form.storageId,
- goodsId: this.formContacts.goodsId
- }).then(res => {
- this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
- })
- }
- // this.formContacts.goodsId = res.data.data.cname
- // this.formContacts.goodsName = res.data.data.id
- })
- }
- }
- this.optionContacts = await this.getColumnData(this.getColumnName(269.1), this.optionContactsBack);
- this.findObject(this.optionContacts.column, "goodsId").change = ({ value, column }) => {
- if (this.formContacts.goodsId !== value) {
- goodsDetail({ id: value, customId: this.dicUrlWithCustomId, stock: this.form.storageId ? this.form.storageId : '' }).then(res => {
- this.goods = res.data.data
- this.formContacts.goodsNo = res.data.data.code
- this.formContacts.brandId = res.data.data.brandId
- this.formContacts.inventory = res.data.data.inventory
- // this.formContacts.brandId = res.data.data.brandName
- // this.formContacts.brandName = res.data.data.brandId
- this.formContacts.propertyName = res.data.data.specificationAndModel
- this.formContacts.pattern = res.data.data.brandItem
- this.formContacts.goodsDescription = res.data.data.goodsDescription
- this.formContacts.dotListunits = res.data.data.unit
- this.sharedCompanyId = res.data.data.sharedCompanyId
- this.formContacts.sharedCompanyId = res.data.data.sharedCompanyId
- //
- this.form.sharedCompanyId = res.data.data.sharedCompanyId
- this.form.sharedCompanyName = res.data.data.sharedCompanyName
- for (let i = 0; i < this.form.orderItemsList.length; i++) {
- if (this.form.orderItemsList[i].sharedCompanyId != res.data.data.sharedCompanyId) {
- this.isStatus = 0
- }
- }
- if (res.data.data.whether == 0) {
- this.findObject(this.optionContacts.column, "dot").disabled = true
- } else {
- this.findObject(this.optionContacts.column, "dot").disabled = false
- dotList({
- storageId: this.form.storageId,
- goodsId: this.formContacts.goodsId
- }).then(res => {
- this.findObject(this.optionContacts.column, "dot").dicData = res.data.data
- })
- }
- // this.formContacts.goodsId = res.data.data.cname
- // this.formContacts.goodsName = res.data.data.id
- })
- }
- }
- this.optionPaymentDetails = await this.getColumnData(this.getColumnName(269.2), this.optionPaymentDetailsBack);
- this.optionOutboundRecords = await this.getColumnData(this.getColumnName(269.3), this.optionOutboundRecordsBack);
- this.key++
- if (this.onLoad.id && this.detailData.id) {
- this.$set(this.optionForm, 'disabled', true)
- this.$set(this.optionContactsBack, 'disabled', true)
- this.isContacts = true
- this.isDisabled = true
- //添加删除按钮禁用
- this.isAdd = true
- this.refresh(this.onLoad.id, true)
- } else if (this.onLoad.id) {
- console.log(2);
- this.refresh(this.onLoad.id, true)
- }
- if (!this.form.id) {
- console.log(3);
- this.optionContactsBack.column.forEach(its => {
- if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
- its.disabled = false
- } else {
- its.disabled = true
- }
- })
- this.isSaveBtn = true;
- this.isDisabledTask = true;
- this.viewDisabled = true;
- // this.$set(this.optionContactsBack, "addBtn", false)
- this['optionContacts'] = this['optionContactsBack'];
- this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
- }
- if (!this.detailData.id) {
- this.editButton = false
- this.isAddBtn = false
- this.isDisabledTask = false;
- this.isSaveBtn = false
- this.viewDisabled = false;
- this.form.businessSource = '内部销售'
- }
- console.log('this.detailData.check', this.detailData.check);
- if (this.detailData.check) {
- this.isExamineBtn = false
- // this.batchNo = this.detailData.check.batchNo
- }
- //成本、毛利对业务员隐藏
- this.optionForm.column.forEach(its => {
- if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('业务员')) {
- if (its.prop == 'cost' || its.prop == 'grossProfit') {
- this.$set(its, 'display', false)
- }
- } else {
- if (its.prop == 'cost' || its.prop == 'grossProfit') {
- this.$set(its, 'display', true)
- }
- }
- })
- // 明细信息成本、毛利对业务员隐藏
- this.optionContacts.column.forEach(its => {
- if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('业务员')) {
- if (its.prop == 'costprie' || its.prop == 'grossProfit') {
- this.$set(its, 'hide', true)
- }
- } else {
- if (its.prop == 'costprie' || its.prop == 'grossProfit') {
- this.$set(its, 'hide', false)
- }
- }
- })
- if (this.detailData.id) {
- this.getDetailsfun()
- }
- },
- watch: {
- dicUrlWithCustomId() {
- console.log(this.form);
- // this.findObject(this.optionContactsBack.column, "goodsId").dicUrl = `/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}&customId=${this.dicUrlWithCustomId}&enableOrNot=0`
- goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
- this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
- })
- },
- 'form.storageId'(newStorageId, oldStorageId) {
- goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
- console.log(res.data.data, '2');
- this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
- })
- },
- 'form.orderItemsList.length'(newformContacts, oldformContacts) {
- console.log(this.formContacts);
- console.log(this.form.orderItemsList);
- // for (let i = 0; i < this.form.orderItemsList.length - 1; i++) {
- // const currentItem = this.form.orderItemsList[i];
- // const nextItem = this.form.orderItemsList[i + 1];
- // if (currentItem.sharedCompanyId !== nextItem.sharedCompanyId) {
- // console.log('不能添加');
- // }
- // }
- if (this.form.orderItemsList.length) {
- this.findObject(this.optionForm.column, 'storageId').disabled = true
- } else {
- this.findObject(this.optionForm.column, 'storageId').disabled = false
- }
- },
- 'form.sharedCompanyId'(newSharedCompanyId, oldSharedCompanyId) {
- console.log(newSharedCompanyId, oldSharedCompanyId);
- if (newSharedCompanyId != oldSharedCompanyId) {
- console.log('不能添加');
- }
- console.log(this.sharedCompanyId);
- },
- $route(to, from) {
- if (this.onLoad.id && this.detailData.id) {
- this.$set(this.optionForm, 'disabled', true)
- this.$set(this.optionContactsBack, 'disabled', true)
- this.isContacts = true
- this.isDisabled = true
- this.isAdd = true
- this.refresh(this.onLoad.id, true)
- } else if (this.onLoad.id) {
- this.refresh(this.onLoad.id, true)
- }
- // if (!this.form.id) {
- // console.log(3);
- // // this.$set(this.optionContactsBack, "addBtn", false)
- // this['optionContacts'] = this['optionContactsBack'];
- // this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
- // }
- // if (!this.detailData.id) {
- // this.form.businessSource = '内部销售'
- // }
- if (this.detailData.status == 1) {
- this.isExamineBtn = false;
- }
- // if (to.name == '销售订单') {
- // console.log('销售订单');
- // this.isExamineBtn = false;
- // }
- }
- },
- methods: {
- uploadAfter(res, done, loading, column) {
- if (Array.isArray(res)) {
- if (res instanceof Array) {
- this.form.orderItemsList = this.form.orderItemsList.concat(res)
- res.forEach(item => {
- dotList({
- storageId: this.form.storageId,
- goodsId: res.goodsId
- }).then(e => {
- this.findObject(this.optionContactsBack.column, "dot").dicData = e.data.data
- })
- })
- }
- } else {
- this.$message.error(res)
- }
- this.excelBox = false;
- loading = false;
- done(res);
- },
- derivation() {
- window.open(
- `${this.templateUrl}?${this.website.tokenHeader
- }=${getToken()}&stockId=${this.form.storageId}`
- );
- },
- uploadBefore(file, done, loading) {
- done();
- loading = true;
- },
- // 销售明细 导入按钮
- excelDialogfun(name) {
- if (!this.form.customerId) {
- this.$message.error('请选择客户')
- return
- }
- if (name == '名称') {
- this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/order/import-item-name'
- this.templateUrl = '/api/blade-sales-part/order/export-item-name'
- } else if (name == 'code') {
- this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/order/import-item-code'
- this.templateUrl = '/api/blade-sales-part/order/export-item-code'
- }
- this.excelBox = true
- },
- //生成退货单
- getReturns() {
- this.$confirm("您确定要退货吗?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- this.$router.push({
- path: "/tirePartsMall/salesService/returns/index",
- query: {
- bsType: 'TKXS',
- id: this.form.id,
- }
- });
- })
- },
- // 客户监听
- KHcorpChange(value) {
- for (let item of this.customerData) {
- if (item.cname == value) {
- this.$set(this.form, 'customerId', item.id)
- this.$set(this.form, 'customerName', item.cname)
- if (this.$refs.form.DIC.customerId || !this.onLoad.id) {
- getCustom({ id: item.id }).then(res => {
- if (res.data.data) {
- this.dicUrlWithCustomId = res.data.data.id ? res.data.data.id : ''
- this.form.storageId = this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
- this.form.contacts = res.data.data.corpsAttnList[0].cname
- this.form.phone = res.data.data.corpsAttnList[0].tel
- this.contactsOption = res.data.data.corpsAddrList
- this.form.recAddress = res.data.data.corpsAddrList[0].belongtoarea + res.data.data.corpsAddrList[0].detailedAddress
- this.form.salerId = res.data.data.salesmanId ? res.data.data.salesmanId : ''
- }
- })
- }
- }
- }
- },
- KHClear() {
- this.form.customerId = ''
- this.form.customerName = ''
- this.dicUrlWithCustomId = ''
- this.form.storageId = ''
- this.form.contacts = ''
- this.form.phone = ''
- this.contactsOption = ''
- this.form.recAddress = ''
- this.form.salerId = ''
- this.KHgetListfun()
- },
- // 获取客户数据
- KHgetListfun(cname) {
- KHgetList({
- current: 1,
- size: 10,
- corpType: 'KH',
- cname: cname ? cname : null,
- }).then(res => {
- this.customerData = res.data.data.records
- })
- },
- // 获取详细明细信息
- getDetailsfun() {
- getDetails({
- id: this.detailData.id
- }).then(res => {
- this.form = res.data.data
- this.form.orderItemsList = res.data.data.orderItemsList
- console.log(this.isEditButton, 'bianj')
- console.log(this.isDisabledTask, 'chexiao')
- console.log(this.buttonColor, '123')
- // if (this.form.status == '待发货') {
- //
- // }
- })
- },
- // 获取左侧筛选
- getAllWorkDicts() {
- getCorpTypes().then(res => {
- this.treeDataGoods = res.data.data;
- });
- },
- //导入页左商品类型查询
- nodeClick(data) {
- this.treeDeptId = data.id;
- this.page.currentPage = 1;
- this.onLoadfun(this.page, { ...this.SelectSearch, goodsTypeId: this.treeDeptId });
- },
- closeGoods() {
- this.treeDataGoods = [];
- this.treeDeptId = "";
- this.activeNameTabs = "searchList";
- },
- //刷新触发
- refreshChange() {
- this.page.currentPage = 1;
- this.onLoadfun(this.page);
- },
- //选中触发
- selectionChange(list) {
- this.tableData = list
- },
- // 点击搜索触发
- goodsSearch(params, done) {
- this.page.currentPage = 1;
- params = {
- ...params,
- artsVision: this.form.belongToCorpId,
- }
- // params.specificationAndModel = params.cname
- // delete params.cname
- this.onLoadfun(this.page, params);
- done()
- },
- // 标签页切换
- tabHandle(data) {
- if (data.name == 'searchList') {
- this.goodsListShow = this.data;
- this.page.total = this.pageList.total
- } else if (data.name == 'importStaging') {
- this.goodsListShow = this.goodsListSave;
- this.page.total = 0
- }
- },
- // 商品信息价格计算
- amountChange(value, row) {
- if (value > 0) {
- this.$refs.crud.toggleRowSelection(row, true);
- } else {
- this.$refs.crud.toggleRowSelection(row, false);
- }
- // 价格
- // if (!row.price) {
- // row.price = 0;
- // }
- },
- importStagList(row, index, type) {
- this.goodsListSave.push(row);
- },
- removeStagList(row, index, type) {
- this.goodsListSave.splice(row.$index, 1)
- },
- //确认导入触发
- async importGoods() {
- this.surplusRouteQuantityOption.push({ storageQuantity: '0' });
- if (this.goodsListSave.length > 0) {
- this.goodsListSaveHandle()
- } else {
- if (this.tableData.length > 0) {
- this.tableDataHandle()
- }
- }
- },
- // 导入按钮事件
- tableDataHandle() {
- // 循环获取库存数量
- for (let item of this.tableData) {
- let page = {}
- if (this.form.storageId) {
- page.storageId = this.form.storageId
- }
- page.goodsId = item.goodsId
- let obj = {
- goodsId: item.id,
- price: item.price,
- goodsName: item.cname,
- goodsNum: item.goodsNum,
- brandName: item.brandName,
- brandId: item.brandId,
- goodsNo: item.code,
- propertyName: item.specificationAndModel,
- inventory: item.inventory,
- pattern: item.brandItem,
- goodsDescription: item.goodsDescription,
- dot: item.dot,
- // poNo: item.poNo,
- whether: item.whether,
- units: item.unit,
- // 小计
- subTotalMoney: Number(item.goodsNum * item.price)?Number(item.goodsNum * item.price).toFixed(2):0,
- // 备注
- remarks: item.remarks,
- // 批次号的状态
- dotedittype: false,
- // 价格数量
- goodsNumtype: false,
- // 价格
- pricetype: false,
- }
- for (let ite of item.goodsFilesList) {
- if (ite.version == '0') {
- obj.url = ite.url
- }
- }
- this.form.orderItemsList.push(obj)
- }
- this.dialogVisible = false
- },
- // 导入
- goodsListSaveHandle() {
- this.tableData = this.goodsListSave
- this.tableDataHandle()
- },
- // 获取添加商品弹窗里的数据
- goodsPageXsfun() {
- goodsPageXs({
- customId: this.form.customerId,
- stock: this.form.storageId,
- enableOrNot: 1
- }).then(res => {
- const data = res.data.data;
- this.goodsListShow = data.records;
- })
- },
- //导入商品弹窗列表查询
- onLoadfun(page, params = { artsVision: this.form.belongToCorpId }) {
- console.log(params)
- this.loading = true;
- goodsPageXs({
- current: page.currentPage,
- size: page.pageSize,
- customId: this.form.customerId,
- stock: this.form.storageId,
- enableOrNot: 1,
- goodsTypeId: this.treeDeptId,
- ...Object.assign(params, this.SelectSearch),
- }).then(res => {
- const data = res.data.data;
- this.page.total = data.total;
- this.pageList.total = data.total
- this.data = data.records;
- this.goodsListShow = data.records;
- for (let item of this.goodsListShow) {
- item.goodsNum = item.goodsNum ? item.goodsNum : 0
- }
- // // 获取单价数据
- // for(let item of this.goodsListShow) {
- // let page = {}
- // if (this.form.storageId) {
- // page.storageId = this.form.storageId
- // }
- // page.goodsId = item.goodsId
- // dotList(page).then(res=>{
- // // console.log(res.data.data[0].inventoryCostPrice)
- // item.price = res.data.data[0].inventoryCostPrice
- // // console.log(item)
- // })
- // }
- this.loading = false;
- })
- },
- // 采购明细行编辑
- hangeditBtn(row, index) {
- // 获取是否管理批次号
- getDetailsGods({ id: row.goodsId }).then(res => {
- row.whether = res.data.data.whether
- this.picihaolistfun(row.id)
- row.dotedittype = true
- // 价格数量
- row.goodsNumtype = true
- row.pricetype = true
- // 编辑和保存状态切换
- this.mingxibaocun = false
- this.goodsPageXsfun()
- })
- },
- // 保存按钮
- hangbaocun(row) {
- row.dotedittype = false
- row.goodsNumtype = false
- row.pricetype = false
- this.mingxibaocun = true
- },
- // 批次号获取数据
- picihaolistfun(goodsId) {
- dotList({
- storageId: this.form.storageId,
- goodsId: goodsId
- }).then(res => {
- this.picihaolist = res.data.data
- })
- },
- // 批次号切换库存
- dotchangefun(value, row) {
- for (let item of this.picihaolist) {
- if (item.dot == value) {
- this.$set(row, 'inventory', item.balanceQuantity)
- this.$set(row, 'rebatePrice', item.rebatePrice)
- }
- }
- },
- // 数量失焦触发
- goodsNumblurfun(row) {
- if (Number(row.goodsNum) > Number(row.inventory)) {
- this.$message.warning("不能大于库存数量");
- return
- }
- },
- editBtn(row, index) {
- this.confirmEditing()
- this.$refs.formContacts.rowEdit(row, index);
- dotList({
- storageId: this.form.storageId,
- goodsId: this.formContacts.goodsId
- }).then(res => {
- this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
- })
- goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
- this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
- })
- },
- //表头编辑
- confirmEditing() {
- this.editButton = false
- goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
- this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
- })
- if (this.form.status == '已发货') {
- this.viewDisabled = false
- return
- }
- /* if (this.form.status == '退款中') {
- this.viewDisabled = false
- this.isRevocationRequest = true
- return
- }*/
- this.isAddBtn = false
- if (this.form.status == '已取消' || this.form.status == '已退款' || this.form.status == '已发货') {
- return
- // this.$message.error('当前状态不允许编辑')
- // this.optionForm.column.forEach(item=>{
- // if(item.prop= 'contacts'){
- // item.disabled = true
- // }
- // })
- }
- if (this.form.status == '退款请核') {
- this.viewDisabled = false
- this.isAddBtn = true
- return
- }
- if (this.form.status == '已取消' || this.form.status == '退款请核') {
- this.isAddBtn = true
- // this.$message.error('当前状态不允许编辑')
- // this.optionForm.column.forEach(item=>{
- // if(item.prop= 'contacts'){
- // item.disabled = true
- // }
- // })
- }
- if (this.form.status == '待发货') {
- this.isAddBtn = true
- }
- this.optionContactsBack.column.forEach(its => {
- if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
- its.disabled = false
- } else {
- its.disabled = true
- }
- })
- this.$set(this.optionForm, 'disabled', false)
- this.$set(this.optionContactsBack, 'disabled', false)
- if (this.form.generateTask == '已生成') {
- this.optionForm.disabled = true
- }
- this.isDisabled = false
- this.isAdd = false
- if (this.form.businessSource == "外部销售") {
- this.optionForm.column.forEach(its => {
- if (its.prop == 'contacts' || its.prop == 'phone' || its.prop == 'recAddress') {
- this.$set(its, 'disabled', true)
- }
- })
- if (this.form.status == '待发货') {
- this.isSaveBtn = false;
- this.isDisabledTask = false;
- this.viewDisabled = false;
- }
- if (this.form.status == '待确认') {
- const loadings = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- console.log('外部销售待确认');
- this.isSaveBtn = false;
- this.isDisabledTask = false;
- this.viewDisabled = false;
- this.optionForm.column.forEach(its => {
- if (its.prop == 'customerName') {
- this.$set(its, 'disabled', true)
- }
- if (its.prop == 'storageId') {
- this.$set(its, 'disabled', false)
- }
- })
- //外部销售都能申请退款
- this.isApplySettlement = false
- //不能录入不能删除
- this.isDisabled = true
- this.isAdd = false
- this.isAddBtn = true
- this.$set(this.form, 'shipType', '物流')
- this.$set(this.form, 'receivableType', '网络支付')
- this.optionContactsBack.column.forEach(item => {
- this.$set(item, 'disabled', true)
- if (item.label == '批次号' || item.label == '备注') {
- item.disabled = false
- }
- })
- loadings.close()
- } else {
- const loadin = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- this.isAddBtn = true
- this.isDisabled = true
- this.isSaveBtn = false;
- this.isDisabledTask = false;
- this.viewDisabled = false;
- this.optionForm.column.forEach(its => {
- if (its.prop != 'remarks') {
- its.disabled = true
- } else {
- its.disabled = false
- }
- })
- this.optionContactsBack.column.forEach(its => {
- if (its.prop != 'remarks') {
- its.disabled = true
- } else {
- its.disabled = false
- }
- })
- loadin.close()
- }
- } else {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- if (this.form.status == '待发货' || this.form.status == '已发货' || this.form.status == '已取消') {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- this.optionForm.column.forEach(its => {
- if (its.prop != 'remarks') {
- its.disabled = true
- } else {
- its.disabled = false
- }
- })
- this.optionContactsBack.column.forEach(its => {
- if (its.prop != 'remarks') {
- its.disabled = true
- } else {
- its.disabled = false
- }
- })
- loading.close()
- } else if (this.form.status == '录入') {
- this.isSaveBtn = false;
- this.isDisabledTask = false;
- this.viewDisabled = false;
- // this.$set(this.optionForm, 'disabled', false)
- // this.$set(this.optionContactsBack, 'disabled', false)
- this.$set(this.optionForm, 'disabled', false)
- this.$set(this.optionContactsBack, 'disabled', false)
- this.isContacts = true
- //删除按钮
- this.isDisabled = false
- // this.optionForm.column.forEach(item => {
- // item.disabled = false
- // })
- loading.close()
- } else if (this.form.status == '待确认') {
- this.isSaveBtn = false;
- this.isDisabledTask = false;
- this.viewDisabled = false;
- // this.isDisabled = true
- console.log('待确认');
- this.optionForm.column.forEach(item => {
- if (item.label === '成本' || item.label === '毛利' || item.label === '销售金额' || item.label === '运费' || item.label === '总金额' || item.label === '已收金额' || item.label === '单据编号' || item.label === '来源编号') {
- this.$set(item, 'disabled', true)
- } else {
- this.$set(item, 'disabled', false)
- }
- })
- this.isContacts = false
- this.optionContactsBack.column.forEach(its => {
- if (its.prop == 'remarks' || its.prop == 'dot') {
- this.$set(its, 'disabled', false)
- } else {
- this.$set(its, 'disabled', true)
- }
- })
- loading.close()
- }
- if (this.form.status == '待发货') {
- this.isSaveBtn = false;
- this.isDisabledTask = false;
- this.viewDisabled = false;
- this.isDisabled = true
- this.isAdd = true
- }
- // this.$set(this.form, 'shipType', '物流')
- // this.$set(this.form, 'receivableType', '现金')
- // this.optionContactsBack.column.forEach(item => {
- // this.$set(item, 'disabled', false)
- // })
- // this.optionContactsBack.column.forEach(item => {
- // if (item.label === '规格型号' || item.label === '花纹' || item.label === '品牌' || item.label === '物料编码' || item.label === '单位' || item.label === '轮胎描述') {
- // item.disabled = true;
- // }
- // })
- // this['optionContacts'] = this['optionContactsBack'];
- // this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
- // this.form.outboundRecordsList.forEach(item=>{
- // if(item.statusName == '待出库'){
- // this.isDisabledTask = true
- // }
- // })
- loading.close()
- }
- // this.$set(this.form.orderItemsList,'goodsNum',66)
- },
- generateOutbound() {
- if (!this.form.id) {
- this.$message.error('请先保存')
- } else {
- if (this.buttonText === '生成任务') {
- //生成任务逻辑
- if (this.form.orderItemsList.length <= 0) {
- this.$message.error('请录入明细');
- } else {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- getParamservice(1, 10, { paramKey: 'whether.financing' }).then(res => {
- if (res.data.data.records.length) {
- res.data.data.records.forEach(e => {
- if (e.paramValue == 1) {
- if(!this.form.storageId) return this.$message.error('请选择仓库')
- whetherExistenceFinancing({
- bsType: "XS",
- ...this.form
- }).then(res => {
- if (res.data.data == true) {
- submit({
- bsType: "XS",
- ...this.form
- }).then(res => {
- // this.refresh(res.data.data.id)
- this.isDisabledTask = false
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- generateShipTask(this.form).then(res => {
- this.$set(this.optionForm, 'disabled', true)
- this.$set(this.optionContactsBack, 'disabled', true)
- this.$message.success("生成出库任务成功");
- // 将按钮文本更改为"撤销任务"
- this.buttonText = '撤销任务';
- // 将按钮颜色更改为对应的颜色
- this.buttonColor = 'warning'; // 比如改为warning
- this.refresh(res.data.data.id)
- this.refreshs(res.data.data.id, true)
- this.isContacts = true
- this.isApplySettlement = false
- this.isAdd = true
- this.isDisabled = true
- this.isAddBtn = true
- this.isDisabledTask = true
- this.editButton = true // 把编辑按钮显示出来
- }).finally(() => {
- loading.close();
- })
- }).catch(() => {
- loading.close();
- })
- } else {
- this.$confirm(res.data.data, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- checkOrderRW({
- bsType: "XS",
- ...this.form,
- url: '/tirePartsMall/salesManagement/saleOrder/index',
- pageStatus: "this.$store.getters.ltxsStatus",
- pageLabel: "销售订单(L)",
- }).then(res => {
- this.$set(this.optionForm, 'disabled', true)
- this.$set(this.optionContactsBack, 'disabled', true)
- this.$message.success("提交成功");
- // 将按钮文本更改为"撤销任务"
- this.buttonText = '撤销任务';
- // 将按钮颜色更改为对应的颜色
- this.buttonColor = 'warning'; // 比如改为warning
- this.refresh(res.data.data.id)
- this.refreshs(res.data.data.id, true)
- this.isContacts = true
- this.isApplySettlement = false
- this.isAdd = true
- this.isDisabled = true
- this.isAddBtn = true
- this.isDisabledTask = true
- this.editButton = true
- }).finally(() => {
- loading.close();
- })
- }).catch(() => {
- loading.close();
- })
- }
- }).catch(() => {
- loading.close();
- })
- } else {
- submit({
- bsType: "XS",
- ...this.form
- }).then(res => {
- // this.refresh(res.data.data.id)
- this.isDisabledTask = false
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- generateShipTask(this.form).then(res => {
- this.$set(this.optionForm, 'disabled', true)
- this.$set(this.optionContactsBack, 'disabled', true)
- this.$message.success("生成出库任务成功");
- // 将按钮文本更改为"撤销任务"
- this.buttonText = '撤销任务';
- // 将按钮颜色更改为对应的颜色
- this.buttonColor = 'warning'; // 比如改为warning
- this.refresh(res.data.data.id)
- this.refreshs(res.data.data.id, true)
- this.isContacts = true
- this.isApplySettlement = false
- this.isAdd = true
- this.isDisabled = true
- this.isAddBtn = true
- this.isDisabledTask = true
- this.editButton = true // 把编辑按钮显示出来
- }).finally(() => {
- loading.close();
- })
- }).catch(() => {
- loading.close();
- })
- }
- })
- }
- if (res.data.data.records.length == 0) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- submit({
- bsType: "XS",
- ...this.form
- }).then(res => {
- // this.refresh(res.data.data.id)
- this.isDisabledTask = false
- generateShipTask(this.form).then(res => {
- this.$set(this.optionForm, 'disabled', true)
- this.$set(this.optionContactsBack, 'disabled', true)
- this.$message.success("生成出库任务成功");
- // 将按钮文本更改为"撤销任务"
- this.buttonText = '撤销任务';
- // 将按钮颜色更改为对应的颜色
- this.buttonColor = 'warning'; // 比如改为warning
- this.refresh(res.data.data.id)
- this.refreshs(res.data.data.id, true)
- this.isContacts = true
- this.isApplySettlement = false
- this.isAdd = true
- this.isDisabled = true
- this.isAddBtn = true
- this.isDisabledTask = true
- this.editButton = true // 把编辑按钮显示出来
- }).finally(() => {
- loading.close();
- })
- }).catch(() => {
- loading.close();
- })
- }
- })
- done();
- } else {
- this.$message.error('请选择仓库')
- this.$set(this.optionForm, 'disabled', false)
- this.$set(this.optionContactsBack, 'disabled', false)
- }
- })
- }
- } else {
- this.$refs["form"].validate((valid, done) => {
- if (valid) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- // this.form.orderItemsList.forEach((items) => {
- // let brandName = items.brandId
- // items.brandId = items.brandName
- // items.brandName = brandName
- // let goodsName = items.goodsId
- // items.goodsId = items.goodsName
- // items.goodsName = goodsName
- // })
- revokeGenerateShipTask(this.form).then(res => {
- // 将按钮文本更改为"生成任务"
- this.buttonText = '生成任务';
- // 将按钮颜色还原为success
- this.buttonColor = 'success';
- this.$message.success("撤销出库成功");
- this.refresh(res.data.data.id)
- this.isApplySettlement = false
- this.isContacts = true
- this.isDisabled = true
- this.isDisabledTask = false
- this.$set(this.optionForm, 'disabled', false) // form 表单的禁用放开
- this.$set(this.optionContactsBack, 'disabled', false) // table 表格的禁用放开
- this.editButton = true // 把编辑按钮显示出来
- //添加删除按钮禁用
- this.isAdd = true
- if (this.form.businessSource == "外部销售") {
- }
- loading.close();
- }).catch((err) => {
- if (err instanceof TooManyResultsException) {
- // 不显示错误消息
- return;
- }
- // 显示其他错误消息
- this.$message.error('发生错误,请稍后重试');
- }).finally(() => {
- loading.close();
- });
- done();
- }
- })
- }
- }
- },
- revokeTask() {
- this.$confirm('是否撤销出库任务审批?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- revokeCheckOrderRW(this.form).then(res => {
- this.buttonText = '生成任务';
- // 将按钮颜色还原为success
- this.buttonColor = 'success';
- this.$message.success("撤销出库成功");
- this.refresh(res.data.data.id)
- this.isApplySettlement = false
- this.isContacts = true
- this.isDisabled = true
- this.isDisabledTask = false
- this.$set(this.optionForm, 'disabled', false) // form 表单的禁用放开
- this.$set(this.optionContactsBack, 'disabled', false) // table 表格的禁用放开
- // this.editButton = true // 把编辑按钮显示出来
- //添加删除按钮禁用
- this.isAdd = true
- })
- })
- },
- //联系人change
- contactsChange(e) {
- // 假设this.contactsOption是你的数组对象
- let matchedContact = this.contactsOption.find(item => item.contacts == e);
- // 判断是否找到匹配的对象
- this.$set(this.form, 'phone', matchedContact.tel)
- this.$set(this.form, 'recAddress', matchedContact.belongtoarea + matchedContact.detailedAddress)
- },
- //修改提交触发
- editCustomer() {
- this.$refs["form"].validate((valid, done) => {
- done();
- let picihao = false
- if (valid) {
- if (this.form.orderItemsList.length == 0) {
- this.$message.warning("请添加商品");
- return
- }
- for (let i in this.form.orderItemsList) {
- this.form.orderItemsList[i].subTotalMoney = this.form.orderItemsList[i].goodsNum * this.form.orderItemsList[i].price
- if (this.form.orderItemsList[i].pid) {
- } else {
- if (this.form.orderItemsList[i].whether == '1') {
- if (this.form.orderItemsList[i].dot) { } else {
- this.$message.warning(`销售明细序号${Number(i) + 1}的批次号不能为空`);
- picihao = true
- break;
- }
- } else {
- }
- }
- if (this.form.orderItemsList[i].goodsNum <= 0) {
- this.$message.warning(`销售明细序号${Number(i) + 1}的数量不能为零`);
- picihao = true
- }
- }
- this.mingxibaocun = true
- if (picihao) {
- return
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- // this.form.orderItemsList.forEach(its => {
- // console.log(its.goodsId);
- // console.log(its.goodsName);
- // its.brandId = its.brandName
- // let goodsName = its.goodsId
- // its.goodsId = its.goodsName
- // its.goodsName = goodsName
- // })
- for (let courierCompanies of this.courierCompaniesList) {
- if (courierCompanies.dictValue === this.form.logisticsCorpName) {
- this.form.logisticsCorpId = courierCompanies.dictKey
- break
- }
- }
- this.form.salerName = this.form.$salerId ? this.form.$salerId : ''
- this.form.storageName = this.form.$storageId ? this.form.$storageId : ''
- submit({
- bsType: "XS",
- ...this.form
- }).then(res => {
- this.$message.success("保存成功");
- this.refresh(res.data.data.id)
- this.isDisabledTask = false
- // this.editButton = true
- this.$set(this.optionContactsBack, 'disabled', true)
- loading.close();
- }).finally(() => {
- loading.close();
- });
- } else {
- return false;
- }
- });
- },
- //保存
- save() {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- submit({
- bsType: "XS",
- ...this.form
- }).then(res => {
- console.log(1);
- this.refresh(res.data.data.id)
- this.isDisabledTask = false
- loading.close();
- }).finally(() => {
- loading.close();
- });
- } else {
- return false;
- }
- });
- },
- //关闭弹窗表单
- beforeClose(done, type) {
- console.log(type);
- // if(row == "add"){
- // this.form.sharedCompanyId = this.form.sharedCompanyId?this.form.sharedCompanyId:''
- // this.form.sharedCompanyName = this.form.sharedCompanyName?this.form.sharedCompanyName:''
- // }
- console.log('this.form.sharedCompanyId', this.form.sharedCompanyId);
- console.log('this.form.sharedCompanyName', this.form.sharedCompanyName);
- done()
- },
- refresh(id, type) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- })
- getDetails({ id: id }).then(res => {
- this.form = res.data.data
- let ordForm = { srcBillNo: this.form.ordNo }
- let _this = this
- this.dataList = res.data.data.paymentRecordsList ? res.data.data.paymentRecordsList : [];
- this.$nextTick(() => {
- this.$refs.formContacts.doLayout()
- })
- // getList(1, 50, ordForm).then((res) => {
- // this.dataList = res.data.data.records ? res.data.data.records : [];
- // this.$nextTick(() => {
- // this.$refs.formContacts.doLayout()
- // })
- // })
- // if (this.form.status !== '录入' && this.form.status !== '退款中' && this.form.status !== '已取消' && this.form.status !== '退款请核' && this.form.status !== '已退款' && this.form.status !== '待确认' && this.form.status !== '待发货') {
- if (this.form.status !== '录入' && this.form.status !== '已取消' && this.form.status !== '退款请核' && this.form.status !== '已退款' && this.form.status !== '待确认' && this.form.status !== '待发货') {
- console.log(1);
- this.isApplySettlement = false;
- }
- if (
- this.form.status === '已退款' ||
- this.form.status === '已收货' ||
- this.form.status === '已发货' ||
- this.form.status === '已取消'
- ) {
- // 禁用编辑按钮
- console.log('按钮全部禁用');
- this.isEditButton = true;
- this.isSaveBtn = true;
- this.isDisabledTask = true;
- this.viewDisabled = true;
- }
- if (this.form.status === '已发货') {
- this.isDisabledTask = true;
- this.viewDisabled = true;
- this.isEditButton = false;
- }
- // else {
- // this.isSaveBtn = true;
- // this.isDisabledTask = true;
- // this.viewDisabled = true;
- // }
- /*if (this.form.status == '退款中') {
- this.isConfirmRefundBtn = false;
- }*/
- if (this.form.status == '已取消') {
- this.isConfirmRefundBtn = true;
- }
- if (this.form.generateTask == '已生成') {
- this.buttonText = '撤销任务';
- // this.isDisabledTask = false;
- this.buttonColor = 'warning'
- this.optionForm.disabled = true
- this.$set(this.optionForm, 'disabled', true)
- }
- if (this.form.status == '退款请核') {
- this.isRevocationRequest = false;
- }
- if (this.form.status == '待发货') {
- this.isApplySettlement = false
- this.isDisabled = true
- }
- //成本、毛利对业务员隐藏
- this.optionForm.column.forEach(its => {
- if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('业务员')) {
- if (its.prop == 'cost' || its.prop == 'grossProfit') {
- this.$set(its, 'display', false)
- }
- } else {
- if (its.prop == 'cost' || its.prop == 'grossProfit') {
- this.$set(its, 'display', true)
- }
- }
- })
- // 明细信息成本、毛利对业务员隐藏
- this.optionContacts.column.forEach(its => {
- if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('业务员')) {
- if (its.prop == 'costprie' || its.prop == 'grossProfit') {
- this.$set(its, 'hide', true)
- }
- } else {
- if (its.prop == 'costprie' || its.prop == 'grossProfit') {
- this.$set(its, 'hide', false)
- }
- }
- })
- this.form.orderItemsList.forEach((items) => {
- if (!items.subTotalMoney) {
- items.subTotalMoney = items.goodsNum * items.price
- items.grossProfit = items.subTotalMoney - items.costprie
- }
- // let brandName = items.brandId
- // items.brandId = items.brandName
- // items.brandName = brandName
- // let goodsName = items.goodsId
- // items.goodsId = items.goodsName
- // items.goodsName = goodsName
- })
- loading.close();
- // if (this.form.businessSource == "外部销售") {
- // console.log('外部销售');
- // this.optionForm.column.forEach(its => {
- // if (its.prop == 'customerId') {
- // this.$set(its, 'disabled', true)
- // }
- // })
- // //不能录入不能删除
- // this.$set(this.optionContactsBack, "addBtn", false)
- // this.isDisabled = true
- // this.$set(this.form, 'shipType', '物流')
- // this.$set(this.form, 'receivableType', '网络支付')
- // this.optionContactsBack.column.forEach(item => {
- // this.$set(item, 'disabled', true)
- // if (item.label == '批次号' || item.label == '备注') {
- // item.disabled = false
- // }
- // })
- // this['optionContacts'] = this['optionContactsBack'];
- // this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
- // this.optionContactsBack.column.forEach(item => {
- // if (item.prop == 'dot') {
- // this.$set(item, disabled, false)
- // } else {
- // this.$set(item, disabled, true)
- // }
- // })
- // } else {
- // this.$set(this.form, 'shipType', '物流')
- // this.$set(this.form, 'receivableType', '现金')
- // this.optionContactsBack.column.forEach(item => {
- // this.$set(item, 'disabled', false)
- // })
- // this.optionContactsBack.column.forEach(item => {
- // if (item.label === '规格型号' || item.label === '花纹' || item.label === '品牌' || item.label === '物料编码' || item.label === '单位' || item.label === '商品描述') {
- // item.disabled = true;
- // }
- // })
- // console.log(324324);
- // this['optionContacts'] = this['optionContactsBack'];
- // this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
- // }
- // // this.$set(this.form.orderItemsList,'goodsNum',66)
- }).catch(() => {
- loading.close();
- })
- },
- refreshs(id, type) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- getDetails({ id: id }).then(res => {
- this.form = res.data.data
- let ordForm = { srcBillNo: this.form.ordNo }
- let _this = this
- this.dataList = res.data.data.paymentRecordsList ? res.data.data.paymentRecordsList : [];
- // if (this.form.status !== '录入' && this.form.status !== '退款中' && this.form.status !== '已取消' && this.form.status !== '退款请核' && this.form.status !== '已退款' && this.form.status !== '待确认' && this.form.status !== '待发货') {
- if (this.form.status !== '录入' && this.form.status !== '已取消' && this.form.status !== '退款请核' && this.form.status !== '已退款' && this.form.status !== '待确认' && this.form.status !== '待发货') {
- console.log(1);
- this.isApplySettlement = false;
- }
- if (
- this.form.status === '已退款' ||
- this.form.status === '已收货' ||
- this.form.status === '已发货' ||
- this.form.status === '已取消'
- ) {
- // 禁用编辑按钮
- console.log('按钮全部禁用');
- this.isEditButton = true;
- this.isSaveBtn = true;
- this.isDisabledTask = true;
- this.viewDisabled = true;
- }
- if (this.form.status === '已发货') {
- this.isDisabledTask = true;
- this.viewDisabled = true;
- this.isEditButton = false;
- }
- /* if (this.form.status == '退款中') {
- this.isConfirmRefundBtn = false;
- }*/
- if (this.form.status == '已取消') {
- this.isConfirmRefundBtn = true;
- }
- if (this.form.generateTask == '已生成') {
- this.buttonText = '撤销任务';
- // this.isDisabledTask = false;
- this.buttonColor = 'warning'
- this.optionForm.disabled = true
- this.$set(this.optionForm, 'disabled', true)
- }
- if (this.form.status == '退款请核') {
- this.isRevocationRequest = false;
- }
- if (this.form.status == '待发货') {
- this.isApplySettlement = false
- }
- //成本、毛利对业务员隐藏
- this.optionForm.column.forEach(its => {
- if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('业务员')) {
- if (its.prop == 'cost' || its.prop == 'grossProfit') {
- this.$set(its, 'display', false)
- }
- } else {
- if (its.prop == 'cost' || its.prop == 'grossProfit') {
- this.$set(its, 'display', true)
- }
- }
- })
- // 明细信息成本、毛利对业务员隐藏
- this.optionContacts.column.forEach(its => {
- if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('业务员')) {
- if (its.prop == 'costprie' || its.prop == 'grossProfit') {
- this.$set(its, 'hide', true)
- }
- } else {
- if (its.prop == 'costprie' || its.prop == 'grossProfit') {
- this.$set(its, 'hide', false)
- }
- }
- })
- this.form.orderItemsList.forEach((items) => {
- if (!items.subTotalMoney) {
- items.subTotalMoney = items.goodsNum * items.price
- items.grossProfit = items.subTotalMoney - items.costprie
- }
- })
- }).finally(() => {
- loading.close();
- });
- },
- //请核关闭
- choceScheduleFun() {
- this.checkScheduleDialog = false
- },
- //关闭审核
- choceCheckFun() {
- this.isExamineBtn = !this.isExamineBtn
- this.checkDialog = false;
- },
- //申请退款
- applySettlement(type) {
- this.$confirm("您确定申请退款吗?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- this.$refs["form"].validate((valid, done) => {
- done()
- if (valid) {
- const data = {
- id: this.form.id,
- url: '/tirePartsMall/salesManagement/saleOrder/index',
- pageStatus: "this.$store.getters.ltxsStatus",
- pageLabel: "销售订单",
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- checkOrder({ ...data }).then((res) => {
- this.refresh(res.data.data.id)
- this.$message.success('申请退款成功');
- this.isApplySettlement = !this.isApplySettlement
- loading.close();
- console.log(res);
- }).catch(() => { loading.close(); })
- }
- })
- })
- },
- //确认退款
- confirmRefundBtn() {
- this.$confirm("您确定退款吗?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- // this.form.orderItemsList.forEach((items) => {
- // let brandName = items.brandId
- // items.brandId = items.brandName
- // items.brandName = brandName
- // let goodsName = items.goodsId
- // items.goodsId = items.goodsName
- // items.goodsName = goodsName
- // })
- confirmRefund({ ...this.form }).then((res) => {
- loading.close()
- this.$message.success('确定退款成功');
- }).catch(() => { loading.close(); })
- })
- },
- //审批
- examineBtn() {
- this.checkData = this.$route.query.check
- this.checkDialog = true;
- },
- //撤销请核
- revocationRequest() {
- this.$confirm("您确定撤回此次申请吗?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- // this.form.orderItemsList.forEach((items) => {
- // if (!items.subTotalMoney) {
- // items.subTotalMoney = items.goodsNum * items.price
- // items.grossProfit = items.subTotalMoney - items.costprie
- // }
- // let brandName = items.brandId
- // items.brandId = items.brandName
- // items.brandName = brandName
- // let goodsName = items.goodsId
- // items.goodsId = items.goodsName
- // items.goodsName = goodsName
- // })
- revokeCheckOrder({ ...this.form }).then(res => {
- this.isRevocationRequest = !this.isRevocationRequest
- this.refresh(res.data.data.id)
- this.$message.success('撤回成功')
- loading.close();
- })
- })
- },
- rowDelBox(row, index, type) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (row.id) {
- delOrderItem({ ids: row.id }).then(res => {
- this.form.orderItemsList.splice(index, 1);
- this.$message.success("操作成功!");
- });
- } else {
- this.form[type].splice(index, 1);
- this.$message.success("操作成功!");
- }
- }
- );
- },
- // 明细信息多选
- selectionContacts(list) {
- this.selectionMultilist = list
- },
- // 快捷复制
- quickCopy() {
- let temp = document.createElement("textarea")
- let txt = `${this.form.customerName} ${this.form.businesDate}`
- for (let item of this.form.orderItemsList) {
- txt += `\n${item.goodsName} ${item.goodsNum}`
- }
- document.body.appendChild(temp)
- temp.value = txt
- temp.select()
- document.execCommand("copy")
- document.body.removeChild(temp)
- },
- // 一键删除
- batchDelete() {
- if (this.selectionMultilist.length == 0) {
- return this.$message.warning('请选择要删除的数据')
- }
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- let multiList = this.selectionMultilist
- let arr = this.form.orderItemsList
- // 获取有id 的数据
- const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
- let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
- // 把选中的删除掉
- multiList.forEach((item) => {
- for (let index in arr) {
- if (JSON.stringify(item) == JSON.stringify(arr[index])) {
- arr.splice(Number(index), 1)
- }
- }
- })
- // 有id 的处理
- if (itemsWithId.length != 0) {
- delOrderItem({ ids: arrIds.join(',') }).then(res => {
- this.$message.success("操作成功!");
- });
- }
- })
- },
- rowSave(form, done, loading) {
- if (this.isStatus) {
- done(form)
- } else {
- this.$message.error('请选择相同公司的商品')
- }
- console.log(form);
- // this.form.sharedCompanyId = res.data.data.sharedCompanyId
- // this.form.sharedCompanyName = res.data.data.sharedCompanyName
- },
- rowUpdate(form, index, done, loading) {
- done(form)
- },
- // 新增商品
- rowAdd(row) {
- if (!this.form.customerId) {
- this.$message.error('请选择客户')
- return
- }
- this.findObject(this.optionContactsBack.column, 'goodsId').dicUrl = `/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}&customId=${this.dicUrlWithCustomId}&enableOrNot=1&stock=${this.form.storageId}`
- this.optionContactsBack.column.forEach(its => {
- if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
- its.disabled = false
- } else {
- its.disabled = true
- }
- })
- console.log('新增了', row);
- // console.log(this.form.storageId,2038)
- // if (this.form.storageId) {
- // this.page.billType = 0
- // }else {
- // this.page.billType = 1
- // }
- this.getAllWorkDicts()
- this.refreshChange()
- this.goodsListSave = []
- setTimeout(res => {
- this.dialogVisible = true
- }, 300)
- // this.$refs.formContacts.rowAdd()
- },
- //打印
- handlePrint() {
- this.switchDialog = !this.switchDialog;
- },
- onClose(val) {
- this.switchDialog = val;
- },
- //自定义列保存
- async saveColumnTwo(ref, option, optionBack, code) {
- /**
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
- * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
- */
- const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumnTwo(ref, option, optionBack, code) {
- this[option] = this[optionBack];
- const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- backToList(type) {
- this.$emit("backToList", type);
- },
- // 弹框的重置
- resetCrud() {
- this.$message.success("重置成功");
- },
- // 弹窗的保存
- saveCrud() {
- this.$message.success("保存成功");
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-form-item {
- margin-bottom: 8px !important;
- }
- </style>
|