12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333 |
- <template>
- <div class="app-container">
- <div class="filter-container">
- <el-select v-model="tableObj1.getdataListParm.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item" @change="change_pasture1">
- <el-option v-for="item in pastureNameList" :key="item.id" :label="item.name" :value="item.name" />
- </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.acceptanceCode" 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>
- <el-input v-model="tableObj1.getdataListParm.parammaps.outsourcingCode" placeholder="委外申请单号" style="width: 200px;" class="filter-item" />
- <el-select v-model="tableObj1.getdataListParm.parammaps.iscontract" style="width: 140px;" clearable placeholder="有无合同" class="filter-item">
- <el-option v-for="item in iscontractList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <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="istab2Add" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</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="acceptanceCode" />
- <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="120px" align="center" prop="applicantName" />
- <el-table-column label="合同" min-width="120px" align="center" prop="contract">
- <template slot-scope="scope">
- <span v-if="scope.row.iscontract == 0 ">有</span>
- <span v-else>无</span>
- </template>
- </el-table-column>
- <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-if="scope.row.status == 2 ">已回厂</span>
- <span v-else>已验收</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="320" 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="istab2Edit && row.isAcceptance == 0" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
- <el-button v-if="istab2Del && row.isAcceptance == 0" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
- <el-button v-if="row.isAcceptance == 0" style="display:inline-block" type="success" size="mini" @click="form_submit(row)">提交</el-button>
- <el-button v-if="istab2Shenhe1 && row.isAcceptance == 1 && (row.flowCompeleted == 1) " style="display:inline-block" type="success" size="mini" @click="form_examine(row)">审核1</el-button>
- <el-button v-if="istab2Shenhe2 && row.isAcceptance == 1 && (row.flowCompeleted == 2) " style="display:inline-block" type="success" size="mini" @click="form_examine2(row)">审核2</el-button>
- <el-button v-if="istab2Shenhe3 && row.isAcceptance == 1 && (row.flowCompeleted == 4) " style="display:inline-block" type="success" size="mini" @click="form_examine3(row)">审核3</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 class="app-container">
- <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="acceptanceCode">
- <el-input ref="acceptanceCode" v-model="createTemp.acceptanceCode" 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==='update' || 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==='update' || 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="outsourcingCode">
- <el-autocomplete :disabled="dialogStatus==='update' || dialogStatus==='see'"
- v-model="createTemp.outsourcingCode"
- value-key="name"
- class="inline-input"
- :fetch-suggestions="getOutNumber"
- placeholder=""
- style="width:100%"
- @select="changeOutNumber"
- >
- <template slot-scope="{ item }">
- <div class="name" style="display: inline;">{{ item.outsourcingCode }}</div>
- <!-- <div class="name" style="display: inline;">{{ item.departmentName }}</div> -->
- </template>
- </el-autocomplete>
- </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==='update' || 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="8">
- <el-form-item label="有无合同:" prop="iscontract">
- <span v-if="createTemp.iscontract == 0">有合同</span>
- <span v-else>无合同</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="离厂日期:" prop="lcdate">
- <el-date-picker v-model="createTemp.lcdate" :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-col :span="8">
- <el-form-item label="回厂日期:" prop="hcdate">
- <el-date-picker v-model="createTemp.hcdate" :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-divider></el-divider>
- <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 label="序号" align="center" type="index" width="50px" />
- <el-table-column label="供应商" prop="providerName" align="center" min-width="80px">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <!-- <el-table-column label="金额" prop="amount" align="center" min-width="80px">
- <template slot-scope="scope">
- <span>{{ scope.row.amount }}</span>
- </template>
- </el-table-column> -->
- <el-table-column label="金额" v-if="createTemp.iscontract !== 0" 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 label="设备名称" prop="eqName" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.eqName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="设备内部编号" prop="eqCode" align="center" min-width="80px">
- <template slot-scope="scope">
- <span>{{ scope.row.eqCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="费用类型" prop="typea" align="center" min-width="80px">
- <template slot-scope="scope">
- <span>{{ scope.row.typea }}</span>
- </template>
- </el-table-column>
- <el-table-column 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 label="质保日期" prop="warrantydate" align="center" min-width="80px">
- <template slot-scope="scope">
- <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
- <!-- <el-date-picker v-model="scope.row.warrantydate" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="margin-top:10px" /> -->
- <el-date-picker v-model="scope.row.warrantydate" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="margin-top:10px" />
- </span>
- <span v-if="dialogStatus ==='see'">{{ scope.row.warrantydate }}</span>
- </template>
- </el-table-column>
- <!-- <el-table-column label="交付日期" prop="date" align="center" min-width="80px">
- <template slot-scope="scope">
- <span>{{ scope.row.date }}</span>
- </template>
- </el-table-column> -->
- <!-- <el-table-column label="合同编号" prop="contractCode" align="center" min-width="80px">
- <template slot-scope="scope">
- <span>{{ scope.row.contractCode }}</span>
- </template>
- </el-table-column> -->
- <el-table-column label="备注" prop="remark" align="center" min-width="80px">
- <template slot-scope="scope">
- <span >{{ scope.row.remark }}</span>
- </template>
- </el-table-column>
- </el-table>
- <el-divider></el-divider>
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="备件类型:" prop="applyType">
- <el-radio-group v-model="createTemp.applyType" :disabled="dialogStatus==='see'" @change="change_applyType" >
- <el-radio :label="0" :checked="createTemp.applyType == 0">牧场</el-radio>
- <el-radio :label="1" :checked="createTemp.applyType == 1">供应商</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20" v-if = "createTemp.applyType == 0">
- <el-button v-if = "dialogStatus !=='see' " class="filter-item" type="primary" size="mini" style="margin-bottom:10px" @click="handleCollectionSparePartsCreate">添加领用单</el-button>
- <!-- <el-col :span="8">
- <el-form-item label="领用单号:" prop="applyCode">
- <el-input ref="applyCode" v-model="createTemp.applyCode" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="16">
- <el-form-item label="备件:" prop="partCode">
- <el-autocomplete v-model="orderPart.partCode" value-key="name" class="inline-input" :fetch-suggestions="sparePartSearch" placeholder="请输入备件编号或备件名称或备件规格" style="width:100%" @select="handleSelectSparePart" :disabled="dialogStatus==='update' || dialogStatus==='see'" >
- <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>
- | <b>品牌:</b><span class="addr">{{ item.brand }}</span>
- | <b>库存:</b><span class="addr">{{ item.reportery }}</span>
- </template>
- </el-autocomplete>
- </el-form-item>
- </el-col> -->
- </el-row>
- <el-table v-if = "createTemp.applyType == 0"
- :key="tableKey"
- v-loading="listLoading"
- element-loading-text="给我一点时间"
- :data="listCollectionSpareParts"
- 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 + (pageNum-1) * pageSize + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="领用单号" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.applyCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="领用部门" width="140px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.departmentName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="领用日期" sortable prop="createDate" min-width="80px" align="center" />
- <el-table-column label="领用备件" prop="details" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.details }}</span>
- </template>
- </el-table-column>
- <el-table-column label="领用状态" min-width="100px" align="center" :formatter="statue" />
- <el-table-column label="操作" min-width="80px" align="center">
- <template slot-scope="{row}">
- <el-button type="primary" size="mini" @click="handleCollarUseSee(row)">查看</el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-divider></el-divider>
- <el-button v-if = "createTemp.applyType == 1 && dialogStatus !=='see' " class="filter-item" type="primary" icon="el-icon-edit" @click="form_add_list2">新增</el-button>
- <el-table v-if = "createTemp.applyType == 1"
- key="2" v-loading="listLoading" element-loading-text="给我一点时间"
- :data="listAdd2" border fit highlight-current-row style="width: 100%;margin-bottom:30px"
- :row-style="rowStyle" :cell-style="cellStyle" class="elTable" >
- <!-- table表格 -->
- <el-table-column type="index" label="序号" align="center" width="50px" />
- <el-table-column label="备件编号" min-width="90px" prop="partCode" align="center">
- <template slot-scope="scope">
- <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
- <el-input v-model="scope.row.partCode" style="margin-top:10px" />
- </span>
- <span v-if="dialogStatus ==='see'">{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" min-width="60px" align="center">
- <template slot-scope="scope">
- <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
- <el-input v-model="scope.row.partName" style="margin-top:10px" />
- </span>
- <span v-if="dialogStatus ==='see'">{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" prop="specification" align="center" min-width="90">
- <template slot-scope="scope">
- <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
- <el-input v-model="scope.row.specification" style="margin-top:10px" />
- </span>
- <span v-if="dialogStatus ==='see'">{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" prop="brand" align="center" min-width="60">
- <template slot-scope="scope">
- <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
- <el-input v-model="scope.row.brand" style="margin-top:10px" />
- </span>
- <span v-if="dialogStatus ==='see'">{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" prop="providerName" align="center" min-width="60">
- <template slot-scope="scope">
- <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
- <el-input v-model="scope.row.providerName" style="margin-top:10px" />
- </span>
- <span v-if="dialogStatus ==='see'">{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
- <template slot-scope="scope">
- <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
- <el-input v-model="scope.row.unit" style="margin-top:10px" />
- </span>
- <span v-if="dialogStatus ==='see'">{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="数量" prop="amount" align="center" min-width="60">
- <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 label="单价" prop="price" align="center" min-width="70">
- <template slot-scope="scope">
- <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
- <el-input v-model="scope.row.price" style="margin-top:10px" />
- </span>
- <span v-if="dialogStatus ==='see'">{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column label="总价" prop="totalPrice" align="center" min-width="70">
- <template slot-scope="scope">
- <span>{{ scope.row.price * parseFloat(scope.row.amount) }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备注" prop="remark" align="center" min-width="60">
- <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-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right" v-if="dialogStatus ==='create'||dialogStatus ==='update'">
- <template slot-scope="{row}">
- <a class="del" @click="partDelete2(row)">删除</a>
- </template>
- </el-table-column>
- </el-table>
- </el-form>
- <el-row 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" v-if="dialogStatus !=='see'" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
- <!-- <el-button type="primary" v-show ="dialogStatus==='create'" :disabled="isokDisable" @click="add_dialog_save()">保存并关闭1</el-button>
- <el-button type="primary" v-show ="dialogStatus==='update'" :disabled="isokDisable" @click="edit_dialog_save()">保存并关闭2</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="istab2Shenhe1 && (examineTemp.flowCompeleted == 1) " type="primary" :disabled="isokDisable" @click="form_examine_save()">确认</el-button>
- <el-button v-if="istab2Shenhe2 && (examineTemp.flowCompeleted == 2) " type="primary" :disabled="isokDisable" @click="form_examine_save2()">确认</el-button>
- <el-button v-if="istab2Shenhe3 && (examineTemp.flowCompeleted == 4) " type="primary" :disabled="isokDisable" @click="form_examine_save3()">确认</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>
- <el-dialog title="领用单" :visible.sync="dialogFormVisible_CollectionSparePartsSee" :close-on-click-modal="false" width="90%">
- <div class="collectionSparePartsSee">
- <el-form
- ref="collectionSparePartsSeeTemp"
- :rules="rules"
- :model="collectionSparePartsSeeTemp"
- label-position="right"
- label-width="120px"
- style="width: 90%;margin:0 auto;"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="领用单号:" prop="applyCode">
- <el-input ref="applyCode" v-model="collectionSparePartsSeeTemp.applyCode" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="领用部门:" prop="departmentName">
- <el-input ref="departmentName" v-model="collectionSparePartsSeeTemp.departmentName" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="领用日期:" prop="applyDate">
- <el-input ref="applyDate" v-model="collectionSparePartsSeeTemp.applyDate" disabled />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="isPartCode">
- <el-col :span="16">
- <el-form-item label="所需备件:" prop="partCode">
- <el-autocomplete
- v-model="collectionSparePartsSeeTemp.partCode"
- value-key="name"
- class="inline-input"
- :fetch-suggestions="sparePartSearch"
- placeholder="请输入备件编号或备件名称或备件规格"
- style="width:98%"
- @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>
- | <b>库存:</b><span class="addr">{{ item.reportery }}</span>
- | <b>是否零库存:</b><span class="addr" v-if="item.isZeroStock==1">是</span>
- <span class="addr" v-else>否</span>
- </template>
- </el-autocomplete>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-table
- :key="tableKey"
- v-loading="listLoading"
- element-loading-text="给我一点时间"
- :data="listCreateCollectionSpareParts"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:30px"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <!-- table表格 -->
- <el-table-column type="index" label="序号" align="center" width="50px" />
- <el-table-column label="备件编号" min-width="90px" prop="partCode" 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><br>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" prop="specification" align="center" min-width="100">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="库存数" prop="reportery" align="center" min-width="100">
- <template slot-scope="scope">
- <span>{{ scope.row.reportery }}</span>
- </template>
- </el-table-column>
- <el-table-column label="领用数量" prop="amount" align="center" min-width="80">
- <template slot-scope="scope">
- <el-form :model="scope.row">
- <el-form-item prop="amount">
- <el-input ref="amount" v-model="scope.row.amount" :disabled="dialogStatus==='collectionSparePartsSee'" style="margin-top:15px" />
- </el-form-item>
- </el-form>
- </template>
- </el-table-column>
- <!-- <el-table-column label="领用时间" prop="date" align="center" min-width="100">
- <template slot-scope="scope">
- <span>{{ scope.row.date }}</span>
- </template>
- </el-table-column> -->
- <el-table-column label="用途" prop="note" align="center" min-width="60">
- <template slot-scope="scope">
- <el-form :model="scope.row">
- <el-form-item prop="note">
- <el-input ref="note" v-model="scope.row.note" :disabled="dialogStatus==='collectionSparePartsSee'" style="margin-top:15px" />
- </el-form-item>
- </el-form>
- </template>
- </el-table-column>
- <el-table-column label="设备名称" prop="eqName" align="center" min-width="250">
- <template slot-scope="scope">
- <el-autocomplete v-if="isCreatePartDelete"
- v-model="scope.row.eqName"
- class="inline-input"
- :fetch-suggestions="querySearchEqName"
- value-key="eqName"
- placeholder="设备名称"
- @select="(value)=>
- {handleSelectEqName(value, scope.row)}"
- @blur="(value)=>
- {blurSelectEqName(value, scope.row)}"
- >
- <template slot-scope="{ item }">
- <span class="addr">{{ item.eqName }}</span>
- |<span class="addr">{{ item.eqCode }}</span>
- </template>
- </el-autocomplete>
- <span v-else class="addr">{{ scope.row.eqName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="设备内部编号" prop="eqCode" align="center" min-width="150">
- <template slot-scope="scope">
- <el-autocomplete v-if="isCreatePartDelete"
- v-model="scope.row.eqCode"
- class="inline-input"
- :fetch-suggestions="querySearchCode"
- value-key="eqCode"
- placeholder="设备内部编号"
- @select="(value)=>
- {handleSelectEqCode(value, scope.row)}"
- @blur="(value)=>
- {blurSelectEqCode(value, scope.row)}"
- />
- <span v-else class="addr">{{ scope.row.eqCode }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="isCreatePartDelete" label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <a class="del" @click="createPartDelete(row)">删除</a>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div slot="footer" class="dialog-footer" style="bottom:5px">
- <el-button v-if="isPartCode" type="primary" :disabled="isokDisable" @click="createCollectionSparePartsData()">确认</el-button>
- <el-button @click="dialogFormVisible_CollectionSparePartsSee = false;">关闭</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import echarts from 'echarts'
- require('echarts/theme/macarons')
- import { GetDataByNames, GetReportform, GetDataByName, PostDataByName, checkButtons, ExecDataByConfig} from '@/api/common'
- import Cookies from 'js-cookie'
- import { parseTime, json2excel } from '@/utils/index.js'
- import { MessageBox } from 'element-ui'
- import Pagination from '@/components/Pagination'
- export default {
- name: 'Tab2',
- components: { Pagination },
- inject: ['reload'],
- data() {
- return {
- 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') }},
- ],
- // 下拉框 - 牧场
- 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: '未通过' }],
- statuesNameList: [{ id: '0', name: '未离厂' }, { id: '1', name: '未回厂' }, { id: '2', name: '已回厂' }, { id: '3', name: '已验收' }],
- iscontractList:[{id: '0', name: '有合同'},{id: '1', name: '无合同'}],
- isokDisable: false,
- tableObj1: {
- getdataListParm: {
- name: 'getBigacceptanceList',
- //请求的 page 无用参数 offset 第几页 pagecount 每页多少条
- page: 1, offset: 1,pagecount: 10,returntype: 'Map',
- parammaps: { pastureName:Cookies.get('pasturename'), acceptanceCode: '',departmentName: '',status: "",outsourcingCode: "", inputDatetime:"",startdate: "",enddate: "",iscontract:''}
- },
- tableKey: 0,listLoading: false,
- //返回的 pageNum 第几页 pageSize 每页多少条 total 总条数
- pageNum:'',pageSize:'',total: 0,
- list: [
- ]
- },
- pageNum:'',pageSize:'',total: 0,
- getAddContListParam: {
- name: "getOutsourcingList",
- page: 1,offset: 1,pagecount: 20,returntype: "Map",
- parammaps: {"bigId": ""}
- },
- pickerOptions: {
- disabledDate(time) {
- return time.getTime() > Date.now()// 当天之前的时间可选
- }
- },
- dialogFormVisible_CollectionSparePartsSee: false,
- listCreateCollectionSpareParts: [],
- isCreatePartDelete: false,
- isPartCode: true,
- getCollarUseSeeParm: {
- name: 'getpartapplyListBybig',
- parammaps: {}
- },
- orderPart: {},
- getOutCodetParm: {
- name: 'getBigoutsourcingCode',
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- outsourcingCode:"",
- }
- },
- useForms: [],
- getParmCreateAdd: {
- name: 'getPartApplyByBig',
- returntype: 'Map',
- parammaps: {}
- },
- rules: {
- equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
- lcdate: [{ required: true, message: '必填', trigger: 'blur' }],
- hcdate: [{ required: true, message: '必填', trigger: 'blur' }],
- },
- getPramPartApplyListBybig: {
- name:"getpartapplyListBybig",
- returntype:"Map",
- parammaps:{"id":""}
- },
- getPramAcceptanceList: {
- name:"getAcceptanceList",
- returntype:"Map",
- parammaps:{"bigId ":""}
- },
- getCollarUseListParm: {
- name: 'getPartsapplybyMt',
- page: 1,
- offset: 1,
- returntype: 'Map',
- parammaps: {
- "RUCode":"",
- }
- },
- collectionSparePartsSeeTemp: {
- applyCode:"",departmentName:"",applyDate:"",
- isStock: 0,
- applyDate:"",
- },
- listCollectionSpareParts: [],
- 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}'),
- providerId: '',
- contract:1,
- acceptanceCode:"",
- outsourcingCode:"",
- applyType:0,
- applicant: '',
- departmentName: '',
- contract:1,
- },
- getParmCreateNumber: {
- name: 'autoCreatCode',
- page: 0, offset: 0, pagecount: 0, returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- codeType: 'WY'
- }
- },
- getParmCreateNumber2: {
- name: 'autoCreatCode',
- page: 0, offset: 0, pagecount: 0, returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- codeType: 'LY'
- }
- },
- requestSparePart: {
- name: 'getPartsListLY', page: 1, offset: 1, pagecount: 20, returntype: 'Map',
- parammaps: { pastureId: Cookies.get('pastureid') }
- },
- EqNameList: [],
- requestEqName: {
- name: 'geteqbyNameCode', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
- parammaps: { pastureId: Cookies.get('pastureid') }
- },
- EqCodeList: [],
- listAdd:[],
- listAdd2:[],
- isData:false,
- listAddCont:[
- // {providerName:"",providerId: "0",eqId: "0",contractId: "0",}
- ],
- activeList: [],
- active: 1,
- 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',
- collectionSparePartsSee: '查看领用',
- collectionSparePartsCreate: '添加领用',
- },
- istab2Add:[],
- istab2Edit:[],
- istab2Del:[],
- istab2Shenhe1:[],
- istab2Shenhe2:[],
- istab2Shenhe3:[],
- }
- },
- created() {
- this.get_select_list()
- this.get_table_data1()
- },
- methods: {
- //获取按钮权限
- get_auto_buttons() {
- const istab2Add = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:add')
- this.istab2Add = istab2Add
- const istab2Edit = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:edit')
- this.istab2Edit = istab2Edit
- const istab2Del = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:del')
- this.istab2Del = istab2Del
- const istab2Shenhe1 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:shenhe1')
- this.istab2Shenhe1 = istab2Shenhe1
- const istab2Shenhe2 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:shenhe2')
- this.istab2Shenhe2 = istab2Shenhe2
- const istab2Shenhe3 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:shenhe3')
- this.istab2Shenhe3 = istab2Shenhe3
- },
- get_select_list() {
- GetDataByNames(this.send_select_list).then(response => {
- this.pastureNameList = response.data.findAllPasture.list
- console.log("牧场下拉框", this.pastureNameList)
- this.employeNameList = response.data.findAllEmploye.list
- console.log("申请人下拉框", this.employeNameList)
- 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 = ''
- }
- GetDataByName(this.tableObj1.getdataListParm).then(response => {
- if (response.data.list !== null) {
- this.tableObj1.list = response.data.list
- 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_applyType(val) {
- console.log(val)
- if(val ==1){
- this.createTemp.applyType = 1
- } else {
- this.createTemp.applyType = 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.getCreateNumber()
- },
- statue: function(cellValue) {
- // console.log(cellValue.isZeroStock)
- if (cellValue.statue == 0) {
- return '未领用'
- } else if (cellValue.statue == 1) {
- return '已领用'
- }
- },
- reset_create() {
- this.createTemp.pastureId = parseInt(Cookies.get('pastureid'))
- this.createTemp.departmentId = parseInt(Cookies.get('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 = ''
- if(parseInt(Cookies.get('pastureid')) == 18){
- this.createTemp.departmentId = ""
- }
- this.createTemp.outsourcingCode = ''
- console.log( this.createTemp.departmentName )
- this.listAddCont = [
- // {providerName:"",providerId: "0",eqId: "0",contractId: "0",amount:"",contractCode:"",date:"",eqCode:"",eqName:"",remark:"",typea:"",}
- ]
- this.listAdd = []
- this.listAdd2 = []
- this.listCreateCollectionSpareParts = []
- this.listCollectionSpareParts = []
- },
- handleCollarUseSee(row, isStock) {
- console.log(row)
- this.collectionSparePartsSeeTemp = Object.assign({}, row)
- // this.dialogStatus = 'collectionSparePartsSee'
- this.collectionSparePartsSeeTemp.applyDate = row.createDate
- this.dialogFormVisible_CollectionSparePartsSee = true
- this.isCreatePartDelete = false
- this.isPartCode = false
- this.getCollarUseSeeList()
- },
- getCollarUseSeeList() {
- this.getCollarUseSeeParm.parammaps.id = this.collectionSparePartsSeeTemp.id
- GetDataByName(this.getCollarUseSeeParm).then(response => {
- this.listCreateCollectionSpareParts = response.data.list
- })
- },
- form_add_list2() {
- var idDel = "id" + Math.round(Math.random()*100) + Math.round(Math.random()*100)
- this.listAdd2.unshift({partCode:"",providerId: "0",eqId: "0",contractId: "0",idDel:idDel,partId: "",partCode: "",partName: "",brandId: "",brand: "",providerId: "",providerName: "",price: "",sumPrice: "",remark: "",amount: ""})
- },
- getCreateNumber() {
- GetDataByName(this.getParmCreateNumber).then(response => {
- this.$nextTick(() => {
- console.log('新增委外维修单单号', response.data.list[0].orderCode)
- this.createTemp.acceptanceCode = response.data.list[0].orderCode
- this.$forceUpdate()
- })
- })
- },
- getCreateLYNumber() {
- GetDataByName(this.getParmCreateNumber2).then(response => {
- this.$nextTick(() => {
- console.log('新增领用单号', response.data.list[0].orderCode)
- this.collectionSparePartsSeeTemp.applyCode = response.data.list[0].orderCode
- this.$forceUpdate()
- })
- })
- },
- add_dialog_save() {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['createTemp'].validate(valid => {
- if (valid) {
- console.log(this.listAddCont)
- if (this.createTemp.acceptanceCode == '' || this.createTemp.acceptanceCode == null || this.createTemp.acceptanceCode == undefined) {
- GetDataByName(this.getParmCreateNumber).then(response => {
- this.$nextTick(() => {
- console.log('新增单号', response.data.list[0].orderCode)
- this.createTemp.acceptanceCode = 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[j].amount)
- 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.applyType == 0){
- let mySumPrice = 0
- for (let i = 0; i < this.listAdd.length; i++) {
- mySumPrice += parseFloat(this.listAdd[i].price) * parseFloat(this.listAdd[i].amount)
- }
- if (mySumPrice > 500) {
- this.createTemp.SHStatus = 2
- } else {
- this.createTemp.SHStatus = 9
- }
- var send_data = {
- "common": { "returnmap": "0" },
- "data": [
- {
- "name": "insertBigacceptance",
- "type": "e",
- "parammaps": this.createTemp
- }
- ]
- }
- }
- //供应商
- if(this.createTemp.applyType == 1){
- if(this.listAdd2.length == 0){
- this.$notify({
- title: '失败', message: "备件必选!",
- type: 'warning',
- duration: 2000
- })
- return false
- }
- this.listAdd2.map((item, index) => {
- return item.partId = "0"
- })
- this.listAdd2.map((item, index) => {
- return item.brandId = "0"
- })
- this.listAdd2.map((item, index) => {
- return item.providerId = "0"
- })
- var send_data = {
- "common": {
- "returnmap": "0"
- },
- "data": [
- {
- "name": "insertBigacceptance",
- "type": "e",
- "parammaps": this.createTemp
- },
- {
- "name": "insertSpotList",
- "resultmaps": {
- "list": this.listAdd2
- },
- "children": [
- {
- "name": "insertAcceptance",
- "type": "e",
- "parammaps": {
- "bigId":"@insertBigacceptance.LastInsertId",
- "partId":"@insertSpotList.partId",
- "partCode":"@insertSpotList.partCode",
- "partName":"@insertSpotList.partName",
- "brandId":"@insertSpotList.brandId",
- "brand":"@insertSpotList.brand",
- "providerId":"@insertSpotList.providerId",
- "providerName":"@insertSpotList.providerName",
- "unit":"@insertSpotList.unit",
- "price":"@insertSpotList.price",
- "remark":"@insertSpotList.remark",
- "specification": "@insertSpotList.specification",
- "amount":"@insertSpotList.amount"
- }
- }
- ]
- }
- ]
- }
- }
- 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
- })
- }
- })
- },
- getOutNumber(queryString, cb) {
- console.log('委外申请单号模糊查询输入值', queryString)
- this.getOutCodetParm.parammaps['outsourcingCode'] = queryString
- GetDataByName(this.getOutCodetParm).then(response => {
- console.log('委外申请单号模糊查询搜索data', response.data.list)
- // this.useForms = response.data.list
- cb(response.data.list)
- })
- },
- changeOutNumber(item) {
- console.log('委外申请单号模糊查询选中值', item)
- this.createTemp.outsourcingCode = item.outsourcingCode
- this.$set(this.createTemp, "outsourcingCode", item.outsourcingCode)
- this.getAddContListParam.parammaps.bigId = item.id
- this.getAddContList()
- // this.createTemp.bid = item.id
- // this.createTemp.applicatId = item.empId
- // this.orderPart.applyCode = item.applyCode
- // this.TotalAmount = 0
- // this.get_table_dataAdd()
- },
- querySearchEqName(queryString, cb) {
- console.log('备件名称/设备内部编号模糊查询输入值', queryString)
- this.requestEqName.parammaps['eqName'] = queryString
- GetDataByName(this.requestEqName).then(response => {
- console.log('备件名称模糊查询搜索data', response.data.list)
- this.EqNameList = response.data.list
- cb(this.EqNameList)
- })
- },
- handleSelectEqName(item, row) {
- console.log('备件名称/设备内部编号模糊查询选中值', item.eqName)
- console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
- this.$set(row, 'eqCode', item.eqCode)
- this.$forceUpdate()
- },
- querySearchCode(queryString, cb) {
- console.log('备件名称/设备内部编号模糊查询输入值', queryString)
- this.requestEqName.parammaps['eqCode'] = queryString
- GetDataByName(this.requestEqName).then(response => {
- console.log('备件名称模糊查询搜索data', response.data.list)
- this.EqNameList = response.data.list
- cb(this.EqNameList)
- })
- },
- handleSelectEqCode(item, row) {
- console.log('备件名称/设备内部编号模糊查询选中值', item)
- console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
- this.$set(row, 'eqName', item.eqName)
- this.$forceUpdate()
- },
- blurSelectEqName(item, row) {
- this.$set(row, 'eqName', '')
- this.$set(row, 'eqCode', '')
- },
- blurSelectEqCode(item, row) {
- this.$set(row, 'eqName', '')
- this.$set(row, 'eqCode', '')
- },
- sparePartSearch(queryString, cb) {
- console.log('备件模糊查询输入值', queryString)
- this.requestSparePart.parammaps.pastureId = this.createTemp.pastureId
- 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)
- // if (this.listAdd.length > 0) {
- // // eslint-disable-next-line no-redeclare
- // if (this.listAdd.find(obj => obj.id === item.id)) {
- // 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.listAdd.push(item)
- // }
- // } 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.listAdd.push(item)
- // }
- // // this.getEqNameList()
- // },
- handleSelectSparePart(item) {
- console.log('备件模糊查询选中值', item)
- if (this.listCreateCollectionSpareParts.length > 0) {
- // eslint-disable-next-line no-redeclare
- if (this.listCreateCollectionSpareParts.find(obj => obj.partId === item.partId)) {
- this.$message({ type: 'warning', message: '此备件已存在,请重新选择备件' })
- } else {
- item.date = this.collectionSparePartsSeeTemp.applyDate
- this.listCreateCollectionSpareParts.unshift(item)
- }
- } else {
- item.date = this.collectionSparePartsSeeTemp.applyDate
- this.listCreateCollectionSpareParts.unshift(item)
- }
- },
- createPartDelete(row) {
- console.log(this.listAdd)
- MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- // console.log(this.list2)
- for (var i = 0; i < this.listCreateCollectionSpareParts.length; i++) {
- console.log(this.listCreateCollectionSpareParts[i])
- if (this.listCreateCollectionSpareParts[i].id === row.id) {
- var listCreateCollectionSparePartsIndex = this.listCreateCollectionSpareParts.indexOf(this.listCreateCollectionSpareParts[i])
- }
- if (listCreateCollectionSparePartsIndex > -1) {
- this.listCreateCollectionSpareParts.splice(listCreateCollectionSparePartsIndex, 1)
- return
- }
- }
- })
- },
- // 添加领用保存
- createCollectionSparePartsData() {
- this.isokDisable = true
- if (this.listCreateCollectionSpareParts.length !== 0) {
- for (var i = 0; i < this.listCreateCollectionSpareParts.length; i++) {
- console.log(this.listCreateCollectionSpareParts[i].amount)
- if (this.listCreateCollectionSpareParts[i].amount !== undefined && this.listCreateCollectionSpareParts[i].amount !== '') {
- var rulesAmount = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
- if (!rulesAmount.test(this.listCreateCollectionSpareParts[i].amount)) {
- this.$message({
- type: 'error',
- message: '领用数量请输入正数,最多保留两位小数',
- duration: 2000
- })
- return false
- } else {
- var listCreateCollectionSpareParts1 = [] // >库存
- var listCreateCollectionSpareParts2 = [] // <=库存
- var amountList = []
- var amount2List = []
- let mySumPrice = 0
- for (let i = 0; i < listCreateCollectionSpareParts2.length; i++) {
- mySumPrice += parseFloat(listCreateCollectionSpareParts2[i].price) * parseFloat(listCreateCollectionSpareParts2[i].amount)
- }
- if (mySumPrice > 500) {
- this.collectionSparePartsSeeTemp.SHStatus = 2
- } else {
- this.collectionSparePartsSeeTemp.SHStatus = 9
- }
- var send_data ={
- "common": { "returnmap": "0" },
- "data": [
- {
- "name": "insertBigpartapply",
- "type": "e",
- "parammaps": {
- "pastureId": this.collectionSparePartsSeeTemp.pastureId,
- "applyCode": this.collectionSparePartsSeeTemp.applyCode,
- "applyType": 1,
- "departmentId": this.collectionSparePartsSeeTemp.departmentId,
- "empId": this.collectionSparePartsSeeTemp.empId,
- "applyDate": this.collectionSparePartsSeeTemp.applyDate,
- "RUCode": this.createTemp.acceptanceCode,
- "SHStatus": 9
- }
- },
- {
- "name": "insertSpotList",
- "resultmaps": {
- "list":this.listCreateCollectionSpareParts
- },
- "children": [
- {
- "name": "insertpartapply",
- "type": "e",
- "parammaps": {
- "bigId": "@insertBigpartapply.LastInsertId",
- "pastureId": "@insertSpotList.pastureId",
- "partId": "@insertSpotList.partId",
- "partCode": "@insertSpotList.partCode",
- "partName": "@insertSpotList.partName",
- "specification": "@insertSpotList.specification",
- "brandId": "@insertSpotList.brandId",
- "price": "@insertSpotList.price",
- "amount": "@insertSpotList.amount",
- "eqName": "@insertSpotList.eqName",
- "eqCode": "@insertSpotList.eqCode",
- "providerId": "@insertSpotList.providerId",
- "note": "@insertSpotList.note",
- "reportery": "@insertSpotList.reportery",
- "contractId": "@insertSpotList.contractId",
- "locationId": "@insertSpotList.locationId"
- }
- }
- ]
- }
- ]
- }
- 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_CollectionSparePartsSee = false
- this.getCollectionSpareParts()
- this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
- }
- })
- return true
- }
- } else {
- this.$message({ type: 'error', message: '请检查领用数量是否未填写', duration: 2000 })
- return false
- }
- }
- } else {
- this.$notify({ title: '', type: 'warning', message: '请选择备件', duration: 2000 })
- return false
- }
- setTimeout(() => {
- this.isokDisable = false
- }, 2000)
- },
- //看领用单
- getCollectionSpareParts() {
- this.getCollarUseListParm.parammaps.RUCode = this.createTemp.acceptanceCode
- GetDataByName(this.getCollarUseListParm).then(response => {
- console.log('领用table数据', response.data.list)
- this.listCollectionSpareParts = response.data.list
- })
- },
- // 新增删除
- partDelete(row) {
- console.log(this.listAdd)
- 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].id === row.id) {
- var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
- }
- if (listAddIndex > -1) {
- this.listAdd.splice(listAddIndex, 1)
- return
- }
- }
- })
- },
- partDelete2(row) {
- console.log(this.listAdd2)
- MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- for (var i = 0; i < this.listAdd2.length; i++) {
- console.log(this.listAdd2[i])
- if (this.listAdd2[i].idDel === row.idDel) {
- var listAddIndex = this.listAdd2.indexOf(this.listAdd2[i])
- }
- if (listAddIndex > -1) {
- this.listAdd2.splice(listAddIndex, 1)
- return
- }
- }
- })
- },
- handleCollectionSparePartsCreate() {
- if(this.createTemp.departmentId == "" || this.createTemp.departmentId == undefined){
- this.$message({ type: 'warning', message: '请选择责任部门', duration: 2000 })
- return false
- }
- if(this.createTemp.applicant == "" || this.createTemp.applicant == undefined){
- this.$message({ type: 'warning', message: '请选择录入人', duration: 2000 })
- return false
- }
- console.log( "createTemp)============",this.createTemp)
- this.collectionSparePartsSeeTemp = Object.assign({}, this.createTemp)
- this.collectionSparePartsSeeTemp.empId = this.collectionSparePartsSeeTemp.applicant
- this.collectionSparePartsSeeTemp.applyDate = parseTime(new Date(), '{y}-{m}-{d}')
- // this.dialogStatus = 'collectionSparePartsCreate'
- this.dialogFormVisible_CollectionSparePartsSee = true
- this.isCreatePartDelete = true
- this.listCreateCollectionSpareParts = []
- this.isPartCode = true
- this.getCreateLYNumber()
- console.log( "console.log( this.collectionSparePartsSeeTemp)============",this.collectionSparePartsSeeTemp)
- },
- // getCreateNumber() {
- // // GetDataByName(this.getParmCreateNumber).then(response => {
- // // this.$nextTick(() => {
- // // console.log('新增领用单号', response.data.list[0].orderCode)
- // // this.collectionSparePartsSeeTemp.applyCode = response.data.list[0].orderCode
- // // this.$forceUpdate()
- // // })
- // // })
- // },
- form_see(row){
- console.log('查看======》',row)
- this.reset_create()
- 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 = 'see'
- this.dialogFormVisible = true
- this.$nextTick(() => {
- this.$refs['createTemp'].clearValidate()
- })
- //委外申请单号获取合同
- this.getAddContListParam.parammaps.bigId = row.outsourcingId
- this.getAddContList()
- //牧场
- if(row.applyType == 0){
- this.getPramPartApplyListBybig.parammaps.id = row.partapplyId
- this.getCollectionSpareParts()
- this.isCreatePartDelete = false
- }
- //供应商
- if(row.applyType == 1){
- this.getPramAcceptanceList.parammaps.bigId = row.id
- this.getListAdd2()
- }
- if (row.flowCompeleted == 1) {
- this.activeList = [{ title: '委外验收', date: row.createTime, name: row.empname }, { title: '供应处长' }, { title: '部门负责人' },{ title: '场长' }]
- this.active = 1
- } else if (row.flowCompeleted == 2) {
- this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人' },{ title: '场长' }]
- this.active = 2
- } else if (row.flowCompeleted === 3) {
- this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName, 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.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser },{ title: '场长' }]
- this.active = 3
- } else if (row.flowCompeleted === 5) {
- this.activeList = [{ title: '委外验收', date: row.createTime, name:row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser, 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.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser },{ 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.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser },{ title: '场长', date: row.fielddate, name: row.fieldName, status: 'error', reason: row.workflowNote }]
- this.active = 4
- }
- },
- 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.outsourcingId
- this.getAddContList()
- this.isData = false
- //牧场
- if(row.applyType == 0){
- this.getCollectionSpareParts()
- }
- //供应商
- if(row.applyType == 1){
- this.getPramAcceptanceList.parammaps.bigId = row.id
- this.getListAdd2()
- }
- },
- getListAdd() {
- GetDataByName(this.getPramPartApplyListBybig).then(response => {
- this.listAdd = response.data.list
- this.listLoading = false
- })
- },
- getListAdd2() {
- GetDataByName(this.getPramAcceptanceList).then(response => {
- this.listAdd2 = response.data.list
- if(this.listAdd2.length>0){
- this.isData = true
- }else{
- this.isData = false
- }
- this.listLoading = false
- })
- },
- 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() {
- //牧场
- if(this.createTemp.applyType == 0){
- for(let i=0;i<this.listAddCont.length;i++){
- if(this.listAddCont[i].sealNumber == ''){
- this.$message({ type: 'warning', message: '请检查铅封号是否未填写', duration: 2000 })
- return false
- }
- if(this.listAddCont[i].warrantydate == ''){
- this.$message({ type: 'warning', message: '请检查质保日期是否未填写', duration: 2000 })
- return false
- }
- }
- var send_data = {
- "common": { "returnmap": "0" },
- "data": [
- {
- "name": "editBigacceptanceDate",
- "type": "e",
- "parammaps": {
- "id":this.createTemp.id,
- "date":this.createTemp.date,
- "applyType":this.createTemp.applyType
- }
- },
- {
- "name": "updateBigacceptanceFlowCompeleted", "type": "e",
- "parammaps":{
- id:this.createTemp.id
- }
- },
- {
- "name": "editBigacceptance", "type": "e",
- "parammaps":{
- id:this.createTemp.id,
- lcdate:this.createTemp.lcdate,
- hcdate:this.createTemp.hcdate
- }
- },
- {
- "name": "insertSpotList",
- "resultmaps": { "list": this.listAddCont },
- "children": [
- {
- "name": "editOutsourcingData", "type": "e",
- "parammaps": {
- "id": "@insertSpotList.id",
- "amount": "@insertSpotList.amount",
- "sealNumber": "@insertSpotList.sealNumber",
- "warrantydate": "@insertSpotList.warrantydate"
- }
- }
- ],
- }
- ]
- }
- }
- //供应商
- if(this.createTemp.applyType == 1){
- if(this.listAdd2.length == 0){
- this.$notify({
- title: '失败', message: "备件必选!",
- type: 'warning',
- duration: 2000
- })
- return false
- }
- this.listAdd2.map((item, index) => {
- return item.partId = "0"
- })
- this.listAdd2.map((item, index) => {
- return item.brandId = "0"
- })
- this.listAdd2.map((item, index) => {
- return item.providerId = "0"
- })
- var myname = ''
- // var bigId = ''
- if(this.isData == true){
- myname = 'editAcceptance'
- // bigId = "@insertBigacceptance.LastInsertId"
- // bigId = "@insertSpotList.bigId"
- }else{
- myname = 'insertAcceptance'
- for(let i=0;i<this.listAdd2.length;i++){
- this.$set(this.listAdd2[i],'bigId',this.createTemp.id)
- }
- // bigId = "@insertSpotList.bigId"
- }
- var send_data = {
- "common": { "returnmap": "0" },
- "data": [
- {
- "name": "editBigacceptanceDate",
- "type": "e",
- "parammaps": {
- "id":this.createTemp.id,"date":this.createTemp.date,"applyType":this.createTemp.applyType
- }
- },
- {
- "name": "insertSpotList",
- "type": "e",
- "resultmaps": {
- "list": this.listAdd2
- },
- "children": [
- {
- "name": myname,
- "type": "e",
- "parammaps": {
- "id":"@insertSpotList.id",
- "bigId":"@insertSpotList.bigId",
- "partId":"@insertSpotList.partId",
- "partCode":"@insertSpotList.partCode",
- "partName":"@insertSpotList.partName",
- "brandId":"@insertSpotList.brandId",
- "brand":"@insertSpotList.brand",
- "providerId":"@insertSpotList.providerId",
- "providerName":"@insertSpotList.providerName",
- "unit":"@insertSpotList.unit",
- "price":"@insertSpotList.price",
- "remark":"@insertSpotList.remark",
- "specification":"@insertSpotList.specification",
- "amount":"@insertSpotList.amount"
- }
- }
- ]
- },
- {
- "name": "updateBigacceptanceFlowCompeleted", "type": "e",
- "parammaps":{
- id:this.createTemp.id
- }
- },
- {
- "name": "editBigacceptance", "type": "e",
- "parammaps":{
- id:this.createTemp.id,
- lcdate:this.createTemp.lcdate,
- hcdate:this.createTemp.hcdate
- }
- },
- {
- "name": "insertSpotList",
- "resultmaps": { "list": this.listAddCont },
- "children": [
- {
- "name": "editOutsourcingData", "type": "e",
- "parammaps": {
- "id": "@insertSpotList.id",
- "amount": "@insertSpotList.amount",
- "sealNumber": "@insertSpotList.sealNumber",
- "warrantydate": "@insertSpotList.warrantydate"
- }
- }
- ],
- }
- ]
- }
- }
- 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": "deleteBigacceptance", "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.dialogFormVisible_Examine = true
- this.statueReason = false
- },
- form_examine_save() {
- console.log('点击了供应处长审核', )
- 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": "EditBigacceptanceEquipment", "type": "e",
- "parammaps": this.examineTemp
- }
- ]
- }
- 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)
- 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.dialogFormVisible_Examine = true
- this.statueReason = false
- },
- form_examine_save2() {
- console.log('点击了部门负责人审核', )
- 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 = "5"
- } else {
- this.examineTemp.status = 0
- this.examineTemp.flowCompeleted = "4"
- }
- this.examineTemp.empid = Cookies.get('employeid')
- var send_data = {
- "common": { "returnmap": "0" },
- "data": [
- {
- "name": "EditBigacceptanceDepartment", "type": "e",
- "parammaps": this.examineTemp
- }
- ]
- }
- 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_examine3(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.dialogFormVisible_Examine = true
- this.statueReason = false
- },
- form_examine_save3() {
- console.log('点击了场长审核', )
- 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 {
- this.examineTemp.status = 1
- this.examineTemp.flowCompeleted = "6"
- }
- this.examineTemp.empid = Cookies.get('employeid')
- var send_data = {
- "common": { "returnmap": "0" },
- "data": [
- {
- "name": "EditBigacceptanceField", "type": "e",
- "parammaps": this.examineTemp
- }
- ]
- }
- 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_submit(row){
- MessageBox.confirm('确认提交此条信息?', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- if(row.isPartapply == 1){
- var send_data1 = {
- "name": "checkOutsourcingAmount",
- "parammaps": { "outsourcingCode":row.outsourcingCode }
- }
- var send_data2 = {
- "common": { "returnmap": "0" },
- "data": [
- {
- "name": "editBigacceptanceIsAcceptance", "type": "e",
- "parammaps": { "id":row.id }
- }
- ]
- }
- GetDataByName(send_data1).then(response => {
- if(parseFloat(response.data.list[0].amount) !== 0){
- this.save_submit(send_data2)
- }else{
- this.$message({
- type: 'error',
- message: '数据未填写,请完善相关信息'
- })
- }
- })
- }else{
- this.$message({ type: 'warning', message: '备件未领用,暂时不能提交。', duration: 2000 })
- }
- }).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()
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .content{
- padding: 20px 20px;
- .title{
- text-align: center;
- font-weight: 700;
- }
- .title2{
- float: left;
- font-weight: 700;
- padding: 10px 0;
- }
- }
- </style>
|