123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857 |
- <template>
- <div class="app-container">
- <div class="filter-container">
- <el-select v-model="tableObj1.getdataListParm.parammaps.pastureArr"
- style="width: 220px;" placeholder="牧场"
- multiple
- filterable
- collapse-tags
- class="filter-item" @change="change_pasture1">
- <!-- -->
- <div class="select_up">
- <el-button type="text" @click="selectAll">
- <i class="jw jw-quanxuan " />
- 全选</el-button>
- <el-button type="text" @click="removeTag">
- <i class="jw jw-qingkong " />
- 清空</el-button>
- <el-button type="text" @click="selectReverse">
- <i class="jw jw-fanxuan " />
- 反选</el-button>
- </div>
- <div class="select_list">
- <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
- </div>
- </el-select>
- <el-select v-model="tableObj1.getdataListParm.parammaps.departmentId" clearable style="width: 140px;" placeholder="部门" class="filter-item">
- <el-option v-for="item in departNameList1" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-input v-model="tableObj1.getdataListParm.parammaps.outsourcingCode" placeholder="委外维修单号" style="width: 200px;" class="filter-item" />
- <el-select v-model="tableObj1.getdataListParm.parammaps.status" style="width: 140px;" clearable placeholder="审核状态" class="filter-item">
- <el-option v-for="item in statuesNameList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <!-- todo -->
- <el-select v-model="tableObj1.getdataListParm.parammaps.reject" style="width: 140px;" clearable placeholder="单据状态" class="filter-item">
- <el-option v-for="item in rejectList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-input v-model="tableObj1.getdataListParm.parammaps.eqName" placeholder="设备名称" style="width: 200px;" class="filter-item" />
- <el-input v-model="tableObj1.getdataListParm.parammaps.eqCode" placeholder="设备内部编号" style="width: 200px;" class="filter-item" />
- <el-input v-model="tableObj1.getdataListParm.parammaps.contractCode" placeholder="合同编号" style="width: 200px;" class="filter-item" />
- <el-date-picker ref="inputDatetime" v-model="tableObj1.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 class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
- <el-button v-if="istab1Add" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
- <!-- isRepairExport
- <el-button class="filter-item" type="success" icon="el-icon-download" style="" @click="handleDownload">导出</el-button> -->
- </div>
- <div class="elTable">
- <el-table :max-height="myHeight" :key="tableObj1.tableKey" v-loading="tableObj1.listLoading" element-loading-text="给我一点时间" :data="tableObj1.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed" >
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (tableObj1.pageNum-1) * tableObj1.pageSize + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="委外单号" min-width="120px" align="center" prop="outsourcingCode" />
- <el-table-column label="牧场" min-width="120px" align="center" prop="pastureName" />
- <el-table-column label="责任部门 " min-width="120px" align="center" prop="departmentName" />
- <el-table-column label="合同" min-width="150px" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.contract ==1 ">有</span>
- <span v-else>无</span>
- </template>
- </el-table-column>
- <el-table-column label="申请人" min-width="120px" align="center" prop="applicantName" />
- <el-table-column label="日期" min-width="120px" align="center" prop="date" />
- <el-table-column label="审核状态" min-width="150px" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.status == 0 ">审核中</span>
- <span v-else-if="scope.row.status == 1 ">审核通过</span>
- <span v-else>审核未通过</span>
- </template>
- </el-table-column>
- <el-table-column label="单据状态" min-width="150px" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.reject == 0 ">正常</span>
- <span v-if="scope.row.reject == 1 ">已关单</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="260" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
- <el-button v-if="istab1Edit && (row.status !== 0) && (row.status !== 1) && row.isPasturd " type="success" size="mini" @click="form_edit(row)">编辑</el-button>
- <el-button v-if="istab1Del && (row.status !== 1) && row.isPasturd " type="danger" size="mini" @click="form_delete(row)">删除</el-button>
- <el-button v-if="row.status !== 0 && row.status !== 1 && row.isPasturd" style="display:inline-block" type="success" size="mini" @click="form_submit(row)">提交</el-button>
- <!-- <el-button v-if="row.isAcceptance == 0" style="display:inline-block" type="warning" size="mini" @click="form_closeSubmit(row)">关单</el-button> -->
- <el-button v-if="istab1Shenhe1 && (row.status== 0) && (row.flowCompeleted == 1) && row.isPasturd " style="display:inline-block" type="success" size="mini" @click="form_examine(row)">审核1</el-button>
- <el-button v-else style="display:none" type="success" size="mini" @click="form_examine(row)">审核1</el-button>
- <el-button v-if="istab1Shenhe2 && (row.status== 0) && (row.flowCompeleted == 2 ) && row.isPasturd" style="display:inline-block" type="success" size="mini" @click="form_examine2(row)">审核2</el-button>
- <el-button v-else style="display:none" type="success" size="mini" @click="form_examine2(row)">审核2</el-button>
- <el-button v-if="istab1Shenhe3 && (row.status== 0) && (row.flowCompeleted == 4) && row.isPasturd" style="display:inline-block" type="success" size="mini" @click="form_examine3(row)">审核3</el-button>
- <el-button v-else style="display:none" type="success" size="mini" @click="form_examine3(row)">审核3</el-button>
- <el-button v-if="istab1Shenhe4 && (row.status== 0) && (row.flowCompeleted == 6) && (row.isAudit == 1) && row.isPasturd" style="display:inline-block" type="success" size="mini" @click="form_examine4(row)">审核4</el-button>
- <el-button v-else style="display:none" type="success" size="mini" @click="form_examine4(row)">审核4</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="tableObj1.total>0" :total="tableObj1.total" :page.sync="tableObj1.getdataListParm.offset" :limit.sync="tableObj1.getdataListParm.pagecount" @pagination="get_table_data1()" />
- </div>
- <!-- 弹出层新增or修改 -->
- <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
- <div >
- <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="100px" style="width: 100%;">
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="委外维修单号:" prop="outsourcingCode">
- <el-input ref="outsourcingCode" v-model="createTemp.outsourcingCode" 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=" dialogStatus==='see'" @change="change_pasture2" >
- <el-option v-for="item in pastureNameList" :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="departmentId">
- <el-select v-model="createTemp.departmentId" placeholder="责任部门" class="filter-item" style="width:100%" :disabled=" dialogStatus==='see'" @change="change_depart2">
- <el-option v-for="item in departNameList2" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="合同:" prop="contract">
- <el-radio-group v-model="createTemp.contract" :disabled="dialogStatus==='see'" @change="change_contract" >
- <el-radio :label="0" :checked="createTemp.contract == 0">无合同</el-radio>
- <el-radio :label="1" :checked="createTemp.contract == 1">有合同</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="申请人:" prop="applicant">
- <el-select v-model="createTemp.applicant" placeholder="申请人" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" >
- <el-option v-for="item in employeNameList" :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="date">
- <el-date-picker v-model="createTemp.date" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="16">
- <el-form-item label="故障描述:" prop="description">
- <el-input v-model="createTemp.description" type="textarea" autosize :disabled="dialogStatus==='see'" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="报修单号:" prop="RUCode">
- <el-input ref="RUCode" v-model="createTemp.RUCode" disabled />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-table
- :key="tableKey"
- v-loading="listLoading"
- element-loading-text="给我一点时间"
- :data="listAddCont"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:30px"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable"
- >
- <!-- table表格 -->
- <el-table-column :key="1" label="序号" align="center" type="index" width="50px" />
- <el-table-column :key="2" label="供应商" prop="providerName" align="center" min-width="80px">
- <template slot-scope="scope">
- <el-select v-model="scope.row.providerName" filterable placeholder="供应商" class="filter-item" style="width: 120px; margin-top:10px" v-if="dialogStatus ==='create'||dialogStatus ==='update'" >
- <el-option v-for="item in providerNameList" :key="item.name" :label="item.name" :value="item.name" />
- </el-select>
- <span v-if="dialogStatus ==='see'">{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column :key="3" v-if="createTemp.contract==0" label="金额" prop="amount" align="center" min-width="80px">
- <template slot-scope="scope">
- <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
- <el-input v-model="scope.row.amount" style="margin-top:10px" />
- </span>
- <span v-if="dialogStatus ==='see'">{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column :key="4" label="设备名称" prop="eqName" align="center" min-width="250">
- <template slot-scope="scope">
- <el-autocomplete style="margin-top:10px" :disabled="dialogStatus ==='see'"
- v-model="scope.row.eqName"
- class="inline-input"
- :fetch-suggestions="querySearchEqNameCont"
- value-key="eqName"
- placeholder="设备名称"
- @select="(value)=>
- {handleSelectEqNameCont(value, scope.row)}"
- @blur="(value)=>
- {blurSelectEqNameCont(value, scope.row)}"
- >
- <template slot-scope="{ item }">
- <span class="addr">{{ item.eqName }}</span>
- |<span class="addr">{{ item.eqCode }}</span>
- </template>
- </el-autocomplete>
- </template>
- </el-table-column>
- <el-table-column :key="5" label="设备内部编号" prop="eqCode" align="center" min-width="150">
- <template slot-scope="scope">
- <el-autocomplete style="margin-top:10px"
- v-model="scope.row.eqCode" :disabled="dialogStatus ==='see'"
- class="inline-input"
- :fetch-suggestions="querySearchCodeCont"
- value-key="eqCode"
- placeholder="设备内部编号"
- @select="(value)=>
- {handleSelectEqCodeCont(value, scope.row)}"
- @blur="(value)=>
- {blurSelectEqCodeCont(value, scope.row)}"
- />
- </template>
- </el-table-column>
- <!-- <el-table-column label="设备名称" prop="eqName" min-width="80px" align="center">
- <template slot-scope="scope">
- <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
- <el-input v-model="scope.row.eqName" style="margin-top:10px" />
- </span>
- <span v-if="dialogStatus ==='see'">{{ scope.row.eqName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="设备内部编号" prop="eqCode" align="center" min-width="80px">
- <template slot-scope="scope">
- <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
- <el-input v-model="scope.row.eqCode" style="margin-top:10px" />
- </span>
- <span v-if="dialogStatus ==='see'">{{ scope.row.eqCode }}</span>
- </template>
- </el-table-column> -->
- <el-table-column :key="6" label="费用类型" prop="typea" align="center" min-width="80px">
- <template slot-scope="scope">
- <el-select v-model="scope.row.typea" placeholder="费用类型" class="filter-item" style="width: 120px; margin-top:10px " v-if="dialogStatus ==='create'||dialogStatus ==='update'">
- <el-option v-for="item in costTypeList" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <span v-if="dialogStatus ==='see'">{{ scope.row.typea }}</span>
- </template>
- </el-table-column>
- <!-- <el-table-column label="交付日期" prop="date" align="center" min-width="80px">
- <template slot-scope="scope">
- <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
- <el-date-picker v-model="scope.row.date" style="margin-top:10px" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
- </span>
- <span v-if="dialogStatus ==='see'">{{ scope.row.date }}</span>
- </template>
- </el-table-column> -->
- <el-table-column :key="7" v-if="createTemp.contract == 1" label="合同编号" prop="contractCode" align="center" min-width="80px">
- <template slot-scope="scope">
- <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
- <el-input v-model="scope.row.contractCode" style="margin-top:10px" />
- </span>
- <span v-if="dialogStatus ==='see'">{{ scope.row.contractCode }}</span>
- </template>
- </el-table-column>
- <el-table-column :key="9" label="铅封号" prop="sealNumber" align="center" min-width="80px">
- <template slot-scope="scope">
- <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
- <el-input v-model="scope.row.sealNumber" style="margin-top:10px" />
- </span>
- <span v-if="dialogStatus ==='see'">{{ scope.row.sealNumber }}</span>
- </template>
- </el-table-column>
- <el-table-column :key="10" label="历史铅封号" prop="sealNumberHis" align="center" min-width="80px">
- <template slot-scope="scope">
- <span>{{ scope.row.sealNumberHis }}</span>
- </template>
- </el-table-column>
- <el-table-column :key="8" label="备注" prop="remark" align="center" min-width="180px">
- <template slot-scope="scope">
- <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
- <el-input v-model="scope.row.remark" style="margin-top:10px" />
- </span>
- <span v-if="dialogStatus ==='see'">{{ scope.row.remark }}</span>
- </template>
- </el-table-column>
- </el-table>
- <el-row :gutter="10" v-if="dialogStatus ==='see' ">
- <el-col>
- <h3>流程进度</h3>
- <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>
- <div slot="footer" class="dialog-footer" style="bottom:10px">
- <el-button type="primary" :disabled="isokDisable" v-if="dialogStatus !=='see'" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
- <el-button @click="dialogFormVisible = false;get_table_data1()">取消并关闭</el-button>
- </div>
- </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" :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.status" @change="change_statue">
- <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="statueReason" :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="istab1Shenhe1 && (examineTemp.flowCompeleted == 1) " type="primary" :disabled="isokDisable" @click="form_examine_save()">确认1</el-button>
- <el-button v-if="istab1Shenhe2 && (examineTemp.flowCompeleted == 2)" type="primary" :disabled="isokDisable" @click="form_examine_save2()">确认2</el-button>
- <el-button v-if="istab1Shenhe3 && (examineTemp.flowCompeleted == 4)" type="primary" :disabled="isokDisable" @click="form_examine_save3()">确认3</el-button>
- <el-button v-if="istab1Shenhe4 && (examineTemp.flowCompeleted == 6)" type="primary" :disabled="isokDisable" @click="form_examine_save4()">确认4</el-button>
- <!-- <el-button v-if="dialogStatus==='examine22'" type="primary" :disabled="isokDisable" @click="form_examine_save22()">确认</el-button>
- <el-button v-if="dialogStatus==='examine2'" type="primary" :disabled="isokDisable" @click="form_examine_save2()">确认</el-button>
- <el-button v-if="dialogStatus==='examine33'" type="primary" :disabled="isokDisable" @click="form_examine_save33()">确认</el-button>
- <el-button v-if="dialogStatus==='examine3'" type="primary" :disabled="isokDisable" @click="form_examine_save3()">确认</el-button> -->
- <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import echarts from 'echarts'
- require('echarts/theme/macarons')
- import { GetDataByNames, GetReportform, GetDataByName,GetAccount, PostDataByName, checkButtons, ExecDataByConfig} from '@/api/common'
- import Cookies from 'js-cookie'
- import { parseTime, json2excel ,sortChange} from '@/utils/index.js'
- import { MessageBox } from 'element-ui'
- import Pagination from '@/components/Pagination'
- export default {
- name: 'Tab1',
- components: { Pagination },
- inject: ['reload'],
- data() {
- return {
- // todo
- isRepairExport: [],
- isPercentage: false,
- percentage: 0,
- findAllPasture:[],
- rejectList: [{ id: '0', name: '正常' }, { id: '1', name: '已关单' }], // TODO: 已关单状态
- myHeight:document.documentElement.clientHeight - 85- 200,
- //多个下拉框 - 请求内容
- send_select_list: [
- { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
- { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
- { name: 'findAllProviderByCt', offset: 0, pagecount: 0, parammaps: { 'id': Cookies.get('pastureid') }},
- { name: 'findAllMainPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
- ],
- // 下拉框 - 牧场
- pastureNameList: [
- // {id: "犊牛1", name: "犊牛1"},
- // {id: "犊牛2", name: "犊牛2"},
- // {id: "犊牛3", name: "犊牛3"}
- ],
- getDepartParam1: {
- name: 'findAllDepart', offset: 0, pagecount: 0,
- parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
- },
- employeNameList: [],
- departNameList1: [],
- getDepartParam2: {
- name: 'findAllDepart', offset: 0, pagecount: 0,
- parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
- },
- departNameList2: [],
- statuesNameList: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
- isokDisable: false,
- tableObj1: {
- getdataListParm: {
- name: 'getBigoutsourcingList',
- //请求的 page 无用参数 offset 第几页 pagecount 每页多少条
- page: 1, offset: 1,pagecount: 50,returntype: 'Map',
- parammaps: { pastureName: Cookies.get('pasturename'), outsourcingCode: '',departmentName: '',status: "",eqName: "",eqCode: "",contractCode: "",inputDatetime:"",startdate: "",enddate: "",pastureArr:[]}
- },
- tableKey: 0,listLoading: false,
- //返回的 pageNum 第几页 pageSize 每页多少条 total 总条数
- pageNum:'',pageSize:'',total: 0,
- list: [
- ]
- },
- requestEqName2: {
- name: 'getOutsourceEqbyNameCode',
- page: 1,
- offset: 1,
- pagecount: '',
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid')
- }
- },
- getAddContListParam: {
- name: "getOutsourcingList",
- page: 1,offset: 1,pagecount: 20,returntype: "Map",
- parammaps: {"bigId": ""}
- },
- pickerOptions: {
- disabledDate(time) {
- return time.getTime() > Date.now()// 当天之前的时间可选
- }
- },
- rules: {
- outsourcingCode: [{ required: true, message: '必填', trigger: 'blur' }],
- equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
- departmentId: [{ required: true, message: '必填', trigger: 'blur' }],
- contract: [{ required: true, message: '必填', trigger: 'blur' }],
- description: [{ required: true, message: '必填', trigger: 'blur' }],
- // equipmentName: [{ required: true, message: '必填', trigger: 'blur' }]
- },
- tableKey: 0,
- listLoading: true,
- total: 0,
- list: [],
- dialogStatus: '',
- dialogFormVisible: false,
- dialogFormVisibleSee: false,
- listLoadingSee: true,
- listSee: [],
- totalSee: 0,
- seeTemp: {},
- getdataListSee: {
- name: 'getpartpurchaseBybig',
- returntype: 'Map',
- parammaps: {}
- },
- createTemp: {
- pastureId: this.$store.state.user.pastureid,
- departmentId: this.$store.state.user.departmentid,
- employeId: this.$store.state.user.employeid,
- date: parseTime(new Date(), '{y}-{m}-{d}'),
- outsourcingCode: '',
- applicant: '',
- RUCode: '',
- providerId: '',
- departmentName: '',
- description: '',
- contract:1,
- },
- costTypeList:[
- {id:'保养',name:'保养'},
- {id:'维修',name:'维修'},
- {id:'物耗',name:'物耗'},
- {id:'土建',name:'土建'},
- {id:'安全',name:'安全'},
- ],
- providerNameList:[
- ],
- getParmCreateNumber: {
- name: 'autoCreatCode',
- page: 0,
- offset: 0,
- pagecount: 0,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- codeType: 'WW'
- }
- },
- listAddCont:[
- {providerName:"",providerId: "0",eqId: "0",contractId: "0",sealNumber:"",sealNumberHis:""}
- ],
- activeList: [],
- active: 1,
- EqNameList: [],
- requestEqName: {
- name: 'geteqbyNameCode', page: 1, offset: 1, pagecount: 50, returntype: 'Map',
- parammaps: { pastureId: Cookies.get('pastureid') }
- },
- EqCodeList: [],
- dialogFormVisible_Examine: false,
- examineTemp: {
- "status": 1,
- "empid": "",
- "flowCompeleted":"",
- "workflowNote": "",
- "id": ""
- },
- statueReason: false,
- rowStyle: { maxHeight: 50 + 'px', height: 35 + 'px' },
- cellStyle: { padding: 0 + 'px' },
- textMap: {
- update: '编辑',
- create: '新增',
- see: '查看',
- examine: '审核1',
- examine22: '审核2',
- examine2: '审核3',
- examine33: '审核4',
- examine3: '审核5',
- check1: "部门负责人审核",
- check2: "财务负责人审核",
- check3: "场长审核"
- },
- istab1Add:[],
- istab1Edit:[],
- istab1Del:[],
- istab1Shenhe1:[],
- istab1Shenhe2:[],
- istab1Shenhe4:[],
- getParmCreateNumber2: {
- name: 'autoCreatCode',
- page: 0, offset: 0, pagecount: 0, returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- codeType: 'WY'
- }
- },
- }
- },
- created() {
- this.get_select_list()
- this.get_auto_buttons()
- },
- methods: {
- // 导出
- 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.downLoadParm = {}
- this.downLoadParm.name = 'loadRepirsList'
- this.downLoadParm.offset = 0
- this.downLoadParm.page = 1
- this.downLoadParm.returntype = 'Map'
- if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
- this.tableObj1.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
- this.tableObj1.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
- } else {
- this.tableObj1.getdataListParm.parammaps.startTime = ''
- this.tableObj1.getdataListParm.parammaps.stopTime = ''
- }
- this.downLoadParm.parammaps =this.tableObj1.getdataListParm.parammaps
- GetAccount(this.downLoadParm).then(response => {
- console.log('导出', response)
- })
- },
- // 删除
- removeTag() {
- this.tableObj1.getdataListParm.parammaps.pastureArr = []
- },
- // 全选
- selectAll(val) {
- val = []
- this.findAllPasture.map(item => {
- val.push(item.name)
- })
- this.tableObj1.getdataListParm.parammaps.pastureArr = val
- },
- // 反选
- selectReverse(val) {
- val = []
- this.findAllPasture.map(item => {
- let index = this.tableObj1.getdataListParm.parammaps.pastureArr.indexOf(item.name);
- if (index != -1) {
- //orgData.splice(index, 1)
- } else {
- val.push(item.name)
- }
- })
- this.tableObj1.getdataListParm.parammaps.pastureArr = val
- },
- // 提交按钮
- form_submit(row) {
- MessageBox.confirm('确认提交此条信息?', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- var send_data2 = {
- "common": { "returnmap": "0" },
- "data": [
- {
- "name": "editBigoutsourcingSubmit", "type": "e",
- "parammaps": { "id":row.id }
- }
- ]
- }
- this.save_submit(send_data2)
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消提交'
- })
- })
- },
- save_submit(send_data) {
- ExecDataByConfig(send_data).then(response => {
- if (response.msg !== 'fail') {
- this.$notify({ title: '成功', message: '提交成功', type: 'success', duration: 2000 })
- this.get_table_data1()
- }
- })
- },
- //获取按钮权限
- get_auto_buttons() {
- const istab1Add = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:add')
- this.istab1Add = istab1Add
- const istab1Edit = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:edit')
- this.istab1Edit = istab1Edit
- const istab1Del = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:del')
- this.istab1Del = istab1Del
- const istab1Shenhe1 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:shenhe1')
- this.istab1Shenhe1 = istab1Shenhe1
- const istab1Shenhe2 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:shenhe2')
- this.istab1Shenhe2 = istab1Shenhe2
- const istab1Shenhe3 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:shenhe3')
- this.istab1Shenhe3 = istab1Shenhe3
- const istab1Shenhe4 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:shenhe4')
- this.istab1Shenhe4 = istab1Shenhe4
- // 导出
- const RejectExport = 'maintenance:subcontractingMainten::rejectExport'
- const isRepairExport = checkButtons(this.$store.state.user.buttons, RejectExport)
- this.isRepairExport = isRepairExport
- },
- querySearchEqNameCont(queryString, cb) {
- console.log('备件名称/设备内部编号模糊查询输入值', queryString)
- this.requestEqName2.parammaps['eqName'] = queryString
- GetDataByName(this.requestEqName2).then(response => {
- console.log('备件名称模糊查询搜索data', response.data.list)
- this.EqNameList = response.data.list
- cb(this.EqNameList)
- })
- },
- handleSelectEqNameCont(item, row) {
- console.log('备件名称/设备内部编号模糊查询选中值', item.eqName)
- console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
- this.$set(row, 'eqCode', item.eqCode)
- this.$set(row, 'sealNumberHis', item.sealNumberHis)
- this.$forceUpdate()
- },
- querySearchCodeCont(queryString, cb) {
- console.log('备件名称/设备内部编号模糊查询输入值', queryString)
- this.requestEqName2.parammaps['eqCode'] = queryString
- GetDataByName(this.requestEqName2).then(response => {
- console.log('备件名称模糊查询搜索data', response.data.list)
- this.EqNameList = response.data.list
- cb(this.EqNameList)
- })
- },
- handleSelectEqCodeCont(item, row) {
- console.log('备件名称/设备内部编号模糊查询选中值', item)
- console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
- this.$set(row, 'eqName', item.eqName)
- this.$set(row, 'sealNumberHis', item.sealNumberHis)
- this.$forceUpdate()
- },
- blurSelectEqNameCont(item, row) {
- this.$set(row, 'eqName', '')
- this.$set(row, 'eqCode', '')
- },
- blurSelectEqCodeCont(item, row) {
- this.$set(row, 'eqName', '')
- this.$set(row, 'eqCode', '')
- },
- get_select_list() {
- GetDataByNames(this.send_select_list).then(response => {
- this.pastureNameList = response.data.findAllPasture.list
- this.findAllPasture = response.data.findAllMainPasture.list
- console.log("牧场下拉框", this.pastureNameList)
- this.employeNameList = response.data.findAllEmploye.list
- console.log("申请人下拉框", this.employeNameList)
- this.providerNameList = response.data.findAllProviderByCt.list
- this.tableObj1.getdataListParm.parammaps.pastureArr = this.findAllPasture.map(item => {
- return item.name
- })
- this.get_table_data1()
- this.get_depart_list1()
- })
- },
- change_pasture1(item) {
- this.getDepartParam1.parammaps.pastureId = this.pastureNameList.find(obj => obj.name == item).id
- this.tableObj1.getdataListParm.parammaps.departmentId = ''
- this.get_depart_list1()
- },
- //部门List
- get_depart_list1() {
- GetDataByName(this.getDepartParam1).then(response => {
- this.departNameList1 = response.data.list
- })
- },
- change_pasture2(item) {
- this.getDepartParam2.parammaps.pastureId = item
- this.get_depart_list2()
- },
- get_depart_list2() {
- GetDataByName(this.getDepartParam2).then(response => {
- this.departNameList2 = response.data.list
- })
- },
- change_depart2(item) {
- this.createTemp.departmentName = this.departNameList2.find(obj => obj.id == item).name
- },
- get_table_data1() {
- this.tableObj1.listLoading = false
- if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
- this.tableObj1.getdataListParm.parammaps.startdate = this.$refs['inputDatetime'].value[0]
- this.tableObj1.getdataListParm.parammaps.enddate = this.$refs['inputDatetime'].value[1]
- } else {
- this.tableObj1.getdataListParm.parammaps.inputDatetime = ''
- this.tableObj1.getdataListParm.parammaps.startdate = ''
- this.tableObj1.getdataListParm.parammaps.enddate = ''
- }
- // 对于多选的牧场,根据数组的名称来转换 pastureArr =》 pastureId TODO:
- if (this.tableObj1.getdataListParm.parammaps.pastureArr && this.tableObj1.getdataListParm.parammaps.pastureArr.length > 0) {
- const arr = this.findAllPasture.filter((item) => {
- if (this.tableObj1.getdataListParm.parammaps.pastureArr.includes(item.name)) {
- return item
- }
- })
- const ids = arr.map((child) => { return child.id })
- this.tableObj1.getdataListParm.parammaps.pastureId = ids.toString();
- }
- GetDataByName(this.tableObj1.getdataListParm).then(response => {
- if (response.data.list !== null) {
- this.tableObj1.list = response.data.list.map((item)=>{
- // 如果当前牧场塞四, 且是塞二和塞三的牧场,则 可展示审核1 按钮,其他状态不变
- // 1. 如果是自身牧场 按照之前的走,都是true
- // 2. 如果是塞四:false
- if(item.pastureId != Cookies.get('mainpasture') && item.pastureId != Cookies.get('pastureid') ) {
- item.isPasturd = false
- } else {
- item.isPasturd = true;
- }
- return item
- })
- this.tableObj1.pageNum = response.data.pageNum
- this.tableObj1.pageSize = response.data.pageSize
- this.tableObj1.total = response.data.total
- } else {
- this.tableObj1.list = [ ]
- }
- setTimeout(() => {
- this.tableObj1.listLoading = false
- }, 100)
- })
- },
- form_search() {
- console.log('查询')
- this.get_table_data1()
- },
- change_contract(val) {
- console.log(val)
- if(val ==1){
- this.createTemp.contract = 1
- } else {
- this.createTemp.contract = 0
- }
- },
- form_add() {
- this.reset_create()
- this.getDepartParam2.parammaps.pastureId = this.createTemp.pastureId
- this.get_depart_list2()
- this.dialogStatus = 'create'
- this.dialogFormVisible = true
- this.listLoading = false
- this.$nextTick(() => {
- this.$refs['createTemp'].clearValidate()
- })
- //新增生成单号
- this.get_create_num()
- },
- reset_create() {
- this.createTemp.pastureId = parseInt(Cookies.get('pastureid'))
- this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
- if(parseInt(Cookies.get('pastureid')) == 18){
- this.createTemp.departmentId = ""
- }
- this.createTemp.departmentName = Cookies.get('departmentname')
- this.createTemp.employeId = parseInt(Cookies.get('employeid'))
- this.createTemp.date = parseTime(new Date(), '{y}-{m}-{d}')
- this.createTemp.outsourcingCode = ''
- this.createTemp.applicant = parseInt(Cookies.get('employeid'))
- this.createTemp.providerId = ''
- this.createTemp.contract = 1
- this.createTemp.description = ''
- this.listAddCont = [{providerName:"",providerId: "0",eqId: "0",contractId: "0",amount:"",contractCode:"",date:"",eqCode:"",eqName:"",remark:"",typea:"",sealNumber:"",sealNumberHis:""}]
- },
- get_create_num() {
- GetDataByName(this.getParmCreateNumber).then(response => {
- this.$nextTick(() => {
- console.log('新增单号', response.data.list[0].orderCode)
- this.createTemp.outsourcingCode = response.data.list[0].orderCode
- this.$forceUpdate()
- })
- })
- },
- add_dialog_save() {
- console.log(this.listAddCont,'000')
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['createTemp'].validate(valid => {
- if (valid) {
- if (this.createTemp.outsourcingCode == '' || this.createTemp.outsourcingCode == null || this.createTemp.outsourcingCode == undefined) {
- GetDataByName(this.getParmCreateNumber2).then(response => {
- this.$nextTick(() => {
- console.log('新增单号', response.data.list[0].orderCode)
- this.createTemp.outsourcingCode = response.data.list[0].orderCode
- this.$forceUpdate()
- this.add_dialog_saveSave()
- })
- })
- } else {
- this.add_dialog_saveSave()
- }
- }
- })
- },
- add_dialog_saveSave() {
- for (var j = 0; j < this.listAddCont.length; j++) {
- console.log(this.listAddCont,'')
- console.log(this.listAddCont[j].amount)
- if(this.createTemp.contract == 1){
- if(this.listAddCont[j].providerName == ''){
- this.$message({ type: 'warning', message: '请检查供应商是否未填写', duration: 2000 })
- return false
- }
- }
- if(this.listAddCont[j].sealNumber == ''){
- this.$message({ type: 'warning', message: '请填写铅封号', duration: 2000 })
- return false
- }
- if(this.listAddCont[j].eqName == ''){
- this.$message({ type: 'warning', message: '请检查设备名称是否未填写', duration: 2000 })
- return false
- }
- if(this.listAddCont[j].eqCode == ''){
- this.$message({ type: 'warning', message: '请检查设备内部编号是否未填写', duration: 2000 })
- return false
- }
- if (this.listAddCont[j].amount == null || this.listAddCont[j].amount === '') {
- // this.$message({ type: 'warning', message: '请检查金额是否未填写', duration: 2000 })
- // return false
- } else {
- // var rulesAmount = /^[1-9]\d*$/
- // if (!rulesAmount.test(this.listAddCont[j].amount)) {
- // this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
- // return false
- // }
- }
- if (this.createTemp.contract == 1){
- if (this.listAddCont[j].contractCode == null || this.listAddCont[j].contractCode === '') {
- this.$message({ type: 'warning', message: '请检查合同编号是否未填写', duration: 2000 })
- return false
- }
- }
- }
- var amount = 0
- if(this.createTemp.contract==0){
- amount = "@insertSpotList.amount"
- }else{
- amount = 0
- }
- if(this.createTemp.contract == 0){
- // 无合同
- this.$set(this.createTemp,'status',0)
- }else{
- // 有合同
- this.$set(this.createTemp,'status',1)
- }
- var send_data = {
- "common": { "returnmap": "0" },
- "data": [
- {
- "name": "addBigoutsourcing", "type": "e",
- "parammaps": this.createTemp
- },
- {
- "name": "insertSpotList",
- "resultmaps": { "list": this.listAddCont },
- "children": [
- {
- "name": "addOutsourcing", "type": "e",
- "parammaps": {
- "bigId": "@addBigoutsourcing.LastInsertId",
- "providerId": "@insertSpotList.providerId",
- "amount": amount,
- "eqId": "@insertSpotList.eqId",
- "eqCode": "@insertSpotList.eqCode",
- "eqName": "@insertSpotList.eqName",
- "typea": "@insertSpotList.typea",
- "date": "@insertSpotList.date",
- "contractId": "@insertSpotList.contractId",
- "providerName": "@insertSpotList.providerName",
- "contractCode": "@insertSpotList.contractCode",
- "remark": "@insertSpotList.remark",
- "status": this.createTemp.status,
- "sealNumber": "@insertSpotList.sealNumber",
- "sealNumberHis" : "@insertSpotList.sealNumberHis"
- }
- }
- ]
- }
- ]
- }
- ExecDataByConfig(send_data).then(response => {
- console.log('新增保存发送参数', send_data)
- if (response.msg === 'fail') {
- this.$notify({
- title: '保存失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- if(this.createTemp.contract==1){
- this.add_dialog_saveSave2()
- }
- this.dialogFormVisible = false
- this.get_table_data1()
- this.$notify({
- title: '',
- message: '保存成功',
- type: 'success',
- duration: 2000
- })
- }
- })
- return true
- },
- form_see(row){
- console.log('查看======》',row)
- this.getDepartParam2.parammaps.pastureId = row.pastureId
- this.get_depart_list2()
- this.createTemp = Object.assign({}, row)
- this.dialogStatus = 'see'
- this.dialogFormVisible = true
- this.$nextTick(() => {
- this.$refs['createTemp'].clearValidate()
- })
- //总价大于等于10000,有高级设备工程师
- if(row.isAudit == 1) {
- if (row.flowCompeleted == 1) {
- this.activeList = [
- { title: '设备处长', date: row.createTime, name: row.applicantName },
- { title: '部门负责人' },
- { title: '财务负责人' },
- { title: '场长' },
- { title: '运营支持部高级工程师' },
- ]
- this.active = 1
- } else if (row.flowCompeleted == 2) {
- this.activeList = [
- { title: '设备处长', date: row.createTime, name: row.applicantName },
- { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
- { title: '财务负责人' },
- { title: '场长' },
- { title: '运营支持部高级工程师' },
- ]
- this.active = 2
- } else if (row.flowCompeleted === 3) {
- this.activeList = [
- { title: '设备处长', date: row.createTime, name: row.applicantName },
- { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName,status: 'error', reason: row.workflowNote },
- { title: '财务负责人' },
- { title: '场长' },
- { title: '运营支持部高级工程师' }
- ]
- this.active = 2
- } else if (row.flowCompeleted === 4) {
- this.activeList = [
- { title: '设备处长', date: row.createTime, name: row.applicantName },
- { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
- { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
- { title: '场长' },
- { title: '运营支持部高级工程师' }
- ]
- this.active = 3
- } else if (row.flowCompeleted === 5) {
- this.activeList = [
- { title: '设备处长', date: row.createTime, name: row.applicantName },
- { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
- { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName,status: 'error', reason: row.workflowNote },
- { title: '场长' },
- { title: '运营支持部高级工程师' }
- ]
- this.active = 3
- } else if (row.flowCompeleted === 6) {
- this.activeList = [
- { title: '设备处长', date: row.createTime, name: row.applicantName },
- { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
- { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
- { title: '场长',date: row.fielddate, name: row.fieldName },
- { title: '运营支持部高级工程师' }
- ]
- this.active = 4
- } else if (row.flowCompeleted === 7) {
- this.activeList = [
- { title: '设备处长', date: row.createTime, name: row.applicantName },
- { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
- { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
- { title: '场长',date: row.fielddate, name: row.fieldName,status: 'error', reason: row.workflowNote },
- { title: '运营支持部高级工程师' }
- ]
- this.active = 4
- }else if (row.flowCompeleted === 8) {
- this.activeList = [
- { title: '设备处长', date: row.createTime, name: row.applicantName },
- { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
- { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
- { title: '场长',date: row.fielddate, name: row.fieldName },
- { title: '运营支持部高级工程师',date: row.advanceddate, name: row.advancedName }
- ]
- this.active = 5
- }else if (row.flowCompeleted === 9) {
- this.activeList = [
- { title: '设备处长', date: row.createTime, name: row.applicantName },
- { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
- { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
- { title: '场长',date: row.fielddate, name: row.fieldName},
- { title: '运营支持部高级工程师',date: row.advanceddate, name: row.advancedName,status: 'error', reason: row.workflowNote }
- ]
- this.active = 5
- }
- //总价小于10000 没有高级设备工程师,直接场长审核
- } else {
- if (row.flowCompeleted == 1) {
- this.activeList = [
- { title: '设备处长', date: row.createTime, name: row.applicantName },
- { title: '部门负责人' },
- { title: '财务负责人' },
- { title: '场长' }
- ]
- this.active = 1
- } else if (row.flowCompeleted == 2) {
- this.activeList = [
- { title: '设备处长', date: row.createTime, name: row.applicantName },
- { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
- { title: '财务负责人' },
- { title: '场长' }
- ]
- this.active = 2
- } else if (row.flowCompeleted === 3) {
- this.activeList = [
- { title: '设备处长', date: row.createTime, name: row.applicantName },
- { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName,status: 'error', reason: row.workflowNote },
- { title: '财务负责人' },
- { title: '场长' }
- ]
- this.active = 2
- } else if (row.flowCompeleted === 4) {
- this.activeList = [
- { title: '设备处长', date: row.createTime, name: row.applicantName },
- { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
- { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
- { title: '场长' },
- ]
- this.active = 3
- } else if (row.flowCompeleted === 5) {
- this.activeList = [
- { title: '设备处长', date: row.createTime, name: row.applicantName },
- { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
- { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName,status: 'error', reason: row.workflowNote },
- { title: '场长' }
- ]
- this.active = 3
- } else if (row.flowCompeleted === 6) {
- this.activeList = [
- { title: '设备处长', date: row.createTime, name: row.applicantName },
- { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
- { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
- { title: '场长',date: row.fielddate, name: row.fieldName },
- ]
- this.active = 4
- } else if (row.flowCompeleted === 7) {
- this.activeList = [
- { title: '设备处长', date: row.createTime, name: row.applicantName },
- { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
- { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
- { title: '场长',date: row.fielddate, name: row.fieldName,status: 'error', reason: row.workflowNote }
- ]
- this.active = 4
- }
- }
- if(row.contract == 1){
- this.activeList = [
- { title: '设备处长', date: row.createTime, name: row.applicantName }
- ]
- this.active = 1
- }
- this.getAddContListParam.parammaps.bigId = row.id
- this.getAddContList()
- },
- getAddContList() {
- GetDataByName(this.getAddContListParam).then(response => {
- this.listAddCont = response.data.list
- this.listLoading = false
- })
- },
- form_edit(row) {
- this.reset_create()
- console.log('编辑',row)
- this.getDepartParam2.parammaps.pastureId = row.pastureId
- this.get_depart_list2()
- if (row.providerId == undefined) {
- row.providerId = ''
- row.providerName = ''
- }
- this.createTemp = Object.assign({}, row) // copy obj
- this.dialogStatus = 'update'
- this.dialogFormVisible = true
- this.$nextTick(() => {
- this.$refs['createTemp'].clearValidate()
- })
- this.getAddContListParam.parammaps.bigId = row.id
- this.getAddContList()
- },
- edit_dialog_save() {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['createTemp'].validate(valid => {
- if (valid) {
- this.edit_dialog_saveSave()
- }
- })
- },
- edit_dialog_saveSave() {
- for (var j = 0; j < this.listAddCont.length; j++) {
- console.log(this.listAddCont[j].amount)
- // eslint-disable-next-line use-isnan
- if (this.listAddCont[j].amount == null || this.listAddCont[j].amount === '') {
- this.$message({ type: 'warning', message: '请检查申购数量是否未填写', duration: 2000 })
- return false
- }
- }
- this.listAddCont[0].providerId = "0"
- this.listAddCont[0].eqId = "0"
- this.listAddCont[0].contractId = "0"
- var amount = 0
- if(this.createTemp.contract==0){
- amount = "@insertSpotList.amount"
- }else{
- amount = 0
- }
- var send_data = {
- "common": { "returnmap": "0" },
- "data": [
- {
- "name": "editBigoutsourcing", "type": "e",
- "parammaps": this.createTemp
- },
- {
- "name": "insertSpotList",
- "resultmaps": { "list": this.listAddCont },
- "children": [
- {
- "name": "editOutsourcing", "type": "e",
- "parammaps": {
- "bigId": "@insertSpotList.LastInsertId",
- "providerId": "@insertSpotList.providerId",
- "amount": amount,
- "eqId": "@insertSpotList.eqId",
- "eqCode": "@insertSpotList.eqCode",
- "eqName": "@insertSpotList.eqName",
- "typea": "@insertSpotList.typea",
- "date": "@insertSpotList.date",
- "contractId": "@insertSpotList.contractId",
- "id": "@insertSpotList.id",
- "providerName": "@insertSpotList.providerName",
- "contractCode": "@insertSpotList.contractCode"
- }
- }
- ]
- },
- {
- "name": "updateBigoutsourcingFlowCompeleted", "type": "e",
- "parammaps":{
- id:this.createTemp.id
- }
- },
- ]
- }
- ExecDataByConfig(send_data).then(response => {
- console.log('新增保存发送参数', send_data)
- if (response.msg === 'fail') {
- this.$notify({
- title: '保存失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.dialogFormVisible = false
- this.get_table_data1()
- this.$notify({
- title: '',
- message: '保存成功',
- type: 'success',
- duration: 2000
- })
- }
- })
- },
- form_delete(row) {
- console.log('点击了删除',row)
- MessageBox.confirm('确认删除此条信息?', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- var send_data = {
- "common": { "returnmap": "0" },
- "data": [
- {
- "name": "deleteBigoutsourcing", "type": "e",
- "parammaps": { "id":row.id }
- }
- ]
- }
- ExecDataByConfig(send_data).then(response => {
- this.get_table_data1()
- this.$notify({
- title: '成功',
- message: '删除成功',
- type: 'success',
- duration: 2000
- })
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- })
- })
- },
- change_statue(val) {
- if (val == 2) {
- this.statueReason = true
- } else {
- this.statueReason = false
- }
- },
- form_examine(row) {
- console.log('点击了设备处长审核',row)
- if (row == undefined) {
- this.examineTemp = this.createTemp
- this.$set(this.createTemp, 'status', 1)
- this.$set(this.createTemp, 'workflowNote', '')
- } else {
- this.examineTemp = Object.assign({}, row)
- this.$set(this.examineTemp, 'status', 1)
- this.$set(this.examineTemp, 'workflowNote', '')
- }
- // this.dialogStatus = 'examine'
- this.dialogStatus = 'check1'
- this.dialogFormVisible_Examine = true
- this.statueReason = false
- },
- form_examine_save() {
- console.log('点击了设备处长审核', this.examineTemp)
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['examineTemp'].validate(valid => {
- if (valid) {
- //不通过
- if(this.statueReason){
- this.examineTemp.status = 2
- //审核角色
- this.examineTemp.flowCompeleted = "3"
- } else {
- this.examineTemp.status = 0
- this.examineTemp.flowCompeleted = "2"
- }
- this.examineTemp.empid = Cookies.get('employeid')
- var send_data = {
- "common": { "returnmap": "0" },
- "data": [
- // {
- // "name": "editBigoutsourcingEquipment", "type": "e",
- // "parammaps": this.examineTemp
- // },
- {
- "name": "editBigoutsourcingDepartment", "type": "e",
- "parammaps": this.examineTemp
- }
- ]
- }
- console.log(send_data,'审核1保存')
- ExecDataByConfig(send_data).then(response => {
- console.log('审核确认发送参数', send_data)
- if (response.msg !== 'fail') {
- this.get_table_data1()
- this.dialogFormVisible_Examine = false
- this.statueReason = false
- this.$notify({
- title: '成功',
- message: '审核成功',
- type: 'success',
- duration: 2000
- })
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- })
- },
- form_examine2(row) {
- console.log('点击了场长审核',row)
- this.examineTemp = Object.assign({}, row)
- if (row == undefined) {
- // this.examineTemp = this.createTemp
- this.$set(this.createTemp, 'status', 1)
- this.$set(this.createTemp, 'workflowNote', '')
- } else {
- this.$set(this.examineTemp, 'status', 1)
- this.$set(this.examineTemp, 'workflowNote', '')
- }
- // this.dialogStatus = 'examine'
- this.dialogStatus = 'check2'
- this.statueReason = false
- this.dialogFormVisible_Examine = true
- // GetDataByName(this.getParmCreateNumber).then(response => {
- // this.$nextTick(() => {
- // console.log('新增单号', response.data.list[0].orderCode)
- // this.examineTemp.acceptanceCode = response.data.list[0].orderCode
- // this.$set(this.examineTemp,'acceptanceCode',response.data.list[0].orderCode)
- // this.$forceUpdate()
- // })
- // })
- },
- add_dialog_saveSave2() {
- console.log(this.examineTemp,'=====---hss')
- // this.examineTemp.iscontract =
- //牧场
- var mydata = {
- // acceptanceCode:this.createTemp.acceptanceCode,
- pastureId: this.createTemp.pastureId,
- departmentId: this.createTemp.departmentId,
- applicant:Cookies.get('employeid'),
- outsourcingCode:this.examineTemp.outsourcingCode,
- applyType:0,
- date:parseTime(new Date(), '{y}-{m}-{d}'),
- status:1
- }
- if(this.examineTemp.contract == 0){
- mydata.iscontract = 1
- }else{
- mydata.iscontract = 0
- }
- var send_data = {
- "common": { "returnmap": "0" },
- "data": [
- {
- "name": "insertBigacceptance",
- "type": "e",
- "parammaps": mydata
- }
- ]
- }
- ExecDataByConfig(send_data).then(response => {
- console.log('新增保存发送参数', send_data)
- if (response.msg === 'fail') {
- this.$notify({
- title: '保存失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- // this.$notify({
- // title: '',
- // message: '保存成功',
- // type: 'success',
- // duration: 2000
- // })
- }
- })
- },
- form_examine_save2() {
- console.log('点击了场长审核', this.examineTemp)
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- // this.examineTemp.acceptanceCode = this.createTemp.acceptanceCode
- this.$refs['examineTemp'].validate(valid => {
- if (valid) {
- //不通过
- if(this.statueReason){
- this.examineTemp.status = 2
- //审核角色
- this.examineTemp.flowCompeleted = "5"
- } else {
- // //总价大于等于10000 有高级设备工程师审核
- // if(this.examineTemp.isAudit == 1){
- // this.examineTemp.status = 0
- // //总价小于10000 没有高级设备工程师,直接场长审核
- // } else {
- // this.examineTemp.status = 1
- // }
- this.examineTemp.status = 0
- this.examineTemp.flowCompeleted = "4"
- }
- this.examineTemp.empid = Cookies.get('employeid')
- var send_data = {
- "common": { "returnmap": "0" },
- "data": [
- // {
- // "name": "editBigoutsourcingField", "type": "e",
- // "parammaps": this.examineTemp
- // },
- {
- "name": "editBigoutsourcingEquipment", "type": "e",
- "parammaps": this.examineTemp
- }
- ]
- }
- console.log(send_data,'审核2保存')
- ExecDataByConfig(send_data).then(response => {
- console.log('审核确认发送参数', send_data)
- if (response.msg !== 'fail') {
- if(this.examineTemp.status == 1){
- this.add_dialog_saveSave2()
- }
- this.get_table_data1()
- this.dialogFormVisible_Examine = false
- this.statueReason = false
- this.$notify({
- title: '成功',
- message: '审核成功',
- type: 'success',
- duration: 2000
- })
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- })
- },
- form_examine3(row) {
- console.log('点击了高级工程师 审核',row)
- this.examineTemp = Object.assign({}, row)
- if (row == undefined) {
- //this.examineTemp = this.createTemp
- this.$set(this.createTemp, 'status', 1)
- this.$set(this.createTemp, 'workflowNote', '')
- } else {
- this.$set(this.examineTemp, 'status', 1)
- this.$set(this.examineTemp, 'workflowNote', '')
- }
- // this.dialogStatus = 'examine'
- this.dialogStatus = 'check3'
- this.dialogFormVisible_Examine = true
- this.statueReason = false
- },
- form_examine_save3() {
- console.log('点击了高级工程师审核',this.examineTemp )
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['examineTemp'].validate(valid => {
- if (valid) {
- //不通过
- if(this.statueReason){
- this.examineTemp.status = 2
- //审核角色
- this.examineTemp.flowCompeleted = "7"
- } else {
- //总价大于等于10000 有高级设备工程师审核
- if(this.examineTemp.isAudit == 1){
- this.examineTemp.status = 0
- //总价小于10000 没有高级设备工程师,直接场长审核
- } else {
- this.examineTemp.status = 1
- }
- this.examineTemp.flowCompeleted = "6"
- }
- this.examineTemp.empid = Cookies.get('employeid')
- var send_data = {
- "common": { "returnmap": "0" },
- "data": [
- // {
- // "name": "editBigoutsourcingAdvanceddate", "type": "e",
- // "parammaps": this.examineTemp
- // },
- {
- "name": "editBigoutsourcingField", "type": "e",
- "parammaps": this.examineTemp
- }
- ]
- }
- console.log(send_data,'审核3保存',this.examineTemp)
- ExecDataByConfig(send_data).then(response => {
- console.log('审核确认发送参数', send_data)
- if (response.msg !== 'fail') {
- if(this.examineTemp.status == 1){
- this.add_dialog_saveSave2()
- }
- this.get_table_data1()
- this.dialogFormVisible_Examine = false
- this.statueReason = false
- this.$notify({
- title: '成功',
- message: '审核成功',
- type: 'success',
- duration: 2000
- })
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- })
- },
- form_examine4(row) {
- console.log('点击了高级工程师 审核',row)
- this.examineTemp = Object.assign({}, row)
- if (row == undefined) {
- //this.examineTemp = this.createTemp
- this.$set(this.createTemp, 'status', 1)
- this.$set(this.createTemp, 'workflowNote', '')
- } else {
- this.$set(this.examineTemp, 'status', 1)
- this.$set(this.examineTemp, 'workflowNote', '')
- }
- this.dialogStatus = 'examine'
- this.dialogFormVisible_Examine = true
- this.statueReason = false
- },
- form_examine_save4() {
- console.log('点击了高级工程师审核',this.examineTemp )
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['examineTemp'].validate(valid => {
- if (valid) {
- //不通过
- if(this.statueReason){
- this.examineTemp.status = 2
- //审核角色
- this.examineTemp.flowCompeleted = "9"
- } else {
- this.examineTemp.status = 1
- this.examineTemp.flowCompeleted = "8"
- }
- this.examineTemp.empid = Cookies.get('employeid')
- var send_data = {
- "common": { "returnmap": "0" },
- "data": [
- // {
- // "name": "editBigoutsourcingAdvanceddate", "type": "e",
- // "parammaps": this.examineTemp
- // },
- {
- "name": "editBigoutsourcingAdvanceddate", "type": "e",
- "parammaps": this.examineTemp
- }
- ]
- }
- console.log(send_data,'审核4保存')
- ExecDataByConfig(send_data).then(response => {
- console.log('审核确认发送参数', send_data)
- if (response.msg !== 'fail') {
- if(this.examineTemp.status == 1){
- this.add_dialog_saveSave2()
- }
- this.get_table_data1()
- this.dialogFormVisible_Examine = false
- this.statueReason = false
- this.$notify({
- title: '成功',
- message: '审核成功',
- type: 'success',
- duration: 2000
- })
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .select_up {
- padding: 0 12px;
- font-size: 14px;
- position: absolute;
- z-index: 99999;
- background-color: white;
- top: 0px;
- width: 100%;
- border-radius: 5px 5px 0 0;
- ::v-deep .el-button {
- color: #bcbcbc;
- font-size: 14px;
- i {
- font-size: 14px;
- }
- }
- ::v-deep .el-button:hover {
- color: #409EFF;
- }
- .el-button+.el-button {
- margin-left: 6px;
- }
- }
- .select_list {
- margin-top: 25px;
- }
- // .content{
- // padding: 20px 20px;
- // .title{
- // text-align: center;
- // font-weight: 700;
- // }
- // .title2{
- // float: left;
- // font-weight: 700;
- // padding: 10px 0;
- // }
- // }
- </style>
|