123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799 |
- <template>
- <div class="app-container">
- <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
- <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
- <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
- </div>
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="合同管理" name="first">
- <div class="filter-container">
- <el-select v-model="getdataListParm.parammaps.pastureName" placeholder="牧场" style="width:120px" class="filter-item">
- <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <el-input v-model="getdataListParm.parammaps.contractCode" placeholder="合同编号" style="width: 140px;" class="filter-item" />
- <el-select v-model="getdataListParm.parammaps.statue" clearable placeholder="合同状态" class="filter-item" style="width: 120px;">
- <el-option v-for="item in statues" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <el-select v-model="getdataListParm.parammaps.providerName" filterable clearable style="width: 140px;" placeholder="供应商" class="filter-item">
- <el-option v-for="item in findAllProvider" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <el-select v-model="getdataListParm.parammaps.stuteSH" clearable placeholder="审核状态" class="filter-item" style="width: 120px;">
- <el-option v-for="item in shStatues" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-date-picker ref="inputDatetime" v-model="getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
- <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
- <div>
- <el-button v-if="isContractAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
- <el-button v-if="isContractTemplate" v-waves class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">模板</el-button>
- <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
- <el-button v-if="isContractImport" v-waves class="filter-item" type="warning" icon="el-icon-download">导入</el-button>
- </el-upload>
- <el-button v-if="isContractExport" v-waves class="filter-item" type="success" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
- <el-radio-group v-model="radioAll" style="margin-top:-9px" @change="changeAll()">
- <el-radio-button label="全部" />
- <el-radio-button label="待处理" />
- <el-radio-button label="已处理" />
- </el-radio-group>
- </div>
- </div>
- <el-table
- :key="tableKey"
- v-loading="listLoading"
- element-loading-text="给我一点时间"
- :data="list"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable"
- :cell-class-name="tableCellClassName"
- >
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="牧场" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pastureName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="合同编号" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.contractCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="合同状态" min-width="100px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.statue }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="120px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="合同开始日期" sortable prop="startTime" min-width="110px" align="center" />
- <el-table-column label="合同截止日期" sortable prop="stopTime" min-width="110px" align="center" />
- <el-table-column label="录入人" prop="creatorMan" min-width="100px" align="center" />
- <el-table-column label="录入时间" sortable prop="creatorTime" min-width="110px" align="center" />
- <el-table-column label="审核状态" min-width="110px" align="center" :formatter="SHStatus" />
- <el-table-column label="操作" align="center" width="300px" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <el-button v-if="isContractSee" type="primary" size="mini" @click="form_see(row)">查看</el-button>
- <el-button v-if="isContractChange && row.statue=='正常' && row.SHStatus == 7" type="warning" size="mini" @click="handleChange(row)">变更</el-button>
- <!-- <el-button type="success" size="mini" @click="form_edit(row)">编辑</el-button> -->
- <!-- 设备主管审核 -->
- <el-button v-if="isContractExamineZG && row.SHStatus == 2" type="success" style="display:inline-block" size="mini" @click="handleExamine(row)">审核1</el-button>
- <el-button v-else type="success" style="display:none" size="mini" @click="handleExamine(row)">审核1</el-button>
- <!-- 设备助理审核 -->
- <!-- <el-button v-if="isContractExamineZL && row.SHStatus == 3" type="success" style="display:inline-block" size="mini" @click="handleExamine2(row)">审核2</el-button>
- <el-button v-else type="success" style="display:none" size="mini" @click="handleExamine2(row)">审核2</el-button> -->
- <!-- 设备中心审核 -->
- <el-button v-if="isContractExamineZX && row.SHStatus == 5" type="success" style="display:inline-block" size="mini" @click="handleExamine3(row)">审核2</el-button>
- <el-button v-else type="success" style="display:none" size="mini" @click="handleExamine3(row)">审核2</el-button>
- <el-button v-if="isContractDelete && (row.SHStatus == 4 || row.SHStatus == 6 || row.SHStatus == 8) " type="danger" size="mini" @click="form_delete(row)">删除</el-button>
- <el-button v-if="isContractDelete2" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="getList" />
- </el-tab-pane>
- <el-tab-pane label="合同明细" name="second">
- <div class="filter-container">
- <el-select v-model="getdataListParm2.parammaps.pastureName" placeholder="牧场" style="width:120px" class="filter-item">
- <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <el-input v-model="getdataListParm2.parammaps.contractCode" placeholder="合同编号" style="width: 140px;" class="filter-item" />
- <el-select v-model="getdataListParm2.parammaps.statue" clearable placeholder="合同状态" class="filter-item" style="width: 120px;">
- <el-option v-for="item in statues" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <el-input v-model="getdataListParm2.parammaps.partCode" placeholder="备件编号" style="width: 140px;" class="filter-item" />
- <el-input v-model="getdataListParm2.parammaps.partName" placeholder="备件名称" style="width: 140px;" class="filter-item" />
- <el-select v-model="getdataListParm2.parammaps.providerName" filterable clearable style="width: 140px;" placeholder="供应商" class="filter-item">
- <el-option v-for="item in findAllProvider" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <el-date-picker ref="inputDatetime2" v-model="getdataListParm2.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
- <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search2">搜索</el-button>
- </div>
- <el-table
- :key="tableKey2"
- v-loading="listLoading2"
- element-loading-text="给我一点时间"
- :data="list2"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable"
- :cell-class-name="tableCellClassName"
- >
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="牧场" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pastureName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="合同编号" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.contractCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="合同状态" min-width="100px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.statue }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="120px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="合同开始日期" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.startTime }}</span>
- </template>
- </el-table-column>
- <el-table-column label="合同截止日期" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.stopTime }}</span>
- </template>
- </el-table-column>
- <el-table-column label="零库存" min-width="100px" align="center" :formatter="isZeroStock" />
- <el-table-column label="备件编号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计划量" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.planAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="单价" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备注" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.remark }}</span>
- </template>
- </el-table-column>
- <el-table-column label="录入人" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.creatorMan }}</span>
- </template>
- </el-table-column>
- <el-table-column label="录入日期" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.creatorTime }}</span>
- </template>
- </el-table-column>
- <!-- <el-table-column label="审核状态" min-width="110px" align="center" :formatter="SHStatus" /> -->
- </el-table>
- <pagination v-show="total2>0" :total="total2" :page.sync="getdataListParm2.offset" :limit.sync="getdataListParm2.pagecount" @pagination="getList2" />
- </el-tab-pane>
- </el-tabs>
- <!-- 弹出层新增or 修改 -->
- <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
- <div class="app-add">
- <el-form
- ref="createTemp"
- :rules="rules"
- :model="createTemp"
- label-position="right"
- label-width="120px"
- style="width: 90%;margin:0 auto;"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="合同编号:" prop="contractCode">
- <el-input ref="contractCode" v-model="createTemp.contractCode" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="牧场:" prop="pastureId">
- <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width:100%;" :disabled="isDisabled">
- <el-option
- v-for="item in findAllPasture"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="供应商:" prop="providerName">
- <el-autocomplete
- v-model="createTemp.providerName"
- :disabled="dialogStatus==='change'"
- value-key="name"
- class="inline-input"
- :fetch-suggestions="providerSearch"
- placeholder="请输入供应商名称或供应商编号"
- style="width:100%;"
- @focus="handleFocusProvider"
- @blur="handleBlurProvider"
- @select="handleSelectProvider"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="开始日期:" prop="startTime">
- <el-date-picker
- v-model="createTemp.startTime"
- :disabled="isDisabled"
- type="date"
- placeholder="开始日期"
- style="width:100%;"
- :picker-options="pickerOptions1"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- @change="changeTime"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="截止日期:" prop="stopTime">
- <el-date-picker
- v-model="createTemp.stopTime"
- style="width:100%;"
- :disabled="isDisabled"
- type="date"
- placeholder="结束日期"
- :picker-options="pickerOptions2"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- @change="changeTime"
- />
- </el-form-item>
- </el-col>
- <el-col v-if="dialogStatus=='create'" :span="8">
- <el-form-item label="合同状态:" prop="statue">
- <el-select v-model="createTemp.statue" clearable placeholder="合同状态" class="filter-item" style="width: 100%;" disabled>
- <el-option
- v-for="item in statues"
- :key="item.id"
- :label="item.name"
- :value="item.name"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col v-if="dialogStatus=='change'" :span="8">
- <el-form-item label="合同状态:" prop="statue">
- <el-select v-model="createTemp.statue" clearable placeholder="合同状态" class="filter-item" style="width: 100%;"@change="changeStatues">
- <el-option
- v-for="item in statues2"
- :key="item.id"
- :label="item.name"
- :value="item.name"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="零库存:" prop="isZeroStock">
- <el-radio-group v-model="createTemp.isZeroStock" :disabled="isDisabled" @change="changeIsZero">
- <el-radio v-model="createTemp.isZeroStock" :label="1">是</el-radio>
- <el-radio v-model="createTemp.isZeroStock" :label="0">否</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="录入人:" prop="creatorId">
- <el-select ref="creatorId" v-model="createTemp.creatorId" :disabled="isDisabled" placeholder="录入人" class="filter-item" style="width:100%;">
- <el-option
- v-for="item in findAllEmploye"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="录入日期:" prop="creatorTime">
- <el-date-picker
- v-model="createTemp.creatorTime"
- :disabled="isDisabled"
- type="date"
- :picker-options="pickerOptions3"
- placeholder="录入日期"
- style="width:100%;"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="备注:" prop="remark">
- <el-input
- v-model="createTemp.remark"
- :disabled="isDisabled"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="16">
- <el-form-item label="备件:" prop="partCode">
- <el-autocomplete
- v-model="orderPart.partCode"
- :disabled="isDisabled"
- value-key="name"
- class="inline-input"
- :fetch-suggestions="sparePartSearch"
- placeholder="请输入备件编号或备件名称或备件规格"
- style="width:100%"
- @select="handleSelectSparePart"
- >
- <template slot-scope="{ item }">
- <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>
- | <b>备件名称:</b><span class="addr">{{ item.partName }}</span>
- | <b>备件规格:</b><span class="addr">{{ item.specification }}</span>
- </template>
- </el-autocomplete>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-table
- :key="tableKey"
- v-loading="listLoadingAdd"
- element-loading-text="给我一点时间"
- :data="listAdd"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:50px"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable"
- >
- <el-table-column label="序号" align="center" type="index" width="50" />
- <!-- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index }}</span>
- </template>
- </el-table-column> -->
- <el-table-column label="备件编号" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="120px" align="center">
- <template slot-scope="scope">
- <el-autocomplete
- v-model="scope.row.brand"
- :disabled="isDisabled"
- value-key="brandName"
- class="inline-input"
- :fetch-suggestions="brandSearch"
- placeholder="请输入品牌"
- style="width:100%;"
- @focus="handleFocusBrand( scope.row)"
- @blur="handleBlurBrand(scope.row)"
- @select="(value)=>
- {handleSelectBrand(value, scope.row)}"
- />
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计划量" min-width="70px" align="center" valign="middle">
- <template slot-scope="scope">
- <el-form :model="scope.row" :rules="rules">
- <el-form-item prop="planAmount">
- <el-input ref="planAmount" v-model="scope.row.planAmount" style="margin-top:15px" :disabled="isDisabled" />
- </el-form-item>
- </el-form>
- </template>
- </el-table-column>
- <el-table-column label="单价" min-width="80px" align="center" valign="middle">
- <template slot-scope="scope">
- <el-input v-model="scope.row.price" :disabled="isDisabled" />
- </template>
- </el-table-column>
- <el-table-column label="备注" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-input v-model="scope.row.remark" type="textarea" placeholder="备注" :disabled="isDisabled" autosize maxlength="100" show-word-limit />
- </template>
- </el-table-column>
- <el-table-column v-if="isDisabled2" label="操作" align="center" width="100px" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <a class="del" @click="partDelete(row)">删除</a>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer" style="bottom:5px">
- <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():add_dialog_save()">保存并关闭</el-button>
- <el-button @click="dialogFormVisible = false;getList();createTemp.providerName=''">取消并关闭</el-button>
- </div>
- </div>
- </el-dialog>
- <!-- 变更 -->
- <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_change" :close-on-click-modal="false" width="90%">
- <div class="app-add">
- <el-form
- ref="createTemp"
- :rules="rules"
- :model="createTemp"
- label-position="right"
- label-width="120px"
- style="width: 90%;margin:0 auto;"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="合同编号:" prop="contractCode">
- <el-input ref="contractCode" v-model="createTemp.contractCode" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="牧场:" prop="pastureId">
- <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width:100%;" :disabled="isDisabled">
- <el-option
- v-for="item in findAllPasture"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="供应商:" prop="providerName">
- <el-autocomplete
- v-model="createTemp.providerName"
- :disabled="dialogStatus==='change'"
- value-key="name"
- class="inline-input"
- :fetch-suggestions="providerSearch"
- placeholder="请输入供应商名称或供应商编号"
- style="width:100%;"
- @focus="handleFocusProvider"
- @blur="handleBlurProvider"
- @select="handleSelectProvider"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="开始日期:" prop="startTime">
- <el-date-picker
- v-model="createTemp.startTime"
- :disabled="isDisabled"
- type="date"
- placeholder="开始日期"
- :picker-options="pickerOptions1"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- style="width:100%"
- @change="changeTime"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="截止日期:" prop="stopTime">
- <el-date-picker
- v-model="createTemp.stopTime"
- :disabled="isDisabled"
- type="date"
- placeholder="结束日期"
- :picker-options="pickerOptions2"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- style="width:100%"
- @change="changeTime"
- />
- </el-form-item>
- </el-col>
- <el-col v-if="dialogStatus=='create'" :span="8">
- <el-form-item label="合同状态:" prop="statue">
- <el-select v-model="createTemp.statue" clearable placeholder="合同状态" class="filter-item" style="width: 100%;" disabled>
- <el-option
- v-for="item in statues"
- :key="item.id"
- :label="item.name"
- :value="item.name"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col v-if="dialogStatus=='change'" :span="8">
- <el-form-item label="合同状态:" prop="statue">
- <el-select v-model="createTemp.statue" clearable placeholder="合同状态" class="filter-item" style="width: 100%;"@change="changeStatues">
- <el-option
- v-for="item in statues2"
- :key="item.id"
- :label="item.name"
- :value="item.name"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="零库存:" prop="isZeroStock">
- <el-radio-group v-model="createTemp.isZeroStock" :disabled="isDisabled" @change="changeIsZero">
- <el-radio v-model="createTemp.isZeroStock" :label="1">是</el-radio>
- <el-radio v-model="createTemp.isZeroStock" :label="0">否</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="录入人:" prop="creatorId">
- <el-select ref="creatorId" v-model="createTemp.creatorId" :disabled="isDisabled" placeholder="录入人" class="filter-item" style="width:100%;">
- <el-option
- v-for="item in findAllEmploye"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="录入日期:" prop="creatorTime">
- <el-date-picker
- v-model="createTemp.creatorTime"
- :disabled="isDisabled"
- type="date"
- :picker-options="pickerOptions3"
- placeholder="录入日期"
- style="width:100%;"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="备注:" prop="remark">
- <el-input
- v-model="createTemp.remark"
- :disabled="isDisabled"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="10">
- <el-form-item label="备件:" prop="partCode">
- <el-autocomplete
- v-model="orderPart.partCode"
- :disabled="isDisabled"
- value-key="name"
- class="inline-input"
- :fetch-suggestions="sparePartSearch"
- placeholder="请输入备件编号或备件名称或备件规格"
- style="width:550px"
- @select="handleSelectSparePart"
- >
- <template slot-scope="{ item }">
- <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>
- | <b>备件名称:</b><span class="addr">{{ item.partName }}</span>
- | <b>备件规格:</b><span class="addr">{{ item.specification }}</span>
- </template>
- </el-autocomplete>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-table
- :key="tableKey"
- v-loading="listLoadingAdd"
- element-loading-text="给我一点时间"
- :data="listAdd"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable"
- >
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNumChange-1) * pageSizeChange + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="120px" align="center">
- <template slot-scope="scope">
- <el-autocomplete
- v-model="scope.row.brand"
- :disabled="isDisabled"
- value-key="brandName"
- class="inline-input"
- :fetch-suggestions="brandSearch"
- placeholder="请输入品牌"
- style="width:100%;"
- @focus="handleFocusBrand( scope.row)"
- @blur="handleBlurBrand(scope.row)"
- @select="(value)=>
- {handleSelectBrand(value, scope.row)}"
- />
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计划量" min-width="70px" align="center" valign="middle">
- <template slot-scope="scope">
- <el-form :model="scope.row" :rules="rules">
- <el-form-item prop="planAmount">
- <el-input ref="planAmount" v-model="scope.row.planAmount" style="margin-top:15px" :disabled="isDisabled" />
- </el-form-item>
- </el-form>
- </template>
- </el-table-column>
- <el-table-column label="单价" min-width="80px" align="center" valign="middle">
- <template slot-scope="scope">
- <el-input v-model="scope.row.price" :disabled="isDisabled" />
- </template>
- </el-table-column>
- <el-table-column label="备注" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-input v-model="scope.row.remark" type="textarea" placeholder="备注" :disabled="isDisabled" autosize maxlength="100" show-word-limit />
- </template>
- </el-table-column>
- <el-table-column v-if="isDisabled2" label="操作" align="center" width="100px" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <a class="primary" :disabled="isokDisable" @click="partSmallSave(row)">保存</a>
- <a class="del" :disabled="isokDisable" @click="partSmallDelete(row)">删除</a>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="totalChange>0" :total="totalChange" :page.sync="getdataListParmChange.offset" :limit.sync="getdataListParmChange.pagecount" @pagination="getListChange" />
- <div slot="footer" class="dialog-footer" style="bottom:5px">
- <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='change'?changeData():changeData()">保存并关闭</el-button>
- <el-button @click="dialogFormVisible_change = false;getList();createTemp.providerName=''">取消并关闭</el-button>
- </div>
- </div>
- </el-dialog>
- <!-- 查看 -->
- <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_See" :close-on-click-modal="false" width="90%">
- <div class="app-contentcard">
- <el-form ref="seeTemp" :rules="rules" :model="seeTemp" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
- <el-row>
- <el-col :span="8">
- <el-form-item label="牧场:" prop="pastureName">
- <span> {{ seeTemp.pastureName }} </span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="合同编号:" prop="contractCode">
- <span> {{ seeTemp.contractCode }} </span>
- <!-- <el-input ref="contractNO" v-model="seeTemp.contractNO" /> -->
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="供应商:" prop="providerName">
- <span> {{ seeTemp.providerName }} </span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="开始日期:" prop="startTime">
- <span> {{ seeTemp.startTime }} </span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="截止日期:" prop="stopTime">
- <span> {{ seeTemp.stopTime }} </span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="合同状态:" prop="statue">
- <span> {{ seeTemp.statue }} </span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="零库存:" prop="isZeroStock">
- <el-radio-group v-model="seeTemp.isZeroStock" disabled @change="changeIsZero">
- <el-radio v-model="seeTemp.isZeroStock" :label="1">是</el-radio>
- <el-radio v-model="seeTemp.isZeroStock" :label="0">否</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="录入人:" prop="creatorMan">
- <span> {{ seeTemp.creatorMan }} </span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="录入日期:" prop="creatorTime">
- <span> {{ seeTemp.creatorTime }} </span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="备注:" prop="remark">
- <span> {{ seeTemp.remark }} </span>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-table
- :key="tableKey"
- element-loading-text="给我一点时间"
- :data="listSee"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable"
- >
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNumSee-1) * pageSizeSee + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计划量" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.planAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="单价" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备注" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.remark }}</span>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="totalSee>0" :total="totalSee" :page.sync="getdataListParmSee.offset" :limit.sync="getdataListParmSee.pagecount" @pagination="getListSee" />
- <el-form
- ref="seeTemp"
- :rules="rules"
- :model="seeTemp"
- label-position="right"
- label-width="120px"
- style="width: 90%;margin:0 auto;"
- >
- <el-row>
- <el-col>
- <el-form-item label="流程进度" />
- <el-steps :active="active" align-center finish-status="success">
- <el-step
- v-for="(item,index) in activeList"
- :key="index"
- :title="item.title"
- :status="item.status"
- >
- <template slot="description">
- <div class="step-row">
- <div>{{ item.name }} {{ item.date }}</div>
- <div>{{ item.reason }}</div>
- </div>
- </template>
- </el-step>
- </el-steps>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="操作:">
- <!-- 设备主管审核 -->
- <el-button v-if="isContractExamineZG && seeTemp.SHStatus == 2" type="success" style="display:inline-block" @click="handleExamine()">审核1</el-button>
- <el-button v-else type="success" style="display:none" @click="handleExamine()">审核1</el-button>
- <!-- 设备助理审核 -->
- <!-- <el-button v-if="isContractExamineZL && seeTemp.SHStatus == 3" type="success" style="display:inline-block" @click="handleExamine2()">审核2</el-button>
- <el-button v-else type="success" style="display:none" @click="handleExamine2()">审核2</el-button> -->
- <!-- 设备中心审核 -->
- <el-button v-if="isContractExamineZX && seeTemp.SHStatus == 5" type="success" style="display:inline-block" @click="handleExamine3()">审核2</el-button>
- <el-button v-else type="success" style="display:none" @click="handleExamine3()">审核2</el-button>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
- <el-button @click="dialogFormVisible_See = false">关闭</el-button>
- </div>
- </el-dialog>
- <!-- 审核 -->
- <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
- <div class="app-examine">
- <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
- <el-form ref="examineTemp" :rules="rules" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
- <el-row style="width:88%;height:150px;margin:0 auto;">
- <el-col :span="20">
- <el-form-item>
- <el-radio-group v-model="examineTemp.statueSH" @change="changeStatue">
- <el-radio :label="1" checked>通过</el-radio>
- <el-radio :label="2">不通过</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
- <el-col v-if="isStatueReason" :span="20">
- <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
- </el-col>
- </el-row>
- </el-form>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button v-if="dialogStatus==='examine'" type="primary" :disabled="isokDisable" @click="createExamineData()">确认</el-button>
- <el-button v-if="dialogStatus==='examine2'" type="primary" :disabled="isokDisable" @click="createExamineData2()">确认</el-button>
- <el-button v-if="dialogStatus==='examine3'" type="primary" :disabled="isokDisable" @click="createExamineData3()">确认</el-button>
- <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- // 引入
- import { GetDataByName, GetDataByNames, checkButtons, PostDataByName, ExecDataByConfig, failproccess, GetAccount } from '@/api/common'
- import waves from '@/directive/waves' // waves directive
- import { parseTime } from '@/utils/index.js'
- // eslint-disable-next-line no-unused-vars
- import { validateEMail } from '@/utils/validate.js'
- import Pagination from '@/components/Pagination' // secondary package based on el-pagination
- import { MessageBox } from 'element-ui'
- // import TreeSelect from '@/components/TreeSelect'
- import Cookies from 'js-cookie'
- import { getToken } from '@/utils/auth'
- import { json2excel } from '@/utils/index.js'
- export default {
- name: 'Contract',
- components: { Pagination },
- directives: { waves },
- data() {
- return {
- listLoadingAdd: false,
- listLoadingSee: true,
- total: 0,
- listLoading: true,
- requestParam: {},
- // 1-2:table&搜索传参
- // 合同明细/编辑表格
- stockAAA: {
- stockA: '',
- stockNumber: '',
- stockName: '',
- specification: '',
- amount: '',
- note: ''
- },
- postDataPramas: {},
- requestFilterParams: {
- returntype: 'Map',
- parammaps: {}
- },
- temp: {},
- searchBtnVisible: true,
- dialogPvVisible: false,
- // 校验规则
- parentClass: [],
- defaultProps: {
- children: 'children',
- label: 'name'
- },
- nodeKey: 'id',
- defaultCheckedKeys: [],
- selectionIndex: [],
- // ---------------------------------
- isContractAdd: [], isContractTemplate: [], isContractImport: [], isContractExport: [], isContractSee: [], isContractChange: [], isContractDelete: [], isContractDelete2: [],
- isContractExamineZG: [],
- // isContractExamineZL: [],
- isContractExamineZX: [],
- statues: [{ id: '0', name: '正常' }, { id: '1', name: '已过期' }, { id: '2', name: '终止' }],
- statues2: [{ id: '0', name: '正常' }, { id: '2', name: '终止' }],
- shStatues: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
- findAllProvider: [],
- findAllAssetType: [],
- findAllPasture: [],
- findAllDepart: [],
- findAllEmploye: [],
- findAllCategory: [],
- // 2-1.请求下拉框接口
- requestParams: [
- { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
- { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
- { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
- { name: 'findAllDepart', offset: 0, pagecount: 0, params: [] },
- { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
- { name: 'findAllCategory', offset: 0, pagecount: 0, params: [] }
- ],
- isokDisable: false,
- disabled: true,
- tableKey: 0,
- rules: {
- providerName: [{ required: true, message: '必填', trigger: 'blur' }],
- providerId: [{ required: true, message: '必填', trigger: 'blur' }],
- startTime: [{ required: true, message: '必填', trigger: 'blur' }],
- stopTime: [{ required: true, message: '必填', trigger: 'blur' }],
- statue: [{ required: true, message: '必填', trigger: 'blur' }]
- },
- rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
- cellStyle: { padding: 0 + 'px' },
- dialogFormVisible: false,
- dialogStatus: '',
- dialogFormVisible_change: false,
- dialogFormVisible_See: false,
- textMap: {
- card: '合同明细打印',
- create: '新增合同',
- update: '编辑',
- change: '变更',
- examine: '审核',
- examine2: '审核2',
- examine3: '审核3'
- },
- radioAll: '全部',
- getdataListParm: {
- name: 'providerPactList',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureName: Cookies.get('pasturename'),
- contractCode: '',
- statue: '',
- stuteSH: '',
- providerName: '',
- inputDatetime: ''
- }
- },
- list: [],
- activeName: 'first',
- tableKey2: 0,
- listLoading2: true,
- total2: 0,
- list2: [],
- getdataListParm2: {
- name: 'contractDetail',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- inputDatetime: '',
- providerName: '',
- contractCode: '',
- stopTime: '',
- startTime: '',
- statue: '',
- partCode: '',
- partName: '',
- pastureName: Cookies.get('pasturename')
- }
- },
- getdataListParmBeforeUploading: {
- name: 'clearPastureStock',
- page: 0,
- offset: 0,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {}
- },
- getdataListParmSee: {
- name: 'getcontratListBybig',
- returntype: 'Map',
- page: 0,
- offset: 0,
- pagecount: 10,
- parammaps: {}
- },
- totalSee: 0,
- getdataListParmChange: {
- name: 'getcontratListBybigtemp',
- returntype: 'Map',
- page: 0,
- offset: 0,
- pagecount: 10,
- parammaps: {}
- },
- listLoadingChange: true,
- totalChange: 0,
- activeList: [],
- active: 3,
- seeTemp: {},
- listSee: [],
- totalSee: 0,
- listAdd: [],
- requestBrand: {
- name: 'getBrandByPartCode',
- page: 0,
- offset: 0,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {}
- },
- BrandList: [],
- createTemp: {
- pastureId: this.$store.state.user.pastureid,
- providerName: '',
- startTime: '',
- stopTime: '',
- statue: '',
- isZeroStock: 0,
- creatorId: this.$store.state.user.employeid,
- creatorTime: parseTime(new Date(), '{y}-{m}-{d}')
- },
- pickerOptions3: {
- disabledDate(time) {
- return time.getTime() > Date.now()// 当天之前的时间可选
- }
- },
- pickerOptions1: {
- disabledDate: (time) => {
- if (this.createTemp.stopTime !== '') {
- return parseTime(time.getTime(), '{y}-{m}-{d}') > parseTime(Date.now(), '{y}-{m}-{d}') || parseTime(time.getTime(), '{y}-{m}-{d}') >= this.createTemp.stopTime
- } else {
- return time.getTime() > Date.now()
- }
- }
- },
- pickerOptions2: {
- disabledDate: (time) => {
- // return time.getTime() < this.createTemp.startTime || time.getTime() > Date.now()
- return parseTime(time.getTime(), '{y}-{m}-{d}') <= this.createTemp.startTime
- }
- },
- getParmCreateNumber: {
- name: 'autoCreatCode',
- page: 0,
- offset: 0,
- pagecount: 0,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- codeType: 'HT'
- }
- },
- requestSparePart: {
- name: 'getPartsListHT',
- page: 1,
- offset: 1,
- pagecount: 20,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid')
- }
- },
- orderPart: {},
- examineTemp: {},
- dialogFormVisible_Examine: false,
- isStatueReason: false,
- isDisabled: false,
- isDisabled2: false,
- buttons: [],
- isPercentage: false,
- percentage: 1,
- downloadParam: {},
- getParmChargeContractSHStatus: {
- name: 'chargeContractSHStatus',
- parammaps: {}
- },
- getdataListParmCopybigcontract: {
- name: 'Copybigcontract',
- parammaps: {}
- }
- }
- },
- computed: {
- // 设置请求头
- headers() {
- return {
- // 设置token
- // eslint-disable-next-line no-undef
- token: getToken()
- }
- },
- uploadData() {
- return {
- name: 'updatePastureStock',
- importParams: '合同编号,牧场,合同开始日期,合同截止日期,供应商,物料编码,品名,规格型号,计量单位,品牌,计划量,单价,备注,一级分类,二级分类,三级分类,填写人,填写时间,分管副场审核,分管副场审核时间,场长审核,场长审核时间,运营办审核,运营办审核时间,过期处理人,过期处理时间',
- sheetname: 'SheetJS'
- }
- },
- // 设置上传地址
- uploadExcelUrl() {
- // process.env.VUE_APP_BASE_API是服务器的路径,也是axios的基本路径
- return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
- }
- },
- created() {
- const that = this
- GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
- that.buttons = response.data.list
- that.getButtons()
- })
- this.getDownList()
- this.getList()
- },
- methods: {
- getButtons() {
- // 新增
- const ContractAdd = 'customs:contract:add'
- const isContractAdd = checkButtons(this.$store.state.user.buttons, ContractAdd)
- this.isContractAdd = isContractAdd
- // 模板
- const ContractTemplate = 'customs:contract:template'
- const isContractTemplate = checkButtons(this.$store.state.user.buttons, ContractTemplate)
- this.isContractTemplate = isContractTemplate
- // 导入
- const ContractImport = 'customs:contract:import'
- const isContractImport = checkButtons(this.$store.state.user.buttons, ContractImport)
- this.isContractImport = isContractImport
- // 导出
- const ContractExport = 'customs:contract:export'
- const isContractExport = checkButtons(this.$store.state.user.buttons, ContractExport)
- this.isContractExport = isContractExport
- // 查看
- const ContractSee = 'customs:contract:see'
- const isContractSee = checkButtons(this.$store.state.user.buttons, ContractSee)
- this.isContractSee = isContractSee
- // 变更
- const ContractChange = 'customs:contract:change'
- const isContractChange = checkButtons(this.$store.state.user.buttons, ContractChange)
- this.isContractChange = isContractChange
- // 删除
- const ContractDelete = 'customs:contract:delete'
- const isContractDelete = checkButtons(this.$store.state.user.buttons, ContractDelete)
- this.isContractDelete = isContractDelete
- // 高级删除
- const ContractDelete2 = 'customs:contract:delete2'
- const isContractDelete2 = checkButtons(this.$store.state.user.buttons, ContractDelete2)
- this.isContractDelete2 = isContractDelete2
- // isContractExamineZG: [], isContractExamineZL: [], isContractExamineZX: [],
- // 设备主管审核
- const ContractExamineZG = 'customs:contract:examineZG'
- const isContractExamineZG = checkButtons(this.$store.state.user.buttons, ContractExamineZG)
- this.isContractExamineZG = isContractExamineZG
- // 设备助理审核
- // const ContractExamineZL = 'customs:contract:examineZL'
- // const isContractExamineZL = checkButtons(this.$store.state.user.buttons, ContractExamineZL)
- // this.isContractExamineZL = isContractExamineZL
- // 设备中心审核
- const ContractExamineZX = 'customs:contract:examineZX'
- const isContractExamineZX = checkButtons(this.$store.state.user.buttons, ContractExamineZX)
- this.isContractExamineZX = isContractExamineZX
- },
- getDownList() {
- GetDataByNames(this.requestParams).then(response => {
- this.findAllProvider = response.data.findAllProvider.list
- this.findAllAssetType = response.data.findAllAssetType.list
- this.findAllPasture = response.data.findAllPasture.list
- this.findAllDepart = response.data.findAllDepart.list
- this.findAllEmploye = response.data.findAllEmploye.list
- this.findAllCategory = response.data.findAllCategory.list
- })
- },
- getList() {
- this.listLoading = true
- console.log(this.$refs['inputDatetime'])
- if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
- this.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
- this.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
- } else {
- this.getdataListParm.parammaps.startTime = ''
- this.getdataListParm.parammaps.stopTime = ''
- }
- console.log('table发送数据', this.getdataListParm.parammaps)
- GetDataByName(this.getdataListParm).then(response => {
- this.list = response.data.list
- this.pageNum = response.data.pageNum
- this.pageSize = response.data.pageSize
- if (response.data.total) {
- this.total = response.data.total
- }
- // // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoading = false
- }, 300)
- })
- },
- form_search() {
- this.listLoading = true
- if (this.getdataListParm.parammaps.inputDatetime === null) {
- this.getdataListParm.parammaps.inputDatetime = ''
- }
- // this.getdataListParm.parammaps.providerName = this.createTemp.providerName
- this.getdataListParm.offset = 1
- this.getList()
- },
- handleClick(tab, event) {
- console.log(tab, event)
- if (tab.name === 'second') {
- this.getList2()
- } else {
- this.getList()
- }
- },
- getList2() {
- this.listLoading2 = true
- if (this.$refs['inputDatetime2'] !== undefined && this.$refs['inputDatetime2'].value !== null) {
- this.getdataListParm2.parammaps.startTime = this.$refs['inputDatetime2'].value[0]
- this.getdataListParm2.parammaps.stopTime = this.$refs['inputDatetime2'].value[1]
- } else {
- this.getdataListParm2.parammaps.startTime = ''
- this.getdataListParm2.parammaps.stopTime = ''
- }
- GetDataByName(this.getdataListParm2).then(response => {
- this.list2 = response.data.list
- this.pageNum2 = response.data.pageNum
- this.pageSize2 = response.data.pageSize
- if (response.data.total) {
- this.total2 = response.data.total
- }
- setTimeout(() => {
- this.listLoading2 = false
- }, 300)
- })
- },
- form_search2() {
- this.listLoading2 = true
- if (this.getdataListParm2.parammaps.inputDatetime === null) {
- this.getdataListParm2.parammaps.inputDatetime = ''
- }
- this.getdataListParm2.offset = 1
- this.getList2()
- },
- changeAll() {
- console.log(this.radioAll)
- if (this.radioAll === '全部') {
- this.getdataListParm.name = 'providerPactList'
- this.getdataListParm.offset = 1
- this.getdataListParm.parammaps = {
- pastureName: Cookies.get('pasturename'),
- contractCode: '',
- statue: '',
- stuteSH: '',
- providerName: '',
- inputDatetime: ''
- }
- this.getList()
- } else if (this.radioAll === '待处理') {
- this.getdataListParm.name = 'providerPactWebListNO'
- this.getdataListParm.offset = 1
- this.getdataListParm.parammaps = {
- pastureName: this.getdataListParm.parammaps.pastureName,
- contractCode: this.getdataListParm.parammaps.contractCode,
- statue: this.getdataListParm.parammaps.statue,
- stuteSH: this.getdataListParm.parammaps.stuteSH,
- providerName: this.getdataListParm.parammaps.providerName,
- inputDatetime: this.getdataListParm.parammaps.inputDatetime,
- empId: Cookies.get('employeid'),
- pastureId: Cookies.get('pastureid'),
- deptId: Cookies.get('departmentid')
- }
- this.getList()
- } else if (this.radioAll === '已处理') {
- this.getdataListParm.name = 'providerPactWebList'
- this.getdataListParm.offset = 1
- this.getdataListParm.parammaps = {
- pastureName: this.getdataListParm.parammaps.pastureName,
- contractCode: this.getdataListParm.parammaps.contractCode,
- statue: this.getdataListParm.parammaps.statue,
- stuteSH: this.getdataListParm.parammaps.stuteSH,
- providerName: this.getdataListParm.parammaps.providerName,
- inputDatetime: this.getdataListParm.parammaps.inputDatetime,
- empId: Cookies.get('employeid'),
- pastureId: Cookies.get('pastureid'),
- deptId: Cookies.get('departmentid')
- }
- this.getList()
- }
- },
- SHStatus: function(cellValue) {
- // console.log(cellValue.isZeroStock)
- if (cellValue.SHStatus == 2) {
- return '审核中'
- } else if (cellValue.SHStatus == 3) {
- return '审核中'
- } else if (cellValue.SHStatus == 4) {
- return '未通过'
- } else if (cellValue.SHStatus == 5) {
- return '审核中'
- } else if (cellValue.SHStatus == 6) {
- return '未通过'
- } else if (cellValue.SHStatus == 7) {
- return '通过'
- } else if (cellValue.SHStatus == 8) {
- return '未通过'
- }
- },
- isZeroStock: function(cellValue) {
- if (cellValue.isZeroStock == 0) {
- return '否'
- } else if (cellValue.isZeroStock == 1) {
- return '是'
- }
- },
- form_see(row) {
- this.seeTemp = Object.assign({}, row) // copy obj
- this.dialogStatus = 'card'
- this.dialogFormVisible_See = true
- // this.seeTemp.isZeroStock = 1
- // this.$nextTick(() => {
- // this.seeTemp.isZeroStock = JSON.stringify(this.seeTemp.isZeroStock)
- // })
- console.log('查看上方数据(从table读取)', this.seeTemp.isZeroStock)
- // 基础信息
- this.getdataListParmSee.parammaps.id = row.id
- this.getListSee()
- // 流程图
- var reason = '未通过原因:' + this.seeTemp.workflowNote
- if (this.seeTemp.SHStatus == 2) {
- this.activeList = [{ title: '合同录入', date: this.seeTemp.creatorTime, name: this.seeTemp.creatorMan }, { title: '办公室主任审核' }, { title: '设备中心审核' }]
- this.active = 1
- } else if (this.seeTemp.SHStatus == 3) {
- this.activeList = [{ title: '合同录入', date: this.seeTemp.creatorTime, name: this.seeTemp.creatorMan }, { title: '办公室主任审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '设备中心审核' }]
- this.active = 2
- } else if (this.seeTemp.SHStatus == 4) {
- this.activeList = [{ title: '合同录入', date: this.seeTemp.creatorTime, name: this.seeTemp.creatorMan }, { title: '办公室主任审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson, status: 'error', reason: reason }, { title: '设备中心审核' }]
- this.active = 2
- } else if (this.seeTemp.SHStatus == 5) {
- this.activeList = [{ title: '合同录入', date: this.seeTemp.creatorTime, name: this.seeTemp.creatorMan }, { title: '办公室主任审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '设备中心审核' }]
- this.active = 2
- } else if (this.seeTemp.SHStatus == 6) {
- this.activeList = [{ title: '合同录入', date: this.seeTemp.creatorTime, name: this.seeTemp.creatorMan }, { title: '办公室主任审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '设备中心审核' }]
- this.active = 3
- } else if (this.seeTemp.SHStatus == 7) {
- this.activeList = [{ title: '合同录入', date: this.seeTemp.creatorTime, name: this.seeTemp.creatorMan }, { title: '办公室主任审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '设备中心审核', date: this.seeTemp.CGChargedate, name: this.seeTemp.CGChargePerson }]
- this.active = 4
- } else if (this.seeTemp.SHStatus == 8) {
- this.activeList = [{ title: '合同录入', date: this.seeTemp.creatorTime, name: this.seeTemp.creatorMan }, { title: '办公室主任审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '设备中心审核', date: this.seeTemp.CGChargedate, name: this.seeTemp.CGChargePerson, status: 'error', reason: reason }]
- this.active = 4
- }
- },
- getListSee() {
- GetDataByName(this.getdataListParmSee).then(response => {
- this.listSee = response.data.list
- this.pageNumSee = response.data.pageNum
- this.pageSizeSee = response.data.pageSize
- if (response.data.total) {
- this.totalSee = response.data.total
- }
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
- const srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
- const picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
- this.listSee[i].srcpath = srcpath
- this.listSee[i].picpath = picpath
- } else {
- this.listSee[i].srcpath = ''
- this.listSee[i].picpath = ''
- }
- }
- }
- console.log('查看下方table数据', this.listSee)
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoadingSee = false
- }, 300)
- })
- },
- resetCreateTemp() {
- // 格式化日期
- parseTime(new Date(), '{y}-{m}-{d}')
- this.temp.defaultCheckedKeys = []
- this.list2 = null
- this.listAdd = []
- // ---
- this.createTemp.pastureId = this.$store.state.user.pastureid
- this.createTemp.providerName = ''
- this.createTemp.startTime = ''
- this.createTemp.stopTime = ''
- this.createTemp.statue = ''
- this.createTemp.isZeroStock = 0
- this.createTemp.creatorId = this.$store.state.user.employeid
- this.createTemp.creatorTime = parseTime(new Date(), '{y}-{m}-{d}')
- this.createTemp.contractCode = ''
- },
- form_add() {
- this.resetCreateTemp()
- this.dialogStatus = 'create'
- this.dialogFormVisible = true
- this.createTemp.pastureId = this.$store.state.user.pastureid
- this.createTemp.record = '#409EFF'
- this.isDisabled2 = true
- this.$nextTick(() => {
- this.$refs['createTemp'].clearValidate()
- })
- this.getCreateNumber()
- },
- getCreateNumber() {
- GetDataByName(this.getParmCreateNumber).then(response => {
- this.$nextTick(() => {
- console.log('合同编号', response.data.list[0].orderCode)
- this.createTemp.contractCode = response.data.list[0].orderCode
- this.$forceUpdate()
- })
- })
- },
- changeTime(val) {
- if (parseTime(new Date(), '{y}-{m}-{d}') <= this.createTemp.stopTime) {
- this.createTemp.statue = '正常'
- this.createTemp.statueId = 0
- } else {
- this.createTemp.statue = '已过期'
- this.createTemp.statueId = 1
- }
- },
- sparePartSearch(queryString, cb) {
- console.log('备件模糊查询输入值', queryString)
- this.requestSparePart.parammaps['partCode'] = queryString
- GetDataByName(this.requestSparePart).then(response => {
- console.log('备件模糊查询搜索data', response.data.list)
- if (response.data.list == null) {
- cb([])
- } else {
- cb(response.data.list)
- }
- })
- },
- handleSelectSparePart(item) {
- console.log('备件模糊查询选中值', item)
- // this.listAdd.push(item)
- if (this.listAdd.length > 0) {
- // eslint-disable-next-line no-redeclare
- if (this.listAdd.find(obj => obj.partId === item.partId)) {
- this.$message({
- type: 'warning',
- message: '此备件已存在,请重新选择备件'
- })
- } else {
- if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
- this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
- this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
- } else {
- item.srcpath = ''
- item.picpath = ''
- }
- this.$set(item, 'myid', new Date().getTime())
- this.listAdd.unshift(item)
- }
- } else {
- if (item.srcpath !== null && item.picpath !== null) {
- this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
- this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
- } else {
- item.srcpath = ''
- item.picpath = ''
- }
- this.$set(item, 'myid', new Date().getTime())
- this.listAdd.unshift(item)
- }
- },
- brandSearch(queryString, cb) {
- console.log('品牌模糊查询输入值', queryString)
- this.requestBrand.parammaps['brandName'] = queryString
- GetDataByName(this.requestBrand).then(response => {
- console.log('品牌模糊查询搜索data', response.data.list)
- this.BrandList = response.data.list
- cb(this.BrandList)
- })
- },
- handleSelectBrand(item, row) {
- console.log('品牌模糊查询选中值', item)
- console.log('品牌模糊查询选中值所在行', row)
- this.$set(row, 'brandName', item.brandName)
- this.$set(row, 'brandId', item.brandId)
- this.$forceUpdate()
- },
- handleFocusBrand(row) {
- this.$set(row, 'brandName', '')
- this.$set(row, 'brandId', '')
- },
- handleBlurBrand(row) {
- if (row.brandId == '') {
- this.$set(row, 'brand', '')
- this.$set(row, 'brandName', '')
- this.$set(row, 'brandId', '')
- }
- },
- partDelete(row) {
- console.log(this.listAdd)
- MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- // console.log(this.list2)
- for (var i = 0; i < this.listAdd.length; i++) {
- console.log(this.listAdd[i])
- if (this.listAdd[i].myid === row.myid) {
- var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
- }
- if (listAddIndex > -1) {
- this.listAdd.splice(listAddIndex, 1)
- return
- }
- }
- })
- },
- add_dialog_save() {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['createTemp'].validate(valid => {
- if (valid) {
- if (this.createTemp.contractCode == '' || this.createTemp.contractCode == null || this.createTemp.contractCode == undefined) {
- GetDataByName(this.getParmCreateNumber).then(response => {
- this.$nextTick(() => {
- console.log('合同编号', response.data.list[0].orderCode)
- this.createTemp.contractCode = response.data.list[0].orderCode
- this.$forceUpdate()
- this.add_dialog_saveSave()
- })
- })
- } else {
- this.add_dialog_saveSave()
- }
- }
- })
- },
- add_dialog_saveSave() {
- if (this.listAdd.length !== 0) {
- for (var j = 0; j < this.listAdd.length; j++) {
- if (this.listAdd[j].planAmount == null || this.listAdd[j].brand == null || this.listAdd[j].price == null || this.listAdd[j].planAmount == '' || this.listAdd[j].brand === '' || this.listAdd[j].brandId === '' || this.listAdd[j].price == '' || this.listAdd[j].brand == undefined || this.listAdd[j].brandId == undefined) {
- this.$message({
- type: 'warning',
- message: '请检查备件品牌或计划量或单价是否为空',
- duration: 2000
- })
- return false
- } else {
- var rulesPlanAmount = /^[1-9]\d*$/
- if (!rulesPlanAmount.test(parseFloat(this.listAdd[j].planAmount))) {
- this.$message({
- type: 'error',
- message: '计划量请输入正整数',
- duration: 2000
- })
- return false
- } else {
- var rulesPrice = /(^[1-9](\d+)?(\.\d{1,5})?$)|(^\d\.\d{1,5}$)/
- if (!rulesPrice.test(parseFloat(this.listAdd[j].price))) {
- this.$message({
- type: 'error',
- message: '价格请输入正数,最多保留小数点后五位',
- duration: 2000
- })
- return false
- }
- }
- }
- }
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- this.postDataPramas.data[0] = { 'name': 'insertBigContract', 'type': 'e', 'parammaps': {
- pastureId: this.createTemp.pastureId,
- providerId: this.createTemp.providerId,
- providerName: this.createTemp.providerName,
- startTime: this.createTemp.startTime,
- stopTime: this.createTemp.stopTime,
- contractCode: this.createTemp.contractCode,
- creatorId: this.createTemp.creatorId,
- creatorMan: this.createTemp.creatorMan,
- creatorTime: this.createTemp.creatorTime,
- isZeroStock: this.createTemp.isZeroStock,
- statue: 1
- }}
- this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
- this.postDataPramas.data[1].children = []
- this.postDataPramas.data[1].children[0] = { 'name': 'insertContract', 'type': 'e', 'parammaps': {
- bigId: '@insertBigContract.LastInsertId',
- pastureId: this.createTemp.pastureId,
- pastureName: '@insertSpotList.pastureName',
- partId: '@insertSpotList.partId',
- partName: '@insertSpotList.partName',
- partCode: '@insertSpotList.partCode',
- specification: '@insertSpotList.specification',
- price: '@insertSpotList.price',
- brandId: '@insertSpotList.brandId',
- brand: '@insertSpotList.brand',
- planAmount: '@insertSpotList.planAmount',
- remark: '@insertSpotList.remark',
- unit: '@insertSpotList.unit'
- }}
- ExecDataByConfig(this.postDataPramas).then(response => {
- console.log('新增保存发送参数', this.postDataPramas)
- if (response.msg === 'fail') {
- this.$notify({
- title: '保存失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.getdataListParm.parammaps.inputDatetime = ''
- this.getList()
- this.dialogFormVisible = false
- this.createTemp.providerName = ''
- this.$notify({
- title: '',
- message: '保存成功',
- type: 'success',
- duration: 2000
- })
- }
- })
- return true
- } else {
- this.$notify({
- title: '',
- message: '请选择备件',
- type: 'warning',
- duration: 2000
- })
- return false
- }
- },
- beforeUploading() {
- PostDataByName(this.getdataListParmBeforeUploading).then(response => {
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoading = false
- }, 300)
- })
- },
- handleExamine(row) {
- console.log('点击了设备主管审核')
- if (row == undefined) {
- this.examineTemp = this.seeTemp
- this.$set(this.seeTemp, 'statueSH', 1)
- this.$set(this.seeTemp, 'workflowNote', '')
- } else {
- this.examineTemp = Object.assign({}, row)
- this.$set(this.examineTemp, 'statueSH', 1)
- this.$set(this.examineTemp, 'workflowNote', '')
- }
- this.dialogStatus = 'examine'
- this.dialogFormVisible_Examine = true
- this.statueReason = false
- },
- changeStatue(val) {
- console.log(val)
- if (val == 2) {
- this.isStatueReason = true
- } else {
- this.isStatueReason = false
- }
- },
- createExamineData() {
- console.log('点击了设备主管审核确认')
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['examineTemp'].validate(valid => {
- if (valid) {
- this.requestParam.name = 'contractCharge'
- this.requestParam.parammaps = {}
- this.requestParam.parammaps.id = this.examineTemp.id
- if (this.examineTemp.statueSH === 1) {
- this.requestParam.parammaps.statue = 5
- } else {
- this.requestParam.parammaps.statue = 4
- }
- this.requestParam.parammaps.empId = Cookies.get('employeid')
- this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
- PostDataByName(this.requestParam).then(response => {
- console.log('设备主管审核确认发送参数', this.requestParam)
- if (response.msg !== 'fail') {
- if (this.getdataListParm.parammaps.inputDatetime === null) {
- this.getdataListParm.parammaps.inputDatetime = ''
- }
- this.getList()
- this.dialogFormVisible_Examine = false
- this.dialogFormVisible_See = false
- this.isStatueReason = false
- this.$notify({
- title: '成功',
- message: '审核成功',
- type: 'success',
- duration: 2000
- })
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- })
- },
- handleExamine2(row) {
- console.log('点击了设备助理审核')
- if (row == undefined) {
- this.examineTemp = this.seeTemp
- this.$set(this.seeTemp, 'statueSH', 1)
- this.$set(this.seeTemp, 'workflowNote', '')
- } else {
- this.examineTemp = Object.assign({}, row)
- this.$set(this.examineTemp, 'statueSH', 1)
- this.$set(this.examineTemp, 'workflowNote', '')
- }
- this.dialogStatus = 'examine2'
- this.dialogFormVisible_Examine = true
- this.statueReason = false
- },
- createExamineData2() {
- console.log('点击了设备助理审核确认')
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['examineTemp'].validate(valid => {
- if (valid) {
- this.requestParam.name = 'contractCharge3'
- this.requestParam.parammaps = {}
- this.requestParam.parammaps.id = this.examineTemp.id
- if (this.examineTemp.statueSH === 1) {
- this.requestParam.parammaps.statue = 5
- } else {
- this.requestParam.parammaps.statue = 6
- }
- this.requestParam.parammaps.empId = Cookies.get('employeid')
- this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
- PostDataByName(this.requestParam).then(response => {
- console.log('设备助理审核确认发送参数', this.requestParam)
- if (response.msg !== 'fail') {
- if (this.getdataListParm.parammaps.inputDatetime === null) {
- this.getdataListParm.parammaps.inputDatetime = ''
- }
- this.getList()
- this.dialogFormVisible_Examine = false
- this.dialogFormVisible_See = false
- this.isStatueReason = false
- this.$notify({
- title: '成功',
- message: '审核成功',
- type: 'success',
- duration: 2000
- })
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- })
- },
- handleExamine3(row) {
- console.log('点击了设备中心审核')
- if (row == undefined) {
- this.examineTemp = this.seeTemp
- this.$set(this.seeTemp, 'statueSH', 1)
- this.$set(this.seeTemp, 'workflowNote', '')
- } else {
- this.examineTemp = Object.assign({}, row)
- this.$set(this.examineTemp, 'statueSH', 1)
- this.$set(this.examineTemp, 'workflowNote', '')
- }
- this.dialogStatus = 'examine3'
- this.dialogFormVisible_Examine = true
- this.statueReason = false
- },
- createExamineData3() {
- console.log('点击了设备中心审核确认')
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['examineTemp'].validate(valid => {
- if (valid) {
- if (this.examineTemp.statueSH === 1) {
- this.requestParam.common = { 'returnmap': '0' }
- this.requestParam.data = []
- this.requestParam.data[0] = { 'name': 'contractCharge1', 'type': 'e', 'parammaps': {
- statue: 7,
- empId: Cookies.get('employeid'),
- workflowNote: this.examineTemp.workflowNote,
- id: this.examineTemp.id
- }}
- this.requestParam.data[1] = { 'name': 'updateBigcontractbyCode', 'type': 'e', 'parammaps': {
- precontractCode: this.examineTemp.precontractCode
- }}
- ExecDataByConfig(this.requestParam).then(response => {
- console.log('新增保存发送参数', this.requestParam)
- if (response.msg === 'fail') {
- this.$notify({
- title: '保存失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.getList()
- this.dialogFormVisible_Examine = false
- this.dialogFormVisible_See = false
- this.isStatueReason = false
- this.$notify({
- title: '',
- message: '保存成功',
- type: 'success',
- duration: 2000
- })
- }
- })
- } else {
- this.requestParam.name = 'contractCharge1'
- this.requestParam.parammaps = {}
- this.requestParam.parammaps.id = this.examineTemp.id
- this.requestParam.parammaps.statue = 8
- this.requestParam.parammaps.empId = Cookies.get('employeid')
- this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
- PostDataByName(this.requestParam).then(response => {
- console.log('设备中心审核确认发送参数', this.requestParam)
- if (response.msg !== 'fail') {
- if (this.getdataListParm.parammaps.inputDatetime === null) {
- this.getdataListParm.parammaps.inputDatetime = ''
- }
- this.getList()
- this.dialogFormVisible_Examine = false
- this.dialogFormVisible_See = false
- this.isStatueReason = false
- this.$notify({
- title: '成功',
- message: '审核成功',
- type: 'success',
- duration: 2000
- })
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- }
- })
- },
- getListChange() {
- GetDataByName(this.getdataListParmChange).then(response => {
- this.$nextTick(() => {
- this.listAdd = response.data.list
- })
- this.pageNumChange = response.data.pageNum
- this.pageSizeChange = response.data.pageSize
- if (response.data.total) {
- this.totalChange = response.data.total
- }
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
- const srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
- const picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
- this.listAdd[i].srcpath = srcpath
- this.listAdd[i].picpath = picpath
- } else {
- this.listAdd[i].srcpath = ''
- this.listAdd[i].picpath = ''
- }
- }
- }
- console.log('变更下方table数据', this.listSee)
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoadingChange = false
- }, 300)
- })
- },
- handleChange(row) {
- this.getParmChargeContractSHStatus.parammaps.contractCode = row.contractCode
- GetDataByName(this.getParmChargeContractSHStatus).then(response => {
- this.$nextTick(() => {
- if (response.data.list[0].flag == 0) {
- this.getdataListParmCopybigcontract.parammaps.id = row.id
- this.getdataListParmCopybigcontract.parammaps.pastureId = row.pastureId
- GetDataByName(this.getdataListParmCopybigcontract).then(response => {
- this.dialogStatus = 'change'
- this.dialogFormVisible_change = true
- this.createTemp = Object.assign({}, row)
- this.createTemp.precontractCode = row.contractCode
- this.isDisabled = false
- this.isDisabled2 = true
- this.getCreateNumber()
- this.getdataListParmChange.parammaps.id = response.data.list[0].msg
- this.getListChange()
- })
- } else {
- this.$message({
- message: '此合同变更审核中,不可重复变更',
- type: 'warning'
- })
- }
- })
- })
- },
- changeStatues(val) {
- if (val == '终止') {
- this.isDisabled = true
- this.isDisabled2 = false
- } else {
- this.isDisabled = false
- this.isDisabled2 = true
- }
- },
- partSmallSave(row) {
- console.log(row)
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- if (row.id == null || row.id == undefined) {
- if (row.brand == '' || row.brandId == '' || row.planAmount == '' || row.price == '') {
- this.$message({
- message: '请检查备件品牌或计划量或单价是否为空',
- type: 'warning'
- })
- return false
- } else {
- this.postDataPramas.name = 'updatecontrattempNoId'
- this.postDataPramas.parammaps = {}
- this.postDataPramas.parammaps.bigId = this.getdataListParmChange.parammaps.id
- this.postDataPramas.parammaps.pastureId = this.createTemp.pastureId
- this.postDataPramas.parammaps.pastureName = this.createTemp.pastureName
- this.postDataPramas.parammaps.partId = row.partId
- this.postDataPramas.parammaps.partName = row.partName
- this.postDataPramas.parammaps.partCode = row.partCode
- this.postDataPramas.parammaps.specification = row.specification
- this.postDataPramas.parammaps.price = row.price
- this.postDataPramas.parammaps.brandId = row.brandId
- this.postDataPramas.parammaps.brand = row.brand
- this.postDataPramas.parammaps.planAmount = row.planAmount
- this.postDataPramas.parammaps.remark = row.remark
- this.postDataPramas.parammaps.unit = row.unit
- PostDataByName(this.postDataPramas).then(response => {
- console.log('保存发送参数', this.requestParam)
- if (response.msg !== 'fail') {
- this.getListChange()
- this.$notify({
- title: '成功',
- message: '保存成功',
- type: 'success',
- duration: 2000
- })
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- } else {
- if (row.brand == '' || row.brandId == '' || row.planAmount == '' || row.price == '') {
- this.$message({
- message: '请检查备件品牌或计划量或单价是否为空',
- type: 'warning'
- })
- return false
- } else {
- this.postDataPramas.name = 'updatecontrattemp'
- this.postDataPramas.parammaps = {}
- this.postDataPramas.parammaps.brandId = row.brandId
- this.postDataPramas.parammaps.brand = row.brand
- this.postDataPramas.parammaps.planAmount = row.planAmount
- this.postDataPramas.parammaps.price = row.price
- this.postDataPramas.parammaps.remark = row.remark
- this.postDataPramas.parammaps.id = row.id
- PostDataByName(this.postDataPramas).then(response => {
- console.log('保存发送参数', this.requestParam)
- if (response.msg !== 'fail') {
- this.getListChange()
- this.$notify({
- title: '成功',
- message: '保存成功',
- type: 'success',
- duration: 2000
- })
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- }
- },
- partSmallDelete(row) {
- if (row.id == null || row.id == undefined) {
- MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- for (var i = 0; i < this.listAdd.length; i++) {
- console.log(this.listAdd[i])
- if (this.listAdd[i].myid === row.myid) {
- var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
- }
- if (listAddIndex > -1) {
- this.listAdd.splice(listAddIndex, 1)
- return
- }
- }
- })
- } else {
- MessageBox.confirm('确认删除此信息?', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.postDataPramas.name = 'deletecontrattemp'
- this.postDataPramas.parammaps = {}
- this.postDataPramas.parammaps['id'] = row.id
- PostDataByName(this.postDataPramas).then(() => {
- this.getListChange()
- this.$notify({
- title: '成功',
- message: '删除成功',
- type: 'success',
- duration: 2000
- })
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- })
- })
- }
- },
- changeData() {
- if (this.createTemp.statue == '终止') {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['createTemp'].validate(valid => {
- if (valid) {
- this.postDataPramas = {}
- this.postDataPramas.name = 'updatecontractstatu'
- this.postDataPramas.parammaps = {}
- this.postDataPramas.parammaps.id = this.createTemp.id
- PostDataByName(this.postDataPramas).then(response => {
- console.log('变更保存发送参数', this.requestParam)
- if (response.msg !== 'fail') {
- this.dialogFormVisible_change = false
- this.getList()
- this.$notify({
- title: '成功',
- message: '变更成功',
- type: 'success',
- duration: 2000
- })
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- })
- // this.$refs['createTemp'].validate(valid => {
- // if (valid) {
- // if (valid) {
- // if (this.listAdd.length !== 0) {
- // for (var j = 0; j < this.listAdd.length; j++) {
- // if (this.listAdd[j].planAmount == null || this.listAdd[j].brand == null || this.listAdd[j].price == null || this.listAdd[j].planAmount == '' || this.listAdd[j].brand === '' || this.listAdd[j].brandId === '' || this.listAdd[j].price == '' || this.listAdd[j].brand == undefined || this.listAdd[j].brandId == undefined) {
- // this.$message({
- // type: 'warning',
- // message: '请检查备件品牌或计划量或单价是否为空',
- // duration: 2000
- // })
- // return false
- // } else {
- // var rulesPlanAmount = /^[1-9]\d*$/
- // if (!rulesPlanAmount.test(parseFloat(this.listAdd[j].planAmount))) {
- // this.$message({
- // type: 'error',
- // message: '计划量请输入正整数',
- // duration: 2000
- // })
- // return false
- // } else {
- // var rulesPrice = /(^[1-9](\d+)?(\.\d{1,3})?$)|(^\d\.\d{1,3}$)/
- // if (!rulesPrice.test(parseFloat(this.listAdd[j].price))) {
- // this.$message({
- // type: 'error',
- // message: '价格请输入正数,最多保留小数点后三位',
- // duration: 2000
- // })
- // return false
- // }
- // }
- // }
- // }
- // this.postDataPramas.common = { 'returnmap': '0' }
- // this.postDataPramas.data = []
- // this.postDataPramas.data[0] = { 'name': 'insertBigContract', 'type': 'e', 'parammaps': {
- // pastureId: this.createTemp.pastureId,
- // providerId: this.createTemp.providerId,
- // providerName: this.createTemp.providerName,
- // startTime: this.createTemp.startTime,
- // stopTime: this.createTemp.stopTime,
- // contractCode: this.createTemp.precontractCode + '(终止)' + parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}'),
- // creatorId: this.createTemp.creatorId,
- // creatorMan: this.createTemp.creatorMan,
- // creatorTime: this.createTemp.creatorTime,
- // isZeroStock: this.createTemp.isZeroStock,
- // statue: 0,
- // remark: this.createTemp.remark,
- // precontractCode: this.createTemp.precontractCode
- // }}
- // this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
- // this.postDataPramas.data[1].children = []
- // this.postDataPramas.data[1].children[0] = { 'name': 'insertContract', 'type': 'e', 'parammaps': {
- // bigId: '@insertBigContract.LastInsertId',
- // pastureId: this.createTemp.pastureId,
- // pastureName: this.createTemp.pastureName,
- // partId: '@insertSpotList.partId',
- // partName: '@insertSpotList.partName',
- // partCode: '@insertSpotList.partCode',
- // specification: '@insertSpotList.specification',
- // price: '@insertSpotList.price',
- // brandId: '@insertSpotList.brandId',
- // brand: '@insertSpotList.brand',
- // planAmount: '@insertSpotList.planAmount',
- // remark: '@insertSpotList.remark',
- // unit: '@insertSpotList.unit'
- // }}
- // // this.postDataPramas.data[2] = { 'name': 'updateBigcontract', 'type': 'e', 'parammaps': {
- // // id: this.createTemp.id
- // // }}
- // ExecDataByConfig(this.postDataPramas).then(response => {
- // console.log('合同终止-保存发送参数', this.postDataPramas)
- // if (response.msg === 'fail') {
- // this.$notify({
- // title: '保存失败',
- // message: response.data,
- // type: 'warning',
- // duration: 2000
- // })
- // } else {
- // this.getdataListParm.parammaps.inputDatetime = ''
- // this.getList()
- // this.dialogFormVisible_change = false
- // this.createTemp.providerName = ''
- // this.$notify({
- // title: '',
- // message: '保存成功',
- // type: 'success',
- // duration: 2000
- // })
- // }
- // })
- // return true
- // } else {
- // this.$notify({
- // title: '',
- // message: '请选择备件',
- // type: 'warning',
- // duration: 2000
- // })
- // return false
- // }
- // }
- // }
- // })
- } else {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['createTemp'].validate(valid => {
- if (valid) {
- this.postDataPramas.name = 'Copybigcontracttemp'
- this.postDataPramas.parammaps = {}
- this.postDataPramas.parammaps.id = this.getdataListParmChange.parammaps.id
- PostDataByName(this.postDataPramas).then(response => {
- console.log('变更保存发送参数', this.requestParam)
- if (response.msg !== 'fail') {
- this.dialogFormVisible_change = false
- this.getList()
- this.$notify({
- title: '成功',
- message: '变更成功',
- type: 'success',
- duration: 2000
- })
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- })
- // this.$refs['createTemp'].validate(valid => {
- // if (valid) {
- // if (valid) {
- // if (this.listAdd.length !== 0) {
- // for (var j = 0; j < this.listAdd.length; j++) {
- // if (this.listAdd[j].planAmount == null || this.listAdd[j].brand == null || this.listAdd[j].price == null || this.listAdd[j].planAmount == '' || this.listAdd[j].brand === '' || this.listAdd[j].brandId === '' || this.listAdd[j].price == '' || this.listAdd[j].brand == undefined || this.listAdd[j].brandId == undefined) {
- // this.$message({
- // type: 'warning',
- // message: '请检查备件品牌或计划量或单价是否为空',
- // duration: 2000
- // })
- // return false
- // } else {
- // var rulesPlanAmount = /^[1-9]\d*$/
- // if (!rulesPlanAmount.test(parseFloat(this.listAdd[j].planAmount))) {
- // this.$message({
- // type: 'error',
- // message: '计划量请输入正整数',
- // duration: 2000
- // })
- // return false
- // } else {
- // var rulesPrice = /(^[1-9](\d+)?(\.\d{1,3})?$)|(^\d\.\d{1,3}$)/
- // if (!rulesPrice.test(parseFloat(this.listAdd[j].price))) {
- // this.$message({
- // type: 'error',
- // message: '价格请输入正数,最多保留小数点后三位',
- // duration: 2000
- // })
- // return false
- // }
- // }
- // }
- // }
- // this.postDataPramas.common = { 'returnmap': '0' }
- // this.postDataPramas.data = []
- // this.postDataPramas.data[0] = { 'name': 'insertBigContract', 'type': 'e', 'parammaps': {
- // pastureId: this.createTemp.pastureId,
- // providerId: this.createTemp.providerId,
- // providerName: this.createTemp.providerName,
- // startTime: this.createTemp.startTime,
- // stopTime: this.createTemp.stopTime,
- // contractCode: this.createTemp.contractCode,
- // creatorId: this.createTemp.creatorId,
- // creatorMan: this.createTemp.creatorMan,
- // creatorTime: this.createTemp.creatorTime,
- // isZeroStock: this.createTemp.isZeroStock,
- // statue: 1,
- // remark: this.createTemp.remark,
- // precontractCode: this.createTemp.precontractCode
- // }}
- // this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
- // this.postDataPramas.data[1].children = []
- // this.postDataPramas.data[1].children[0] = { 'name': 'insertContract', 'type': 'e', 'parammaps': {
- // bigId: '@insertBigContract.LastInsertId',
- // pastureId: this.createTemp.pastureId,
- // pastureName: this.createTemp.pastureName,
- // partId: '@insertSpotList.partId',
- // partName: '@insertSpotList.partName',
- // partCode: '@insertSpotList.partCode',
- // specification: '@insertSpotList.specification',
- // price: '@insertSpotList.price',
- // brandId: '@insertSpotList.brandId',
- // brand: '@insertSpotList.brand',
- // planAmount: '@insertSpotList.planAmount',
- // remark: '@insertSpotList.remark',
- // unit: '@insertSpotList.unit'
- // }}
- // // this.postDataPramas.data[2] = { 'name': 'updateBigcontract', 'type': 'e', 'parammaps': {
- // // id: this.createTemp.id
- // // }}
- // console.log(this.listAdd[0].brandId)
- // console.log(this.listAdd[0].brand)
- // ExecDataByConfig(this.postDataPramas).then(response => {
- // console.log('新增保存发送参数', this.postDataPramas)
- // if (response.msg === 'fail') {
- // this.$notify({
- // title: '保存失败',
- // message: response.data,
- // type: 'warning',
- // duration: 2000
- // })
- // } else {
- // this.getdataListParm.parammaps.inputDatetime = ''
- // this.getList()
- // this.dialogFormVisible_change = false
- // this.createTemp.providerName = ''
- // this.$notify({
- // title: '',
- // message: '保存成功',
- // type: 'success',
- // duration: 2000
- // })
- // }
- // })
- // return true
- // } else {
- // this.$notify({
- // title: '',
- // message: '请选择备件',
- // type: 'warning',
- // duration: 2000
- // })
- // return false
- // }
- // }
- // }
- // })
- }
- },
- // --------------------------------------------
- // 导出
- handleDownload() {
- this.$alert('合同管理正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
- this.isPercentage = true
- this.percentage = 1
- var timer = setInterval(() => {
- this.percentage += 5
- if (this.percentage > 95) {
- this.percentage = 99
- clearInterval(timer)
- }
- this.percentage = this.percentage
- }, 1000)
- this.downloadParam.name = 'contractDownload'
- this.downloadParam.parammaps = this.getdataListParm.parammaps
- GetAccount(this.downloadParam).then(response => {
- if (response.data.list !== '') {
- this.percentage = 99
- setTimeout(() => {
- this.isPercentage = false
- }, 2000)
- }
- this.$nextTick(() => {
- const ExcelDatas = [
- {
- tHeader: ['合同编号', '牧场', '合同开始日期', '合同截止日期', '供应商', '物料编码', '品名', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注', '一级分类', '二级分类', '三级分类', '填写人', '填写时间', '合同状态', '是否零库存(0否,1是)'],
- filterVal: ['contractCode', 'pastureName', 'startTime', 'stopTime', 'providerName', 'partCode', 'partName', 'specification', 'unit', 'brand', 'planAmount', 'price', 'remark', '', '', '', 'creatorMan', 'creatorTime', 'statue', 'isZeroStock'],
- tableDatas: response.data.list,
- sheetName: '合同管理'
- }
- ]
- json2excel(ExcelDatas, '合同管理', true, 'xlsx')
- })
- })
- },
- // 导出模板
- handleDownloadTemp() {
- this.requestParam.name = 'pStockDownTemp'
- GetDataByName(this.requestParam).then(response => {
- this.$nextTick(() => {
- import('@/vendor/Export2Excel').then(excel => {
- const list1 = response.data.list
- const tHeader = [
- '合同编号', '牧场', '合同开始日期', '合同截止日期', '供应商', '物料编码', '品名', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注', '一级分类', '二级分类', '三级分类', '填写人', '填写时间'
- ]
- const filterVal = [
- '合同编号', '牧场', '合同开始日期', '合同截止日期', '供应商', '物料编码', '品名', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注', '一级分类', '二级分类', '三级分类', '填写人', '填写时间'
- ]
- const data1 = this.formatJsonTemp(filterVal, list1)
- excel.export_json_to_excel({
- header: tHeader,
- data: data1,
- filename: '合同信息模板',
- autoWidth: true,
- bookType: 'xlsx'
- })
- })
- })
- })
- },
- formatJsonTemp(filterVal, jsonData) {
- return jsonData.map(v =>
- filterVal.map(j => {
- if (j === 'timestamp') {
- return parseTime(v[j])
- } else {
- return v[j]
- }
- })
- )
- },
- beforeImportExcel(file) {
- const isLt2M = file.size / 1024 / 1024 < 6
- if (!isLt2M) {
- this.$message.error('上传文件大小不能超过 6MB!')
- }
- return isLt2M
- },
- handleImportExcelSuccess(res, file) {
- this.getList()
- if (res.msg === 'ok') {
- this.$message({
- title: '成功',
- message: '导入成功:' + res.data.success + '条!',
- type: 'success',
- duration: 2000
- })
- if (res.data.err_count > 0) {
- this.$notify({
- title: '失败',
- message: '导入失败:' + res.data.err_count + '条!',
- type: 'danger',
- duration: 2000
- })
- import('@/vendor/Export2Excel').then(excel => {
- const list1 = res.data.result
- const tHeader = [
- '合同编号', '牧场', '合同开始日期', '合同截止日期', '供应商', '物料编码', '品名', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注', '一级分类', '二级分类', '三级分类', '填写人', '填写时间', '分管副场审核', '分管副场审核时间', '场长审核', '场长审核时间', '运营办审核', '运营办审核时间', '过期处理人', '过期处理时间', '报错信息'
- ]
- const filterVal = [
- '合同编号', '牧场', '合同开始日期', '合同截止日期', '供应商', '物料编码', '品名', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注', '一级分类', '二级分类', '三级分类', '填写人', '填写时间', '分管副场审核', '分管副场审核时间', '场长审核', '场长审核时间', '运营办审核', '运营办审核时间', '过期处理人', '过期处理时间', 'error_msg'
- ]
- const data1 = this.formatJson(filterVal, list1)
- excel.export_json_to_excel({
- header: tHeader,
- data: data1,
- filename: '合同报错信息',
- autoWidth: true,
- bookType: 'xlsx'
- })
- })
- }
- } else {
- this.$notify({
- title: '失败',
- message: '上传失败,文件格式错误',
- type: 'danger',
- duration: 2000
- })
- }
- },
- formatJson(filterVal, jsonData) {
- return jsonData.map(v =>
- filterVal.map(j => {
- if (j === 'timestamp') {
- return parseTime(v[j])
- } else {
- return v[j]
- }
- })
- )
- },
- // 供应商模糊查询
- providerSearch(queryString, cb) {
- var returnList = this.findAllProvider
- var results = queryString ? returnList.filter(this.createFilter(queryString)) : returnList
- // 调用 callback 返回建议列表的数据
- cb(results)
- },
- createFilter(queryString) {
- return returnValue => {
- return (
- returnValue.name.toLowerCase().indexOf(queryString.toLowerCase()) >= 0
- )
- }
- },
- handleSelectProvider(item) {
- console.log(item)
- this.$set(this.createTemp, 'providerId', item.id)
- this.$set(this.createTemp, 'providerName', item.name)
- // this.createTemp.providerId = item.id
- // this.createTemp.providerName = item.name
- },
- handleFocusProvider() {
- this.createTemp.providerId = ''
- this.createTemp.providerName = ''
- },
- handleBlurProvider() {
- if (this.createTemp.providerId == '') {
- this.createTemp.providerId = ''
- this.createTemp.providerName = ''
- }
- },
- // 1-1: table&搜索
- tableCellClassName({ row, column, rowIndex, columnIndex }) {
- row.index = rowIndex
- column.index = columnIndex
- },
- selected(select) {
- // this.batchCancelId = []
- this.selectionIndex = []
- this.selectionIndex.push(3, 4, 5)
- // console.log(this.selectionIndex)
- },
- // 2-2:下拉框
- popoverHide(checkedIds, checkedData) {
- this.temp.categoryId = checkedIds
- this.temp.stockNumber = checkedData.checkNumber
- // console.log(checkedIds, checkedData.checkNumber)
- },
- handleModifyStatus(row, status) {
- this.$message({
- message: '操作成功',
- type: 'success'
- })
- row.status = status
- },
- // 合同明细打印
- edit_dialog_save() {
- this.$refs['temp'].validate(valid => {
- if (valid) {
- this.requestParam.name = 'updateStock'
- this.requestParam.parammaps = this.temp
- PostDataByName(this.requestParam).then(response => {
- console.log(response)
- if (response.msg === 'fail') {
- this.$notify({
- title: '失败',
- message: '保存失败-' + response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.getList()
- this.dialogFormVisible = false
- this.$notify({
- title: '成功',
- message: '修改成功',
- type: 'success',
- duration: 2000
- })
- }
- })
- }
- })
- },
- // 修改
- form_edit(row) {
- this.temp = Object.assign({}, row) // copy obj
- // 基础信息
- this.defaultCheckedKeys = [this.temp.categoryId]
- this.dialogStatus = 'update'
- this.dialogFormVisible = true
- this.getdataListParmSee.parammaps.pastureId = row.pastureId
- this.getdataListParmSee.parammaps.contractNO = row.contractNO
- this.getListCard()
- },
- getListCard() {
- GetDataByName(this.getdataListParmSee).then(response => {
- // this.list2 = response.data.list
- console.log(this.list2)
- // this.pageNum = response.data.pageNum
- // this.pageSize = response.data.pageSize
- // if (response.data.total) {
- // this.total = response.data.total
- // }
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoadingAdd = false
- }, 300)
- })
- },
- // 删除
- form_delete(row) {
- console.log('点击了删除')
- MessageBox.confirm('确认删除此条信息?', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- this.postDataPramas.data[0] = { 'name': 'deleteBigContract', 'type': 'e', 'parammaps': {
- id: row.id
- }}
- this.postDataPramas.data[1] = { 'name': 'deleteContract', 'type': 'e', 'parammaps': {
- bigId: row.id
- }}
- ExecDataByConfig(this.postDataPramas).then(response => {
- this.getList()
- this.$notify({
- title: '成功',
- message: '删除成功',
- type: 'success',
- duration: 2000
- })
- })
- })
- .catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- })
- })
- },
- // 编号/名称
- stockSearch(queryString, cb) {
- this.requestFilterParams.parammaps = {}
- this.requestFilterParams.name = 'findByDimStock'
- this.requestFilterParams.parammaps['stockA'] = queryString
- GetDataByName(this.requestFilterParams).then(response => {
- // console.log(response.data.list)
- cb(response.data.list)
- })
- },
- handleStockSelect(item) {
- var ss = 0
- GetDataByName(this.requestFilterParams).then(response => {
- this.$nextTick(() => {
- if (response.data.list.length > 0) {
- this.stockAAA = {}
- if (item.repertory <= 0) {
- this.$notify({
- title: '添加失败',
- message: '此备件无库存了,请联系库管尽快补货哦...',
- type: 'warning',
- duration: 2000
- })
- } else {
- if (this.list2 === null) {
- this.list2 = []
- }
- this.list2.some((item1, i) => {
- if (item1.stockNumber === item.stockNumber) {
- ss = 1
- }
- })
- if (ss === 0) { this.list2.push(item) }
- }
- }
- })
- })
- },
- changeIsZero(val) {
- console.log(val)
- }
- }
- }
- </script>
|