123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397 |
- <template>
- <div>
- <div v-if="pageDisplay" class="app-container">
- <formComponent
- v-if="searchWhether"
- :formOption="formOption"
- :dataList="dataList"
- :inDex="inDex"
- ref="avatar"
- @submitForm="submitForm"
- @returnToForm="returnToForm"
- />
- <listComponent
- :tableData="tableData"
- @selectionbox="selectionbox"
- @see="viewMethod"
- @modify="modification"
- @deletion="deletion"
- @buttonList="buttonList"
- @showSearch="showSearch"
- @feedback="feedback"
- @getList="getList"
- :hasPermi="hasPermi"
- :isItHidden="isItHidden"
- :customButton="customButton"
- :listStyle="listStyle"
- :queryList="queryList"
- :setRowList="setRowList"
- :tatolLabel="tatolLabel"
- />
- <!-- <el-pagination-->
- <!-- style="float: right;margin-top: 10px"-->
- <!-- @size-change="handleSizeChange"-->
- <!-- @current-change="handleCurrentChange"-->
- <!-- :page-sizes="[10, 20, 30, 50]"-->
- <!-- :page-size="this.formDataList.pageSize"-->
- <!-- background-->
- <!-- layout="sizes, prev, pager, next"-->
- <!-- :total="total"-->
- <!-- >-->
- <!-- </el-pagination>-->
- <div style="float: right; margin-bottom: 10px">
- <pagination
- v-show="total > 0"
- :total="total"
- :page.sync="formDataList.pageNum"
- :limit.sync="formDataList.pageSize"
- @pagination="feedback('搜索')"
- :page-sizes="[10, 100, 200, 500, 1000]"
- />
- </div>
- </div>
- <div v-else class="app-container">
- <div style="display: flex; margin-bottom: 10px">
- <el-breadcrumb>
- <el-breadcrumb-item style="margin-top: -7px">
- <el-button
- style="margin-left: 10px"
- size="mini"
- type="danger"
- plain
- @click="backToList"
- icon="el-icon-arrow-left"
- >
- 返回列表
- </el-button>
- </el-breadcrumb-item>
- </el-breadcrumb>
- </div>
- <h1 style="text-align: center; margin-top: -42px">销售出库单</h1>
- <formComponent
- v-if="searchWhether"
- :formOption="contentOption"
- :dataList="dataList"
- :inDex="inDex"
- ref="avatar"
- @writeOff="writeOff"
- @submitForm="submitForm"
- @returnToForm="returnToForm"
- @submitAndSave="submitAndSave"
- @selectTrigger="selectTrigger"
- />
- <listComponent
- ref="listComponent"
- :tableData="contentList"
- @selectionbox="selectionbox"
- @see="viewMethod"
- @modify="modification"
- @deletion="deletion"
- @buttonList="buttonList"
- @showSearch="showSearch"
- @feedback="feedback"
- @getList="getList"
- @deletRows="deletRows"
- @totalAmount="totalAmount"
- @change="change"
- :tatolLabel="tatolLabel"
- :isItHidden="isItHidden"
- :hasPermi="hasPermi"
- :customButton="contentButton"
- :listStyle="contentStyle"
- :queryList="purchaseList"
- :setRowList="setRowList"
- :listData="listData"
- />
- </div>
- <add-or-update
- v-if="addOrUpdateVisible"
- ref="addOrUpdate"
- @refreshDataList="getDataList"
- ></add-or-update>
- <approval-comments
- v-if="addOrUpdateVisib"
- ref="ApprovalComments"
- @refreshDataList="returnData"
- ></approval-comments>
- <div class="print_div">
- <el-dialog
- :visible.sync="dialogVisible"
- :fullscreen="true"
- width="70%"
- style="background-color: #1c84c6"
- >
- <div ref="print" style="color: #000000">
- <div v-if="formList.fsbuName === '青岛安品餐饮服务有限公司'">
- <h1 style="text-align: center; font-weight: bold">
- {{ formList.fsbuName }}
- </h1>
- <div
- style="
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
- "
- >
- <div style="width: 250px; height: 20px; font-size: 14px">
- 客户项目:{{ projectName }}
- </div>
- <div style="width: 200px; height: 20px; font-size: 14px">
- 销售出库单
- </div>
- <div style="width: 250px; height: 20px; font-size: 14px">
- 出库日期:{{ formList.fBsdate }}
- </div>
- </div>
- <div
- style="
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
- "
- >
- <div style="width: 250px; height: 20px; font-size: 14px">
- 公司电话:{{ formList.fsbuTel }}
- </div>
- <div style="width: 250px; height: 20px; font-size: 14px">
- 编号:{{ formList.corpsNo
- }}{{
- formList.fBillno
- ? formList.fBillno.substring(2)
- : formList.fBillno
- }}
- </div>
- </div>
- </div>
- <div v-else-if="formList.fsbuName === '青岛安品餐饮管理有限公司'">
- <h1 style="text-align: center; font-weight: bold">
- {{ formList.fsbuName }}-出库单
- </h1>
- <div
- style="
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
- "
- >
- <div style="width: 250px; height: 20px; font-size: 14px">
- 客户项目:{{ projectName }}
- </div>
- <!-- <div style="width: 200px;height: 20px;font-size: 14px;">销售出库单</div>-->
- <div style="width: 250px; height: 20px; font-size: 14px">
- 出库日期:{{ formList.fBsdate }}
- </div>
- </div>
- <div
- style="
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
- "
- >
- <div style="width: 250px; height: 20px; font-size: 14px">
- 公司电话:{{ formList.fsbuTel }}
- </div>
- <div style="width: 250px; height: 20px; font-size: 14px">
- 编号:{{ formList.corpsNo
- }}{{
- formList.fBillno
- ? formList.fBillno.substring(2)
- : formList.fBillno
- }}
- </div>
- </div>
- </div>
- <div v-else-if="formList.fsbuName === '青岛弘益祥粮油有限公司'">
- <h1 style="text-align: center; font-weight: bold">
- {{ formList.fsbuName }}
- </h1>
- <div
- style="
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
- "
- >
- <div style="width: 250px; height: 20px; font-size: 14px">
- 公司电话:{{ formList.fsbuTel }}
- </div>
- <div style="width: 200px; height: 20px; font-size: 14px">
- 销售单
- </div>
- <div style="width: 250px; height: 20px; font-size: 14px">
- 出库日期:{{ formList.fBsdate }}
- </div>
- </div>
- <div
- style="
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
- "
- >
- <div style="width: 250px; height: 20px; font-size: 14px">
- 客户项目:{{ projectName }}
- </div>
- <div style="width: 250px; height: 20px; font-size: 14px">
- 编号:{{ formList.corpsNo
- }}{{
- formList.fBillno
- ? formList.fBillno.substring(2)
- : formList.fBillno
- }}
- </div>
- </div>
- </div>
- <div v-else-if="formList.fsbuName === '青岛锦圣康海产品有限公司'">
- <h1 style="text-align: center; font-weight: bold">
- {{ formList.fsbuName }}-销售单
- </h1>
- <div
- style="
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
- "
- >
- <div style="width: 250px; height: 20px; font-size: 14px">
- 编号:{{ formList.corpsNo
- }}{{
- formList.fBillno
- ? formList.fBillno.substring(2)
- : formList.fBillno
- }}
- </div>
- <!-- <div style="width: 200px;height: 20px;font-size: 14px;">销售出库单</div>-->
- <div style="width: 250px; height: 20px; font-size: 14px">
- 公司电话:{{ formList.fsbuTel }}
- </div>
- </div>
- <div
- style="
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
- "
- >
- <div style="width: 250px; height: 20px; font-size: 14px">
- 出库日期:{{ formList.fBsdate }}
- </div>
- <div style="width: 250px; height: 20px; font-size: 14px">
- 客户项目:{{ projectName }}
- </div>
- </div>
- </div>
- <div v-else-if="formList.fsbuName === '青岛盛元嘉蔬菜配送有限公司'">
- <h1 style="text-align: center; font-weight: bold">
- 销售出库-{{ formList.fsbuName }}
- </h1>
- <div
- style="
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
- "
- >
- <div style="width: 250px; height: 20px; font-size: 14px">
- 客户项目:{{ projectName }}
- </div>
- <!-- <div style="width: 200px;height: 20px;font-size: 14px;">销售出库单</div>-->
- <div style="width: 250px; height: 20px; font-size: 14px">
- 编号:{{ formList.corpsNo
- }}{{
- formList.fBillno
- ? formList.fBillno.substring(2)
- : formList.fBillno
- }}
- </div>
- </div>
- <div
- style="
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
- "
- >
- <div style="width: 250px; height: 20px; font-size: 14px">
- 出库日期:{{ formList.fBsdate }}
- </div>
- <div style="width: 250px; height: 20px; font-size: 14px">
- 公司电话:{{ formList.fsbuTel }}
- </div>
- </div>
- </div>
- <div v-else-if="formList.fsbuName === '青岛优利安肉食有限公司'">
- <h1 style="text-align: center; font-weight: bold">
- 销售单 {{ formList.fsbuName }}
- </h1>
- <div
- style="
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
- "
- >
- <div style="width: 250px; height: 20px; font-size: 14px">
- 编号:{{ formList.corpsNo
- }}{{
- formList.fBillno
- ? formList.fBillno.substring(2)
- : formList.fBillno
- }}
- </div>
- <!-- <div style="width: 200px;height: 20px;font-size: 14px;">销售出库单</div>-->
- <div style="width: 250px; height: 20px; font-size: 14px">
- 客户项目:{{ projectName }}
- </div>
- </div>
- <div
- style="
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
- "
- >
- <div style="width: 250px; height: 20px; font-size: 14px">
- 出库日期:{{ formList.fBsdate }}
- </div>
- <div style="width: 250px; height: 20px; font-size: 14px">
- 公司电话:{{ formList.fsbuTel }}
- </div>
- </div>
- </div>
- <div v-else>
- <h1 style="text-align: center; font-weight: bold">
- {{ formList.fsbuName }}
- </h1>
- <div
- style="
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
- "
- >
- <div style="width: 250px; height: 20px; font-size: 14px">
- 客户项目:{{ projectName }}
- </div>
- <div style="width: 200px; height: 20px; font-size: 14px">
- 销售出库单
- </div>
- <div style="width: 250px; height: 20px; font-size: 14px">
- 出库日期:{{ formList.fBsdate }}
- </div>
- </div>
- <div
- style="
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
- "
- >
- <div style="width: 250px; height: 20px; font-size: 14px">
- 公司电话:{{ formList.fsbuTel }}
- </div>
- <div style="width: 250px; height: 20px; font-size: 14px">
- 编号:{{ formList.corpsNo
- }}{{
- formList.fBillno
- ? formList.fBillno.substring(2)
- : formList.fBillno
- }}
- </div>
- </div>
- </div>
- <table
- class="table table-striped table-bordered"
- align="center"
- valign="center"
- >
- <tr>
- <td class="column" style="width: 8%">行号</td>
- <td class="column" style="width: 20%">物料名称</td>
- <td class="column" style="width: 10%">规格型号</td>
- <td class="column" style="width: 8%">单位</td>
- <td class="column" style="width: 10%">数量</td>
- <td class="column" style="width: 10%">单价</td>
- <td class="column" style="width: 10%">金额</td>
- <td class="column" style="width: 10%">备注</td>
- </tr>
- <tr v-for="(item, index) in contentList" :key="index">
- <td class="column">{{ index + 1 }}</td>
- <td class="column">{{ item.feeName }}</td>
- <td class="column">{{ item.fCurrencyName }}</td>
- <td class="column">{{ item.fFeeunitName }}</td>
- <td class="column">{{ item.fQty }}</td>
- <td class="column">
- {{
- item.fUnitprice
- ? parseFloat(item.fUnitprice).toFixed(2)
- : item.fUnitprice
- }}
- </td>
- <td class="column">
- {{
- item.fAmount
- ? parseFloat(item.fAmount).toFixed(2)
- : item.fAmount
- }}
- </td>
- <td class="column">{{ item.remark }}</td>
- </tr>
- <!-- <tr>-->
- <!-- <td class="column" colspan="2">大写金额:</td>-->
- <!-- <td class="column" colspan="2" style="text-align: left">100亿元</td>-->
- <!-- <td class="column">总金额:</td>-->
- <!-- <td class="column" colspan="3">{{formList.fMoney}}</td>-->
- <!-- </tr>-->
- </table>
- <table
- class="table table-striped table-bordered"
- align="center"
- valign="center"
- >
- <tr>
- <td
- class="column"
- colspan="2"
- style="border-top: none; width: 15%"
- >
- 大写总金额:
- </td>
- <td
- class="column"
- colspan="2"
- style="text-align: left; border-top: none; width: 40%"
- >
- {{ chineseStr }}
- </td>
- <td class="column" style="border-top: none; width: 15%">
- 小写总金额:
- </td>
- <td
- class="column"
- colspan="3"
- style="border-top: none; text-align: left; width: 30%"
- >
- {{
- formList.fMoney
- ? parseFloat(formList.fMoney).toFixed(2)
- : formList.fMoney
- }}
- </td>
- </tr>
- </table>
- <div
- style="
- display: flex;
- justify-content: space-between;
- margin-top: 20px;
- "
- >
- <div style="width: 200px; height: 20px; font-size: 14px">
- 发货人:{{ formList.manage }}
- </div>
- <div style="width: 200px; height: 20px; font-size: 14px">
- 收货:
- </div>
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="Printing">打印</el-button>
- </span>
- </el-dialog>
- </div>
- </div>
- </template>
- <script>
- import { select } from "@/api/system/set";
- import {
- listQuery,
- submit,
- viewSingle,
- deleteQuery,
- productName,
- queryItem,
- company,
- warehouse,
- listDelete,
- tableDeleteQuery,
- exportDetail,
- confirmDeletion,
- pleaseCheck,
- revoke,
- queryUserVal,
- getName,
- revokeBill,
- copyNew,
- printingTiem,
- getExport,
- } from "@/api/purchaseIssue/index";
- import Cookies from "js-cookie";
- import Global from "@/layout/components/global";
- import moment from "moment";
- export default {
- name: "index",
- data() {
- return {
- form: {},
- before: "",
- hasPermi: {
- lookup: ["anpin:stockControl:query"],
- disappear: ["anpin:stockControl:remove"],
- },
- addOrUpdateVisib: false,
- addOrUpdateVisible: false,
- chineseStr: 0,
- total: 0,
- formDataList: {
- fBilltype: "XS",
- pageSize: 10,
- pageNum: 1,
- },
- formList: {},
- tatolLabel: ["金额"],
- dialogVisible: false,
- listData: {
- fFeeid: [],
- fFeeunitid: [],
- fStltypeid: [],
- },
- setTimeout: "",
- searchWhether: true,
- pageDisplay: true,
- projectName: "",
- dataList: {
- fGoodsid: [],
- fSbu: [],
- fWarehouseid: [],
- fCorpid: [],
- fMarketTypid: [],
- fFeeid: [],
- },
- contentList: [],
- inDex: 4,
- tableData: [],
- selection: [],
- tableList: [],
- isItHidden: true,
- listStyle: [
- {
- surface: "1",
- label: "serialNumber",
- name: "序号",
- checked: 0,
- width: 100,
- onabort: "",
- },
- {
- surface: "2",
- label: "fBillno",
- name: "系统编号",
- checked: 0,
- width: 100,
- onabort: "",
- },
- {
- surface: "3",
- label: "projectName",
- name: "项目名称",
- checked: 0,
- width: 100,
- onabort: "",
- },
- {
- surface: "4",
- label: "corpName",
- name: "客户名称",
- checked: 0,
- width: 100,
- onabort: "",
- },
- {
- surface: "5",
- label: "fMoney",
- name: "金额",
- checked: 0,
- width: 100,
- onabort: "",
- },
- {
- surface: "6",
- label: "fCurrencyName",
- name: "规格型号",
- checked: 0,
- width: 100,
- onabort: "",
- },
- {
- surface: "7",
- label: "createTime",
- name: "制单日期",
- checked: 0,
- width: 100,
- onabort: "",
- },
- {
- surface: "8",
- label: "createBy",
- name: "申请人",
- checked: 0,
- width: 100,
- onabort: "",
- },
- {
- surface: "9",
- label: "fBillstatusName",
- name: "状态",
- checked: 0,
- width: 100,
- onabort: "",
- },
- {
- surface: "10",
- label: "fReviewDate",
- name: "审核日期",
- checked: 0,
- width: 100,
- onabort: "",
- },
- {
- surface: "11",
- label: "fBsdate",
- name: "出库日期",
- checked: 0,
- width: 100,
- onabort: "",
- },
- {
- surface: "12",
- label: "remark",
- name: "备注",
- checked: 0,
- width: 100,
- onabort: "",
- },
- {
- surface: "13",
- label: "fPrintLog",
- name: "打印日志",
- checked: 0,
- width: 100,
- onabort: "",
- },
- {
- surface: "14",
- label: "fsbuName",
- name: "开票公司",
- checked: 0,
- width: 100,
- onabort: "",
- },
- {
- surface: "15",
- label: "operation",
- name: "操作",
- checked: 0,
- width: 160,
- fixed: "right",
- operation: "1",
- onabort: "",
- },
- ],
- contentStyle: [
- {
- surface: "1",
- label: "serialNumber",
- name: "序号",
- checked: 0,
- width: 100,
- disabled: false,
- onabort: "",
- },
- {
- surface: "2",
- label: "fFeeid",
- name: "品名",
- checked: 0,
- width: 100,
- onabort: "",
- disabled: false,
- changeable: 1,
- },
- {
- surface: "3",
- label: "fCurrencyName",
- name: "规格",
- checked: 0,
- width: 100,
- onabort: "",
- disabled: false,
- },
- {
- surface: "4",
- label: "fUnitprice",
- name: "单价",
- checked: 0,
- width: 100,
- disabled: false,
- onabort:
- 'this.value=this.value.replace(/[^\\-?\\d.]/g,"").replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/, "$1$2.$3")',
- changeable: 2,
- },
- {
- surface: "5",
- label: "fPurchase",
- name: "数量",
- checked: 0,
- width: 100,
- onabort: "",
- disabled: false,
- changeable: 2,
- },
- {
- surface: "6",
- label: "fQty",
- name: "实际数量",
- checked: 0,
- width: 100,
- onabort: "",
- disabled: false,
- changeable: 2,
- },
- {
- surface: "7",
- label: "fFeeunitid",
- name: "计量单位",
- checked: 0,
- width: 100,
- onabort: "",
- disabled: false,
- changeable: 1,
- },
- {
- surface: "8",
- label: "fAmount",
- name: "金额",
- checked: 0,
- width: 100,
- onabort:
- 'this.value=this.value.replace(/[^\\-?\\d.]/g,"").replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/, "$1$2.$3")',
- disabled: false,
- changeable: 2,
- },
- {
- surface: "9",
- label: "remark",
- name: "备注",
- checked: 0,
- width: 100,
- onabort: "",
- disabled: false,
- changeable: 2,
- },
- {
- surface: "10",
- label: "createTime",
- name: "制单日期",
- checked: 0,
- disabled: false,
- width: 100,
- onabort: "",
- },
- // {
- // surface: '11',
- // label: 'createBy',
- // name: '申请人',
- // disabled: false,
- // checked: 0,
- // width: 100,
- // onabort: ''
- // }, {
- // surface: '12',
- // label: 'fReviewDate',
- // name: '审核日期',
- // checked: 0,
- // disabled: false,
- // width: 100,
- // onabort: ''
- // },
- {
- surface: "13",
- label: "operation",
- name: "操作",
- checked: 0,
- disabled: false,
- fixed: "right",
- width: 160,
- operation: "2",
- onabort: "",
- },
- ],
- queryList: {
- tableName: "销售出库",
- columnList: [],
- },
- purchaseList: {
- tableName: "销售出库详情",
- columnList: [],
- },
- setRowList: [],
- customButton: [
- {
- type: "primary",
- size: "mini",
- icon: "el-icon-edit",
- name: "新单",
- disabled: false,
- hasPermi: ["anpin:stockControl:anPingApply"],
- },
- // {
- // type:'warning',
- // size:'mini',
- // icon:'el-icon-edit',
- // name:'立即修改',
- // disabled:false,
- // },
- {
- type: "warning",
- size: "mini",
- icon: "el-icon-upload2",
- name: "导出",
- disabled: false,
- hasPermi: ["anpin:stockControl:export"],
- },
- {
- type: "success",
- size: "mini",
- icon: "el-icon-c-scale-to-original",
- name: "复制新单",
- disabled: false,
- hasPermi: ["anpin:stockControl:generateReceipts"],
- },
- ],
- contentButton: [
- {
- type: "primary",
- size: "mini",
- icon: "el-icon-plus",
- name: "录入明细",
- disabled: false,
- },
- {
- type: "primary",
- size: "mini",
- icon: "el-icon-plus",
- name: "保存",
- plain: true,
- disabled: false,
- },
- {
- type: "primary",
- size: "mini",
- icon: "el-icon-edit-outline",
- name: "请核",
- disabled: false,
- },
- {
- type: "success",
- size: "mini",
- icon: "el-icon-edit",
- name: "修改",
- disabled: false,
- },
- {
- type: "primary",
- size: "mini",
- icon: "el-icon-plus",
- name: "新单",
- nameTwo: "详情页",
- plain: true,
- disabled: false,
- },
- {
- type: "primary",
- size: "mini",
- icon: "el-icon-plus",
- name: "复制新单",
- nameTwo: "详情页",
- plain: true,
- disabled: false,
- },
- {
- type: "primary",
- size: "mini",
- icon: "el-icon-edit-outline",
- name: "打印",
- disabled: false,
- },
- {
- type: "warning",
- size: "mini",
- icon: "el-icon-download",
- name: "导出明细",
- disabled: false,
- },
- // {
- // type: 'info',
- // size: 'mini',
- // icon: 'el-icon-edit-outline',
- // name: '打印',
- // disabled: false
- // },
- {
- type: "info",
- size: "mini",
- icon: "el-icon-edit-outline",
- name: "申请发票",
- disabled: false,
- },
- ],
- formOption: [
- {
- span: 6,
- label: "fBillno",
- name: "系统编号",
- inputType: 2,
- width: 200,
- labelSize: "80",
- rules: [{ required: false, message: " " }],
- },
- {
- span: 6,
- label: "fGoodsid",
- name: "项目名称",
- inputType: 1,
- width: 200,
- labelSize: "80",
- rules: [{ required: false, message: " " }],
- },
- {
- span: 6,
- label: "fCorpid",
- name: "客户名称",
- inputType: 1,
- width: 200,
- labelSize: "80",
- rules: [{ required: false, message: " " }],
- },
- {
- span: 6,
- label: "timeInterval",
- name: "出库日期",
- inputType: 3,
- width: 300,
- labelSize: "80",
- rules: [{ required: false, message: " " }],
- },
- {
- span: 6,
- label: "createBy",
- name: "申请人",
- inputType: 2,
- width: 200,
- labelSize: "80",
- rules: [{ required: false, message: " " }],
- },
- {
- span: 6,
- label: "fWarehouseid",
- name: "仓库",
- inputType: 1,
- width: 200,
- labelSize: "80",
- rules: [{ required: false, message: " " }],
- },
- {
- span: 6,
- label: "fFeeid",
- name: "品名",
- inputType: 1,
- width: 200,
- labelSize: "80",
- rules: [{ required: false, message: " " }],
- },
- {
- span: 6,
- label: "fSbu",
- name: "开票公司",
- inputType: 1,
- width: 200,
- labelSize: "80",
- rules: [{ required: false, message: " " }],
- },
- ],
- contentOption: [
- {
- index: "1",
- span: 6,
- label: "fBillno",
- name: "系统编号",
- inputType: 2,
- width: 200,
- labelSize: "80",
- disabled: true,
- rules: [{ required: false, message: " " }],
- },
- {
- index: "2",
- span: 6,
- label: "fGoodsid",
- name: "项目名称",
- inputType: 1,
- width: 200,
- labelSize: "80",
- disabled: true,
- rules: [{ required: true, message: " " }],
- },
- {
- index: "5",
- span: 6,
- label: "corpsName",
- name: "客户名称",
- inputType: 2,
- width: 200,
- labelSize: "80",
- disabled: true,
- rules: [{ required: false, message: " " }],
- },
- {
- index: "3",
- span: 6,
- label: "fMarketTypid",
- name: "出库类别",
- inputType: 1,
- width: 200,
- labelSize: "80",
- disabled: true,
- rules: [{ required: false, message: " " }],
- },
- {
- index: "4",
- span: 6,
- label: "fStudentsWeight",
- name: "人数",
- inputType: 2,
- onabort: "this.value=this.value.replace(/[^0-9]/g,'')",
- width: 200,
- disabled: true,
- labelSize: "80",
- rules: [{ required: true, message: " " }],
- },
- {
- index: "6",
- span: 6,
- label: "fWarehouseid",
- name: "仓库",
- inputType: 1,
- width: 200,
- disabled: true,
- labelSize: "80",
- rules: [{ required: true, message: " " }],
- },
- {
- index: "7",
- span: 6,
- label: "fBsdate",
- name: "出库日期",
- inputType: 6,
- width: 200,
- disabled: true,
- labelSize: "80",
- rules: [{ required: true, message: " " }],
- },
- // {
- // index:'8',
- // span: 6,
- // label: 'createBy',
- // name: '申请人',
- // inputType: 2,
- // width: 200,
- // disabled: true,
- // labelSize: '80',
- // rules: [{ required: false, message: ' ' }]
- // },
- {
- index: "9",
- span: 6,
- label: "fSbu",
- name: "开票公司",
- inputType: 1,
- width: 200,
- disabled: true,
- labelSize: "80",
- rules: [{ required: true, message: " " }],
- },
- {
- index: "10",
- span: 6,
- label: "remark",
- name: "备注",
- inputType: 4,
- disabled: true,
- width: 200,
- labelSize: "80",
- rules: [{ required: false, message: " " }],
- },
- ],
- pendingPage: "",
- };
- },
- activated() {
- if (this.$route.query.list) {
- this.pendingPage = JSON.parse(this.$route.query.list);
- this.homePage();
- }
- },
- created() {
- //获取登陆人
- queryUserVal().then((response) => {
- this.lander = response.user.userName;
- });
- let data = {
- tableName: this.queryList.tableName,
- userId: Cookies.get("userName"),
- };
- this.getRow(data);
- let y = moment(Date.parse(new Date())).format("YYYY-MM-DD");
- this.$set(this.formDataList, "timeInterval", [
- y + " 00:00:00",
- y + " 23:59:59",
- ]);
- this.query(this.formDataList);
- productName().then((res) => {
- console.log(res);
- if (res.code === 200) {
- for (let item in res.rows) {
- this.dataList.fFeeid.push({
- label: res.rows[item].fName,
- value: res.rows[item].fId,
- });
- this.listData.fFeeid.push({
- label: res.rows[item].fName,
- value: res.rows[item].fId,
- fFeeunitid: res.rows[item].fFeeunitid,
- fCurrency: res.rows[item].fCurrency,
- });
- }
- }
- });
- this.getDicts("data_unitfees").then((res) => {
- for (let item in res.data) {
- this.listData.fFeeunitid.push({
- label: res.data[item].dictLabel,
- value: JSON.parse(res.data[item].dictValue),
- });
- }
- });
- this.getDicts("f_paymode").then((res) => {
- for (let item in res.data) {
- this.listData.fStltypeid.push({
- label: res.data[item].dictLabel,
- value: JSON.parse(res.data[item].dictValue),
- });
- }
- });
- this.getDicts("f_deliveryCategory").then((res) => {
- for (let item in res.data) {
- this.dataList.fMarketTypid.push({
- label: res.data[item].dictLabel,
- value: JSON.parse(res.data[item].dictValue),
- });
- }
- });
- queryItem().then((res) => {
- for (let item in res.data) {
- this.dataList.fGoodsid.push({
- label: res.data[item].projectName,
- value: res.data[item].fId,
- personNaem: res.data[item].personNaem,
- corpsName: res.data[item].corpsName,
- fCorpid: res.data[item].fCorpid,
- });
- }
- });
- //查询仓库
- warehouse().then((res) => {
- for (let item in res.rows) {
- this.dataList.fWarehouseid.push({
- label: res.rows[item].fName,
- value: res.rows[item].fId,
- });
- }
- });
- this.fCompany(3);
- this.fCompany(2);
- },
- methods: {
- toChies(amount) {
- //形参
- this.chineseStr = 0;
- // 汉字的数字
- const cnNums = [
- "零",
- "壹",
- "贰",
- "叁",
- "肆",
- "伍",
- "陆",
- "柒",
- "捌",
- "玖",
- ];
- // 基本单位
- const cnIntRadice = ["", "拾", "佰", "仟"];
- // 对应整数部分扩展单位
- const cnIntUnits = ["", "万", "亿", "兆"];
- // 对应小数部分单位
- const cnDecUnits = ["角", "分"];
- // 整数金额时后面跟的字符
- const cnInteger = "整";
- // 整型完以后的单位
- const cnIntLast = "元";
- // 最大处理的数字
- const maxNum = 9999999999999999.99;
- // 金额整数部分
- let integerNum;
- // 金额小数部分
- let decimalNum;
- // 输出的中文金额字符串
- let chineseStr = "";
- // 分离金额后用的数组,预定义
- let parts;
- if (amount === "") {
- return "";
- }
- amount = parseFloat(amount);
- if (amount >= maxNum) {
- // 超出最大处理数字
- return "";
- }
- if (amount === 0) {
- chineseStr = cnNums[0] + cnIntLast + cnInteger;
- return chineseStr;
- }
- // 转换为字符串
- amount = amount.toString();
- if (amount.indexOf(".") === -1) {
- integerNum = amount;
- decimalNum = "";
- } else {
- parts = amount.split(".");
- integerNum = parts[0];
- decimalNum = parts[1].substr(0, 4);
- }
- // 获取整型部分转换
- if (parseInt(integerNum, 10) > 0) {
- let zeroCount = 0;
- const IntLen = integerNum.length;
- for (let i = 0; i < IntLen; i++) {
- const n = integerNum.substr(i, 1);
- const p = IntLen - i - 1;
- const q = p / 4;
- const m = p % 4;
- if (n === "0") {
- zeroCount++;
- } else {
- if (zeroCount > 0) {
- chineseStr += cnNums[0];
- }
- // 归零
- zeroCount = 0;
- //alert(cnNums[parseInt(n)])
- chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
- }
- if (m === 0 && zeroCount < 4) {
- chineseStr += cnIntUnits[q];
- }
- }
- chineseStr += cnIntLast;
- }
- // 小数部分
- if (decimalNum !== "") {
- const decLen = decimalNum.length;
- for (let i = 0; i < decLen; i++) {
- const n = decimalNum.substr(i, 1);
- if (n !== "0") {
- chineseStr += cnNums[Number(n)] + cnDecUnits[i];
- }
- }
- }
- if (chineseStr === "") {
- chineseStr += cnNums[0] + cnIntLast + cnInteger;
- } else if (decimalNum === "") {
- chineseStr += cnInteger;
- }
- if (chineseStr[chineseStr.length - 1] !== "整") {
- this.chineseStr = chineseStr + "整";
- } else {
- this.chineseStr = chineseStr;
- }
- // return chineseStr;
- },
- change(scope) {
- for (let item in this.contentList) {
- for (let li in this.listData.fFeeid) {
- if (this.contentList[item].fFeeid == this.listData.fFeeid[li].value) {
- this.$set(
- this.contentList[item],
- "fFeeunitid",
- this.listData.fFeeid[li].fFeeunitid
- );
- this.$set(
- this.contentList[item],
- "fCurrencyName",
- this.listData.fFeeid[li].fCurrency
- );
- }
- }
- }
- },
- homePage() {
- let date = this.$route.query;
- if (this.$route.query.list) {
- console.log(this.$route.query.list);
- // this.contentButton = this.$options.data().contentButton
- // this.contentButton.push(JSON.parse(this.$route.query.list))
- console.log(this.contentButton);
- let scope = {
- row: {
- fId: JSON.parse(this.$route.query.data).billId,
- },
- };
- this.viewMethod(scope);
- } else {
- this.pageDisplay = true;
- }
- },
- // 查看审批流
- getDataList() {
- this.addOrUpdateVisible = false;
- },
- returnData() {
- this.addOrUpdateVisib = false;
- this.open = false;
- this.cancelTwo();
- },
- addOrUpdateHandle() {
- this.addOrUpdateVisible = true;
- this.$nextTick(() => {
- this.$refs.addOrUpdate.init(this.$refs.avatar.form.fId, 550);
- });
- },
- //首页审批跳转关闭返回首页
- cancelTwo() {
- let view = {};
- if (this.pendingPage.pendingPage) {
- view = {
- fullPath: "/morePage/stock?open=true",
- hash: "",
- matched: Array(2),
- meta: Object,
- name: "MorePage/stock",
- params: Object,
- path: "/morePage/stock",
- query: Object,
- title: "待审数据",
- };
- this.$router.push({ path: "/morePage/stock" });
- } else {
- view = {
- fullPath: "/purchaseIssue",
- hash: "",
- matched: Array(2),
- meta: Object,
- name: "PurchaseIssue",
- params: Object,
- path: "/purchaseIssue",
- query: Object,
- title: "销售出库",
- };
- this.$router.push({ path: "/index" });
- }
- this.$store
- .dispatch("tagsView/delView", view)
- .then(({ visitedViews }) => {
- if (this.isActive(view)) {
- this.toLastView(visitedViews, view);
- }
- });
- Global.$emit("removeCache", "closeSelectedTag", view);
- },
- handleSizeChange(val) {
- this.formDataList.pageSize = val;
- this.query(this.formDataList);
- },
- handleCurrentChange(val) {
- this.formDataList.pageNum = val;
- this.query(this.formDataList);
- },
- //计算金额
- totalAmount(scope, item) {
- if (item.label === "fAmount") {
- if (scope.row.fAmount && scope.row.fQty) {
- this.$set(
- scope.row,
- "fUnitprice",
- (scope.row.fAmount / scope.row.fQty).toFixed(2)
- );
- }
- }
- if (item.label === "fUnitprice" || item.label === "fQty") {
- if (scope.row.fUnitprice && scope.row.fQty) {
- this.$set(
- scope.row,
- "fAmount",
- (scope.row.fUnitprice * scope.row.fQty).toFixed(2)
- );
- }
- }
- },
- //查询公司
- fCompany(name) {
- company(name).then((res) => {
- console.log(res);
- if (name == 3) {
- this.dataList.fCorpid = [];
- for (let item in res.data) {
- this.dataList.fCorpid.push({
- label: res.data[item].fName,
- value: res.data[item].fId,
- });
- }
- } else if (name == 2) {
- this.dataList.fSbu = [];
- for (let item in res.data) {
- this.dataList.fSbu.push({
- label: res.data[item].fName,
- value: res.data[item].fId,
- });
- }
- }
- });
- },
- //查询主页列数据
- query(data) {
- listQuery(data).then((res) => {
- this.tableData = res.rows;
- this.tableData.forEach((item) => {
- console.log(item.fPrint);
- console.log(item.fPrintLog);
- if (item.fPrint && item.fPrintLog) {
- item.fPrintLog = item.fPrint + "," + item.fPrintLog;
- } else if (item.fPrint || item.fPrintLog == null) {
- item.fPrintLog = item.fPrint;
- } else if (item.fPrint == null || item.fPrintLog) {
- item.fPrintLog = item.fPrintLog;
- } else {
- item.fPrintLog = "";
- }
- // item.fPrintLog = item.fPrint == null && item.fPrintLog == null ? '' :
- // item.fPrint && item.fPrintLog == null? item.fPrint : item.fPrint && item.fPrintLog? item.fPrint + ',' + item.fPrintLog :item.fPrintLog
- });
- console.log(this.tableData);
- this.total = res.total;
- });
- },
- //查询列数据
- getRow(data, list, add, i) {
- select(data).then((res) => {
- if (data.tableName === "销售出库详情") {
- if (res.data.length != 0) {
- this.purchaseList.columnList = res.data.filter(
- (e) => e.checked == 0
- );
- this.purchaseList.columnList = res.data;
- this.setRowList = res.data;
- this.purchaseList.columnList = this.purchaseList.columnList.filter(
- (e) => e.checked == 0
- );
- // this.waitFor = true
- } else {
- // this.waitFor = true
- this.$set(
- this.purchaseList,
- "columnList",
- this.$options.data().contentStyle
- );
- this.setRowList = this.$options.data().contentStyle;
- }
- if (add) {
- this.purchaseList.columnList.forEach(
- (item) => (item.disabled = false)
- );
- } else {
- this.purchaseList.columnList.forEach(
- (item) => (item.disabled = true)
- );
- }
- this.pageDisplay = false;
- this.isItHidden = false;
- this.inDex = this.contentOption.length;
- } else {
- if (res.data.length != 0) {
- this.queryList.columnList = res.data.filter((e) => e.checked == 0);
- this.queryList.columnList = res.data;
- this.setRowList = res.data;
- this.queryList.columnList = this.queryList.columnList.filter(
- (e) => e.checked == 0
- );
- // this.waitFor = true
- } else {
- this.$set(
- this.queryList,
- "columnList",
- this.$options.data().listStyle
- );
- this.setRowList = this.$options.data().listStyle;
- }
- this.$refs.avatar.form = this.form;
- this.pageDisplay = true;
- this.isItHidden = true;
- this.inDex = 4;
- let y = moment(Date.parse(new Date())).format("YYYY-MM-DD");
- if (this.formDataList.timeInterval === undefined) {
- this.$set(this.formDataList, "timeInterval", [
- y + " 00:00:00",
- y + " 23:59:59",
- ]);
- } else {
- this.$set(
- this.formDataList,
- "timeInterval",
- this.formDataList.timeInterval
- );
- }
- this.$refs.avatar.assignmentTime(this.formDataList);
- }
- if (list) {
- this.$refs.avatar.form = list.warehouseBills;
- this.contentList = list.tWarehousebillsfees;
- this.contentButton = this.$options.data().contentButton;
- console.log(this.pendingPage);
- console.log(this.pendingPage.name);
- if (this.pendingPage.name) {
- this.contentButton.push(JSON.parse(this.$route.query.list));
- if (JSON.parse(this.$route.query.list))
- this.$router.push({ query: {} });
- }
- let data = {
- actId: 550,
- id: this.$refs.avatar.form.fId,
- };
- getName(data).then((response) => {
- console.log(response);
- if (response.data.length != 0) {
- this.before = response.data[0].userName;
- if (
- this.$refs.avatar.form.fBillstatus == 6 &&
- this.before == this.lander
- ) {
- console.log(this.contentButton);
- this.contentButton.push({
- type: "warning",
- size: "mini",
- icon: "el-icon-refresh-left",
- name: "撤销出库",
- disabled: false,
- });
- }
- }
- });
- let operator = this.$refs.avatar.form.createBy;
- if (
- this.$refs.avatar.form.fBillstatus == 4 &&
- this.lander === operator
- ) {
- this.contentButton.push({
- type: "danger",
- size: "mini",
- icon: "el-icon-refresh-left",
- name: "撤销审批",
- disabled: false,
- });
- }
- if (this.$refs.avatar.form.fBillstatus > 3) {
- console.log(this.contentButton);
- this.contentButton.push({
- type: "primary",
- size: "mini",
- icon: "el-icon-edit-outline",
- name: "查看审批",
- disabled: false,
- });
- }
- for (let li in this.contentButton) {
- if (this.$refs.avatar.form.fBillstatus < 4) {
- if (
- this.contentButton[li].name == "录入明细" ||
- this.contentButton[li].name == "保存"
- ) {
- this.contentButton[li].disabled = true;
- } else {
- this.contentButton[li].disabled = false;
- }
- } else {
- if (
- this.contentButton[li].name == "录入明细" ||
- this.contentButton[li].name == "保存" ||
- this.contentButton[li].name == "请核" ||
- this.contentButton[li].name == "修改"
- ) {
- this.contentButton[li].disabled = true;
- } else {
- this.contentButton[li].disabled = false;
- }
- }
- }
- }
- if (i == 1) this.submitAnd();
- });
- },
- submitAnd() {
- this.$refs.avatar.form.fId = "";
- this.$refs.avatar.form.fBillno = "";
- this.$refs.avatar.form.fCreateLog = "";
- this.$refs.avatar.form.fBillstatus = 2;
- this.$refs.avatar.form.fPrintLog = "";
- this.$refs.avatar.form.fBillstatus = 2;
- this.$refs.avatar.form.fPrint = 0;
- this.contentList.forEach((item) => (item.fId = ""));
- this.contentOption.forEach((item) => {
- if (
- item.label == "personNaem" ||
- item.label == "corpsName" ||
- item.label == "createBy" ||
- item.label == "fBillno"
- ) {
- item.disabled = true;
- } else {
- item.disabled = false;
- }
- });
- this.purchaseList.columnList.forEach((item) => (item.disabled = false));
- this.contentButton.forEach((item) => (item.disabled = false));
- this.contentStyle.forEach((item) => (item.disabled = false));
- },
- returnToForm(row) {},
- //查看
- viewMethod(scope, res, i) {
- console.log(res);
- if (this.form.length !== undefined) this.form = this.$refs.avatar.form;
- if (res) {
- this.contentButton.forEach((item) => {
- item.disabled = false;
- this.purchaseList.columnList.forEach(
- (item) => (item.disabled = false)
- );
- this.contentStyle.forEach((item) => (item.disabled = false));
- this.contentOption.forEach((item) => {
- if (
- item.label == "personNaem" ||
- item.label == "corpsName" ||
- item.label == "createBy" ||
- item.label == "fBillno"
- ) {
- item.disabled = true;
- } else {
- item.disabled = false;
- }
- });
- });
- } else {
- this.contentOption.forEach((item) => (item.disabled = true));
- this.contentStyle.forEach((item) => (item.disabled = true));
- }
- viewSingle(scope.row.fId).then((res) => {
- console.log(res);
- if (res.code === 200) {
- let data = {
- tableName: this.purchaseList.tableName,
- userId: Cookies.get("userName"),
- };
- let list = {
- warehouseBills: res.data.warehouseBills,
- tWarehousebillsfees: res.data.tWarehousebillsfees,
- };
- this.getRow(data, list, "", i);
- }
- });
- },
- //请核
- writeOff() {
- let formData = new window.FormData();
- formData.append(
- "tWarehousebills",
- JSON.stringify(this.$refs.avatar.form)
- );
- formData.append("tWarehousebillsfees", JSON.stringify(this.contentList));
- formData.append("fBilltype", "XS");
- pleaseCheck(formData).then((res) => {
- if (res.code == 200) {
- this.$message.success("请核成功");
- // this.$refs.avatar.form = res.data.warehouseBills
- // this.contentList = res.data.tWarehousebillsCntrs
- this.contentOption.forEach((item) => (item.disabled = true));
- this.contentStyle.forEach((item) => (item.disabled = true));
- let data = {
- tableName: this.queryList.tableName,
- userId: Cookies.get("userName"),
- };
- this.getRow(data);
- this.query(this.formDataList);
- }
- });
- },
- //修改
- modification(scope) {},
- //删除
- deletion(scope) {
- tableDeleteQuery(scope.row.fId).then((res) => {
- this.$confirm(
- res.msg == 1
- ? "主表数据为空"
- : (res.msg == 2 ? "主表有数据" : "未知状态") +
- "是否永久删除该条数据?",
- "提示",
- {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }
- )
- .then(() => {
- confirmDeletion(scope.row.fId).then((data) => {
- this.$message({
- type: "success",
- message: "删除成功!",
- });
- this.query(this.formDataList);
- });
- })
- .catch(() => {
- this.$message({
- type: "info",
- message: "已取消删除",
- });
- });
- });
- },
- //选择框
- selectionbox(selection) {
- if (selection.length > 1) {
- this.customButton.forEach((item) => {
- if (item.name === "复制新单") {
- item.disabled = true;
- } else {
- item.disabled = false;
- }
- });
- } else {
- this.customButton.forEach((item) => (item.disabled = false));
- this.selection = selection;
- }
- },
- addOrUpdateHand() {
- this.addOrUpdateVisib = true;
- this.$nextTick(() => {
- this.$refs.ApprovalComments.init(this.$refs.avatar.form.fId, 550);
- });
- },
- //详情内容保存
- submitAndSave(item, res) {
- if (
- this.$refs.avatar.form.fBillstatus <= 4 ||
- !this.$refs.avatar.form.fBillstatus
- ) {
- console.log(this.$refs.avatar.form.fGoodsid);
- console.log(this.dataList.fGoodsid);
- let formData = new window.FormData();
- this.$refs.avatar.form.fMoney = 0;
- this.contentList.forEach(
- (item) => (this.$refs.avatar.form.fMoney += Number(item.fAmount))
- );
- this.dataList.fGoodsid.forEach((item) => {
- if (item.value == this.$refs.avatar.form.fGoodsid) {
- this.$refs.avatar.form.fCorpid = item.fCorpid;
- }
- });
- formData.append(
- "tWarehousebills",
- JSON.stringify(this.$refs.avatar.form)
- );
- formData.append(
- "tWarehousebillsfees",
- JSON.stringify(this.contentList)
- );
- formData.append("fBilltype", "XS");
- if (item === 3) {
- this.$refs.avatar.form.fId = "";
- this.$refs.avatar.form.fBillno = "";
- this.$refs.avatar.form.fCreateLog = "";
- this.$refs.avatar.form.fReviewDate = "";
- this.$refs.avatar.form.fPrintLog = "";
- this.$refs.avatar.form.fBillstatus = 2;
- this.$refs.avatar.form.fPrint = 0;
- this.contentList.forEach((item) => (item.fId = ""));
- this.contentOption.forEach((item) => {
- if (
- item.label == "personNaem" ||
- item.label == "corpsName" ||
- item.label == "createBy" ||
- item.label == "fBillno"
- ) {
- item.disabled = true;
- } else {
- item.disabled = false;
- }
- });
- this.purchaseList.columnList.forEach(
- (item) => (item.disabled = false)
- );
- this.contentButton.forEach((item) => (item.disabled = false));
- this.contentStyle.forEach((item) => (item.disabled = false));
- } else {
- submit(formData).then((res) => {
- if (res.code == 200) {
- if (res) {
- this.$refs.avatar.form = res.data.warehouseBills;
- }
- this.contentList = res.data.tWarehousebillsCntrs;
- this.$message.success("保存成功");
- viewSingle(this.$refs.avatar.form.fId).then((res) => {
- if (res.code === 200) {
- let list = {
- warehouseBills: res.data.warehouseBills,
- tWarehousebillsfees: res.data.tWarehousebillsfees,
- };
- this.$refs.avatar.form = list.warehouseBills;
- this.contentList = list.tWarehousebillsfees;
- this.toChies(this.$refs.avatar.form.fMoney);
- // this.dialogVisible = true
- }
- });
- }
- });
- }
- }
- if (item == 1) {
- // this.dialogVisible = true
- } else if (item === 2) {
- let data = {
- tableName: this.queryList.tableName,
- userId: Cookies.get("userName"),
- };
- this.getRow(data);
- this.query(this.formDataList);
- }
- if (item === 3 && this.$refs.avatar.form.fBillstatus > 3) {
- this.$refs.avatar.form.fId = "";
- this.$refs.avatar.form.fBillno = "";
- this.$refs.avatar.form.fCreateLog = "";
- this.$refs.avatar.form.fReviewDate = "";
- this.$refs.avatar.form.fPrintLog = "";
- this.$refs.avatar.form.fBillstatus = 2;
- this.$refs.avatar.form.fPrint = 0;
- this.contentList.forEach((item) => (item.fId = ""));
- this.contentOption.forEach((item) => {
- if (
- item.label == "personNaem" ||
- item.label == "corpsName" ||
- item.label == "createBy" ||
- item.label == "fBillno"
- ) {
- item.disabled = true;
- } else {
- item.disabled = false;
- }
- });
- this.purchaseList.columnList.forEach((item) => (item.disabled = false));
- this.contentButton.forEach((item) => (item.disabled = false));
- this.contentStyle.forEach((item) => (item.disabled = false));
- // let datae = {
- // fId:this.$refs.avatar.form.fId,
- // fBilltype:'SQ'
- // }
- // copyNew(datae).then(res=> {
- // this.$message({
- // message: '复制新单成功',
- // type: 'success',
- // showClose: true
- // });
- // let scope = {
- // row: {
- // fId: res.data
- // }
- // }
- // this.query(this.formDataList)
- // this.viewMethod(scope,res)
- // })
- }
- },
- //表单选中后触发
- selectTrigger(name, list, id) {
- if (name == "fGoodsid") {
- for (let item in list) {
- if (list[item].value == id) {
- this.$refs.avatar.form.personNaem = list[item].personNaem;
- this.$refs.avatar.form.corpsName = list[item].corpsName;
- }
- }
- }
- },
- //确认打印
- Printing() {
- this.$print(this.$refs.print);
- let list = {
- fId: this.$refs.avatar.form.fId,
- };
- printingTiem(list).then((res) => {});
- },
- //返回列表
- backToList() {
- let data;
- if (
- (!this.$refs.avatar.form.fId && this.contentList !== 0) ||
- (this.$refs.avatar.form.fBillstatus >= 4 && !this.$route.query.data)
- ) {
- data = {
- tableName: this.queryList.tableName,
- userId: Cookies.get("userName"),
- };
- this.getRow(data);
- this.query(this.formDataList);
- } else if (this.$route.query.data) {
- this.cancelTwo();
- // this.$router.push({ path: '/index' })
- } else {
- this.$confirm("当前数据未保存是否保存?", "提示", {
- confirmButtonText: "保存",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- this.submitAndSave(2, 1);
- })
- .catch(() => {
- data = {
- tableName: this.queryList.tableName,
- userId: Cookies.get("userName"),
- };
- this.getRow(data);
- this.query(this.formDataList);
- });
- }
- },
- //所有按钮
- buttonList(row) {
- let data;
- switch (row.name) {
- case "新单":
- if (row.nameTwo == "详情页") {
- if (this.$refs.avatar.form.fId) {
- this.contentList = [];
- data = {
- tableName: this.purchaseList.tableName,
- userId: Cookies.get("userName"),
- };
- this.$refs.avatar.form = {};
- this.getRow(data, "", 1);
- this.contentOption.forEach((item) => {
- if (
- item.label == "personNaem" ||
- item.label == "corpsName" ||
- item.label == "createBy" ||
- item.label == "fBillno"
- ) {
- item.disabled = true;
- } else {
- item.disabled = false;
- }
- });
- this.contentButton.forEach((item) => (item.disabled = false));
- this.contentStyle.forEach((item) => (item.disabled = false));
- this.$refs.avatar.clearVerification();
- this.$refs.avatar.form.createBy = Cookies.get("userName");
- } else {
- this.$message.error("当前数据未保存,请先保存");
- }
- } else {
- this.contentList = [];
- data = {
- tableName: this.purchaseList.tableName,
- userId: Cookies.get("userName"),
- };
- this.$refs.avatar.form = {};
- this.getRow(data, "", 1);
- this.contentOption.forEach((item) => {
- if (
- item.label == "personNaem" ||
- item.label == "corpsName" ||
- item.label == "createBy" ||
- item.label == "fBillno"
- ) {
- item.disabled = true;
- } else {
- item.disabled = false;
- }
- });
- this.contentButton.forEach((item) => (item.disabled = false));
- this.contentStyle.forEach((item) => (item.disabled = false));
- this.$refs.avatar.clearVerification();
- this.$refs.avatar.form.createBy = Cookies.get("userName");
- }
- break;
- case "复制新单":
- if (row.nameTwo === "详情页") {
- this.$refs.avatar.submitForm("submit", 3);
- } else {
- if (this.selection.length > 0) {
- let scope = {
- row: {
- fId: this.selection[0].fId,
- },
- };
- this.query(this.formDataList);
- this.viewMethod(scope, "", 1);
- } else {
- this.$message.warning("未选择列表,请选择后再点击");
- }
- }
- break;
- case "保存":
- this.$refs.avatar.submitForm("submit");
- break;
- // case '打印':
- // if (!this.$refs.avatar.form.fId){
- // this.$message.error('未保存,不允许打印');
- // }else {
- // this.formList = this.$refs.avatar.form
- // this.submitAndSave(1)
- // }
- // break
- case "修改":
- this.contentButton.forEach((item) => {
- if (this.$refs.avatar.form.fBillstatus >= 4) {
- if (
- item.name === "返回列表" ||
- item.name === "修改" ||
- item.name === "申请发票" ||
- item.name === "查看审批" ||
- item.name === "审批" ||
- item.name === "打印" ||
- item.name === "撤销审批"
- ) {
- item.disabled = false;
- } else {
- item.disabled = true;
- }
- } else {
- item.disabled = false;
- this.purchaseList.columnList.forEach(
- (item) => (item.disabled = false)
- );
- this.contentStyle.forEach((item) => (item.disabled = false));
- this.contentOption.forEach((item) => {
- if (
- item.label == "personNaem" ||
- item.label == "corpsName" ||
- item.label == "fBillno"
- ) {
- item.disabled = true;
- } else {
- item.disabled = false;
- }
- });
- }
- });
- break;
- case "录入明细":
- this.contentList.push({
- fFeeid: "",
- fUnitprice: "",
- fPurchase: "",
- fQty: "",
- fFeeunitid: "",
- fAmount: "",
- fStltypeid: "",
- remark: "",
- createTime: "",
- createBy: Cookies.get("userName"),
- fReviewDate: "",
- operation: "",
- });
- break;
- case "返回列表":
- if (
- (!this.$refs.avatar.form.fId && this.contentList !== 0) ||
- (this.$refs.avatar.form.fBillstatus >= 4 && !this.$route.query.data)
- ) {
- data = {
- tableName: this.queryList.tableName,
- userId: Cookies.get("userName"),
- };
- this.getRow(data);
- this.query(this.formDataList);
- } else if (this.$route.query.data) {
- this.cancelTwo();
- this.$router.push({ path: "/index" });
- } else {
- this.$confirm("当前数据未保存是否保存?", "提示", {
- confirmButtonText: "保存",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- this.submitAndSave(2);
- })
- .catch(() => {
- data = {
- tableName: this.queryList.tableName,
- userId: Cookies.get("userName"),
- };
- this.getRow(data);
- this.query(this.formDataList);
- });
- }
- break;
- case "请核":
- if (this.$refs.avatar.form.fBillstatus < 4) {
- this.$refs.avatar.submitForm("check");
- } else {
- this.$message.error("请先保存");
- }
- break;
- case "查看审批":
- this.addOrUpdateHandle();
- break;
- case "审批":
- this.addOrUpdateHand();
- break;
- case "撤销审批":
- this.revocationOfApproval(1);
- break;
- case "撤销出库":
- this.revocationOfApproval(2);
- break;
- case "导出明细":
- if (!this.$refs.avatar.form.fId) {
- this.$message.error("数据未保存,请先保存");
- } else {
- let id = this.$refs.avatar.form.fId;
- this.$confirm("是否确认导出销售出库明细?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(function () {
- return exportDetail({ fPid: id });
- })
- .then((response) => {
- this.download(response.msg);
- });
- }
- break;
- case "打印":
- // console.log(this.listData.fFeeid,this.contentList)
- this.formList.createBy = Cookies.get("userName");
- for (let ul in this.dataList.fGoodsid) {
- if (
- this.$refs.avatar.form.fGoodsid ==
- this.dataList.fGoodsid[ul].value
- ) {
- this.projectName = this.dataList.fGoodsid[ul].label;
- }
- }
- for (let item in this.contentList) {
- for (let li in this.listData.fFeeid) {
- if (
- this.contentList[item].fFeeid == this.listData.fFeeid[li].value
- ) {
- this.contentList[item].feeName = this.listData.fFeeid[li].label;
- }
- }
- for (let i in this.listData.fFeeunitid) {
- if (
- this.contentList[item].fFeeunitid ==
- this.listData.fFeeunitid[i].value
- ) {
- this.contentList[item].fFeeunitName =
- this.listData.fFeeunitid[i].label;
- }
- }
- }
- console.log(this.$refs.avatar.form.fMoney);
- this.toChies(this.$refs.avatar.form.fMoney);
- if (!this.$refs.avatar.form.fId) {
- this.$message.error("未保存,不允许打印");
- } else if (this.$refs.avatar.form.fBillstatus >= 4) {
- this.formList = this.$refs.avatar.form;
- this.dialogVisible = true;
- } else {
- this.formList = this.$refs.avatar.form;
- this.submitAndSave(1);
- this.dialogVisible = true;
- }
- break;
- case "导出":
- let dataForm = this.$refs.avatar.form
- this.$confirm("是否确认导出销售出库?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(function () {
- return getExport(dataForm);
- })
- .then((response) => {
- this.download(response.msg);
- });
- break;
- default:
- this.$message.error("该按钮暂无功能");
- }
- },
- //撤销审批
- revocationOfApproval(res) {
- if (res == 1) {
- let data = {
- id: this.$refs.avatar.form.fId,
- actId: 550,
- billId: this.$refs.avatar.form.fId,
- };
- revoke(data).then((res) => {
- if (res.code == 200) {
- this.$message.success("撤销成功");
- this.getList();
- this.isItHidden = true;
- this.pageDisplay = true;
- }
- });
- } else if (res == 2) {
- let data = {
- fId: this.$refs.avatar.form.fId,
- };
- revokeBill(data).then((res) => {
- if (res.code == 200) {
- this.$message.success("撤销成功");
- this.getList();
- this.isItHidden = true;
- this.pageDisplay = true;
- }
- });
- }
- },
- // 显示搜索条件、点击后会调用此方法
- showSearch() {
- console.log("到我了");
- this.searchWhether = !this.searchWhether;
- },
- //搜索、重置、展开
- feedback(res) {
- if (res == "展开") {
- if (this.inDex == 4) {
- this.inDex = this.formOption.length;
- } else {
- this.inDex = 4;
- }
- } else if (res == "搜索") {
- this.$refs.avatar.submitForm();
- } else if (res == "重置") {
- this.formDataList = {
- pageNum: 1,
- pageSize: 10,
- timeInterval: null,
- fBilltype: "XS",
- };
- this.$refs.avatar.assignmentTime(this.formDataList);
- this.$refs.avatar.submitForm();
- }
- },
- //表单验证通过执行搜索
- submitForm() {
- console.log(this.formDataList.timeInterval);
- let list = this.formDataList;
- this.formDataList = this.$refs.avatar.form;
- this.formDataList.fBilltype = list.fBilltype;
- this.formDataList.pageSize = list.pageSize;
- this.formDataList.pageNum = list.pageNum;
- this.formDataList.timeInterval = list.timeInterval;
- this.query(this.formDataList);
- },
- //点击刷新会调用此方法
- getList() {
- this.feedback("重置");
- this.submitForm();
- console.log("到我了2");
- },
- //详情表内容移出
- deletRows(index, rows) {
- if (rows[index].fId) {
- deleteQuery(
- this.$refs.avatar.form.fId,
- this.$refs.avatar.form.fDateChanged
- ).then((res) => {
- if (res.code === 200) {
- listDelete(rows[index].fId).then((data) => {
- rows.splice(index, 1);
- });
- }
- });
- } else {
- rows.splice(index, 1);
- }
- },
- },
- };
- </script>
- <style scoped>
- .table {
- border-collapse: collapse;
- border-spacing: 0;
- background-color: transparent;
- display: table;
- width: 99%;
- max-width: 100%;
- margin: 0 auto;
- }
- .table td {
- text-align: center;
- vertical-align: middle;
- font-size: 14px;
- color: #000000;
- padding: 8px 12px;
- }
- .column {
- border: 1px solid #000;
- }
- .app-container >>> .el-form-item {
- margin-bottom: 0;
- }
- .print_div ::v-deep .el-table__body-wrapper {
- z-index: 2;
- }
- .print_div ::v-deep .el-dialog__header {
- padding: 0;
- }
- .print_div ::v-deep .el-dialog__body {
- padding: 0 20px;
- }
- .app-container ::v-deep .el-table__body-wrapper {
- z-index: 2;
- }
- </style>
|