1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530 |
- <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 v-if="isDistributionSheet" label="采购配单" name="first">
- <div class="purchaseDistributionSheet">
- <el-table
- :key="tableKey1"
- v-loading="listLoading1"
- element-loading-text="给我一点时间"
- :data="list1"
- border
- fit
- :row-style="tableRowStyle"
- :cell-style="tableCellStyle"
- highlight-current-row
- style="width: 100%;"
- class="elTable table-fixed"
- @cell-click="cellClick"
- @sort-change="tableSort"
- :max-height="myHeight"
- >
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum1-1) * pageSize1 + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" align="center" min-width="150px">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" align="center" min-width="120px">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" align="center" min-width="120px">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="100px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="图片" min-width="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="供应商" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="price" label="单价" min-width="70px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumAmount" label="申购数量" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购数量" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-form :model="scope.row" :rules="rules">
- <el-form-item prop="amount">
- <el-input
- v-model="scope.row.amount"
- style="width:80px;margin-top:25px;height:10px"
- />
- </el-form-item>
- </el-form>
- </template>
- </el-table-column>
- </el-table>
- <el-button :disabled="confirmationSheetDisabled" type="primary" style="float: right;margin-top: 10px;" @click="confirmationSheet()">确认配单</el-button>
- <el-dialog :title="textMap[dialogStatusConfirmation]" :visible.sync="dialogFormVisibleConfirmation" :close-on-click-modal="false" style="width:100%;margin: 0 auto;overflow:auto">
- <div class="app-contentConfirmationSheet">
- <el-form ref="temp1" :rules="rules" :model="temp1" label-position="right" label-width="90px" style="width:100%;margin-bottom:50px">
- <el-row>
- <el-col :span="8">
- <el-form-item label="配单号:" prop="matchCode">
- <el-input ref="matchCode" v-model="temp1.matchCode" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="提交日期:" prop="buyerDate">
- <el-date-picker
- v-model="temp1.buyerDate"
- :picker-options="pickerOptions"
- type="date"
- placeholder="提交日期"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- style="width:170px;"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="采购员:" prop="buyerPerson">
- <el-select v-model="temp1.buyerPerson" placeholder="采购员" class="filter-item">
- <el-option
- v-for="item in findAllEmploye"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div v-for="(item,index) in listConfirmationSheet" :key="index" class="app-content">
- <div class="title">
- <div>
- <b>采购单号:</b>
- <span>{{ item.orderNumber }}</span>
- </div>
- <div>
- <b>供应商:</b>
- <span>{{ item.providerName }}</span>
- </div>
- </div>
- <el-table
- :key="tableKey1"
- v-loading="listLoading1"
- element-loading-text="给我一点时间"
- :data="item.list"
- border
- fit
- highlight-current-row
- style="width: 97%;margin:0 auto"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <!-- table表格 -->
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum1-1) * pageSize1 + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" align="center" min-width="150px">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" align="center" min-width="120px">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" align="center" min-width="120px">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="图片" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="100px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="单价" min-width="70px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row. price }}</span>
- </template>
- </el-table-column>
- <el-table-column label="申购数量" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="合计采购数量" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="总价" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ (scope.row.sumPrice = scope.row.price * parseFloat(scope.row.amount))| keepTwoNum }}</span>
- </template>
- </el-table-column>
- </el-table>
- <div ref="total" class="total">
- 合计:
- <span>{{ item.Sum }}</span>
- </div>
- </div>
- <div slot="footer" class="dialog-footer" style="bottom:10px">
- <el-button type="primary" :disabled="isokDisable" @click="confirmationSheetData()">确认</el-button>
- <el-button @click="dialogFormVisibleConfirmation= false;get_table_data1();">取消</el-button>
- </div>
- </div>
- </el-dialog>
- </div>
- </el-tab-pane>
- <el-tab-pane v-if="isDistributionManagement" label="配单管理" name="fouth">
- <div class="DistributionManagement">
- <div class="filter-container">
- <el-select v-model="getdataListParm4.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="getdataListParm4.parammaps.matchCode" placeholder="配单号" clearable style="width: 200px;" class="filter-item" />
- <el-select v-model="getdataListParm4.parammaps.statue" clearable placeholder="审核状态" class="filter-item" style="width: 120px;">
- <el-option v-for="item in status2" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-date-picker ref="inputDatetime4" v-model="getdataListParm4.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;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_search4">搜索</el-button>
-
-
- </div>
- <el-table
- :key="tableKey4"
- v-loading="listLoading4"
- element-loading-text="给我一点时间"
- :data="list4"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- @sort-change="tableSort"
- @current-change="handleCurrentChange"
- :max-height="myHeight"
- >
-
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="牧场" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pastureName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="配单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.matchCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购员" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.empname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="提交日期" sortable prop="dealTime" min-width="110px" align="center" />
- <el-table-column sortable prop="cou" label="采购单数" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.cou }}</span>
- </template>
- </el-table-column>
- <el-table-column label="审核状态" min-width="80px" align="center" :formatter="statue" />
-
- <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <el-button v-if="isPurchaseSee" type="primary" size="mini" @click="form_see4(row)">查看</el-button>
- <el-button v-if="parseFloat(row.statue) === 0 && isExamineDM" style="display:inline-block" type="success" size="mini" @click="handleExamine(row)">审核</el-button>
- <el-button v-else style="display:none;" type="success" size="mini" @click="handleExamine(row)">审核</el-button>
- <el-button v-if="parseFloat(row.statue) === 2" type="success" style="display:inline-block" size="mini" @click="form_edit(row)">编辑</el-button>
- <el-button v-else style="display:none;" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="total4>0" :total="total4" :page.sync="getdataListParm4.offset" :limit.sync="getdataListParm4.pagecount" @pagination="get_table_data4" />
- <el-dialog :title="textMap[dialogStatusSee4]" :visible.sync="dialogFormVisibleSee4" :close-on-click-modal="false">
- <div class="app-contentSee">
- <el-form ref="temp4" :rules="rules" :model="temp4" label-position="right" label-width="80px" style="width: 800px;margin-bottom:30px">
- <el-row>
- <el-col :span="8">
- <el-form-item label="配单号:" prop="matchCode">
- <span>{{ temp4.matchCode }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="采购员:" prop="empname">
- <span>{{ temp4.empname }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="配单日期:" prop="dealTime">
- <span>{{ temp4.dealTime }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-table
- :key="tableKeySee4"
- v-loading="listLoadingSee4"
- element-loading-text="给我一点时间"
- :data="listSee4"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:100px"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
-
- <el-table-column label="序号" align="center" type="index" width="50px" />
- <el-table-column label="采购单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.buyeCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="price" label="单价" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumAmount" label="申购数量" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="amount" label="采购数量" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumPrice" label="总价" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumPrice }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件图片" 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 prop="SGremark" label="备注" min-width="60px" align="center" />
- </el-table>
- <el-form ref="temp4" :rules="rules" :model="temp4" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
- <el-row>
- <el-col>
- <el-form-item label="流程进度" />
- <el-steps :active="active" align-center finish-status="success">
- <el-step
- v-for="(item,index) in activeList"
- :key="index"
- :title="item.title"
- :status="item.status"
- >
- <template slot="description">
- <div class="step-row">
- <div>{{ item.name }} {{ item.date }}</div>
- <div>{{ item.reason }}</div>
- </div>
- </template>
- </el-step>
- </el-steps>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="操作:">
- <!-- 审核 -->
- <el-button v-if="isExamineDM && temp4.statue == 0" type="success" style="display:inline-block" @click="handleExamine()">审核</el-button>
- <el-button v-else type="success" style="display:none" @click="handleExamine()">审核</el-button>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
- <el-button @click="dialogFormVisibleSee4 = false;">关闭</el-button>
- </div>
- </div>
- </el-dialog>
- <el-dialog :title="textMap[dialogStatusUpdate4]" width="90%" :visible.sync="dialogFormVisibleUpdate4" :close-on-click-modal="false">
- <div class="app-contentUpdate">
- <el-form
- ref="updateTemp4"
- :rules="rules"
- :model="updateTemp4"
- label-position="right"
- label-width="80px"
- style="width:80%;margin-bottom:30px"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="配单号:" prop="matchCode">
- <span>{{ updateTemp4.matchCode }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="采购员:" prop="empname">
- <span>{{ updateTemp4.empname }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="配单日期:" prop="dealTime">
- <span>{{ updateTemp4.dealTime }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-table
- :key="tableKeyUpdate4"
- v-loading="listLoadingUpdate4"
- element-loading-text="给我一点时间"
- :data="listUpdate4"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:100px"
- :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="采购单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.buyeCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="单价" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column label="申购数量" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购数量" min-width="100px" align="center">
- <template slot-scope="scope">
- <el-form :model="scope.row" :rules="rules">
- <el-form-item prop="amount">
- <el-input
- v-model="scope.row.amount"
- style="width:80px;margin-top:25px;height:10px"
- />
- </el-form-item>
- </el-form>
- </template>
- </el-table-column>
- <el-table-column label="总价" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ (parseFloat(scope.row.price) * parseFloat(scope.row.amount)) | keepTwoNum2 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件图片" 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>
- <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
- <el-button type="primary" :disabled="isokDisable" @click="edit_dialog_save()">确认</el-button>
- <el-button @click="dialogFormVisibleUpdate4 = false;">关闭</el-button>
- </div>
- </div>
- </el-dialog>
- <el-dialog :title="textMap[dialogStatus_Examine]" :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.SHstatue" @change="changeSHStatue">
- <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==='examine'?createExamineData():createExamineData()">确认</el-button>
- <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
- </div>
- </el-dialog>
- </div>
- </el-tab-pane>
- <el-tab-pane label="采购单管理" name="second">
- <div class="purchaseOrderManagement">
- <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.buyeCode" placeholder="采购单号" clearable style="width: 200px;" class="filter-item" />
- <el-select v-model="getdataListParm2.parammaps.statu" clearable placeholder="单据状态" class="filter-item" style="width: 120px;">
- <el-option v-for="item in status" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-autocomplete v-model="getdataListParm2.parammaps.providerName" value-key="providerName" class="inline-input" :fetch-suggestions="providerSearch" placeholder="供应商" style="width:150px;top:-3px;" @select="handleSelectProvider" />
- <el-date-picker ref="inputDatetime2" v-model="getdataListParm2.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;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>
- <el-button v-waves v-if="isPurchaseSap" class="filter-item" type="primary" @click="sapUpload">SAP上传</el-button>
- <el-button v-waves v-if="isPurchaseSrm" class="filter-item" type="primary" @click="srmUpload">SRM上传</el-button>
- </div>
- <el-table
- :key="tableKey2"
- v-loading="listLoading2"
- element-loading-text="给我一点时间"
- :data="list2"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- @sort-change="tableSort"
- @selection-change="change_table_selection"
- >
- <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 + (pageNum2-1) * pageSize2 + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="牧场" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pastureName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.buyeCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购员" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.empname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="提交日期" sortable prop="buyerDate" min-width="110px" align="center" />
- <el-table-column label="最近到货日期" sortable prop="DoneDate" min-width="110px" align="center" />
- <el-table-column label="单据状态" min-width="80px" align="center" :formatter="statu" />
- <el-table-column prop="sapNumber" label="sap编码" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{scope.row.sapNumber}}</span>
- </template>
- </el-table-column>
- <el-table-column prop
- <el-table-column prop="sapstatus" label="sap上传状态" min-width="80px" align="center">
- <template slot-scope="scope">
- <span v-show="scope.row.sapstatus == 1">上传失败</span>
- <span v-show="scope.row.sapstatus == -1">未上传</span>
- <span v-show="scope.row.sapstatus == 0">上传成功</span>
- </template>
- </el-table-column>
- <el-table-column prop="srmstatus" label="srm上传状态" min-width="80px" align="center">
- <template slot-scope="scope">
- <span v-show="scope.row.srmstatus == 1">上传失败</span>
- <span v-show="scope.row.srmstatus == -1">未上传</span>
- <span v-show="scope.row.srmstatus == 0">上传成功</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <el-button v-if="isPurchaseSee" type="primary" size="mini" @click="form_see2(row)">查看</el-button>
- <el-button v-if="(row.statu === 2 || row.statu === 4) && isPurchaseClose" style="display:none" type="danger" size="mini" @click="handleClose2(row)">关闭</el-button>
- <el-button v-else-if="isPurchaseClose" style="display:inline-block" type="danger" size="mini" @click="handleClose2(row)">关闭</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="total2>0" :total="total2" :page.sync="getdataListParm2.offset" :limit.sync="getdataListParm2.pagecount" @pagination="get_table_data2" />
- <el-dialog :title="textMap[dialogStatusSee2]" :visible.sync="dialogFormVisibleSee2" :close-on-click-modal="false">
- <div class="app-contentSee">
- <el-form
- ref="temp2"
- :rules="rules"
- :model="temp2"
- label-position="right"
- label-width="80px"
- style="width: 800px;margin-bottom:30px"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="采购单号:" prop="buyeCode">
- <span>{{ temp2.buyeCode }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="供应商:" prop="providerName">
- <span>{{ temp2.providerName }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="5">
- <el-form-item label="采购员:" prop="empname">
- <span>{{ temp2.empname }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="5">
- <el-form-item label="提交日期:" prop="buyerDate">
- <span>{{ temp2.buyerDate }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-table
- :key="tableKeySee2"
- v-loading="listLoadingSee2"
- element-loading-text="给我一点时间"
- :data="listSee2"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:100px"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- @sort-change="tableSort2"
- >
- <el-table-column label="序号" align="center" type="index" width="50px" />
- <el-table-column label="备件编号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件图片" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="price" label="单价(元)" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumAmount" label="申购数量" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="amount" label="采购数量" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumPrice" label="总价(元)" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumPrice }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="receiveAmount" label="入库数" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.receiveAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="SGremark" label="备注" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.SGremark }}</span>
- </template>
- </el-table-column>
- </el-table>
- <div class="sum" style="right:30px;position:absolute;bottom:90px">
- <b>总计:{{ temp2.sumPrices }}元</b>
- </div>
- <div class="stuts" style="left:30px;position:absolute;bottom:70px">
- <b>单据状态:{{ temp2.statu }}</b>
- <b v-if="isStatu">关闭原因:{{ temp2.note }}</b>
- <div v-if="isExtensionDays">延期天数:{{ temp2.extensionDays }}</div>
- </div>
- <div
- slot="footer"
- class="dialog-footer"
- style="right:30px;position:absolute;bottom:10px"
- >
- <el-button @click="dialogFormVisibleSee2 = false;get_table_data2()">关闭</el-button>
- </div>
- </div>
- </el-dialog>
- <el-dialog :title="textMap[dialogStatusClose]" :visible.sync="dialogFormVisibleClose" :close-on-click-modal="false" style="width:70%;margin: 0 auto">
- <div class="app-contentClose">
- <el-form
- ref="temp2"
- :rules="rules"
- :model="temp2"
- label-position="right"
- label-width="80px"
- style="width: 300px;margin-bottom:30px"
- >
- <el-row>
- <el-col :span="24">
- <el-form-item label="采购单号:" prop="orderNo">
- <span>{{ temp2.buyeCode }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-form-item label="" prop="note">
- <el-input ref="note" v-model="temp2.note" type="textarea" placeholder="请输入关闭该采购单原因" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div
- slot="footer"
- class="dialog-footer"
- style="right:30px;position:absolute;bottom:10px"
- >
- <el-button @click="dialogFormVisibleClose = false;get_table_data2();">取消</el-button>
- <el-button type="primary" :disabled="isokDisable" @click="closeData()">确认关闭</el-button>
- </div>
- </div>
- </el-dialog>
- </div>
- </el-tab-pane>
- <el-tab-pane label="采购明细" name="third">
- <div class="procurementDetails">
- <div class="filter-container">
- <el-select v-model="getdataListParm3.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="getdataListParm3.parammaps.partCode" placeholder="备件编号" style="width: 200px;" class="filter-item" />
- <el-input v-model="getdataListParm3.parammaps.partName" placeholder="备件名称" style="width: 140px;" class="filter-item" />
- <el-autocomplete v-model="getdataListParm3.parammaps.providerName" value-key="providerName" class="inline-input" :fetch-suggestions="providerSearch" placeholder="供应商" style="width:150px;top:-3px;" @select="handleSelectProvider" />
- <el-input v-model="getdataListParm3.parammaps.matchCode" placeholder="配单号" style="width: 140px;" class="filter-item" />
- <el-input v-model="getdataListParm3.parammaps.buyeCode" placeholder="采购单号" style="width: 140px;" class="filter-item" />
- <el-select v-model="getdataListParm3.parammaps.isStorage" clearable placeholder="到货情况" class="filter-item" style="width: 120px;">
- <el-option v-for="item in isStorages" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-date-picker ref="inputDatetime3" v-model="getdataListParm3.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;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_search3">搜索</el-button>
- <el-button v-if="isPurchaseExport" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-edit" @click="handleDownload3">导出</el-button>
- </div>
- <el-table
- :key="tableKey3"
- v-loading="listLoading3"
- element-loading-text="给我一点时间"
- :data="list3"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- @sort-change="tableSort"
- :max-height="myHeight"
- >
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum3-1) * pageSize3 + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="牧场" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pastureName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="配单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.matchCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.buyeCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="price" label="单价" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumAmount" label="申购数量" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="amount" label="采购数量" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="receiveAmount" label="入库数" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.receiveAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="申购部门" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.departmentName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购人" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.empname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="配单日期" sortable prop="buyerDate" min-width="110px" align="center" />
- <!-- <el-table-column label="备注" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.note }}</span>
- </template>
- </el-table-column> -->
- </el-table>
- <pagination v-show="total3>=0" :total="total3" :page.sync="getdataListParm3.offset" :limit.sync="getdataListParm3.pagecount" @pagination="get_table_data3" />
- </div>
- </el-tab-pane>
- </el-tabs>
- </div>
- </template>
- <script>
- // 引入
- import { GetDataByName, GetDataByNames, ExecDataByConfig, PostDataByName, failproccess, checkButtons, GetAccount,SapOrder,SrmOrder } from '@/api/common'
- import waves from '@/directive/waves' // waves directive
- import Pagination from '@/components/Pagination' // secondary package based on el-pagination
- import Cookies from 'js-cookie'
- import { parseTime, sortChange, json2excel } from '@/utils/index.js'
- export default {
- name: 'Purchase',
- components: { Pagination },
- directives: { waves },
- filters: {
- keepTwoNum(value) {
- value = Number(value)
- return value.toFixed(3)
- },
- keepTwoNum2(value) {
- value = Number(value)
- return value.toFixed(2)
- }
- },
- data() {
- return {
- myHeight:document.documentElement.clientHeight - 85- 150,
- isSap:1,
- isSrm:1,
- selectList: [],
- isPurchaseSap: [],isPurchaseSrm: [],
- isPurchaseSee: [], isPurchaseClose: [], isPurchaseExport: [], isDistributionSheet: [], isDistributionManagement: [], isExamineDM: [],
- stripe: true,
- activeName: 'first',
- listLoading1: false,
- tableKey1: 0,
- list1: [],
- confirmationSheetDisabled: false,
- isokDisable: false,
- pickerOptions: {
- disabledDate(time) {
- return time.getTime() > Date.now() // 当天之前的时间可选
- }
- },
- temp: {},
- total: 0,
- total1: 0,
- listParmConfirmation: [],
- listConfirmationSheet: null,
- getParmPurchaseOrderNumber: {
- name: 'autoCreatCode',
- page: 1,
- offset: 1,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- codeType: 'CG'
- }
- },
- postDataPramas: {},
- requestProvider: {
- name: 'getProviderList',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {}
- },
- listLoading2: false,
- tableKey2: 0,
- list2: [],
- status2: [
- { id: '0', name: '审核中' },
- { id: '1', name: '审核通过' },
- { id: '2', name: '审核驳回' }
- ],
- status: [
- { id: '0', name: '未到货' },
- { id: '1', name: '部分到货' },
- { id: '2', name: '按时到货' },
- { id: '3', name: '已延期' },
- { id: '4', name: '已关闭' },
- { id: '5', name: '部分到货-延期' },
- { id: '6', name: '全部到货-延期' }
- ],
- isStorages: [
- { id: '0', name: '未入库' },
- { id: '1', name: '已入库' }
- ],
- isStatu: false,
- listLoadingSee2: false,
- tableKeySee2: 0,
- total2: 0,
- total3: 0,
- listLoading3: false,
- tableKey3: 0,
- list3: [],
- findAllEmploye: [],
- findAllPasture: [],
- requestParams: [
- { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
- { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
- ],
- getdataListParm1: {
- name: 'getbuydetailParts',
- page: 1,
- // offset: 1,
- // pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid')
- }
- },
- getdataListPart: {
- name: 'getpartpurchasebg',
- page: 1,
- // offset: 1,
- // pagecount: 10,
- returntype: 'Map',
- parammaps: {
- id: Cookies.get('pastureid')
- }
- },
- partData: [],
- getParmCreateNumber: {
- name: 'autoCreatCode',
- page: 1,
- offset: 1,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- codeType: 'PD'
- }
- },
- pageNum1: 0,
- pageSize1: 0,
- temp1: {
- pastureId: Cookies.get('pastureid'),
- buyerPerson: this.$store.state.user.employeid,
- buyerDate: parseTime(new Date(), '{y}-{m}-{d}')
- },
- getdataListParm2: {
- name: 'getBigbuydetailList',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- providerName: '',
- buyeCode: '',
- inputDatetime: '',
- // pastureId: Cookies.get('pastureid'),
- pastureName: Cookies.get('pasturename')
- }
- },
- dialogFormVisibleConfirmation: false,
- dialogStatusConfirmation: '',
- pageNum2: 0,
- pageSize2: 0,
- temp2: {
- note: ''
- },
- getdataListParm3: {
- name: 'getbuydetailList',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureName: Cookies.get('pasturename'),
- providerName: '',
- partCode: '',
- partName: '',
- matchCode: '',
- buyeCode: '',
- isStorage: '',
- startTime: '',
- stopTime: '',
- inputDatetime: ''
- }
- },
- isExtensionDays: false,
- listSee2: [],
- getdataListSee2: {
- name: 'getbuydetailListbyBig',
- returntype: 'Map',
- parammaps: {}
- },
- requestParamStute: {
- name: 'updateBigbuydetailStatu',
- returntype: 'Map',
- parammaps: {}
- },
- pageNum3: 0,
- pageSize3: 0,
- temp3: {},
- dialogFormVisibleSee2: false,
- dialogStatusSee2: '',
- // 配单管理
- listLoading4: false,
- tableKey4: 0,
- list4: [],
- pageNum4: 0,
- pageSize4: 0,
- total4: 0,
- getdataListParm4: {
- name: 'getbigpartdeallist',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureName: Cookies.get('pasturename'),
- matchCode: '',
- statue: '',
- inputDatetime: '',
- startTime: '',
- stopTime: ''
- }
- },
- dialogFormVisibleSee4: false,
- dialogStatusSee4: '',
- temp4: {},
- listSee4: [],
- tableKeySee4: 0,
- listLoadingSee4: false,
- getdataListSee4: {
- name: 'getbigpartdealdetiallist',
- returntype: 'Map',
- parammaps: {}
- },
- activeList: [],
- active: 3,
- currentRow:{},
- dialogStatusUpdate4: '',
- dialogFormVisibleUpdate4: false,
- updateTemp4: {},
- listUpdate4: [],
- tableKeyUpdate4: 0,
- listLoadingUpdate4: false,
- dialogFormVisible_Examine: false,
- dialogStatus_Examine: '',
- examineTemp: {
- SHstatue: 1,
- workflowNote: ''
- },
- statueReason: false,
- dialogFormVisibleClose: false,
- dialogStatusClose: '',
- textMap: {
- confirmation: '确认配单',
- see: '查看详情',
- close: '关闭提示',
- examine: '审核',
- update: '编辑'
- },
- // 校验规则
- rules: {
- equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
- note: [{ required: true, message: '必填', trigger: 'blur' }]
- },
- rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
- cellStyle: { padding: 0 + 'px' },
- buttons: [],
- downloadListParm3: {},
- downloadList3: [],
- isPercentage: false,
- percentage: 1
- }
- },
- created() {
- const that = this
- // GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
- // that.buttons = response.data.list
- // that.get_auto_buttons()
- // if (this.isDistributionSheet == true) {
- // this.activeName = 'first'
- // console.log(1, this.isDistributionSheet, this.isDistributionManagement)
- // } else if (this.isDistributionManagement == true) {
- // this.activeName = 'fouth'
- // console.log(2, this.isDistributionSheet, this.isDistributionManagement)
- // } else if (this.isDistributionSheet == false && this.isDistributionManagement == false) {
- // this.activeName = 'second'
- // console.log(3, this.isDistributionSheet, this.isDistributionManagement)
- // }
- // })
- // this.get_select_list()
- // this.get_table_data1()
- // this.get_table_data2()
- // this.get_table_data3()
- // this.get_table_data4()
- // if (this.$route.query.activeName !== undefined) {
- // this.activeName = this.$route.query.activeName
- // }
-
-
- },
- methods: {
- tableSort(column) {
- if (this.activeName == 'first') {
- sortChange(column, this.list1)
- } else if (this.activeName == 'second') {
- sortChange(column, this.list2)
- } else if (this.activeName == 'third') {
- sortChange(column, this.list3)
- } else if (this.activeName == 'fouth') {
- sortChange(column, this.list4)
- }
- },
- tableSort2(column) {
- sortChange(column, this.listSee2)
- },
- get_auto_buttons() {
- const DistributionSheet = 'customs:purchase:distributionSheet'
- const isDistributionSheet = checkButtons(this.$store.state.user.buttons, DistributionSheet)
- this.isDistributionSheet = isDistributionSheet
- const PurchaseSee = 'customs:purchase:see'
- const isPurchaseSee = checkButtons(this.$store.state.user.buttons, PurchaseSee)
- this.isPurchaseSee = isPurchaseSee
- const PurchaseClose = 'customs:purchase:close'
- const isPurchaseClose = checkButtons(this.$store.state.user.buttons, PurchaseClose)
- this.isPurchaseClose = isPurchaseClose
- const PurchaseSap = 'customs:purchase:sap'
- const isPurchaseSap = checkButtons(this.$store.state.user.buttons, PurchaseSap)
- this.isPurchaseSap = isPurchaseSap
- const PurchaseSrm = 'customs:purchase:srm'
- const isPurchaseSrm = checkButtons(this.$store.state.user.buttons, PurchaseSrm)
- this.isPurchaseSrm = isPurchaseSrm
- const PurchaseExport = 'customs:purchase:export'
- const isPurchaseExport = checkButtons(this.$store.state.user.buttons, PurchaseExport)
- this.isPurchaseExport = isPurchaseExport
- const ExamineDM = 'customs:purchase:shenhe'
- const isExamineDM = checkButtons(this.$store.state.user.buttons, ExamineDM)
- this.isExamineDM = isExamineDM
- const DistributionManagement = 'customs:purchase:peidanjiemian'
- const isDistributionManagement = checkButtons(this.$store.state.user.buttons, DistributionManagement)
- this.isDistributionManagement = isDistributionManagement
- },
- cellClick(row, column, cell, event) {
- console.log(cell)
- console.log('column', column)
- console.log('行索引', row.id)
- console.log('列索引', column.id)
- return {
- background: '#eceb3c'
- }
- // console.log('event',event)
- },
- tableRowStyle({ row, rowIndex }) {
- console.log(row, row)
- console.log(' row.isParity', row.isParity)
- console.log(parseInt(row.isParity) % 2 == 0)
- if (parseInt(row.isParity) % 2 == 0) {
- return {
- background: '#eee'
- }
- }
- return {
- background: ''
- }
- },
- tableCellStyle({ row, column, rowIndex, columnIndex }) {
- if (row.isNo == 'No' && columnIndex === 10) {
- return {
- background: 'red'
- }
- }
- return {
- background: ''
- }
- },
- handleClick(tab, event) {
- console.log(tab, event)
- if (tab.name === 'first') {
- this.get_table_data1()
- } else if (tab.name === 'fouth') {
- this.get_table_data4()
- } else if (tab.name === 'second') {
- this.get_table_data2()
- } else if (tab.name === 'third') {
- this.get_table_data3()
- }
- },
- get_select_list() {
- GetDataByNames(this.requestParams).then(response => {
- this.findAllEmploye = response.data.findAllEmploye.list
- this.findAllPasture = response.data.findAllPasture.list
- })
- },
- providerSearch(queryString, cb) {
- console.log('供应商模糊查询输入值', queryString)
- this.requestProvider.parammaps['providerName'] = queryString
- GetDataByName(this.requestProvider).then(response => {
- console.log('供应商模糊查询搜索data', response.data.list)
- cb(response.data.list)
- })
- },
- handleSelectProvider(item) {
- console.log('供应商模糊查询选中值', item)
- },
- get_table_data1() {
- this.listLoading1 = true
- GetDataByName(this.getdataListPart).then(response => {
- console.log(response)
- this.partData = response.data.list
- })
- GetDataByName(this.getdataListParm1).then(response => {
- console.log('this.list1', response.data.list)
- if (response.data.list === null) {
- this.list1 = []
- this.confirmationSheetDisabled = true
- } else {
- // eslint-disable-next-line no-unused-vars
- var list1
- list1 = response.data.list
- var result = []
- list1.forEach((i, j) => {
- // eslint-disable-next-line no-irregular-whitespace
- Array.from(new Set(list1.map(function(item) { return item.partCode }))).forEach((x, y) => {
- if (i.partCode === x) {
- result.push({
- 'amount': i.amount,
- 'amountPre': i.amountPre,
- 'bigId': i.bigId,
- 'brand': i.brand,
- 'brandId': i.brandId,
- 'contractCode': i.contractCode,
- 'count': i.count,
- 'enable': i.enable,
- 'id': i.id,
- 'inventoryType': i.inventoryType,
- 'isZeroStock': i.isZeroStock,
- 'orderNumber': i.orderNumber,
- 'partCode': i.partCode,
- 'partId': i.partId,
- 'partName': i.partName,
- 'pastureId': i.pastureId,
- 'pastureName': i.pastureName,
- 'planAmount': i.planAmount,
- 'price': i.price,
- 'providerId': i.providerId,
- 'providerName': i.providerName,
- 'purpose': i.purpose,
- 'remark': i.remark,
- 'specification': i.specification,
- 'sumAmount': i.sumAmount,
- 'unit': i.unit,
- 'isNo': i.isNo,
- 'srcpath': i.srcpath,
- 'picpath': i.picpath,
- 'departmentName': i.departmentName,
- 'isParity': y
- })
- }
- })
- })
- console.log(result)
- if (result !== null) {
- for (let i = 0; i < result.length; i++) {
- console.log(result[i].srcpath)
- if (result[i].srcpath !== null && result[i].picpath !== null && result[i].srcpath !== undefined && result[i].picpath !== undefined) {
- result[i].srcpath = process.env.VUE_APP_BASE_API + result[i].srcpath
- result[i].picpath = process.env.VUE_APP_BASE_API + result[i].picpath
- } else {
- // this.$set(result[i], 'srcpath', '')
- // this.$set(result[i], 'picpath', '')
- result[i].srcpath = ''
- result[i].picpath = ''
- }
- }
- }
- // console.log(result)
- this.list1 = result
- console.log('处理后table数', this.list1)
- this.confirmationSheetDisabled = false
- }
- var tem = ''
- for (var i = 0; i < this.list1.length; i++) {
- if (tem !== this.list1[i].partCode) {
- this.list1[i].amount = this.list1[i].sumAmount
- tem = this.list1[i].partCode
- } else {
- this.list1[i].amount = 0
- }
- }
- // var a = 0
- // var b = 0
- // for (var i = 0; i < this.list1.length; i++) {
- // if (parseInt(this.list1[i].amountPre) !== 0) {
- // console.log(parseInt(this.list1[i].amountPre))
- // if (a <= 0) {
- // a = this.list1[i].count - 1
- // if (b === 0) {
- // b = parseInt(this.list1[i].amountPre)
- // }
- // } else {
- // a--
- // }
- // if (b > 0) {
- // this.list1[i].amount = this.list1[i].amount + 1
- // b--
- // }
- // }
- // }
- if (response.data.total) {
- this.total1 = response.data.total
- }
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoading1 = false
- }, 300)
- })
- },
- confirmationSheet() {
- console.log('点击立确认配单')
- this.temp1.matchCode = ''
- console.log(this.list1) // table表格数据
- // -------------------------------------------
- function groupBy1(array, f) {
- var groups1 = {}
- array.forEach(function(o) {
- var group2 = JSON.stringify(f(o))
- console.log("group2",group2)
- groups1[group2] = groups1[group2] || []
- groups1[group2].push(o)
- })
- return Object.keys(groups1).map(function(group2) {
- return groups1[group2]
- })
- }
- var sorted1 = groupBy1(this.list1, function(item) {
- return [item.partCode]
- })
- console.log('表格数据根据供应商分划', sorted1)
- for (var i = 0; i < sorted1.length; i++) {
- var b = 0
- var c = 0
- for (var j = 0; j < sorted1[i].length; j++) {
- // eslint-disable-next-line no-self-compare
- if (sorted1[i][j].partCode === sorted1[i][j].partCode) {
- // console.log(sorted1[i][j])
- var element = sorted1[i][j]
- b += parseInt(element.amount)
- c = parseInt(element.sumAmount)
- // console.log("amount", element.amount);
- }
- }
- if (b > c || b < c) {
- console.log('No')
- console.log(element.id)
- for (var a = 0; a < this.list1.length; a++) {
- if (element.id === this.list1[a].id) {
- console.log(this.list1[a].partCode)
- for (var b = 0; b < this.list1.length; b++) {
- if (this.list1[b].partCode === this.list1[a].partCode) {
- console.log(this.list1[b])
- this.$set(this.list1[b], 'isNo', 'No')
- } else {
- this.$set(this.list1[b], 'isNo', 'Yes')
- }
- }
- } else {
- this.$set(this.list1[a], 'isNo', 'Yes')
- }
- }
- console.log(b)
- this.$message({
- type: 'warning',
- message: '同一备件多个供应商合计采购数量总和等于申购数量'
- })
- return
- } else {
- for (var a = 0; a < this.list1.length; a++) {
- this.$set(this.list1[a], 'isNo', 'Yes')
- var rulesAmount = /^[0-9]\d*$/
- if (!rulesAmount.test(this.list1[a].amount)) {
- this.$message({
- type: 'error',
- message: '采购数量请输入正整数',
- duration: 2000
- })
- return false
- }
- }
- // console.log('Yes')
- }
- }
- this.getCreateNumber()
- // -------------------------------------------
- this.dialogStatusConfirmation = 'confirmation'
- this.dialogFormVisibleConfirmation = true
- console.log('确认配单data------', JSON.stringify(this.list1) )
- // this.list1 = this.list1.filter(i => parseFloat(i.amount) !== 0)
- console.log(this.list1)
- console.log('根据供应商分类', sorted1)
- console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
- // 处理渲染数据
- var providerNameMap = {}
- var providerNameDest = []
- var departmentNameMap = {}
-
-
- // // eslint-disable-next-line no-redeclare
- // for (var i = 0; i < this.list1.length; i++) {
- // console.log(this.list1[i])
- // var ai = this.list1[i]
- // var price = this.list1[i].price
- // var amount = this.list1[i].amount
- // // console.log(price, amount)
- // var sumPrice = 0
- // sumPrice = parseFloat(price) * parseFloat(amount)
- // if (!providerNameMap[ai.providerName]) {
- // providerNameDest.push({
- // price: [price],
- // amount: [amount],
- // sumPrice: [sumPrice],
- // providerId: ai.providerId,
- // providerName: ai.providerName,
- // purpose: ai.purpose,
- // list: [ai]
- // })
- // providerNameMap[ai.providerName] = ai
- // providerNameMap[ai.providerId] = ai
- // } else {
- // // eslint-disable-next-line no-redeclare
- // for (var j = 0; j < providerNameDest.length; j++) {
- // console.log(providerNameDest[j])
- // var dj = providerNameDest[j]
- // if (dj.providerName === ai.providerName) {
- // dj.sumPrice.push(sumPrice)
- // dj.price.push(price)
- // // eslint-disable-next-line no-mixed-spaces-and-tabs
- // dj.amount.push(amount)
- // dj.list.push(ai)
- // break
- // }
- // }
- // }
- // }
- // var providerNameArray = []
- // // eslint-disable-next-line no-redeclare
- // for (var i = 0; i < this.list1.length; i++) {
- // providerNameArray.push(this.list1[i].providerName)
- // }
- // // console.log('原供应商', providerNameArray)
- // function unique(providerNameArray) {
- // return Array.from(new Set(providerNameArray))
- // }
- // var uniqueProviderNameArray = unique(providerNameArray)
- // console.log('去重后供应商', uniqueProviderNameArray) // ["泰森机电", "浩祥晟机电", "国宇商贸", "赛娜牧业"]
- // // ------------------------------------------
- // var OrderNumberArray = []
- // this.postDataPramas.common = { 'returnmap': '0' }
- // this.postDataPramas.data = []
- // for (var i = 0; i < uniqueProviderNameArray.length; i++) {
- // this.postDataPramas.data[i] = { 'name': 'autoCreatCode', 'type': 'sm', 'parammaps': {
- // pastureId: Cookies.get('pastureid'),
- // codeType: 'CG'
- // }}
- // }
- // ExecDataByConfig(this.postDataPramas).then(response => {
- // console.log('采购单请求发送参数', this.postDataPramas)
- // for (var i = 0; i < response.data.length; i++) {
- // // console.log(response.data[i].resultmaps[0].orderCode)
- // OrderNumberArray.push(response.data[i].resultmaps[0].orderCode)
- // }
- // console.log(OrderNumberArray)
- // this.listConfirmationSheet.map((item, index) => {
- // item.orderNumber = OrderNumberArray[index]
- // return item
- // })
- // this.$forceUpdate()
- // })
- // console.log(OrderNumberArray)
- // this.listConfirmationSheet = providerNameDest
- // // console.log(JSON.stringify(this.listConfirmationSheet))
- // console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
- // var SumArray = []
- // this.listConfirmationSheet.forEach((item, index) => {
- // console.log(item.sumPrice)
- // // console.log(item.sumPrice.reduce((count, v) => count + v, 0))
- // SumArray.push(item.sumPrice.reduce((count, v) => count + v, 0).toFixed(3))
- // })
- // this.listConfirmationSheet.map((item, index) => {
- // // console.log(item, index)
- // item.Sum = SumArray[index]
- // return item
- // })
- // console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
- // -------------------------------------------
- },
- getCreateNumber() {
- GetDataByName(this.getParmCreateNumber).then(response => {
- this.$nextTick(() => {
- this.show = false
- console.log('配单号', response.data.list[0].orderCode)
- this.temp1.matchCode = response.data.list[0].orderCode
- this.$forceUpdate()
- })
- })
- },
- confirmationSheetData() {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- console.log('点击了确认配单提交')
- this.$refs['temp1'].validate(valid => {
- if (valid) {
- // orderNumber
- if (this.temp1.matchCode == '' || this.temp1.matchCode == null || this.temp1.matchCode == undefined) {
- this.getCreateNumber()
- }
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- console.log(this.listConfirmationSheet)
- for (let i = 0; i < this.listConfirmationSheet.length; i++) {
- if (this.listConfirmationSheet[i].orderNumber == null || this.listConfirmationSheet[i].orderNumber == undefined) {
- this.$notify({
- title: '保存失败',
- message: '网络异常未生成采购单,请刷新后重新进行配单',
- type: 'warning',
- duration: 2000
- })
- return false
- }
- }
- var a = this.listConfirmationSheet.length
- this.listConfirmationSheet.forEach((item, index) => {
- console.log(item)
- this.postDataPramas.data[index] = { 'name': 'insertBigbuydetail', 'resultname': 'insertBigbuydetail' + index, 'type': 'e', 'parammaps': {
- pastureId: Cookies.get('pastureid'),
- buyeCode: item.orderNumber,
- providerId: item.providerId,
- buyerPerson: this.temp1.buyerPerson,
- buyerDate: this.temp1.buyerDate,
- matchCode: this.temp1.matchCode
- }}
- this.postDataPramas.data[a] = { 'name': 'insertSpotList', 'resultmaps': { 'list': item.list }}
- this.postDataPramas.data[a].children = []
- this.postDataPramas.data[a].children[0] = { 'name': 'insertbuydetail', 'type': 'e', 'parammaps': {
- bigId: '@insertBigbuydetail' + index + '.LastInsertId',
- pastureId: '@insertSpotList.pastureId',
- contractCode: '@insertSpotList.contractCode',
- amount: '@insertSpotList.amount',
- sumAmount: '@insertSpotList.sumAmount',
- contractId: '@insertSpotList.id',
- departmentName: '@insertSpotList.departmentName',
- remark: '@insertSpotList.purpose'
- }}
- a = a + 1
- })
- this.postDataPramas.data[a] = { 'name': 'insertSpotListbpp', 'resultmaps': { 'list': this.partData }}
- this.postDataPramas.data[a].children = []
- this.postDataPramas.data[a].children[0] = { 'name': 'updateBigpartpurchaseStatu', 'type': 'e', 'parammaps': {
- id: '@insertSpotListbpp.id',
- matchCode: this.temp1.matchCode
- }}
- this.postDataPramas.data.push({ 'name': 'insertbigpartdeal', 'type': 'e', 'parammaps': {
- empId: this.temp1.buyerPerson,
- pastureId: Cookies.get('pastureid'),
- matchCode: this.temp1.matchCode
- }}
- )
- ExecDataByConfig(this.postDataPramas).then(response => {
- if (response.msg === 'fail') {
- var buyeCode = new RegExp('buyeCode')
- if (buyeCode.test(response.data)) {
- this.$notify({
- title: '',
- message: '网络异常未生成采购单,请刷新后重新进行配单',
- type: 'warning',
- duration: 2000
- })
- } else {
- this.$notify({
- title: '保存失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- }
- } else {
- this.dialogFormVisibleConfirmation = false
- this.activeName = 'fouth'
- this.get_table_data4()
- this.$notify({
- title: '',
- message: '保存成功',
- type: 'success',
- duration: 2000
- })
- }
- })
- }
- })
- },
- get_table_data2() {
- this.listLoading2 = true
- if (this.$refs['inputDatetime2'] !== undefined && this.$refs['inputDatetime2'].value !== null) {
- this.getdataListParm2.parammaps.startTime = this.$refs['inputDatetime2'].value[0]
- this.getdataListParm2.parammaps.stopTime = this.$refs['inputDatetime2'].value[1]
- } else {
- this.getdataListParm2.parammaps.startTime = ''
- this.getdataListParm2.parammaps.stopTime = ''
- }
- GetDataByName(this.getdataListParm2).then(response => {
- this.list2 = response.data.list
- this.pageNum2 = response.data.pageNum
- this.pageSize2 = response.data.pageSize
- if (response.data.total) {
- this.total2 = response.data.total
- }
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoading2 = false
- }, 300)
- })
- },
- form_search2() {
- this.listLoading = true
- if (this.getdataListParm2.parammaps.inputDatetime === null) {
- this.getdataListParm2.parammaps.inputDatetime = ''
- }
- this.getdataListParm2.offset = 1
- this.get_table_data2()
- },
- statu: function(cellValue) {
- if (cellValue.statu === 0) {
- return '未到货'
- } else if (cellValue.statu === 1) {
- return '部分到货'
- } else if (cellValue.statu === 2) {
- return '按时到货'
- } else if (cellValue.statu === 3) {
- return '已延期'
- } else if (cellValue.statu === 4) {
- return '已关闭'
- } else if (cellValue.statu === 5) {
- return '部分到货-延期'
- } else if (cellValue.statu === 6) {
- return '全部到货-延期'
- }
- },
- statue: function(cellValue) {
- if (cellValue.statue === 0) {
- return '审核中'
- } else if (cellValue.statue === 1) {
- return '审核通过'
- } else if (cellValue.statue === 2) {
- return '未通过'
- }
- },
- form_see2(row) {
- this.temp2 = Object.assign({}, row)
- if (this.temp2.statu === 0) {
- this.isStatu = false
- this.temp2.statu = '未到货'
- this.isExtensionDays = false
- } else if (this.temp2.statu === 1) {
- this.isStatu = false
- this.temp2.statu = '部分到货'
- this.isExtensionDays = false
- } else if (this.temp2.statu === 2) {
- this.isStatu = false
- this.temp2.statu = '按时到货'
- this.isExtensionDays = false
- } else if (this.temp2.statu === 3) {
- this.isStatu = false
- this.temp2.statu = '已延期'
- this.isExtensionDays = true
- } else if (this.temp2.statu === 4) {
- this.temp2.statu = '已关闭'
- this.isStatu = true
- this.isExtensionDays = false
- } else if (this.temp2.statu === 5) {
- this.isStatu = false
- this.temp2.statu = '部分到货-延期'
- this.isExtensionDays = true
- } else if (this.temp2.statu === 6) {
- this.isStatu = false
- this.temp2.statu = '全部到货-延期'
- this.isExtensionDays = true
- }
- this.dialogStatusSee2 = 'see'
- this.dialogFormVisibleSee2 = true
- this.getdataListSee2.parammaps.id = row.id
- this.getSeeList2()
- },
- getSeeList2() {
- GetDataByName(this.getdataListSee2).then(response => {
- this.listSee2 = response.data.list
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
- this.listSee2[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
- this.listSee2[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
- } else {
- this.listSee2[i].srcpath = ''
- this.listSee2[i].picpath = ''
- }
- }
- }
- console.log('查看下方table数据', response.data.list)
- // this.pageNum2 = response.data.pageNum
- // this.pageSize2 = response.data.pageSize
- var sumArray = []
- for (var i = 0; i < this.listSee2.length; i++) {
- console.log()
- sumArray.push(
- this.listSee2[i].sumPrice
- )
- }
- console.log('总价', sumArray)
- var arrvalue = 0
- for (var i = 0; i < sumArray.length; i++) {
- console.log('table内总价每一个值', sumArray[i])
- arrvalue += parseFloat(sumArray[i])// 数组的索引是从0开始的
- }
- this.temp2.sumPrices = arrvalue.toFixed(3)
- setTimeout(() => {
- this.listLoadingSee = false
- }, 100)
- })
- },
- resetCloseTemp() {
- this.temp2.note = ''
- },
- handleClose2(row) {
- this.resetCloseTemp()
- this.temp2 = Object.assign({}, row)
- this.dialogStatusClose = 'close'
- this.dialogFormVisibleClose = true
- },
- handleCurrentChange(val) {
- this.currentRow = val;
- console.log("currentRow",this.currentRow)
- },
- sapUpload(){
- const that = this
- console.log("currentRow",this.currentRow.sapstatus)
- 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
- SapOrder(send_data).then(response => {
- console.log('response', response)
-
- if (response.msg !== 'fail') {
- that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- that.selectList = []
- that.get_table_data2()
-
- } else {
- that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
- }
-
- })
-
-
- } else {
- that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击' , type: 'error', duration: 2000 })
- }
- setTimeout(() => {
- that.isSap = 1
- }, 3000)
-
-
-
- // if(this.currentRow.sapstatus){
-
- // if(this.currentRow.sapstatus != 0){
- // const sapArr = this.currentRow.sapbuyeCode.split(",")
- // console.log("sapArr",sapArr)
- // sapArr.forEach(function(item){
- // console.log("sapArr item",item)
- // var send_data = {
-
- // "code":item,
- // "pastureid":Cookies.get('pastureid')
-
- // }
- // SapOrder(send_data).then(response => {
- // console.log('response', response)
-
- // if (response.msg !== 'fail') {
- // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- // that.get_table_data()
-
- // } else {
- // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
- // }
-
- // })
-
-
- // })
- // }
- // }
- },
- checkboxInit(row,index){
- // console.log(row)
- var data1 = new Date(row.creatTime)
- var data2 = new Date('2022-10-25')
- if(data1 > data2){ return 1 } else {return 0}
- },
- //监听 - 表格 - 勾选
- change_table_selection(val) {
- this.selectList = val
- console.log('勾选数据selectList', this.selectList)
- },
- srmUpload(){
- const that = this
- console.log("currentRow",this.currentRow.srmstatus)
-
- console.log('勾选数据selectList', this.selectList)
- var send_data = this.selectList
- if(send_data.length == 0){
- that.$notify({ title: '失败', message: '请勾选数据!' , type: 'error', duration: 2000 })
- return false
- }
- console.log(that.isSrm)
- if(that.isSrm == 1){
- that.isSrm = 0
- SrmOrder(send_data).then(response => {
- console.log('response', response)
-
- if (response.msg !== 'fail') {
- that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- that.selectList = []
- that.get_table_data2()
-
-
- } else {
- that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
- }
-
- })
-
-
- } else {
- that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击' , type: 'error', duration: 2000 })
- }
- setTimeout(() => {
- that.isSrm = 1
- }, 3000)
-
- // if(this.currentRow.srmstatus){
- // if(this.currentRow.srmstatus != 0){
- // const srmArr = this.currentRow.srmbuyeCode.split(",")
- // console.log("srmArr",srmArr)
- // srmArr.forEach(function(item){
- // console.log("srmArr item",item)
- // var send_data = {
-
- // "code":item,
- // "pastureid":Cookies.get('pastureid')
- // }
- // SrmOrder(send_data).then(response => {
- // console.log('response', response)
-
- // if (response.msg !== 'fail') {
- // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- // that.get_table_data()
-
- // } else {
- // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
- // }
-
- // })
-
-
- // })
- // }
- // }
- },
-
- closeData() {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- console.log('点击确认关闭', this.temp2)
- this.$refs['temp2'].validate(valid => {
- if (valid) {
- this.requestParamStute.parammaps.id = this.temp2.id
- this.requestParamStute.parammaps.note = this.temp2.note
- PostDataByName(this.requestParamStute).then(response => {
- console.log('新增保存发送参数', this.requestParamStute)
- if (response.msg !== 'fail') {
- this.get_table_data2()
- this.dialogFormVisibleClose = false
- this.$notify({
- title: '成功',
- message: '关闭成功',
- type: 'success',
- duration: 2000
- })
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- })
- },
- get_table_data3() {
- this.listLoading3 = true
- if (this.$refs['inputDatetime3'] !== undefined && this.$refs['inputDatetime3'].value !== null) {
- this.getdataListParm3.parammaps.startTime = this.$refs['inputDatetime3'].value[0]
- this.getdataListParm3.parammaps.stopTime = this.$refs['inputDatetime3'].value[1]
- } else {
- this.getdataListParm3.parammaps.startTime = ''
- this.getdataListParm3.parammaps.stopTime = ''
- }
- GetDataByName(this.getdataListParm3).then(response => {
- this.list3 = response.data.list
- this.pageNum3 = response.data.pageNum
- this.pageSize3 = response.data.pageSize
- if (response.data.total) {
- this.total3 = response.data.total
- }
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoading3 = false
- }, 300)
- })
- },
- form_search3() {
- this.listLoading = true
- if (this.getdataListParm3.parammaps.inputDatetime === null) {
- this.getdataListParm3.parammaps.inputDatetime = ''
- }
- this.getdataListParm3.offset = 1
- this.get_table_data3()
- },
- handleDownload3() {
- 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.downloadListParm3.name = this.getdataListParm3.name
- this.downloadListParm3.parammaps = this.getdataListParm3.parammaps
- GetAccount(this.downloadListParm3).then(response => {
- if (response.data.list !== '') {
- this.percentage = 99
- setTimeout(() => {
- this.isPercentage = false
- }, 2000)
- }
- this.downloadList3 = response.data.list
- const elecExcelDatas = [
- {
- tHeader: ['配单号', '采购单号', '备件编号', '备件名称', '备件规格', '备件品牌', '计量单位', '供应商', '单价', '申购数量', '采购数量', '入库数', '申购部门', '采购人', '配单日期'],
- filterVal: ['matchCode', 'buyeCode', 'partCode', 'partName', 'specification', 'brand', 'unit', 'providerName', 'price', 'sumAmount', 'amount', 'receiveAmount', 'departmentName', 'empname', 'buyerDate'],
- tableDatas: this.downloadList3,
- sheetName: '采购明细'
- }
- ]
- json2excel(elecExcelDatas, '采购明细', true, 'xlsx')
- })
- },
- get_table_data4() {
- this.listLoading4 = true
- if (this.$refs['inputDatetime4'] !== undefined && this.$refs['inputDatetime4'].value !== null) {
- this.getdataListParm4.parammaps.startTime = this.$refs['inputDatetime4'].value[0]
- this.getdataListParm4.parammaps.stopTime = this.$refs['inputDatetime4'].value[1]
- } else {
- this.getdataListParm4.parammaps.startTime = ''
- this.getdataListParm4.parammaps.stopTime = ''
- }
- GetDataByName(this.getdataListParm4).then(response => {
- this.list4 = response.data.list
- this.pageNum4 = response.data.pageNum
- this.pageSize4 = response.data.pageSize
- if (response.data.total) {
- this.total4 = response.data.total
- }
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoading4 = false
- }, 300)
- })
- },
- form_search4() {
- this.listLoading = true
- if (this.getdataListParm4.parammaps.inputDatetime === null) {
- this.getdataListParm4.parammaps.inputDatetime = ''
- }
- this.getdataListParm4.offset = 1
- this.get_table_data4()
- },
- form_see4(row) {
- this.dialogStatusSee4 = 'see'
- this.dialogFormVisibleSee4 = true
- this.temp4 = Object.assign({}, row)
- this.getdataListSee4.parammaps.matchCode = row.matchCode
- this.getSeeList4()
- var reason = '未通过原因:' + this.temp4.workflowNote
- if (this.temp4.statue === 0) {
- this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '办公室主任审核' }]
- this.active = 1
- } else if (this.temp4.statue === 1) {
- this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '办公室主任审核', date: this.temp4.chargeDate, name: this.temp4.chargeName }]
- this.active = 2
- } else if (this.temp4.statue === 2) {
- this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '办公室主任审核', date: this.temp4.chargeDate, name: this.temp4.chargeName, status: 'error', reason: reason }]
- this.active = 2
- }
- },
- getSeeList4() {
- GetDataByName(this.getdataListSee4).then(response => {
- this.listSee4 = response.data.list
- this.listUpdate4 = response.data.list
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- console.log(response.data.list[i].srcpath)
- console.log(response.data.list[i].picpath)
- console.log(process.env.VUE_APP_BASE_API + response.data.list[i].srcpath)
- 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) {
- if (this.dialogStatusSee4 == 'see') {
- this.listSee4[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
- this.listSee4[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
- } else {
- this.listUpdate4[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
- this.listUpdate4[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
- }
- } else {
- this.listSee4[i].srcpath = ''
- this.listSee4[i].picpath = ''
- this.listUpdate4[i].srcpath = ''
- this.listUpdate4[i].picpath = ''
- }
- }
- }
- console.log('查看下方table数据', response.data.list)
- this.pageNum4 = response.data.pageNum
- this.pageSize4 = response.data.pageSize
- })
- },
- handleExamine(row) {
- if (row == undefined) {
- this.examineTemp = this.temp4
- this.$set(this.temp4, 'SHstatue', 1)
- this.$set(this.temp4, 'workflowNote', '')
- } else {
- this.examineTemp = Object.assign({}, row)
- this.$set(this.examineTemp, 'SHstatue', 1)
- this.$set(this.examineTemp, 'workflowNote', '')
- }
- this.dialogStatus_Examine = 'examine'
- this.dialogFormVisible_Examine = true
- this.statueReason = false
- },
- changeSHStatue(val) {
- if (val == 2) {
- this.statueReason = true
- } else {
- this.statueReason = false
- }
- },
- createExamineData() {
- console.log(this.examineTemp)
- this.$refs['examineTemp'].validate(valid => {
- if (valid) {
- if (this.examineTemp.SHstatue == 1) {
- console.log('通过')
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- this.postDataPramas.data[0] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
- 'id': this.examineTemp.id,
- 'statue': this.examineTemp.SHstatue,
- 'empId': Cookies.get('employeid'),
- 'workflowNote': this.examineTemp.workflowNote
- }}
- this.postDataPramas.data[1] = { 'name': 'updatebigbuydetailenable', 'type': 'e', 'parammaps': {
- 'matchCode': this.examineTemp.matchCode
- }}
- this.postDataPramas.data[2] = { 'name': 'updatebigbuydetailZero', 'type': 'e', 'parammaps': {
- 'matchCode': this.examineTemp.matchCode
- }}
- 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_Examine = false
- this.get_table_data4()
- this.$notify({
- title: '',
- message: '审核成功',
- type: 'success',
- duration: 2000
- })
- }
- })
- } else if (this.examineTemp.SHstatue == 2) {
- console.log('不通过')
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- this.postDataPramas.data[0] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
- 'id': this.examineTemp.id,
- 'statue': this.examineTemp.SHstatue,
- 'empId': Cookies.get('employeid'),
- 'workflowNote': this.examineTemp.workflowNote
- }}
- // this.postDataPramas.data[1] = { 'name': 'updatepartpurchase', 'type': 'e', 'parammaps': {
- // 'matchCode': this.examineTemp.matchCode
- // }}
- 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_Examine = false
- this.get_table_data4()
- this.$notify({
- title: '',
- message: '审核成功',
- type: 'success',
- duration: 2000
- })
- }
- })
- }
- }
- })
- },
- form_edit(row) {
- this.dialogStatusUpdate4 = 'update'
- this.dialogFormVisibleUpdate4 = true
- this.getdataListSee4.parammaps.matchCode = row.matchCode
- this.updateTemp4 = Object.assign(row, {})
- this.getSeeList4()
- },
- edit_dialog_save() {
- this.$refs['updateTemp4'].validate(valid => {
- if (valid) {
- // for (let i = 0; i < this.listUpdate4.length; i++) {
- // var rulesAmount = /^\d+$/
- // if ((this.listUpdate4[i].amount == '' || this.listUpdate4[i].amount == undefined) && parseFloat(this.listUpdate4[i].amount) !== 0) {
- // this.$message({
- // type: 'error',
- // message: '采购数量不可为空',
- // duration: 2000
- // })
- // return false
- // } else if (!rulesAmount.test(parseFloat(this.listUpdate4[i].amount))) {
- // this.$message({
- // type: 'error',
- // message: '采购数量不可为空',
- // duration: 2000
- // })
- // return false
- // }
- // }
- for (let i = 0; i < this.listUpdate4.length; i++) {
- console.log(this.listUpdate4[i].amount)
- var rulesAmount = /^\d+$/
- if ((this.listUpdate4[i].amount == '' || this.listUpdate4[i].amount == undefined) && parseFloat(this.listUpdate4[i].amount) !== 0) {
- this.$message({
- type: 'error',
- message: '采购数量不可为空',
- duration: 2000
- })
- return false
- } else if (!rulesAmount.test(parseFloat(this.listUpdate4[i].amount))) {
- this.$message({
- type: 'error',
- message: '采购数量请输入大于等于0的整数',
- duration: 2000
- })
- return false
- } else {
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- this.postDataPramas.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listUpdate4 }}
- this.postDataPramas.data[0].children = []
- this.postDataPramas.data[0].children[0] = { 'name': 'updatePDbuydetail', 'type': 'e', 'parammaps': {
- amount: '@insertSpotList.amount',
- id: '@insertSpotList.id'
- }}
- this.postDataPramas.data[1] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
- id: this.updateTemp4.id,
- statue: '0',
- empId: Cookies.get('employeid')
- }}
- }
- }
- 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.dialogFormVisibleUpdate4 = false
- this.getdataListParm4.parammaps.inputDatetime = ''
- this.get_table_data4()
- this.$notify({
- title: '',
- message: '保存成功',
- type: 'success',
- duration: 2000
- })
- }
- })
- return true
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" >
- .el-table .warning-row {
- background: red;
- }
- .el-table .color-row {
- background: #eee;
- }
- </style>
- <style lang="scss" scoped>
- .app-contentClose .el-form-item__content {
- margin-left: 0 !important;
- }
- </style>
- <style lang="scss" scoped>
- .app-contentConfirmationSheet {
- margin-bottom: 50px;
- }
- .app-content {
- background: #eee;
- margin-bottom: 50px;
- .title {
- line-height: 40px;
- div {
- float: left;
- margin-right: 50px;
- b {
- padding-left: 10px;
- }
- }
- }
- .total {
- margin-left: 80%;
- line-height: 30px;
- }
- }
- </style>
|