123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644 |
- <template>
- <div>
- <div>
- <el-page-header :content="!cid ? '存货调价单' : '编辑'" @back="goBack" />
- </div>
- <br><br>
- <div>
- <el-form
- ref="screenForm"
- label-width="100px"
- size="small"
- label-position="left"
- >
- <el-row :gutter="20">
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="单据编号">
- <el-input size="mini"
- v-model="base.updPriceBillId"
- placeholder="系统自动生成"
- disabled
- />
- </el-form-item>
- </el-col>
- <!-- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="调价业务员">
- <el-select
- placeholder="请选择调价业务员"
- filterable
- @change="handleUser"
- v-model="serviceId"
- >
- <el-option
- v-for="(item, index) in userList"
- :label="item.nickName"
- :value="item.roleId"
- :key="index"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="调价部门">
- <el-input size="mini"
- placeholder="调价部门"
- disabled
- v-model="adminCompanyName"
- ></el-input>
- </el-form-item>
- </el-col> -->
- <!-- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="销售类型">
- <el-select
- placeholder="请选择销售类型"
- filterable
- v-model="saleTypeId"
- >
- <el-option
- v-for="item in typeList"
- :label="item.saleName"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col> -->
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="备注">
- <el-input size="mini" v-model="base.remark" placeholder="请输入" />
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="" class="fr" />
- </el-col>
- </el-row>
- </el-form>
- </div>
- <div class="btn-group clearfixs" v-if="!cid">
- <!-- <el-upload
- class="import-btn"
- :action="baseURL + 'student/import'"
- :http-request="handleImport"
- :file-list="importFileList"
- :show-file-list="false"
- >
- <el-button
- type="primary"
- size="small"
- >导入调价单</el-button>
- </el-upload>
- <el-button
- type="primary"
- size="small"
- @click="hanleDownloadFiles"
- >下载模板</el-button> -->
- </div>
- <div class="mymain-container">
- <!-- 列表 -->
- <el-form v-if="!detail.length" size="small" label-position="left">
- <div class="table">
- <el-table
- v-loading="listLoading"
- :data="items"
- element-loading-text="Loading"
- border
- fit
- highlight-current-row
- stripe
- >
- <el-table-column
- align="center"
- label="操作类型"
- prop="nname"
- fixed="right"
- min-width="160"
- show-overflow-tooltip
- >
- <!-- <el-button type="text" class="textColor">修改</el-button> -->
- <template slot-scope="scope">
- <el-button
- type="text"
- class="textColor"
- @click="hanleDeleInd(scope.$index, scope.row.cid,scope.row.materialId)"
- >删除</el-button>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="销售类型"
- prop="mainId"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-form-item>
- <template v-if="!cid">
- <el-select
- size="mini"
- v-model="scope.row.mainId"
- placeholder="请选择销售类型"
- @change="
- handleSale($event, scope.$index, scope.row.saleTypes)
- "
- >
- <el-option
- v-for="item in scope.row.saleTypes"
- :label="item.saleName"
- :value="item.id"
- />
- </el-select>
- </template>
- <template v-else>
- <el-select
- size="mini"
- v-model="scope.row.saleTypeId"
- placeholder="请选择销售类型"
- @change="handleSale($event, scope.$index, scope.row.id)"
- >
- <el-option
- v-for="item in typeList"
- :label="item.saleName"
- :value="item.id"
- />
- </el-select>
- </template>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="物料编码"
- prop="materialNumber"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-form-item>
- <el-input size="mini"
- v-model="scope.row.materialNumber"
- disabled
- />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="产品名称"
- prop="materialName"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-form-item>
- <el-input size="mini"
- v-model="scope.row.materialName"
- disabled
- />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="规格型号"
- prop="specification"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-form-item>
- <el-input size="mini"
- v-model="scope.row.specification"
- disabled
- />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="计量单位"
- prop="unit"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-form-item>
- <el-input size="mini" v-model="scope.row.unit" disabled />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="批发价"
- prop="batchPrice"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-form-item>
- <el-input size="mini" v-model="scope.row.batchPrice" placeholder="请输入批发价" />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="格力折扣"
- prop="discAmount"
- min-width="160"
- show-overflow-tooltip
- ><template slot-scope="scope">
- <el-form-item>
- <el-input size="mini" v-model="scope.row.discAmount" placeholder="请输入格力折扣" />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="返利类型"
- prop="rebateUseRate"
- min-width="160"
- show-overflow-tooltip
- ><template slot-scope="scope">
- <el-form-item>
- <el-select
- size="mini"
- v-model="scope.row.walletRebateId"
- multiple
- :disabled="scope.row.fang"
- placeholder="请选择返利类型"
- @change="handelRebateList($event, scope.$index, scope.row)"
- @remove-tag="handleRemove2($event, scope.$index, scope.row)"
- >
- <el-option
- v-for="(item, index) in scope.row.rebateList"
- :key="item.index"
- :value="item.walletRebateId"
- :label="item.name"
- />
- </el-select>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="生效日期"
- prop="startDate"
- min-width="160"
- show-overflow-tooltip
- ><template slot-scope="scope">
- <el-form-item>
- <el-date-picker
- size="mini"
- v-model="scope.row.startDate"
- type="date"
- placeholder="请输入调价日期"
- value-format="yyyy-MM-dd"
- />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="失效日期"
- prop="endDate"
- min-width="160"
- show-overflow-tooltip
- ><template slot-scope="scope">
- <el-form-item>
- <el-date-picker
- v-model="scope.row.endDate"
- type="date"
- size="mini"
- placeholder="请输入调价日期"
- value-format="yyyy-MM-dd"
- />
- </el-form-item>
- </template>
- </el-table-column>
- <!-- <el-table-column
- align="center"
- label="是否促销价"
- prop="isPromote"
- min-width="160"
- show-overflow-tooltip
- ><template slot-scope="scope">
- <el-form-item>
- <el-select
- v-model="scope.row.isPromote"
- placeholder="请选择是否促销价"
- >
- <el-option
- v-for="item in scope.row.isPromoteArr"
- :key="item.bool"
- :value="item.bool"
- :label="item.value"
- />
- </el-select>
- </el-form-item>
- </template>
- </el-table-column> -->
- <el-table-column
- align="center"
- label="数量"
- prop="qty"
- min-width="160"
- show-overflow-tooltip
- ><template slot-scope="scope">
- <el-form-item>
- <el-input size="mini" v-model="scope.row.qty" placeholder="请输入数量" />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="现金钱包"
- prop="wallets"
- min-width="160"
- show-overflow-tooltip
- ><template slot-scope="scope">
- <el-form-item>
- <template v-if="!cid">
- <el-select
- size="mini"
- v-model="scope.row.walletsId"
- multiple
- clearable
- placeholder="请选择现金钱包"
- @change="handelWallets($event, scope.$index, scope.row)"
- @remove-tag="
- handleRemove($event, scope.$index, scope.row)
- "
- >
- <el-option
- v-for="item in scope.row.walleList"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- /> </el-select></template>
- <template v-else>
- <el-select
- v-model="scope.row.walletsId"
- multiple
- clearable
- size="mini"
- placeholder="请选择现金钱包"
- @change="handelWallets($event, scope.$index, scope.row)"
- @remove-tag="
- handleRemove($event, scope.$index, scope.row)
- "
- >
- <el-option
- v-for="item in scope.row.walleList"
- :key="item.walletId || item.id"
- :value="item.walletId || item.id"
- :label="item.walletName || item.name"
- /> </el-select></template>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="发布"
- prop="isPublish"
- min-width="160"
- show-overflow-tooltip
- ><template slot-scope="scope">
- <el-form-item>
- <el-select
- size="mini"
- v-model="scope.row.isPublish"
- placeholder="请选择是否发布"
- >
- <el-option
- v-for="item in scope.row.isPublishArr"
- :key="item.bool"
- :value="item.bool"
- :label="item.value"
- />
- </el-select>
- </el-form-item>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </el-form>
- <el-form v-else :model="detail" size="small" label-position="left">
- <el-table
- v-loading="listLoading"
- :data="detail"
- element-loading-text="Loading"
- border
- fit
- highlight-current-row
- stripe
- >
- <el-table-column
- align="center"
- label="操作类型"
- prop="nname"
- min-width="160"
- show-overflow-tooltip
- >
- <!-- <el-button type="text" class="textColor">修改</el-button> -->
- <template slot-scope="scope">
- <el-button
- type="text"
- class="textColor"
- @click="hanleDeleInd(scope.$index)"
- >删除</el-button>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="销售类型"
- prop="mainId"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-form-item>
- <el-select
- v-model="scope.row.saleTypeId"
- placeholder="请选择销售类型"
- @change="handleSale($event, scope.$index, scope.row.id)"
- >
- <el-option
- v-for="item in typeList"
- :label="item.saleName"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="物料编码"
- prop="materialNumber"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-form-item>
- <el-input size="mini" v-model="scope.row.materialNumber" />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="产品名称"
- prop="materialName"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-form-item>
- <el-input size="mini" v-model="scope.row.materialName" />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="规格型号"
- prop="specification"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-form-item>
- <el-input size="mini" v-model="scope.row.specification" />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="计量单位"
- prop="unit"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-form-item>
- <el-input size="mini" v-model="scope.row.SalesType" />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="批发价"
- prop="batchPrice"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-form-item>
- <el-input size="mini" v-model="scope.row.batchPrice" />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="零售价"
- prop="retailPrice"
- min-width="160"
- show-overflow-tooltip
- ><template slot-scope="scope">
- <el-form-item>
- <el-input size="mini" v-model="scope.row.retailPrice" />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="返利使用比例"
- prop="rebateUseRate"
- min-width="160"
- show-overflow-tooltip
- ><template slot-scope="scope">
- <el-form-item>
- <el-input size="mini" v-model="scope.row.rebateUseRate" />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="返利类型"
- prop="rebateUseRate"
- min-width="160"
- show-overflow-tooltip
- ><template slot-scope="scope">
- <el-form-item>
- <el-select
- v-model="scope.row.walletRebateId"
- multiple
- :disabled="scope.row.fang"
- placeholder="请选择返利类型"
- @change="handelRebateList($event, scope.$index, scope.row)"
- @remove-tag="handleRemove2($event, scope.$index, scope.row)"
- >
- <el-option
- v-for="(item, index) in scope.row.rebateList"
- :key="item.index"
- :value="item.walletRebateId"
- :label="item.name"
- />
- </el-select>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="生效日期"
- prop="startDate"
- min-width="160"
- show-overflow-tooltip
- ><template slot-scope="scope">
- <el-form-item>
- <el-date-picker
- v-model="scope.row.startDate"
- type="date"
- placeholder="请输入调价日期"
- value-format="yyyy-MM-dd"
- />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="失效日期"
- prop="endDate"
- min-width="160"
- show-overflow-tooltip
- ><template slot-scope="scope">
- <el-form-item>
- <el-date-picker
- v-model="scope.row.endDate"
- type="date"
- placeholder="请输入调价日期"
- value-format="yyyy-MM-dd"
- />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="是否促销价"
- prop="isPromote"
- min-width="160"
- show-overflow-tooltip
- ><template slot-scope="scope">
- <el-form-item>
- <el-select
- v-model="scope.row.isPromote"
- placeholder="请选择是否促销价"
- >
- <el-option
- v-for="item in scope.row.isPromoteArr"
- :key="item.bool"
- :value="item.bool"
- :label="item.value"
- />
- </el-select>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="数量"
- prop="qty"
- min-width="160"
- show-overflow-tooltip
- ><template slot-scope="scope">
- <el-form-item>
- <el-input size="mini" v-model="scope.row.qty" />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="支付钱包类型"
- prop="wallets"
- min-width="160"
- show-overflow-tooltip
- ><template slot-scope="scope">
- <el-form-item>
- <el-select
- v-model="scope.row.isPublish"
- placeholder="请选择支付钱包类型"
- >
- <el-option
- v-for="item in scope.row.rebateList"
- :key="item.walletRebateId"
- :value="item.walletRebateId"
- :label="item.name"
- />
- </el-select>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="发布"
- prop="isPublish"
- min-width="160"
- show-overflow-tooltip
- ><template slot-scope="scope">
- <el-form-item>
- <el-select
- v-model="scope.row.isPublish"
- placeholder="请选择是否发布"
- >
- <el-option
- v-for="item in scope.row.isPublishArr"
- :key="item.bool"
- :value="item.bool"
- :label="item.value"
- />
- </el-select>
- </el-form-item>
- </template>
- </el-table-column>
- </el-table>
- </el-form>
- <el-dialog
- title="提示"
- :visible.sync="centerDialogVisible"
- width="50%"
- center
- class="dia"
- >
- <el-form
- ref="form"
- :model="form"
- label-width="80px"
- :inline="false"
- size="normal"
- >
- <el-form-item label="产品类型">
- <el-select v-model="materialId" placeholder="请选择" width="100%">
- <el-option
- v-for="item in materialLis"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="centerDialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="hanleAdd">确 定</el-button>
- </span>
- </el-dialog>
- </div>
- <div class="btn-group clearfix">
- <template v-if="!cid">
- <el-button size="small" @click="handleReseat">重置</el-button>
- <el-button
- size="small"
- type="primary"
- @click="hanleSbumit"
- >提交</el-button>
- </template>
- <template v-else>
- <el-button
- size="small"
- type="primary"
- @click="hanleSave"
- >保存</el-button>
- </template>
- <el-button
- style="float: right"
- type="primary"
- size="small"
- @click="centerDialogVisible = true"
- >添加</el-button>
- </div>
- <el-dialog title="" :visible.sync="centerDialogVisible" width="80%" center>
- <div>
- <el-form
- ref="screenForm"
- :model="screenForm"
- label-width="70px"
- size="small"
- label-position="left"
- >
- <el-row :gutter="20">
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="名称" prop="keyword">
- <el-input size="mini"
- v-model="screenForm.keyword"
- placeholder="请输入名称"
- />
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="物料编码" prop="materialNumber">
- <el-input size="mini"
- v-model="screenForm.materialNumber"
- placeholder="请输入物料编码"
- />
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="规格" prop="specification">
- <el-input size="mini"
- v-model="screenForm.specification"
- placeholder="请输入规格"
- />
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="12" class="tr">
- <el-form-item label="">
- <el-button
- size="small"
- @click="resetScreenForm"
- >清空</el-button>
- <el-button
- size="small"
- type="primary"
- @click="submitScreenForm"
- >搜索</el-button>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <div class="mymain-container">
- <div class="table">
- <el-table
- ref="multipleTable"
- v-loading="listLoading"
- :data="dataList"
- element-loading-text="Loading"
- border
- fit
- highlight-current-row
- stripe
- @select-all="handleSelectionAllChange"
- @selection-change="handleSelectionChange"
- >
- <!-- :selectable="selectable"-->
- <el-table-column
- align="center"
- type="selection"
- width="55"
- />
- <el-table-column
- align="center"
- label="使用组织"
- prop="useOrgName"
- min-width="100"
- />
- <el-table-column
- align="center"
- label="物料编码"
- prop="number"
- min-width="100"
- label-class-name="bianma"
- class-name="fontstyle"
- />
- <el-table-column
- align="center"
- label="名称"
- prop="name"
- min-width="100"
- />
- <el-table-column
- align="center"
- label="规格型号"
- prop="specification"
- min-width="100"
- />
- <el-table-column
- align="center"
- label="数据状态"
- prop="forbidStatus"
- min-width="100"
- >
- <template slot-scope="scope">
- <el-tag
- v-if="scope.row.forbidStatus == 'A'"
- type="success"
- >正常</el-tag>
- <el-tag v-else type="danger">禁用</el-tag>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="是否维护商城资料"
- prop="maintainData"
- min-width="100"
- />
- <el-table-column
- align="center"
- label="是否维护内外机档案"
- prop="maintainFiles"
- min-width="100"
- />
- <el-table-column
- align="center"
- label="基本单位"
- prop="baseUnitId"
- min-width="100"
- />
- <el-table-column
- align="center"
- label="已使用"
- prop="used"
- min-width="100"
- />
- </el-table>
- </div>
- <!-- 分页 -->
- <div class="fr">
- <el-pagination
- :current-page="currentPage"
- :page-sizes="[10]"
- :page-size="10"
- layout="total, sizes, prev, pager, next, jumper"
- :total="listTotal"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- />
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="centerDialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="handleDetermine">确 定</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- getMaterialList,
- getProductRriceAdd,
- getProductRriceDetail,
- getRebate,
- getTypeList,
- getUserList,
- getWalletList,
- handleEdit
- } from '@/api/basic_data/material'
- import { downloadFiles, handleImport } from '@/utils/util'
- import Mixin from '@/mixin/index'
- export default {
- mixins: [Mixin],
- props: ['cid'],
- data() {
- return {
- baseURL: '',
- importFileList: [],
- listLoading: false,
- importLoading:false,
- screenForm: {
- keyword: '',
- specification: '',
- materialNumber:''
- },
- base: {
- adminCompanyId: '',
- adminWebsitId: '',
- billId: '',
- examineNote: '',
- examineResult: true,
- examineStatus: '',
- id: null,
- serviceId: '',
- serviceName: '',
- remark: '',
- saleTypeId: ''
- },
- items: [],
- materialLis: [],
- materialId: '',
- rebateList: [],
- typeList: [],
- saleTypeId: '',
- serviceId: '',
- adminCompanyId: '',
- serviceName: '',
- adminCompanyName: '',
- adminWebsitId: '',
- detail: [],
- form: {},
- startDate: '',
- userList: [],
- centerDialogVisible: false,
- selectData: [],
- walleList: [],
- fang: true,
- wall1: [],
- wall2: []
- }
- },
- mounted() {
- },
- methods: {
- handleSale(e, index, saleTypes) {
- // console.log(this.rebateList);
- this.$set(this.items[index], 'rebateList', [])
- const linshi = []
- let saleArr = []
- const rebateList = []
- this.rebateList.forEach((k) => {
- k.saleTypes.forEach((j) => {
- if (!linshi.includes(j.saleTypeId) && j.saleTypeId == e) {
- rebateList.push(k)
- }
- })
- })
- saleArr = this.typeList.filter((i) => {
- return e == i.id
- })
- console.log(rebateList, '4444', this.rebateList, e)
- // this.items[index].mainName = saleArr[0].mainName;
- this.items[index].saleTypeId = e
- this.items[index].fang = false
- this.items[index].saleTypeName = saleArr[0].saleName
- this.$set(this.items[index], 'rebateList', rebateList)
- // this.fang = false;
- },
- resArr(arr1, arr2) {
- return arr1.filter((v) => arr2.every((val) => val.id != v.id))
- },
- // xua
- handelWallets(e, index, row) {
- // const id = row.cid || row.updPriceBillId
- // // if (e && e.length) {
- // for (let i = 0; i < e.length; i++) {
- // // if (!this.wall1.includes(e[e.length - 1])) {
- // this.$set(row, 'wallets', [
- // ...row.wallets,
- // {
- // type: 'COMMONLY',REBATE
- // id: '',
- // updPriceBillId: id,
- // updPriceBillItemId: id,
- // walletId: e[e.length - 1]
- // }
- // ])
- // // this.wall1.push(e[e.length - 1])
- // }
- // // }
- // // }
- },
- handelRebateList(e, index, row) {
- // const id = row.cid || row.updPriceBillId
- // if (e && e.length) {
- // for (let i = 0; i < e.length; i++) {
- // if (!this.wall2.includes(e[e.length - 1])) {
- // console.log(44544)
- // this.$set(row, 'wallets', [
- // ...row.wallets,
- // {
- // type: 'REBATE',
- // id: '',
- // updPriceBillId: id,
- // updPriceBillItemId: id,
- // walletId: e[e.length - 1]
- // }
- // ])
- // this.wall2.push(e[e.length - 1])
- // }
- // }
- // }
- },
- handleRemove(e, index, row) {
- // const copxyWall = JSON.parse(JSON.stringify(row.wallets))
- // if (row.wallets[0].walletId === e) {
- // copxyWall.splice(0, 1)
- // }
- // for (let i = 0; i < row.wallets.length; i++) {
- // if (this.wall1.includes(e) && row.wallets[i].walletId === e) {
- // this.wall1.splice(i, 1)
- // copxyWall.splice(i, 1)
- // }
- // }
- // this.$set(row, 'wallets', copxyWall)
- },
- handleRemove2(e, index, row) {
- // const copxyWall = JSON.parse(JSON.stringify(row.wallets))
- // for (let i = 0; i < row.wallets.length; i++) {
- // if (this.wall2.includes(e) && row.wallets[i].walletId == e) {
- // copxyWall.splice(i, 1)
- // this.wall2.splice(i, 1)
- // }
- // }
- // this.$set(row, 'wallets', copxyWall)
- },
- handleUser(e) {
- const adminCompany = this.userList.filter((k) => {
- return e == k.roleId
- })[0]
- this.adminWebsitId = adminCompany.adminUserId
- this.adminCompanyName = adminCompany.adminCompanyName
- this.serviceName = adminCompany.nickName || 'd'
- this.serviceId = adminCompany.roleId
- },
- goBack() {
- this.$parent.cid = ''
- this.$parent.show = 1
- // 更新父组件数据
- this.$parent.getList()
- },
- indexMethod(index) {
- console.log(index)
- },
- hanleDeleInd(index, id,materialId) {
- if (id || materialId) {
- const dataArr = JSON.parse(JSON.stringify(this.dataList))
- for (let j = 0; j < dataArr.length; j++) {
- if ((id || materialId) === dataArr[j].id) {
- // dataArr[j].disabled = false
- console.log(747)
- this.$set(dataArr[j], 'disabled', false)
- }
- }
- this.dataList = dataArr
- }
- this.items.splice(index, 1)
- },
- handleDetermine() {
- if (this.selectData.length) {
- for (let i = 0; i < this.selectData.length; i++) {
- for (let j = 0; j < this.dataList.length; j++) {
- if (this.selectData[i].id == this.dataList[j].id) {
- this.dataList[j].disabled = true
- }
- }
- this.items.push({
- baseUnitId: '',
- batchPrice: '',
- unit: this.selectData[i].baseUnitId,
- billId: '',
- endDate: '',
- isPromote: '',
- isPublish: '',
- materialId: this.selectData[i].id,
- materialName: this.selectData[i].name,
- materialNumber: this.selectData[i].number,
- discAmount: '',
- saleTypes: this.selectData[i].saleTypes,
- materialOldNumber: this.selectData[i].oldNumber,
- parentId: '',
- walletRebateName: '',
- walletRebateId: [],
- rebateRate: '',
- qty: '',
- rebateUseRate: '',
- retailPrice: '' || 0,
- saleTypeId: '',
- specification: this.selectData[i].specification,
- startDate: this.selectData[i].startDate,
- wallets: [],
- rebateWallets: [],
- rebateList: [],
- walletsId: [this.selectData[i].wallets[0].id],
- walleList: this.selectData[i].wallets,
- isPublishArr: [
- {
- value: '是',
- bool: true
- },
- {
- value: '否',
- bool: false
- }
- ],
- isPromoteArr: [
- {
- value: '是',
- bool: true
- },
- {
- value: '否',
- bool: false
- }
- ],
- cid: this.selectData[i].id,
- fang: true
- })
- }
- this.selectData = []
- this.$refs.multipleTable.clearSelection()
- this.centerDialogVisible = false
- } else {
- this.$errorMsg('请选择内容')
- }
- },
- getMaterialList() {
- const params = {
- pageNum: 1,
- pageSize: 10,
- keyword: '',
- bindMain: true
- }
- getMaterialList(params).then((res) => {
- this.materialLis = res.data.records
- })
- },
- handleSelectionAllChange(e) {
- this.selectData = e
- },
- handleSelectionChange(e) {
- this.selectData = e
- },
- hanleAdd() {
- if (this.materialId) {
- this.centerDialogVisible = false
- } else {
- this.$errorMsg('请选择产品')
- }
- },
- async getList() {
- const params1 = {
- pageNum: 1,
- pageSize: -1,
- saleCode: '',
- saleName: '',
- status: ''
- }
- getTypeList(params1).then((res) => {
- this.typeList = res.data.records
- })
- getUserList({
- pageNum: 1,
- pageSize: -1,
- adminWebsitId: '',
- isCustomer: 0,
- roleId: '',
- status: '',
- userName: ''
- }).then((res) => {
- this.userList = res.data.records
- })
- this.listLoading = true
- const params = {
- pageNum: this.currentPage,
- pageSize: 10 || this.pageSize,
- keyword: this.screenForm.keyword,
- specification: this.screenForm.specification,
- number:this.screenForm.materialNumber,
- bindMain: true,
- }
- getMaterialList(params).then((res) => {
- this.dataList = res.data.records
- this.listTotal = res.data.total
- this.listLoading = false
- })
- const rebateParams = {
- pageNum: 1,
- pageSize: -1,
- mainName: '',
- saleTypeCode: '',
- saleTypeName: '',
- status: ''
- }
- const ress = await getRebate(rebateParams)
- this.rebateList = ress.data.records
- const wall = await getWalletList({ mainId: '', walletName: '' })
- for (let u = 0; u < wall.data.length; u++) {
- wall.data[u].walletId = wall.data[u].id
- wall.data[u].walletName = wall.data[u].name
- }
- this.walleList = wall.data
- if (this.$parent.show === 5) {
- getProductRriceDetail({ id: this.cid }).then((res) => {
- for (let i = 0; i < res.data.items.length; i++) {
- const linshi = []
- const rebateList = []
- const walletIds = []
- const walletRebateIds = []
- res.data.items[i].isPublishArr = [
- {
- value: '是',
- bool: true
- },
- {
- value: '否',
- bool: false
- }
- ]
- res.data.items[i].isPromoteArr = [
- {
- value: '是',
- bool: true
- },
- {
- value: '否',
- bool: false
- }
- ]
- res.data.items[i].wallets = []
- res.data.items[i].walletsId = []
- res.data.items[i].walletRebateId = []
- res.data.items[i].rebateWallets = []
- for (let p = 0; p < res.data.items[i].wallets2.length; p++) {
- if (res.data.items[i].wallets2[p].type === 'COMMONLY') {
- walletIds.push(res.data.items[i].wallets2[p].walletId)
- this.$set(res.data.items[i], 'wallets', [
- ...res.data.items[i].wallets,
- {
- type: 'COMMONLY',
- id: '',
- updPriceBillId: res.data.items[i].updPriceBillId,
- updPriceBillItemId: res.data.items[i].updPriceBillId,
- walletId: res.data.items[i].wallets2[p].walletId
- }
- ])
- } else if (res.data.items[i].wallets2[p].type === 'REBATE') {
- walletRebateIds.push(res.data.items[i].wallets2[p].walletId)
- this.$set(res.data.items[i], 'wallets', [
- ...res.data.items[i].wallets,
- {
- type: 'REBATE',
- id: '',
- updPriceBillId: res.data.items[i].updPriceBillId,
- updPriceBillItemId: res.data.items[i].updPriceBillId,
- walletId: res.data.items[i].wallets2[p].walletId
- }
- ])
- }
- }
- console.log(res.data.items[i].wallets)
- this.rebateList.forEach((k) => {
- k.saleTypes.forEach((j) => {
- if (
- !linshi.includes(j.saleTypeId) &&
- j.saleTypeId === res.data.items[i].saleTypeId
- ) {
- for (let w = 0; w < walletRebateIds.length; w++) {
- if (walletRebateIds[w] !== k.walletRebateId) {
- // walletRebateIds.splice(w, 1)
- }
- }
- rebateList.push(k)
- }
- })
- })
- if (this.dataList.length) {
- for (let j = 0; j < res.data.items.length; j++) {
- for (let k = 0; k < this.dataList.length; k++) {
- if (res.data.items[j].materialId === this.dataList[k].id) {
- this.dataList[k].disabled = true
- }
- }
- }
- // console.log(this.dataList)
- }
- this.$set(res.data.items[i], 'walletsId', walletIds)
- this.$set(res.data.items[i], 'walletRebateId', walletRebateIds)
- res.data.items[i].walleList = this.walleList
- res.data.items[i].rebateList = rebateList
- res.data.items[i].fang = false
- }
- this.items = res.data.items
- this.base = res.data
- this.listLoading = false
- })
- } else {
- }
- },
- /**
- * 根据条件禁用行复选框
- * 函数返回值为false则禁用选择(反之亦然)
- * @param {Object} row - 行数据
- * @param {String} index - 索引值
- * @return Boolean
- */
- // selectable: function(row, index) {
- // // row.disabled == undefined 才能被选中
- // if (row.disabled == undefined || row.disabled == false) {
- // return true
- // } else {
- // return false
- // }
- // // 函数必须有返回值且是布尔值
- // // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
- // // 如果没有返回值则默认返回false(全部无法选中)
- // },
- hanleSbumit() {
- this.filterWallets(this.items)
- // return
- const params = {
- ...this.base,
- items: this.items,
- saleTypeId: this.saleTypeId,
- adminWebsitId: this.adminWebsitId,
- serviceId: this.serviceId,
- adminCompanyName: this.adminCompanyName,
- serviceName: this.nickName
- }
- // console.log(this.filterWallets(this.items),params);
- getProductRriceAdd(params).then((res) => {
- console.log(res.code,'klkk');
- this.$successMsg('成功')
- this.$parent.show = 1
- this.$parent.getList()
- }).catch((err)=>{
- console.log(err);
- for (let j = 0; j < this.items.length; j++) {
- this.$set(this.items[j],'wallets',[])
- }
- })
- },
- hanleSave() {
- this.filterWallets(this.items)
- handleEdit({
- ...this.base,
- items: this.items,
- saleTypeId: this.saleTypeId,
- adminWebsitId: this.adminWebsitId,
- serviceId: this.serviceId,
- adminCompanyName: this.adminCompanyName,
- serviceName: this.nickName
- }).then((res) => {
- this.$successMsg('成功')
- this.$parent.cid = ''
- this.$parent.show = 1
- this.$parent.getList()
- }).catch((err)=>{
- for (let j = 0; j < this.items.length; j++) {
- this.$set(this.items[j],'wallets',[])
- }
- })
- },
- handleReseat() {
- this.base = {
- adminCompanyId: '',
- adminWebsitId: '',
- billId: '',
- examineNote: '',
- examineResult: true,
- examineStatus: '',
- id: null,
- serviceId: '',
- serviceName: '',
- remark: '',
- saleTypeId: ''
- }
- this.saleTypeId = ''
- this.items = []
- },
- // 导入
- async handleImport(param) {
- this.importLoading = true
- const file = param.file
- const formData = new FormData()
- formData.append('file', file)
- const result = await handleImport('/product-upd-price/material/import', formData)
- this.importLoading = false
- this.importFileList = []
- if (result.code === 200) {
- this.$alert(result.message, '导入成功', {
- confirmButtonText: '确定'
- })
- for (let i = 0; i < result.data.length; i++) {
- const linshi = []
- const rebateList = []
- const walletIds = []
- const walletRebateIds = []
- // result.data[i].id = result.data[i].materialId
- result.data[i].isPublishArr = [
- {
- value: '是',
- bool: true
- },
- {
- value: '否',
- bool: false
- }
- ]
- result.data[i].isPromoteArr = [
- {
- value: '是',
- bool: true
- },
- {
- value: '否',
- bool: false
- }
- ]
- result.data[i].wallets = []
- result.data[i].walletsId = []
- result.data[i].walletRebateId = []
- result.data[i].rebateWallets = []
- result.data[i].saleTypes = this.typeList
- result.data[i].mainId = result.data[i].saleTypeId
- for (let p = 0; p < result.data[i].wallets2.length; p++) {
- if (result.data[i].wallets2[p].type === 'COMMONLY') {
- walletIds.push(result.data[i].wallets2[p].walletId)
- this.$set(result.data[i], 'wallets', [
- ...result.data[i].wallets,
- {
- type: 'COMMONLY',
- id: '',
- updPriceBillId: result.data[i].updPriceBillId,
- updPriceBillItemId: result.data[i].updPriceBillId,
- walletId: result.data[i].wallets2[p].walletId
- }
- ])
- } else if (result.data[i].wallets2[p].type === 'REBATE') {
- walletRebateIds.push(result.data[i].wallets2[p].walletId)
- this.$set(result.data[i], 'wallets', [
- ...result.data[i].wallets,
- {
- type: 'REBATE',
- id: '',
- updPriceBillId: result.data[i].updPriceBillId,
- updPriceBillItemId: result.data[i].updPriceBillId,
- walletId: result.data[i].wallets2[p].walletId
- }
- ])
- }
- }
- this.rebateList.forEach((k) => {
- k.saleTypes.forEach((j) => {
- if (
- !linshi.includes(j.saleTypeId) &&
- j.saleTypeId === result.data[i].saleTypeId
- ) {
- for (let w = 0; w < walletRebateIds.length; w++) {
- if (walletRebateIds[w] !== k.walletRebateId) {
- // walletRebateIds.splice(w, 1)
- }
- }
- rebateList.push(k)
- }
- })
- })
- this.$set(result.data[i], 'walletsId', walletIds)
- this.$set(result.data[i], 'walletRebateId', walletRebateIds)
- result.data[i].walleList = this.walleList
- result.data[i].rebateList = rebateList
- result.data[i].fang = false
- }
- // if (this.dataList.length) {
- // for (let j = 0; j < result.data.length; j++) {
- // for (let k = 0; k < this.dataList.length; k++) {
- // if (result.data[j].materialId === this.dataList[k].id) {
- // this.dataList[k].disabled = true
- // }
- // }
- // }
- // }
- // this.items = [...this.items,...result.data]
- // let newArr = [];
- // let obj = {};
- // for (var i = 0; i < this.items.length; i++) {
- // if (!obj[this.items[i].materialId]) {
- // newArr.push(this.items[i])
- // obj[this.items[i].materialId] = true
- // }
- // }
- // console.log(newArr,454 ,obj)
- this.items = [...this.items,...result.data]
- // console.log(resArrs(result.data,this.dataList),'55555')
- } else {
- this.$alert(result.message, '导入失败', {
- confirmButtonText: '确定'
- })
- }
- },
- // 下载经销商模板
- hanleDownloadFiles() {
- downloadFiles('/product-upd-price/download')
- },
- filterWallets(array){
- for (let i = 0; i < array.length; i++) {
- const wallets = []
- if (array[i].walletsId.length){
- for (let j = 0; j < array[i].walleList.length; j++) {
- for (let k = 0; k < array[i].walletsId.length; k++) {
- if (array[i].walleList[j].id === array[i].walletsId[k]) {
- wallets.push({
- type: 'COMMONLY',
- id: '',
- updPriceBillId: array[i].cid || array[i].updPriceBillId,
- updPriceBillItemId: array[i].cid || array[i].updPriceBillId,
- walletId: array[i].walletsId[k]
- })
- }
- }
- }
- array[i].wallets = wallets
- }
- if(array[i].walletRebateId.length){
- for (let k = 0; k < array[i].rebateList.length; k++) {
- if (!array[i].walletRebateId.length) return
- for (let j = 0; j < array[i].walletRebateId.length; j++) {
- if (array[i].rebateList[k].walletRebateId === array[i].walletRebateId[j]) {
- wallets.push({
- type: 'REBATE',
- id: '',
- updPriceBillId: array[i].cid || array[i].updPriceBillId,
- updPriceBillItemId: array[i].cid || array[i].updPriceBillId,
- walletId: array[i].walletRebateId[j]
- })
- }
- }
- array[i].wallets = wallets
- }
- }
- }
- return array
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-date-editor--date {
- width: 100%;
- }
- .dia .el-select--normal {
- width: 100%;
- }
- .clearfixs{
- display: flex;
- }
- .import-btn{
- margin-right: 10px;
- }
- </style>
|