12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928 |
- <template>
- <div class="app-container">
- <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
- <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
- <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
- </div>
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="备件退货" name="first">
- <div class="filter-container">
- <el-select v-model="getdataListParm.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item" @change="changePastureName">
- <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <el-input v-model="getdataListParm.parammaps.orderNumber" placeholder="退货单号" style="width: 200px;" class="filter-item" />
- <el-select v-model="getdataListParm.parammaps.statue" clearable style="width: 140px;" placeholder="审核状态" class="filter-item">
- <el-option v-for="item in statues" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-select v-model="getdataListParm.parammaps.easStatus" style="width: 150px;" clearable placeholder="EAS同步状态" class="filter-item">
- <el-option v-for="item in easStatus.easStatusList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-date-picker ref="inputDatetime" v-model="getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
- <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
- <div>
- <el-button v-if="isReturngoodsAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
- <el-radio-group v-model="radioAll" style="margin-top:-9px" @change="changeAll()">
- <el-radio-button label="全部" />
- <el-badge :value="pending.total" class="item">
- <el-radio-button label="待处理" />
- </el-badge>
- <el-radio-button label="已处理" />
- </el-radio-group>
- <el-button v-if="isEasSynchronization" class="filter-item" type="primary" style="float: right;" @click="handleEAS">EAS同步</el-button>
- <el-button v-if="isRetrunsap" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-upload2" @click="sapUpload">SAP上传</el-button>
- </div>
- </div>
- <el-table
- :key="tableKey"
- v-loading="listLoading"
- element-loading-text="给我一点时间"
- :data="list"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- @selection-change="change_table_selection"
- @current-change="handleCurrentChange"
- >
- <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="退货单号" min-width="150px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.useForm }}</span>
- </template>
- </el-table-column>
- <el-table-column label="牧场" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pastureName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="录入人" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.empname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="退货日期" sortable prop="createTime1" min-width="80px" align="center" />
- <el-table-column label="审核状态" min-width="80px" align="center" :formatter="statue" />
- <el-table-column label="EAS同步状态" min-width="120px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.easStatus }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="ProofCode" label="sap编码" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{scope.row.ProofCode}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="ProofCode" label="sap上传状态" min-width="80px" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.ProofCode">已上传</span>
- <span v-else>未上传</span>
-
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <el-button v-if="isReturngoodsSee" type="primary" size="mini" @click="form_see(row)">查看</el-button>
- <el-button v-if="isReturngoodsUpdate && (row.statue == 4 || row.statue == 6)" type="success" style="display:inline-block" size="mini" @click="form_edit(row)">编辑</el-button>
- <el-button v-else type="success" style="display:none" size="mini" @click="form_edit(row)">编辑</el-button>
- <!-- 主管审核 -->
- <el-button v-if="isReturngoodsExamineZG && row.statue == 2" type="success" style="display:inline-block" size="mini" @click="handleExamine(row)">审核1</el-button>
- <el-button v-else type="success" style="display:none" size="mini" @click="handleExamine(row)">审核1</el-button>
- <!-- 采购审核 -->
- <el-button v-if="isReturngoodsExamineCG && row.statue == 3" type="success" style="display:inline-block" size="mini" @click="handleExamine2(row)">审核2</el-button>
- <el-button v-else type="success" style="display:none" size="mini" @click="handleExamine2(row)">审核2</el-button>
- <el-button v-if="isReturngoodsDelete && (row.statue == 4 || row.statue == 6)" style="display:inline-block" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
- <el-button v-else type="danger" style="display:none" size="mini" @click="form_delete(row)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset":limit.sync="getdataListParm.pagecount"@pagination="getList" />
- </el-tab-pane>
- <el-tab-pane label="退货记录" name="second">
- <div class="filter-container">
- <el-select v-model="getdataListParm2.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item">
- <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <el-input v-model="getdataListParm2.parammaps.useForm" placeholder="退货单号" style="width: 200px;" class="filter-item" />
- <el-input v-model="getdataListParm2.parammaps.partCode" placeholder="备件编号" style="width: 200px;" class="filter-item" />
- <el-input v-model="getdataListParm2.parammaps.partName" placeholder="备件名称" style="width: 200px;" class="filter-item" />
- <el-select v-model="getdataListParm2.parammaps.providerId" style="width: 140px;" filterable clearable placeholder="供应商" class="filter-item">
- <el-option v-for="item in findAllProvider" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-date-picker ref="inputDatetime2" v-model="getdataListParm2.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
- <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search2">搜索</el-button>
- <div>
- <el-button v-if="isReturngoodsExport" v-waves class="filter-item" type="success" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
- </div>
- </div>
- <el-table
- :key="tableKey2"
- v-loading="listLoading2"
- element-loading-text="给我一点时间"
- :data="list2"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- @sort-change="tableSort"
- >
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="牧场" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pastureName }}</span><br>
- </template>
- </el-table-column>
- <el-table-column label="退货单号" align="center" min-width="150px">
- <template slot-scope="scope">
- <span>{{ scope.row.useForm }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" min-width="150px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span><br>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" align="center" min-width="150px">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span><br>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span><br>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" align="center" min-width="100px">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span><br>
- </template>
- </el-table-column>
- <el-table-column label="期初库存" sortable prop="reportery" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.reportery }}</span><br>
- </template>
- </el-table-column>
- <el-table-column label="退货数量" sortable prop="refundNumber" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.refundNumber }}</span><br>
- </template>
- </el-table-column>
- <el-table-column label="单价" sortable prop="price" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span><br>
- </template>
- </el-table-column>
- <el-table-column label="总价" sortable prop="sumPrice" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumPrice }}</span><br>
- </template>
- </el-table-column>
- <el-table-column label="退货原因" align="center" min-width="90px">
- <template slot-scope="scope">
- <span>{{ scope.row.note }}</span>
- </template>
- </el-table-column>
- <el-table-column label="录入人" align="center" min-width="90px">
- <template slot-scope="scope">
- <span>{{ scope.row.empname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="退货日期" min-width="120px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.createTime1 }}</span><br>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="total2>0" :total="total2" :page.sync="getdataListParm2.offset" :limit.sync="getdataListParm2.pagecount" @pagination="getList2" />
- </el-tab-pane>
- </el-tabs>
- <!-- 弹出层新增or修改 -->
- <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
- <div class="app-container">
- <el-form
- ref="createTemp"
- :rules="rules"
- :model="createTemp"
- label-position="right"
- label-width="100px"
- style="width: 90%;margin:0 auto;"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="退货单号:" prop="useForm">
- <el-input ref="useForm" v-model="createTemp.useForm" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="供应商:" prop="providerId">
- <el-select v-model="createTemp.providerId" :disabled="dialogStatus=='update'" filterable placeholder="供应商" style="width:100%" @change="changeProvider">
- <el-option v-for="item in findAllProvider" :key="item.id" clearable :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="牧场:" prop="pastureId">
- <el-select v-model="createTemp.pastureId" :disabled="dialogStatus=='update'" placeholder="牧场" class="filter-item" style="width:100%">
- <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="录入人:" prop="employeId">
- <el-select v-model="createTemp.employeId" placeholder="录入人" class="filter-item" style="width:100%" :disabled="dialogStatus=='update'">
- <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="退货日期:" prop="createTime">
- <el-date-picker v-model="createTemp.createTime" :disabled="dialogStatus=='update'" :picker-options="pickerOptions" type="date" placeholder="退货日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="退货原因:" prop="note">
- <el-input ref="note" v-model="createTemp.note" placeholder="退货原因" :disabled="dialogStatus=='update'" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="15">
- <el-form-item label="备件:" prop="partCode">
- <el-autocomplete
- v-model="createTemp.partCode"
- value-key="name"
- class="inline-input"
- :fetch-suggestions="sparePartSearch"
- placeholder="请输入备件编号或备件名称或备件规格"
- style="width:100%"
- @select="handleSelectSparePart"
- >
- <template slot-scope="{ item }">
- <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>
- | <b>备件名称:</b><span class="addr">{{ item.partName }}</span>
- | <b>备件规格:</b><span class="addr">{{ item.specification }}</span>
- </template>
- </el-autocomplete>
- </el-form-item>
- </el-col>
- <el-col v-if="isBatchOperation" :span="3" style="margin-left:20px;">
- <el-button class="filter-item" type="primary" @click="handleBatchOperation">批量添加</el-button>
- </el-col>
- </el-row>
- </el-form>
- <h5 style="float:right;">总金额:{{ TotalAmount }}</h5>
- <el-table
- :key="tableKey"
- v-loading="listLoading"
- element-loading-text="给我一点时间"
- :data="listAdd"
- 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 label="序号" align="center" type="index" width="50px" />
- <el-table-column label="备件编号" prop="partCode" align="center" min-width="90">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" prop="partName" align="center" min-width="90">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" prop="specification" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件图片" prop="picpath" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" prop="brand" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="库存数" prop="reportery" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.reportery }}</span>
- </template>
- </el-table-column>
- <el-table-column label="退货数量" min-width="120px" align="center" valign="middle">
- <template slot-scope="scope">
- <el-form :model="scope.row" :rules="rules">
- <el-form-item prop="refundNumber">
- <el-input v-model="scope.row.refundNumber" style="margin-top:15px" @blur="blurRefundNumber" />
- </el-form-item>
- </el-form>
- </template>
- </el-table-column>
- <el-table-column label="单价" min-width="110px" align="center" valign="middle">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column label="总价" min-width="110px" align="center" valign="middle">
- <template slot-scope="scope">
- <span>{{ scope.row.price * parseFloat(scope.row.refundNumber) | keepTwoNum }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <a class="del" @click="partDelete(row)">删除</a>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer" style="bottom:10px">
- <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
- <el-button @click="dialogFormVisible = false;getList()">取消并关闭</el-button>
- </div>
- </div>
- </el-dialog>
- <!-- 查看 -->
- <el-dialog :title="textMap[dialogStatusSee]" :visible.sync="dialogFormVisibleSee" :close-on-click-modal="false" width="90%">
- <div class="app-containerSee">
- <el-form
- ref="seeTemp"
- :rules="rules"
- :model="seeTemp"
- label-position="right"
- label-width="100px"
- style="width: 90%;margin:0 auto;"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="退货单号:" prop="useForm">
- <el-input ref="useForm" v-model="seeTemp.useForm" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="供应商" prop="providerName">
- <el-input ref="providerName" v-model="seeTemp.providerName" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="牧场:" prop="pastureName">
- <el-input ref="pastureName" v-model="seeTemp.pastureName" disabled />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="录入人:" prop="empname">
- <el-input ref="empname" v-model="seeTemp.empname" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="退货日期:" prop="createTime1">
- <el-input ref="createTime1" v-model="seeTemp.createTime1" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="退货原因:" prop="note">
- <el-input ref="note" v-model="seeTemp.note" disabled />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <h5 style="float:right;">总金额:{{ TotalAmount }}</h5>
- <el-table
- :key="tableKey"
- v-loading="listLoadingSee"
- element-loading-text="给我一点时间"
- :data="listSee"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:30px"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- @sort-change="tableSort"
- >
- <el-table-column label="序号" align="center" type="index" width="50px" />
- <el-table-column label="备件编号" prop="partCode" align="center" min-width="90">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" prop="partName" align="center" min-width="90">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" prop="specification" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件图片" prop="picpath" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" prop="brand" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="库存数" sortable prop="reportery" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.reportery }}</span>
- </template>
- </el-table-column>
- <el-table-column label="退货数量" sortable prop="refundNumber" min-width="120px" align="center" valign="middle">
- <template slot-scope="scope">
- <span>{{ scope.row.refundNumber }}</span>
- </template>
- </el-table-column>
- <el-table-column label="单价" sortable prop="price" min-width="110px" align="center" valign="middle">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column label="总价" sortable prop="sumPrice" min-width="110px" align="center" valign="middle">
- <template slot-scope="scope">
- <span>{{ scope.row.sumPrice }}</span>
- </template>
- </el-table-column>
- </el-table>
- <el-form ref="seeTemp" :rules="rules" :model="seeTemp" label-position="right" label-width="100px" style="width: 90%;margin:0 auto;">
- <el-row>
- <el-col>
- <el-form-item label="流程进度" />
- <el-steps :active="active" align-center finish-status="success">
- <el-step
- v-for="(item,index) in activeList"
- :key="index"
- :title="item.title"
- :status="item.status"
- >
- <template slot="description">
- <div class="step-row">
- <div>{{ item.name }} {{ item.date }}</div>
- <div>{{ item.reason }}</div>
- </div>
- </template>
- </el-step>
- </el-steps>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="操作:">
- <el-button v-if="isReturngoodsExamineZG && seeTemp.statue == 2" type="success" style="display:inline-block" @click="handleExamine(row)">审核1</el-button>
- <el-button v-else type="success" style="display:none" @click="handleExamine(row)">审核1</el-button>
- <!-- 采购审核 -->
- <el-button v-if="isReturngoodsExamineCG && seeTemp.statue == 3" type="success" style="display:inline-block" @click="handleExamine2(row)">审核2</el-button>
- <el-button v-else type="success" style="display:none" @click="handleExamine2(row)">审核2</el-button>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer" style="bottom:5px;">
- <el-button @click="dialogFormVisibleSee = false">关闭</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" :rules="rules" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
- <el-row style="width:88%;height:150px;margin:0 auto;">
- <el-col :span="20">
- <el-form-item>
- <el-radio-group v-model="examineTemp.statueSH" @change="changeStatue">
- <el-radio :label="1" checked>通过</el-radio>
- <el-radio :label="2">不通过</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
- <el-col v-if="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 type="primary" :disabled="isokDisable" @click="dialogStatus==='examine'?createExamineData():createExamineData2()">确认</el-button>
- <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
- </div>
- </el-dialog>
- <!-- EAS同步 -->
- <el-dialog :title="textMap[easStatus.dialogStatus]" :visible.sync="easStatus.dialogFormVisible" :close-on-click-modal="false" width="80%">
- <div class="easStatus">
- <el-table
- :key="easStatus.tableKey"
- v-loading="easStatus.listLoading"
- element-loading-text="给我一点时间"
- :data="easStatus.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 + (pageNum-1) * pageSize + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="退货单号" min-width="110px" align="center" prop="useForm" />
- <el-table-column label="牧场" min-width="110px" align="center" prop="pastureName" />
- <el-table-column label="录入人" min-width="110px" align="center" prop="empName" />
- <el-table-column label="退货日期" min-width="110px" align="center" prop="createTime" />
- <el-table-column label="失败原因" min-width="110px" align="center" prop="failReason" />
- <el-table-column label="操作" align="center" width="300px" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <el-button v-if="isManualSynchronization" type="primary" size="mini" style="width:70px;" @click="handleManual(row)">手动同步</el-button>
- <el-button v-if="isCloseSynchronization" type="danger" size="mini" style="width:70px;" @click="handleClose(row)">关闭同步</el-button>
- <el-button v-if="isIgnoreSynchronization" type="danger" size="mini" style="width:70px;" @click="handleIgnore(row)">忽略同步</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="easStatus.total>0" :total="easStatus.total" :page.sync="easStatus.getdataListParm.offset" :limit.sync="easStatus.getdataListParm.pagecount" @pagination="getListEasStatusLst" />
- </div>
- <div slot="footer" class="dialog-footer" style="bottom: 10px;">
- <el-button @click="easStatus.dialogFormVisible = false;getList()">关闭</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- // / 引入
- import { GetDataByName, GetDataByNames, ExecDataByConfig, failproccess, PostDataByName, checkButtons, GetAccount, EasSync, SapRef } from '@/api/common'
- import waves from '@/directive/waves' // waves directive
- import { parseTime, json2excel, sortChange } from '@/utils/index.js'
- // eslint-disable-next-line no-unused-vars
- import { validateEMail } from '@/utils/validate.js'
- import Pagination from '@/components/Pagination' // secondary package based on el-pagination
- import { MessageBox } from 'element-ui'
- import Cookies from 'js-cookie'
- export default {
- name: 'Returngoods',
- components: { Pagination },
- directives: { waves },
- filters: {
- keepTwoNum(value) {
- value = Number(value)
- return value.toFixed(2)
- }
- },
- data() {
- return {
- isSap:1,
- isSrm:1,
- selectList: [],
- isRetrunsap: [],
- currentRow:{},
- // 权限
- isReturngoodsAdd: [], isReturngoodsTemplate: [], isReturngoodsImport: [], isReturngoodsExport: [], isReturngoodsSee: [], isReturngoodsDelete: [], isReturngoodsExamineZG: [], isReturngoodsExamineCG: [], isReturngoodsUpdate: [],
- isEasSynchronization: [], isManualSynchronization: [], isCloseSynchronization: [], isIgnoreSynchronization: [],
- isokDisable: false,
- findAllProvider: [],
- findAllPasture: [],
- findAllDepart: [],
- findAllEmploye: [],
- requestParams: [
- { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
- { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
- { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
- { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
- ],
- pickerOptions: {
- disabledDate(time) {
- return time.getTime() > Date.now()// 当天之前的时间可选
- }
- },
- textMap: {
- update: '编辑',
- create: '新增',
- see: '查看',
- examine: '审核',
- examine2: '审核',
- easStatus: 'EAS同步—同步失败数据'
- },
- rules: {
- // useForm: [{ required: true, message: '必填', trigger: 'blur' }],
- providerId: [{ required: true, message: '必填', trigger: 'blur' }]
- },
- rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
- cellStyle: { padding: 0 + 'px' },
- statues: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
- radioAll: '全部',
- getdataListParm: {
- name: 'getBigPartrefundlist',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureName: Cookies.get('pasturename'),
- pastureId: Cookies.get('pastureid'),
- useForm: '',
- inputDatetime: '',
- startTime: '',
- stopTime: '',
- easStatus: ''
- }
- },
- tableKey: 0,
- listLoading: true,
- total: 0,
- list: [],
- activeName: 'first',
- tableKey2: 0,
- listLoading2: true,
- total2: 0,
- list2: [],
- getdataListParm2: {
- name: 'getPartrefundDetaillist',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- inputDatetime: '',
- orderNumber: '',
- startTime: '',
- stopTime: '',
- partCode: '',
- partName: '',
- providerId: '',
- pastureName: Cookies.get('pasturename')
- }
- },
- requestParam: {
- name: 'insertAsset',
- offset: 0,
- pagecount: 0,
- parammaps: {}
- },
- listLoadingSee: true,
- listSee: [],
- totalSee: 0,
- dialogStatusSee: '',
- dialogFormVisibleSee: false,
- seeTemp: {},
- getdataListSee: {
- name: 'getPartrefundlist',
- returntype: 'Map',
- parammaps: {}
- },
- dialogFormVisible: false,
- dialogStatus: '',
- createTemp: {
- providerId: '',
- useForm: '',
- note: '',
- pastureId: this.$store.state.user.pastureid,
- employeId: this.$store.state.user.employeid,
- createTime: parseTime(new Date(), '{y}-{m}-{d}')
- },
- requestSparePart: {
- name: 'getPartsListTH',
- page: 1,
- offset: 1,
- pagecount: 20,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid')
- }
- },
- getParmCreateNumber: {
- name: 'autoCreatCode',
- page: 0,
- offset: 0,
- pagecount: 0,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- codeType: 'TH'
- }
- },
- // getParmCreateAmount: {
- // name: 'getPartsAmountList',
- // page: 0,
- // offset: 0,
- // pagecount: 0,
- // returntype: 'Map',
- // parammaps: {
- // pastureId: Cookies.get('pastureid')
- // }
- // },
- listAdd: [],
- postDataPramas: {},
- dialogFormVisible_Examine: false,
- examineTemp: {
- statueSH: 1
- },
- statueReason: false,
- activeList: [],
- active: 3,
- buttons: [],
- downloadParam: {},
- isBatchOperation: false,
- getParmBatchOperation: {
- name: 'getStockPastureListBypv',
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- providerId: ''
- }
- },
- TotalAmount: 0,
- isPercentage: false,
- percentage: 1,
- // EAS同步
- easStatus: {
- easStatusList: [{ name: '同步成功', id: '1' }, { name: '同步失败', id: '0' }, { name: '关闭同步', id: '2' }],
- dialogStatus: '',
- dialogFormVisible: false,
- tableKey: 0,
- total: 0,
- listLoading: true,
- list: [],
- getdataListParm: {
- name: 'getbigpartrefundSync',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid')
- }
- }
- },
- pending: {
- total: 0,
- getdataListParm: {
- name: 'getBigPartrefundWebListNO', page: 1, offset: 1, getTotal: 'total3', pagecount: 10, returntype: 'Map',
- parammaps: {pastureId: Cookies.get('pastureid')}
- }
- }
- }
- },
- computed: {
- },
- watch: {
-
- listAdd: {
- deep: true,
- handler: function (item) {
-
- this.listAdd.forEach(function(i){
- if(parseInt(i.refundNumber) > parseInt(i.reportery)){
- i.refundNumber = i.reportery
- }
-
- })
-
- }
- },
-
- },
- created() {
- const that = this
- GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
- that.buttons = response.data.list
- that.getButtons()
- })
- this.getDownList()
- this.getList()
- this.getPendingList()
- },
- methods: {
- tableSort(column) {
- if (this.activeName == 'first') {
- sortChange(column, this.listSee)
- } else if (this.activeName == 'second') {
- sortChange(column, this.list2)
- }
- },
- getButtons() {
-
- const Retrunsap = 'customs:returngoods:sap'
- const isRetrunsap = checkButtons(this.$store.state.user.buttons, Retrunsap)
- this.isRetrunsap = isRetrunsap
- // 新增
- const ReturngoodsAdd = 'customs:returngoods:add'
- const isReturngoodsAdd = checkButtons(this.$store.state.user.buttons, ReturngoodsAdd)
- this.isReturngoodsAdd = isReturngoodsAdd
- // 编辑
- const ReturngoodsUpdate = 'customs:Returngoods:update'
- const isReturngoodsUpdate = checkButtons(this.$store.state.user.buttons, ReturngoodsUpdate)
- this.isReturngoodsUpdate = isReturngoodsUpdate
- // 模板
- const ReturngoodsTemplate = 'customs:returngoods:template'
- const isReturngoodsTemplate = checkButtons(this.$store.state.user.buttons, ReturngoodsTemplate)
- this.isReturngoodsTemplate = isReturngoodsTemplate
- // 导入
- const ReturngoodsImport = 'customs:returngoods:import'
- const isReturngoodsImport = checkButtons(this.$store.state.user.buttons, ReturngoodsImport)
- this.isReturngoodsImport = isReturngoodsImport
- // 导出
- const ReturngoodsExport = 'customs:returngoods:export'
- const isReturngoodsExport = checkButtons(this.$store.state.user.buttons, ReturngoodsExport)
- this.isReturngoodsExport = isReturngoodsExport
- // 查看
- const ReturngoodsSee = 'customs:returngoods:see'
- const isReturngoodsSee = checkButtons(this.$store.state.user.buttons, ReturngoodsSee)
- this.isReturngoodsSee = isReturngoodsSee
- // 删除
- const ReturngoodsDelete = 'customs:returngoods:delete'
- const isReturngoodsDelete = checkButtons(this.$store.state.user.buttons, ReturngoodsDelete)
- this.isReturngoodsDelete = isReturngoodsDelete
- // 主管审核
- const ReturngoodsExamineZG = 'customs:returngoods:examineZG'
- const isReturngoodsExamineZG = checkButtons(this.$store.state.user.buttons, ReturngoodsExamineZG)
- this.isReturngoodsExamineZG = isReturngoodsExamineZG
- // 采购审核
- const ReturngoodsExamineCG = 'customs:returngoods:examineCG'
- const isReturngoodsExamineCG = checkButtons(this.$store.state.user.buttons, ReturngoodsExamineCG)
- this.isReturngoodsExamineCG = isReturngoodsExamineCG
- const EasSynchronization = 'customs:returngoods:easSynchronization'
- const isEasSynchronization = checkButtons(this.$store.state.user.buttons, EasSynchronization)
- this.isEasSynchronization = isEasSynchronization
- const ManualSynchronization = 'customs:returngoods:manualSynchronization'
- const isManualSynchronization = checkButtons(this.$store.state.user.buttons, ManualSynchronization)
- this.isManualSynchronization = isManualSynchronization
- const CloseSynchronization = 'customs:returngoods:closeSynchronization'
- const isCloseSynchronization = checkButtons(this.$store.state.user.buttons, CloseSynchronization)
- this.isCloseSynchronization = isCloseSynchronization
- const IgnoreSynchronization = 'customs:returngoods:ignoreSynchronization'
- const isIgnoreSynchronization = checkButtons(this.$store.state.user.buttons, IgnoreSynchronization)
- this.isIgnoreSynchronization = isIgnoreSynchronization
- },
- changePastureName(item) {
- this.getdataListParm.parammaps.pastureId = this.findAllPasture.find(obj => obj.name == item).id
- },
- getPendingList() {
- this.pending.getdataListParm.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
- this.pending.getdataListParm.parammaps.useForm = this.getdataListParm.parammaps.useForm
- this.pending.getdataListParm.parammaps.inputDatetime = this.getdataListParm.parammaps.inputDatetime
- this.pending.getdataListParm.parammaps.empId = Cookies.get('employeid')
- this.pending.getdataListParm.parammaps.pastureId = this.getdataListParm.parammaps.pastureId
- this.pending.getdataListParm.parammaps.deptId = Cookies.get('departmentid')
- GetDataByName(this.pending.getdataListParm).then(response => {
- this.pending.total = response.data.total3
- })
- },
- getList() {
- this.listLoading = true
- if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
- this.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
- this.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
- } else {
- this.getdataListParm.parammaps.startTime = ''
- this.getdataListParm.parammaps.stopTime = ''
- }
- GetDataByName(this.getdataListParm).then(response => {
- if (response.data.list !== null) {
- console.log('table数据', response.data.list)
- this.list = response.data.list
- this.pageNum = response.data.pageNum
- this.pageSize = response.data.pageSize
- } else {
- this.list = []
- }
- this.total = response.data.total
- setTimeout(() => {
- this.listLoading = false
- }, 100)
- })
- },
- handleClick(tab, event) {
- console.log(tab, event)
- if (tab.name === 'second') {
- this.getList2()
- } else {
- this.getList()
- }
- },
- getList2() {
- this.listLoading2 = true
- if (this.$refs['inputDatetime2'] !== undefined && this.$refs['inputDatetime2'].value !== null) {
- this.getdataListParm2.parammaps.startTime = this.$refs['inputDatetime2'].value[0]
- this.getdataListParm2.parammaps.stopTime = this.$refs['inputDatetime2'].value[1]
- } else {
- this.getdataListParm2.parammaps.startTime = ''
- this.getdataListParm2.parammaps.stopTime = ''
- }
- GetDataByName(this.getdataListParm2).then(response => {
- console.log('table数据', response.data.list)
- this.list2 = response.data.list
- this.pageNum2 = response.data.pageNum
- this.pageSize2 = response.data.pageSize
- if (response.data.total) {
- this.total2 = response.data.total
- }
- setTimeout(() => {
- this.listLoading2 = false
- }, 100)
- })
- },
- form_search2() {
- this.listLoading2 = true
- if (this.getdataListParm2.parammaps.inputDatetime === null) {
- this.getdataListParm2.parammaps.inputDatetime = ''
- }
- this.getdataListParm2.offset = 1
- this.getList2()
- },
- changeAll() {
- console.log(this.radioAll)
- if (this.radioAll === '全部') {
- this.getdataListParm.name = 'getBigPartrefundlist'
- this.getdataListParm.offset = 1
- this.getdataListParm.parammaps = {
- pastureName: Cookies.get('pasturename'),
- useForm: '',
- inputDatetime: '',
- startTime: '',
- stopTime: ''
- }
- this.getList()
- } else if (this.radioAll === '待处理') {
- this.getdataListParm.name = 'getBigPartrefundWebListNO'
- this.getdataListParm.offset = 1
- this.getdataListParm.parammaps = {
- pastureName: this.getdataListParm.parammaps.pastureName,
- useForm: this.getdataListParm.parammaps.useForm,
- inputDatetime: this.getdataListParm.parammaps.inputDatetime,
- startTime: this.getdataListParm.parammaps.startTime,
- stopTime: this.getdataListParm.parammaps.stopTime,
- empId: Cookies.get('employeid'),
- pastureId: Cookies.get('pastureid'),
- deptId: Cookies.get('departmentid')
- }
- this.getList()
- } else if (this.radioAll === '已处理') {
- this.getdataListParm.name = 'getBigPartrefundWebList'
- this.getdataListParm.offset = 1
- this.getdataListParm.parammaps = {
- pastureName: this.getdataListParm.parammaps.pastureName,
- useForm: this.getdataListParm.parammaps.useForm,
- inputDatetime: this.getdataListParm.parammaps.inputDatetime,
- startTime: this.getdataListParm.parammaps.startTime,
- stopTime: this.getdataListParm.parammaps.stopTime,
- empId: Cookies.get('employeid'),
- pastureId: Cookies.get('pastureid'),
- deptId: Cookies.get('departmentid')
- }
- this.getList()
- }
- },
- statue: function(cellValue) {
- // console.log(cellValue.isZeroStock)
- if (cellValue.statue == 2) {
- return '审核中'
- } else if (cellValue.statue == 3) {
- return '审核中'
- } else if (cellValue.statue == 4) {
- return '未通过'
- } else if (cellValue.statue == 6) {
- return '未通过'
- } else if (cellValue.statue == 5) {
- return '已通过'
- }
- },
- form_search() {
- console.log('点击了table搜索')
- if (this.getdataListParm.parammaps.inputDatetime === null) {
- this.getdataListParm.parammaps.inputDatetime = ''
- }
- this.getdataListParm.offset = 1
- this.listLoading = true
- this.getList()
- this.getPendingList()
- },
- resetCreateTemp() {
- this.createTemp.pastureId = this.$store.state.user.pastureid
- this.createTemp.providerId = ''
- this.createTemp.note = ''
- this.createTemp.employeId = this.$store.state.user.employeid
- this.createTemp.createTime = parseTime(new Date(), '{y}-{m}-{d}')
- this.createTemp.useForm = ''
- this.listAdd = []
- this.TotalAmount = 0
- },
- handleCurrentChange(val) {
- this.currentRow = val;
- console.log("currentRow",this.currentRow)
- },
- checkboxInit(row,index){
- // console.log(row)
- if(row.ProofCode){ return 0 } else {return 1}
- },
- //监听 - 表格 - 勾选
- change_table_selection(val) {
- this.selectList = val
- console.log('勾选数据selectList', this.selectList)
- },
- sapUpload(){
- const that = this
- console.log("currentRow ProofCode",this.currentRow.ProofCode)
- var send_data = this.selectList
- if(send_data.length == 0){
- that.$notify({ title: '失败', message: '请勾选数据!' , type: 'error', duration: 2000 })
- return false
- }
- console.log(that.isSap)
- if(that.isSap == 1){
- that.isSap = 0
- SapRef(send_data).then(response => {
- console.log('response', response)
-
- if (response.msg !== 'fail') {
- that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- that.selectList = []
- that.getList()
-
- } else {
- that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
- }
- })
-
-
- } else {
- that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击' , type: 'error', duration: 2000 })
- }
- setTimeout(() => {
- that.isSap = 1
- }, 3000)
-
- // if(true){
- // if(this.currentRow.ProofCode){
- // console.log("currentRow ProofCode 这个值说明已经上传了,不用上传")
- // //如果有这个值说明已经上传了,不用上传
- // } else {
- // console.log("currentRow ProofCode没有这个值")
- // console.log("currentRow ProofCode",this.currentRow.ProofCode)
- // const id = this.currentRow.id
-
- // console.log("id",id)
- // var send_data = {
- // "id":id,
-
- // "pastureid":Cookies.get('pastureid')
-
- // }
- // SapRef(send_data).then(response => {
- // console.log('response', response)
-
- // if (response.msg !== 'fail') {
- // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- // that.getList()
-
- // } else {
- // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
- // }
- // })
-
- // }
- },
- form_add() {
- this.resetCreateTemp()
- this.createTemp.useForm = ''
- this.dialogStatus = 'create'
- this.dialogFormVisible = true
- this.getCreateNumber()
- },
- changeProvider(val) {
- console.log(val, '供应商change')
- this.listAdd = []
- this.getParmBatchOperation.parammaps.providerId = val
- this.isBatchOperation = true
- },
- getCreateNumber() {
- GetDataByName(this.getParmCreateNumber).then(response => {
- this.$nextTick(() => {
- console.log('新增退货单号', response.data.list[0].orderCode)
- this.createTemp.useForm = response.data.list[0].orderCode
- this.$forceUpdate()
- })
- })
- },
- sparePartSearch(queryString, cb) {
- console.log('备件模糊查询输入值', queryString)
- if (this.createTemp.providerId !== '') {
- this.requestSparePart.parammaps.providerId = this.createTemp.providerId
- 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)
- }
- })
- } else {
- this.$message({
- title: '',
- message: '请选择供应商',
- type: 'warning',
- duration: 2000
- })
- }
- },
- handleSelectSparePart(item) {
- console.log('备件模糊查询选中值', item)
- console.log('备件模糊查询选中值', item.id)
- this.TotalAmount = 0
- 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: '此备件已存在,请重新选择备件'
- })
- console.log(this.listAdd)
- console.log(this.listAdd.length)
- this.TotalAmount = 0
- for (let i = 0; i < this.listAdd.length; i++) {
- console.log(this.TotalAmount)
- this.TotalAmount += (parseFloat(this.listAdd[i].refundNumber) * parseFloat(this.listAdd[i].price))
- this.TotalAmount = this.TotalAmount
- console.log(this.TotalAmount)
- }
- console.log(this.TotalAmount)
- return false
- // this.TotalAmount = parseFloat((this.TotalAmount).toFixed(2))
- } else {
- this.listAdd.unshift(item)
- this.$set(item, 'refundNumber', item.reportery)
- 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 = ''
- }
- }
- } else {
- this.listAdd.unshift(item)
- this.$set(item, 'refundNumber', item.reportery)
- 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.$forceUpdate()
- console.log(this.listAdd)
- for (let i = 0; i < this.listAdd.length; i++) {
- this.TotalAmount += (parseFloat(this.listAdd[i].refundNumber) * parseFloat(this.listAdd[i].price))
- }
- this.TotalAmount = parseFloat((this.TotalAmount).toFixed(2))
- },
- handleBatchOperation() {
- GetDataByName(this.getParmBatchOperation).then(response => {
- this.$nextTick(() => {
- console.log('批量添加', response.data.list)
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- this.$set(response.data.list[i], 'refundNumber', response.data.list[i].reportery)
- this.TotalAmount += parseFloat(response.data.list[i].refundNumber) * parseFloat(response.data.list[i].price)
- this.TotalAmount = parseFloat((this.TotalAmount).toFixed(2))
- if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
- this.$set(response.data.list[i], 'srcpath', process.env.VUE_APP_BASE_API + response.data.list[i].srcpath)
- this.$set(response.data.list[i], 'picpath', process.env.VUE_APP_BASE_API + response.data.list[i].picpath)
- } else {
- response.data.list[i].srcpath = ''
- response.data.list[i].picpath = ''
- }
- }
- this.listAdd = response.data.list
- } else {
- this.listAdd = []
- }
- })
- })
- },
- blurRefundNumber() {
- this.TotalAmount = 0
- for (let i = 0; i < this.listAdd.length; i++) {
- this.TotalAmount += parseFloat(this.listAdd[i].refundNumber) * parseFloat(this.listAdd[i].price)
- }
- this.TotalAmount = parseFloat((this.TotalAmount).toFixed(2))
- },
- add_dialog_save() {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['createTemp'].validate(valid => {
- if (valid) {
- console.log(this.listAdd)
- console.log(this.createTemp.useForm)
- if (this.createTemp.useForm == '' || this.createTemp.useForm == null || this.createTemp.useForm == undefined) {
- GetDataByName(this.getParmCreateNumber).then(response => {
- this.$nextTick(() => {
- console.log('退库单号', response.data.list[0].orderCode)
- this.createTemp.useForm = response.data.list[0].orderCode
- this.$forceUpdate()
- this.add_dialog_saveSave()
- })
- })
- } else {
- this.add_dialog_saveSave()
- }
- }
- })
- },
- add_dialog_saveSave() {
- if (this.listAdd.length !== 0) {
- for (var j = 0; j < this.listAdd.length; j++) {
- console.log(this.listAdd[j].refundNumber)
- // eslint-disable-next-line use-isnan
- if (this.listAdd[j].refundNumber == null || this.listAdd[j].refundNumber === '') {
- this.$message({
- type: 'warning',
- message: '请检查退货数量是否未填写',
- duration: 2000
- })
- return false
- } else {
- var rulesRefundNumber = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
- if (!rulesRefundNumber.test(this.listAdd[j].refundNumber)) {
- this.$message({
- type: 'error',
- message: '退货数量请输入正数,最多保留两位小数点',
- duration: 2000
- })
- return false
- } else if (parseFloat(this.listAdd[j].refundNumber) > parseFloat(this.listAdd[j].reportery)) {
- this.$message({
- type: 'error',
- message: '退货数量不可大于库存数',
- duration: 2000
- })
- return false
- }
- }
- }
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- this.postDataPramas.data[0] = { 'name': 'insertBigPartrefund', 'type': 'e', 'parammaps': {
- pastureId: this.createTemp.pastureId,
- providerId: this.createTemp.providerId,
- useForm: this.createTemp.useForm,
- employeId: this.createTemp.employeId,
- createTime: this.createTemp.createTime,
- note: this.createTemp.note
- }}
- // eslint-disable-next-line no-irregular-whitespace
- this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
- this.postDataPramas.data[1].children = []
- this.postDataPramas.data[1].children[0] = { 'name': 'insertPartrefund', 'type': 'e', 'parammaps': {
- bigId: '@insertBigPartrefund.LastInsertId',
- partId: '@insertSpotList.partId',
- partCode: '@insertSpotList.partCode',
- partName: '@insertSpotList.partName',
- specification: '@insertSpotList.specification',
- price: '@insertSpotList.price',
- unit: '@insertSpotList.unit',
- brand: '@insertSpotList.brand',
- reportery: '@insertSpotList.reportery',
- refundNumber: '@insertSpotList.refundNumber',
- contractId: '@insertSpotList.contractId',
- location: '@insertSpotList.location'
- }}
- // this.postDataPramas.data[1].children[1] = { 'name': 'updatePartRepertoryTH', 'type': 'e', 'parammaps': {
- // refundNumber: '@insertSpotList.refundNumber',
- // partCode: '@insertSpotList.partCode',
- // contractId: '@insertSpotList.contractId',
- // providerId: this.createTemp.providerId
- // }}
- ExecDataByConfig(this.postDataPramas).then(response => {
- console.log('新增保存发送参数', this.postDataPramas)
- if (response.msg === 'fail') {
- this.$notify({
- title: '保存失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.dialogFormVisible = false
- this.getdataListParm.parammaps.inputDatetime = ''
- setTimeout(() => {
- this.getList()
- this.getPendingList()
- }, 1000)
- this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
- }
- })
- return true
- } else {
- this.$message({
- title: '',
- message: '请选择备件',
- type: 'warning',
- duration: 2000
- })
- return false
- }
- },
- partDelete(row) {
- console.log(row)
- console.log(this.listAdd)
- MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- // console.log(this.list2)
- this.TotalAmount = 0
- 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
- }
- this.TotalAmount += parseFloat(this.listAdd[i].refundNumber) * parseFloat(this.listAdd[i].price)
- }
- this.TotalAmount = parseFloat((this.TotalAmount).toFixed(2))
- // this.TotalAmount = (this.TotalAmount).toFixed(2)
- })
- },
- // 查看
- form_see(row) {
- this.dialogStatusSee = 'see'
- this.dialogFormVisibleSee = true
- this.seeTemp = Object.assign({}, row)
- console.log('查看上方数据(从table读取)', this.seeTemp)
- this.TotalAmount = 0
- this.getdataListSee.parammaps.bigId = this.seeTemp.id
- this.getSeeList()
- // 流程图
- var reason = '未通过原因:' + this.seeTemp.workflowNote
- if (this.seeTemp.statue === 2) {
- this.activeList = [{ title: '退货申请', date: this.seeTemp.createTime1, name: this.seeTemp.empname }, { title: '技术助理审核' }, { title: '采购审核' }]
- this.active = 1
- } else if (this.seeTemp.statue === 3) {
- this.activeList = [{ title: '退货申请', date: this.seeTemp.createTime1, name: this.seeTemp.empname }, { title: '技术助理审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '采购审核' }]
- this.active = 2
- } else if (this.seeTemp.statue === 4) {
- this.activeList = [{ title: '退货申请', date: this.seeTemp.createTime1, name: this.seeTemp.empname }, { title: '技术助理审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson, status: 'error', reason: reason }, { title: '采购审核' }]
- this.active = 2
- } else if (this.seeTemp.statue === 5) {
- this.activeList = [{ title: '退货申请', date: this.seeTemp.createTime1, name: this.seeTemp.empname }, { title: '技术助理审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '采购审核', date: this.seeTemp.CGChargedate, name: this.seeTemp.CGChargePerson }]
- this.active = 3
- } else if (this.seeTemp.statue === 6) {
- this.activeList = [{ title: '退货申请', date: this.seeTemp.createTime1, name: this.seeTemp.empname }, { title: '技术助理审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '采购审核', date: this.seeTemp.CGChargedate, name: this.seeTemp.CGChargePerson, status: 'error', reason: reason }]
- this.active = 3
- }
- },
- getSeeList() {
- GetDataByName(this.getdataListSee).then(response => {
- console.log('查看下方table数据', response.data.list)
- this.listSee = response.data.list
- this.listAdd = response.data.list
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- this.TotalAmount += parseFloat(response.data.list[i].sumPrice)
- if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
- this.listSee[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
- this.listSee[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
- } else {
- this.listSee[i].srcpath = ''
- this.listSee[i].picpath = ''
- }
- }
- this.TotalAmount = this.TotalAmount.toFixed(2)
- }
- setTimeout(() => {
- this.listLoadingSee = false
- }, 100)
- })
- },
- form_edit(row) {
- row.createTime = row.createTime1
- this.createTemp = Object.assign({}, row) // copy obj
- this.dialogStatus = 'update'
- this.dialogFormVisible = true
- this.TotalAmount = 0
- this.listAdd = []
- this.getdataListSee.parammaps.bigId = this.createTemp.id
- this.getSeeList()
- },
- edit_dialog_save() {
- if (this.listAdd.length !== 0) {
- for (var j = 0; j < this.listAdd.length; j++) {
- console.log(this.listAdd[j].refundNumber)
- // eslint-disable-next-line use-isnan
- if (this.listAdd[j].refundNumber == null || this.listAdd[j].refundNumber === '') {
- this.$message({
- type: 'warning',
- message: '请检查退货数量是否未填写',
- duration: 2000
- })
- return false
- } else {
- var rulesRefundNumber = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
- if (!rulesRefundNumber.test(this.listAdd[j].refundNumber)) {
- this.$message({
- type: 'error',
- message: '退货数量请输入正数,最多保留两位小数点',
- duration: 2000
- })
- return false
- } else if (parseFloat(this.listAdd[j].refundNumber) > parseFloat(this.listAdd[j].reportery)) {
- this.$message({
- type: 'error',
- message: '退货数量不可大于库存数',
- duration: 2000
- })
- return false
- }
- }
- }
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- this.postDataPramas.data[0] = { 'name': 'updatepartrefundCharge', 'type': 'e', 'parammaps': {
- id: this.createTemp.id
- }}
- this.postDataPramas.data[1] = { 'name': 'deletePartrefund', 'type': 'e', 'parammaps': {
- id: this.createTemp.id
- }}
- // eslint-disable-next-line no-irregular-whitespace
- this.postDataPramas.data[2] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
- this.postDataPramas.data[2].children = []
- this.postDataPramas.data[2].children[0] = { 'name': 'insertPartrefund', 'type': 'e', 'parammaps': {
- bigId: this.createTemp.id,
- partId: '@insertSpotList.partId',
- partCode: '@insertSpotList.partCode',
- partName: '@insertSpotList.partName',
- specification: '@insertSpotList.specification',
- price: '@insertSpotList.price',
- unit: '@insertSpotList.unit',
- brand: '@insertSpotList.brand',
- reportery: '@insertSpotList.reportery',
- refundNumber: '@insertSpotList.refundNumber',
- contractId: '@insertSpotList.contractId',
- location: '@insertSpotList.location'
- }}
- ExecDataByConfig(this.postDataPramas).then(response => {
- console.log('新增保存发送参数', this.postDataPramas)
- if (response.msg === 'fail') {
- this.$notify({
- title: '保存失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.dialogFormVisible = false
- this.getdataListParm.parammaps.inputDatetime = ''
- this.getList()
- this.getPendingList()
- this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
- }
- })
- return true
- } else {
- this.$message({
- title: '',
- message: '请选择备件',
- type: 'warning',
- duration: 2000
- })
- return false
- }
- },
- getDownList() {
- GetDataByNames(this.requestParams).then(response => {
- this.findAllProvider = response.data.findAllProvider.list
- this.findAllPasture = response.data.findAllPasture.list
- this.findAllDepart = response.data.findAllDepart.list
- this.findAllEmploye = response.data.findAllEmploye.list
- })
- },
- // 导入
- handleDownload() {
- console.log('点击了下载')
- this.$alert('退货记录正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
- this.isPercentage = true
- this.percentage = 1
- var timer = setInterval(() => {
- this.percentage += 5
- if (this.percentage > 95) {
- this.percentage = 99
- clearInterval(timer)
- }
- this.percentage = this.percentage
- }, 1000)
- this.downloadParam.name = 'getPartrefundDetaillist'
- this.downloadParam.parammaps = this.getdataListParm2.parammaps
- GetAccount(this.downloadParam).then(response => {
- if (response.data.list !== '') {
- this.percentage = 99
- setTimeout(() => {
- this.isPercentage = false
- }, 2000)
- }
- this.$nextTick(() => {
- const ExcelDatas = [
- {
- tHeader: ['牧场', '退货单号', '备件编号', '备件名称', '备件规格', '备件品牌', '计量单位', '供应商', '期初库存', '退货数量', '单价', '总价', '退货原因', '录入人', '退货日期'],
- filterVal: ['pastureName', 'useForm', 'partCode', 'partName', 'specification', 'brand', 'unit', 'providerName', 'reportery', 'refundNumber', 'price', 'sumPrice', 'note', 'empname', 'createTime1'],
- tableDatas: response.data.list,
- sheetName: '退货记录'
- }
- ]
- json2excel(ExcelDatas, '退货记录', true, 'xlsx')
- })
- })
- },
- form_delete(row) {
- console.log('点击了删除')
- MessageBox.confirm('确认删除此条信息?', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- this.postDataPramas.data[0] = { 'name': 'deleteBigPartrefund', 'type': 'e', 'parammaps': {
- id: row.id
- }}
- this.postDataPramas.data[1] = { 'name': 'deletePartrefund', 'type': 'e', 'parammaps': {
- bigId: row.id
- }}
- ExecDataByConfig(this.postDataPramas).then(response => {
- this.getList()
- this.getPendingList()
- this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
- })
- }).catch(() => {
- this.$message({ type: 'info', message: '已取消删除' })
- })
- },
- changeStatue(val) {
- if (val == 2) {
- this.statueReason = true
- } else {
- this.statueReason = false
- }
- },
- handleExamine(row) {
- console.log('点击了库管审核')
- if (row == undefined) {
- this.examineTemp = this.seeTemp
- this.$set(this.seeTemp, 'statueSH', 1)
- this.$set(this.seeTemp, 'workflowNote', '')
- } else {
- this.examineTemp = Object.assign({}, row)
- this.$set(this.examineTemp, 'statueSH', 1)
- this.$set(this.examineTemp, 'workflowNote', '')
- }
- this.dialogStatus = 'examine'
- this.dialogFormVisible_Examine = true
- this.statueReason = false
- },
- createExamineData() {
- console.log('点击了主管审核')
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['examineTemp'].validate(valid => {
- if (valid) {
- this.requestParam.name = 'partrefundCharge'
- this.requestParam.parammaps = {}
- this.requestParam.parammaps.id = this.examineTemp.id
- if (this.examineTemp.statueSH == 1) {
- this.requestParam.parammaps.statue = 3
- } else if (this.examineTemp.statueSH == 2) {
- this.requestParam.parammaps.statue = 4
- }
- this.requestParam.parammaps.empId = Cookies.get('employeid')
- this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
- PostDataByName(this.requestParam).then(response => {
- console.log('主管审核确认发送参数', this.requestParam)
- if (response.msg !== 'fail') {
- setTimeout(() => {
- this.getList()
- }, 1000)
- this.dialogFormVisible_Examine = false
- this.dialogFormVisibleSee = false
- this.statueReason = false
- this.getPendingList()
- this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- })
- },
- handleExamine2(row) {
- console.log('点击了采购审核')
- if (row == undefined) {
- this.examineTemp = this.seeTemp
- this.$set(this.seeTemp, 'statueSH', 1)
- this.$set(this.seeTemp, 'workflowNote', '')
- } else {
- this.examineTemp = Object.assign({}, row)
- this.$set(this.examineTemp, 'statueSH', 1)
- this.$set(this.examineTemp, 'workflowNote', '')
- }
- this.dialogStatus = 'examine2'
- this.dialogFormVisible_Examine = true
- this.statueReason = false
- },
- createExamineData2() {
- console.log('点击了采购审核')
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['examineTemp'].validate(valid => {
- if (valid) {
- if (this.examineTemp.statueSH == 1) {
- this.requestParam.common = { 'returnmap': '0' }
- this.requestParam.data = []
- this.requestParam.data[0] = { 'name': 'partrefundCharge1', 'type': 'e', 'parammaps': {
- id: this.examineTemp.id,
- statue: 5,
- empId: Cookies.get('employeid')
- }}
- // eslint-disable-next-line no-irregular-whitespace
- this.requestParam.data[1] = { 'name': 'updatePartRepertoryTHS', 'type': 'e', 'parammaps': {
- id: this.examineTemp.id
- }}
- ExecDataByConfig(this.requestParam).then(response => {
- console.log('采购审核保存发送参数', this.requestParam)
- if (response.msg === 'fail') {
- this.$notify({
- title: '保存失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.dialogFormVisible_Examine = false
- this.dialogFormVisibleSee = false
- setTimeout(() => {
- this.getList()
- }, 1000)
- this.getPendingList()
- this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
- }
- })
- } else if (this.examineTemp.statueSH == 2) {
- this.requestParam.name = 'partrefundCharge1'
- this.requestParam.parammaps = {}
- this.requestParam.parammaps.id = this.examineTemp.id
- this.requestParam.parammaps.statue = 6
- this.requestParam.parammaps.empId = Cookies.get('employeid')
- this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
- PostDataByName(this.requestParam).then(response => {
- console.log('采购审核确认发送参数', this.requestParam)
- if (response.msg !== 'fail') {
- setTimeout(() => {
- this.getList()
- }, 1000)
- this.dialogFormVisible_Examine = false
- this.dialogFormVisibleSee = false
- this.statueReason = false
- this.getPendingList()
- this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- }
- })
- },
- handleEAS() {
- this.easStatus.dialogStatus = 'easStatus'
- this.easStatus.dialogFormVisible = true
- this.getListEasStatusLst()
- },
- getListEasStatusLst() {
- this.easStatus.listLoading = true
- GetDataByName(this.easStatus.getdataListParm).then(response => {
- if (response.data.list !== null) {
- this.easStatus.list = response.data.list
- } else {
- this.easStatus.list = []
- }
- this.easStatus.pageNum = response.data.pageNum
- this.easStatus.pageSize = response.data.pageSize
- if (response.data.total) {
- this.easStatus.total = response.data.total
- }
- })
- setTimeout(() => {
- this.easStatus.listLoading = false
- }, 100)
- },
- handleClose(row) {
- MessageBox.confirm('是否确认关闭同步此数据?', {
- confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
- }).then(() => {
- this.requestParam = {}
- this.requestParam.name = 'updatebigpartrefundSync'
- this.requestParam.parammaps = {}
- this.requestParam.parammaps.issync = '2'
- this.requestParam.parammaps.id = row.id
- PostDataByName(this.requestParam).then((response) => {
- if (response.msg !== 'fail') {
- this.$notify({ title: '成功', message: '关闭同步成功', type: 'success', duration: 2000 })
- this.getListEasStatusLst()
- this.getList()
- this.getPendingList()
- } else {
- this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
- this.getListEasStatusLst()
- this.getList()
- this.getPendingList()
- }
- })
- }).catch(() => {
- this.$message({ type: 'info', message: '已取消关闭同步' })
- })
- },
- handleManual(row) {
- MessageBox.confirm('是否确认同步此数据至EAS?', {
- confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
- }).then(() => {
- this.requestParam = {}
- this.requestParam.typeIn = row.typeIn
- this.requestParam.billCode = row.billCode
- EasSync(this.requestParam).then((response) => {
- if (response.msg !== 'fail') {
- this.$notify({ title: '成功', message: '手动同步成功', type: 'success', duration: 2000 })
- this.getListEasStatusLst()
- this.getList()
- this.getPendingList()
- } else {
- this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
- this.getListEasStatusLst()
- this.getList()
- this.getPendingList()
- }
- })
- }).catch(() => {
- this.$message({ type: 'info', message: '已取消手动同步' })
- })
- },
- handleIgnore(row) {
- MessageBox.confirm('是否确认忽略同步此数据?', {
- confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
- }).then(() => {
- this.requestParam = {}
- this.requestParam.name = 'updatebigpartrefundSync'
- this.requestParam.parammaps = {}
- this.requestParam.parammaps.issync = '3'
- this.requestParam.parammaps.id = row.id
- PostDataByName(this.requestParam).then((response) => {
- if (response.msg !== 'fail') {
- this.$notify({ title: '成功', message: '忽略同步成功', type: 'success', duration: 2000 })
- this.getListEasStatusLst()
- this.getList()
- this.getPendingList()
- } else {
- this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
- this.getListEasStatusLst()
- this.getList()
- this.getPendingList()
- }
- })
- }).catch(() => {
- this.$message({ type: 'info', message: '已取消忽略同步' })
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .pagination-container{
- display: block !important;
- }
- /deep/ .el-badge__content.is-fixed{
- z-index: 1;
- }
- </style>
- <style lang="scss">
- .el-step__head.is-success {
- color: #409EFF;
- border-color: #409EFF;
- }
- .el-step__title.is-success{
- color: #409EFF;
- }
- .el-step__head.is-process{
- color: #409EFF;
- border-color: #409EFF;
- .el-step__icon.is-text{
- background: #409EFF;
- color: #fff;
- }
- }
- .step-row{
- color: #000;
- }
- </style>
|