| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142 |
- <template>
- <div id="commodityManageMentEdit">
- <h5>商品信息</h5>
- <div class="boxsSTTs">
- <h5 class="fengs">基本信息</h5>
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form
- label-position="right"
- label-width="120px"
- :model="listData"
- :rules="rules"
- ref="listData1"
- >
- <el-form-item label="商品类型" prop="goodsType">
- <el-select
- v-model="listData.goodsType"
- placeholder="请选择商品类型"
- >
- <el-option
- v-for="(item, index) in goodsTypeOptions"
- :key="index"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="商品名称" prop="goodsName">
- <el-input
- style="width: 300px"
- v-model="listData.goodsName"
- ></el-input>
- </el-form-item>
- <el-form-item label="学时" prop="classHours">
- <el-input
- class="numInputs"
- type="age"
- v-model.number="listData.classHours"
- ><template slot="append">分钟</template></el-input
- >
- </el-form-item>
- <el-form-item label="教育类型" prop="educationTypeId">
- <el-select
- v-model="listData.educationTypeId"
- placeholder="请选择教育类型"
- @change="changeEducationTypeId"
- >
- <el-option
- v-for="(item, index) in eduTypeOptions"
- :key="index"
- :label="item.educationName"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="业务层次" prop="businessId">
- <el-select
- v-model="listData.businessId"
- placeholder="请选择业务层次"
- @change="changeBusinessId"
- >
- <el-option
- v-for="(item, index) in newCourTypeOptions"
- :key="index"
- :label="item.businessName"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item
- label="院校"
- prop="schoolId"
- v-if="listData.businessId && avtives()"
- >
- <el-select v-model="listData.schoolId" placeholder="请选择院校">
- <el-option
- v-for="(item, index) in newSchoolOption"
- :key="index"
- :label="item.schoolName"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item
- label="专业"
- prop="majorId"
- v-if="listData.businessId && avtivesMajor()"
- >
- <el-select v-model="listData.majorId" placeholder="请选择专业">
- <el-option
- v-for="(item, index) in newMajorOption"
- :key="index"
- :label="item.categoryName"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <!-- <el-form-item
- label="科目/类目"
- prop="subjectId"
- v-if="listData.businessId"
- >
- <el-select
- v-model="listData.subjectId"
- placeholder="请选择科目/类目"
- >
- <el-option
- v-for="(item, index) in newSujectOption"
- :key="index"
- :label="item.subjectName"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item> -->
- </el-form>
- </el-col>
- <el-col :span="12">
- <el-form label-position="right" label-width="120px" :model="listData">
- <el-form-item label="年份" prop="year">
- <el-date-picker
- v-model="listData.year"
- type="year"
- value-format="yyyy"
- placeholder="请选择年份"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="供应方(服务)" prop="supplyId">
- <el-select
- v-model="listData.supplyId"
- placeholder="请选择供应方(服务)"
- >
- <el-option
- v-for="(item, index) in supplyOption"
- :key="index"
- :label="item.supplyName"
- :value="item.supplyId"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="课程封面">
- <div class="imgBoxins">
- <img
- :src="$methodsTools.splitImgHost(listData.coverUrl)"
- alt=""
- />
- <div
- class="posimg"
- v-if="
- listData.coverUrl === null ||
- listData.coverUrl === '' ||
- listData.coverUrl === undefined
- "
- >
- <label for="uplose">
- <i class="el-icon-circle-plus-outline iconStsz"></i
- ></label>
- <input
- ref="file"
- type="file"
- style="display: none"
- id="uplose"
- @change="getImgFile"
- />
- <p>
- 注:请上传小于300kb,尺寸为750*440的图片,支持gif、jpg、jpeg、png等类型
- </p>
- </div>
- </div>
- <el-button
- v-if="
- listData.coverUrl !== null &&
- listData.coverUrl !== '' &&
- listData.coverUrl !== undefined
- "
- type="danger"
- size="mini"
- class="margin-top: 20px;"
- @click="clearImgs"
- >删除</el-button
- >
- </el-form-item>
- </el-form>
- </el-col>
- </el-row>
- <h5 class="fengs">商品价格和有效期</h5>
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form
- label-position="right"
- label-width="120px"
- :model="listData"
- :rules="rulesMors"
- ref="listData2"
- >
- <el-form-item label="商品标准价格" prop="standPrice">
- <el-input class="numInputs" v-model="listData.standPrice"
- ><template slot="append">元</template></el-input
- >
- </el-form-item>
- <el-form-item label="商品最低价格" prop="lowestPrice">
- <el-input class="numInputs" v-model="listData.lowestPrice"
- ><template slot="append">元</template></el-input
- >
- </el-form-item>
- <el-form-item label="状态" prop="status">
- <el-radio-group v-model="listData.status">
- <el-radio :label="1">有效</el-radio>
- <el-radio :label="0">无效</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="商品有效期" prop="timeArrays">
- <el-date-picker
- v-model="listData.timeArrays"
- type="daterange"
- value-format="timestamp"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- >
- </el-date-picker>
- </el-form-item>
- </el-form>
- </el-col>
- <el-col :span="12">
- <h5 style="margin-bottom: 10px">
- 商品标准价格明细表:
- <span class="clickSpan" @click="openBoxs(1)">添加</span>
- </h5>
- <el-table
- :data="listData.standPriceJson"
- show-summary
- border
- :header-cell-style="{
- 'background-color': '#eee',
- padding: '8px',
- color: '#333',
- }"
- >
- <el-table-column
- type="index"
- label="序号"
- width="80"
- align="center"
- >
- </el-table-column>
- <template v-for="(item, index) in tableSet">
- <el-table-column
- :width="item.width"
- :key="index"
- :label="item.label"
- align="center"
- :show-overflow-tooltip="true"
- header-align="center"
- :prop="item.prop"
- >
- <template slot-scope="scope">
- <span
- v-if="item.scope === 'editInfo'"
- @click="openBoxs(2, scope.row)"
- class="clickSpan"
- >{{ scope.row[item.prop] }}</span
- >
- <span v-else>{{ scope.row[item.prop] }}</span></template
- >
- </el-table-column></template
- >
- <el-table-column
- label="操作"
- align="center"
- fixed="right"
- width="100px"
- >
- <template slot-scope="scope">
- <el-button type="text" @click="delList(scope.row)"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </el-col>
- </el-row>
- <div v-if="listData.goodsType === 1">
- <h5 class="fengs">课程内容</h5>
- <div style="margin-bottom: 20px">
- <el-button @click="editAddBoxs" size="small">添加</el-button>
- <el-button
- @click="openSet"
- type="success"
- size="small"
- v-if="tableData.length"
- >试听设置</el-button
- >
- <el-button type="primary" @click="openJY" size="small"
- >关联讲义</el-button
- >
- </div>
- <el-table
- :data="tableData"
- border
- :header-cell-style="{
- 'background-color': '#eee',
- padding: '8px',
- color: '#333',
- }"
- :default-sort="{ prop: 'sort', order: 'ascending' }"
- >
- <template v-for="(item, index) in tableSetTSB">
- <el-table-column
- :width="item.width"
- :key="index"
- :label="item.label"
- align="center"
- :show-overflow-tooltip="true"
- header-align="center"
- :sortable="item.prop === 'sort'"
- sort-by="sort"
- :prop="item.prop"
- >
- <template slot-scope="scope">
- <span v-if="item.scope === 'types'">{{
- scope.row[item.prop] === 1
- ? "录播"
- : scope.row[item.prop] === 2
- ? "直播"
- : scope.row[item.prop] === 3
- ? "回放"
- : "未知"
- }}</span>
- <span v-else-if="item.scope === 'busin'">
- {{ scope.row[item.prop1] + " - " + scope.row[item.prop2] }}
- </span>
- <span v-else-if="item.scope === 'Status'">
- {{
- scope.row[item.prop] === 1
- ? "发布"
- : scope.row[item.prop] === 0
- ? "未发布"
- : "未知"
- }}
- </span>
- <div v-else-if="item.scope === 'inputs'">
- <el-input-number
- style="width: 50px"
- size="small"
- :controls="false"
- v-model="scope.row[item.prop]"
- controls-position="right"
- :min="0"
- ></el-input-number>
- </div>
- <span v-else>{{ scope.row[item.prop] }}</span></template
- >
- </el-table-column></template
- >
- <el-table-column
- label="操作"
- align="center"
- fixed="right"
- width="100px"
- >
- <template slot-scope="scope">
- <el-button type="text" @click="del(scope.row, scope.$index)"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div v-if="listData.goodsType === 2">
- <h5 class="fengs">题卷内容</h5>
- <div style="margin-bottom: 20px">
- <el-button @click="changeOptionsType2" size="small">添加</el-button>
- <el-button
- @click="openSetTK"
- type="success"
- size="small"
- v-if="tableData2.length"
- >试做设置</el-button
- >
- </div>
- <el-table
- :data="tableData2"
- border
- :header-cell-style="{
- 'background-color': '#eee',
- padding: '8px',
- color: '#333',
- }"
- :default-sort="{ prop: 'sort', order: 'ascending' }"
- >
- <template v-for="(item, index) in tableSetTSB2">
- <el-table-column
- :width="item.width"
- :key="index"
- :label="item.label"
- align="center"
- :show-overflow-tooltip="true"
- header-align="center"
- :sortable="item.prop === 'sort'"
- sort-by="sort"
- :prop="item.prop"
- >
- <template slot-scope="scope">
- <span v-if="item.scope === 'types'">{{
- scope.row[item.prop] === 1
- ? "录播"
- : scope.row[item.prop] === 2
- ? "直播"
- : scope.row[item.prop] === 3
- ? "回放"
- : "未知"
- }}</span>
- <span v-else-if="item.scope === 'type'">
- {{
- scope.row[item.prop] === 1
- ? "模块卷"
- : scope.row[item.prop] === 2
- ? "章卷"
- : scope.row[item.prop] === 3
- ? "试卷"
- : "未知"
- }}
- </span>
- <span v-else-if="item.scope === 'busin'">
- {{ scope.row[item.prop1] + " - " + scope.row[item.prop2] }}
- </span>
- <span v-else-if="item.scope === 'Status'">
- {{
- scope.row[item.prop] === 1
- ? "发布"
- : scope.row[item.prop] === 0
- ? "未发布"
- : "未知"
- }}
- </span>
- <div v-else-if="item.scope === 'inputs'">
- <el-input-number
- style="width: 50px"
- size="small"
- :controls="false"
- v-model="scope.row[item.prop]"
- controls-position="right"
- :min="0"
- ></el-input-number>
- </div>
- <span v-else>{{ scope.row[item.prop] }}</span></template
- >
- </el-table-column></template
- >
- <el-table-column
- label="操作"
- align="center"
- fixed="right"
- width="100px"
- >
- <template slot-scope="scope">
- <el-button type="text" @click="del2(scope.row, scope.$index)"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </div>
- <h5 class="fengs">颁发证书</h5>
- <div class="dis_fs">
- <el-popover placement="bottom" trigger="click">
- <el-checkbox-group v-model="listData.certificateIds">
- <el-checkbox
- v-for="(item, index) in certificateOption"
- :key="index"
- :label="item.id"
- >{{ item.certificateName }}</el-checkbox
- >
- </el-checkbox-group>
- <el-button slot="reference" size="small">选择证书</el-button>
- </el-popover>
- <ul>
- <li
- class="boxlefs"
- v-for="item in listData.certificateIds"
- :key="item"
- >
- {{ checkListName(item) }}
- <i
- class="el-icon-error"
- style="color: #f56c6c"
- @click="clearBtns(item)"
- ></i>
- </li>
- <div style="clear: both"></div>
- </ul>
- </div>
- </div>
- <h5>商品包装介绍</h5>
- <div class="boxsSTTs">
- <el-form
- label-position="right"
- label-width="70px"
- :model="listData"
- :rules="rules"
- ref="listData"
- >
- <el-form-item label="商品简介" prop="introduce">
- <el-input type="textarea" v-model="listData.introduce"></el-input>
- </el-form-item>
- <el-form-item label="适合对象" prop="suitableObject">
- <el-input
- type="textarea"
- v-model="listData.suitableObject"
- ></el-input>
- </el-form-item>
- <el-form-item label="购买须知" prop="buyNote">
- <el-input type="textarea" v-model="listData.buyNote"></el-input>
- </el-form-item>
- </el-form>
- <div class="courseStyle">
- 商品详情<span style="color: #999; margin-left: 6px">支持图文</span>
- </div>
- <div style="text-align: center; margin-bottom: 10px">
- <el-button
- size="mini"
- :type="active === 1 ? 'success' : ''"
- @click="active = 1"
- >PC端</el-button
- >
- <el-button
- size="mini"
- :type="active === 2 ? 'success' : ''"
- @click="active = 2"
- >手机端</el-button
- >
- </div>
- <editor
- v-show="active === 1"
- v-model="listData.pcDetailHtml"
- :min-height="300"
- :max-height="500"
- :uploadStatus="uploadStatus"
- />
- <editor
- v-show="active === 2"
- v-model="listData.mobileDetailHtml"
- :min-height="300"
- :max-height="500"
- :uploadStatus="uploadStatus"
- />
- </div>
- <div style="text-align: center; margin-top: 20px">
- <el-button @click="backPage" size="mini">取消</el-button>
- <el-button type="primary" @click="submit('listData', 1)" size="mini"
- >保存</el-button
- >
- <el-button
- v-if="listData.goodsStatus !== 0 || listData.goodsStatus !== 1"
- type="primary"
- @click="submit('listData', 2)"
- size="mini"
- >{{
- listData.goodsStatus === 0
- ? "上架"
- : listData.goodsStatus === 1
- ? "下架"
- : "未知"
- }}</el-button
- >
- </div>
- <el-dialog
- :title="statusBox === 1 ? '添加' : '编辑'"
- :visible.sync="dialogVisible"
- width="800px"
- >
- <el-form
- label-position="right"
- label-width="110px"
- :model="listitemData"
- :rules="rulesItem"
- ref="listitemData"
- >
- <el-form-item
- v-for="(items, indexs) in listitem"
- :key="indexs"
- :label="items.label"
- :prop="items.prop"
- >
- <el-select
- v-if="items.scope === 'select'"
- v-model="listitemData[items.prop]"
- placeholder="请选择费用类型"
- >
- <el-option
- v-for="(item, index) in items.options"
- :key="index"
- :label="item.costName"
- :value="item.costId"
- >
- </el-option>
- </el-select>
- <el-input v-else v-model="listitemData[items.prop]"></el-input>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="submitForm('listitemData')"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <el-dialog
- title="添加课程"
- :visible.sync="dialogVisibleTableBoxs"
- width="800px"
- >
- <el-table
- ref="multipleTable"
- :data="boxtableData"
- border
- @select-all="selectAll"
- @select="select"
- :row-key="getRowKeys"
- :header-cell-style="{
- 'background-color': '#eee',
- padding: '8px',
- color: '#333',
- }"
- >
- <el-table-column
- align="center"
- type="selection"
- width="55"
- header-align="center"
- :selectable="checkboxT"
- :reserve-selection="true"
- >
- </el-table-column>
- <template v-for="(item, index) in tableSetTSBBOX">
- <el-table-column
- v-if="item.scope !== 'inputs'"
- :width="item.width"
- :key="index"
- :label="item.label"
- align="center"
- :show-overflow-tooltip="true"
- header-align="center"
- >
- <template slot-scope="scope">
- <span v-if="item.scope === 'Status'">
- {{
- scope.row[item.prop] === 1
- ? "发布"
- : scope.row[item.prop] === 0
- ? "未发布"
- : "未知"
- }}
- </span>
- <span v-else>{{ scope.row[item.prop] }}</span></template
- >
- </el-table-column></template
- >
- </el-table>
- <pagination
- :total="total"
- :pageSize="pageSize"
- :currentPage="currentPage"
- @handleSizeChange="handleSizeChange"
- @handleCurrentChange="handleCurrentChange"
- />
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisibleTableBoxs = false">取 消</el-button>
- <el-button
- type="primary"
- :disabled="activeLists.length === 0"
- @click="submitTab"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <el-dialog
- title="添加题卷"
- :visible.sync="dialogVisibleTableBoxs2"
- width="800px"
- >
- <el-select
- v-model="optionsNums"
- placeholder="请选择类型"
- @change="editAddBoxs2"
- >
- <el-option
- v-for="item in optionsType"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- <el-table
- ref="multipleTable2"
- :data="boxtableData2"
- border
- @select-all="selectAll2"
- @select="select2"
- :row-key="getRowKeys2"
- :header-cell-style="{
- 'background-color': '#eee',
- padding: '8px',
- color: '#333',
- }"
- >
- <el-table-column
- align="center"
- type="selection"
- width="55"
- header-align="center"
- :selectable="checkboxT2"
- :reserve-selection="true"
- >
- </el-table-column>
- <template v-for="(item, index) in tableSetTSBBOX2">
- <el-table-column
- v-if="item.scope !== 'inputs'"
- :width="item.width"
- :key="index"
- :label="item.label"
- align="center"
- :show-overflow-tooltip="true"
- header-align="center"
- >
- <template slot-scope="scope">
- <span v-if="item.scope === 'Status'">
- {{
- scope.row[item.prop] === 1
- ? "发布"
- : scope.row[item.prop] === 0
- ? "未发布"
- : "未知"
- }}
- </span>
- <span v-else-if="item.scope === 'type'">
- {{
- scope.row[item.prop] === 1
- ? "模块卷"
- : scope.row[item.prop] === 2
- ? "章卷"
- : scope.row[item.prop] === 3
- ? "试卷"
- : "未知"
- }}
- </span>
- <span v-else>{{ scope.row[item.prop] }}</span></template
- >
- </el-table-column></template
- >
- </el-table>
- <pagination
- :total="total2"
- :pageSize="pageSize2"
- :currentPage="currentPage2"
- @handleSizeChange="handleSizeChange2"
- @handleCurrentChange="handleCurrentChange2"
- />
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisibleTableBoxs2 = false">取 消</el-button>
- <el-button type="primary" @click="submitTab2">确 定</el-button>
- </span>
- </el-dialog>
- <el-dialog title="关联讲义" :visible.sync="aboutJYBox" width="400px">
- <el-button @click="openJYActiveBox" size="mini">选择讲义</el-button>
- <div v-if="handoutsArray" style="margin: 10px">
- {{ handoutsArray.handoutsName }}
- <i
- class="el-icon-error"
- style="color: #f56c6c; cursor: pointer"
- @click="delHandouts"
- ></i>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="aboutJYBox = false">取 消</el-button>
- <el-button type="primary" @click="submitJYs">确 定</el-button>
- </span>
- </el-dialog>
- <el-dialog
- title="关联讲义列表"
- :visible.sync="jYactiveBoxs"
- width="780px"
- append-to-body
- >
- <el-table
- ref="multipleTable"
- :data="jYtableData"
- border
- :header-cell-style="{
- 'background-color': '#eee',
- padding: '8px',
- color: '#333',
- }"
- >
- <el-table-column label="" width="45" align="center">
- <template scope="scope">
- <el-radio
- :label="scope.row.handoutsId"
- v-model="templateRadio"
- @change.native="getTemplateRow(scope.$index, scope.row)"
- >{{ "" }}</el-radio
- >
- </template>
- </el-table-column>
- <template v-for="(item, index) in jYtableSet">
- <el-table-column
- v-if="item.scope !== 'inputs'"
- :width="item.width"
- :key="index"
- :label="item.label"
- align="center"
- :show-overflow-tooltip="true"
- header-align="center"
- >
- <template slot-scope="scope">
- <span v-if="item.scope === 'Status'">
- {{
- scope.row[item.prop] === 1
- ? "发布"
- : scope.row[item.prop] === 0
- ? "未发布"
- : "未知"
- }}
- </span>
- <span v-else>{{ scope.row[item.prop] }}</span></template
- >
- </el-table-column></template
- >
- </el-table>
- <span slot="footer" class="dialog-footer">
- <el-button @click="jYactiveBoxs = false">取 消</el-button>
- <el-button type="primary" @click="activejY">确 定</el-button>
- </span>
- </el-dialog>
- <popple-set
- :key="Math.random()"
- ref="poppleSet"
- :tableData="tableData"
- :auditionList="auditionList"
- @uploadArrays="uploadArrays"
- />
- <popple-set-tk
- :key="Math.random()"
- ref="poppleSetTk"
- :tableData="tableData2"
- :examConfigList="examConfigList"
- @uploadArrays="uploadArraysTK"
- />
- </div>
- </template>
- <script>
- import poppleSet from "../poppleSet.vue";
- import poppleSetTk from "../poppleSetTK.vue";
- import pagination from "@/components/pagination";
- import Editor from "@/components/Editor";
- export default {
- components: { Editor, pagination, poppleSet, poppleSetTk },
- data() {
- return {
- active: 1,
- uploadStatus: 2,
- bfImg: "oss/images/avatar/20211013/1634097664410_1397766697",
- listData: {
- coverUrl: "oss/images/avatar/20211013/1634097664410_1397766697",
- educationTypeId: "",
- businessId: "",
- schoolId: "",
- majorId: "",
- subjectId: "",
- standPriceJson: [],
- certificateIds: [],
- },
- eduTypeOptions: [], //教育类型数据
- courTypeOptions: [], //业务层次数据
- sujectOption: [], //科目数据
- schoolOption: [], //院校数据
- majorOption: [], //专业数据
- supplyOption: [], //供应方数据
- certificateOption: [], //证书数据
- goodsTypeOptions: [
- {
- label: "视频",
- value: 1,
- },
- {
- label: "题库",
- value: 2,
- },
- {
- label: "面授",
- value: 3,
- },
- {
- label: "服务",
- value: 4,
- },
- {
- label: "组合",
- value: 5,
- },
- ], //商品类型
- newCourTypeOptions: [], //当前业务层次数据
- newSujectOption: [], //当前科目数据数据
- newSchoolOption: [], //当前院校数据
- newMajorOption: [], //当前专业数据
- tableSet: [
- {
- label: "费用类型",
- prop: "priceTypeName",
- prop1: "priceTypeId",
- scope: "editInfo",
- },
- {
- label: "费用金额(元)",
- prop: "price",
- scope: "price",
- },
- ],
- listitemData: {},
- // 弹窗字段
- listitem: [
- {
- label: "费用类型",
- prop: "priceTypeId",
- scope: "select",
- options: [],
- },
- {
- label: "费用金额",
- prop: "price",
- },
- ],
- statusBox: 1, //1添加2编辑
- dialogVisible: false,
- NUMBerS: 0,
- rules: {
- goodsType: [
- {
- required: true,
- message: "请选择商品类型",
- trigger: ["blur", "change"],
- },
- ],
- goodsName: [
- {
- required: true,
- message: "请输入商品名称",
- trigger: "change",
- },
- ],
- educationTypeId: [
- {
- required: true,
- message: "请选择教育类型",
- trigger: ["blur", "change"],
- },
- ],
- businessId: [
- {
- required: true,
- message: "请选择业务层次",
- trigger: ["blur", "change"],
- },
- ],
- schoolId: [
- {
- required: true,
- message: "请选择院校",
- trigger: ["blur", "change"],
- },
- ],
- majorId: [
- {
- required: true,
- message: "请选择专业",
- trigger: ["blur", "change"],
- },
- ],
- subjectId: [
- {
- required: true,
- message: "请选择科目",
- trigger: ["blur", "change"],
- },
- ],
- classHours: [
- { required: true, message: "请输入学时", trigger: "blur" },
- {
- validator(rule, value, callback) {
- if (
- Number.isInteger(Number(value)) &&
- Number(value) >= 0 &&
- Number(value) < 9999999
- ) {
- callback();
- } else {
- callback(new Error("请输入正整数"));
- }
- },
- trigger: "blur",
- },
- ],
- },
- rulesMors: {
- timeArrays: [
- {
- required: true,
- message: "请选择有效期",
- trigger: ["blur", "change"],
- },
- ],
- status: [
- {
- required: true,
- message: "请选择状态",
- trigger: ["blur", "change"],
- },
- ],
- standPrice: [
- { required: true, message: "请输入标准价格", trigger: "blur" },
- {
- validator(rule, value, callback) {
- var reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/;
- if (reg.test(value)) {
- callback();
- } else {
- callback(new Error("请输入不超过两位小数点的价格数值"));
- }
- },
- trigger: "blur",
- },
- ],
- lowestPrice: [
- { required: true, message: "请输入最低价格", trigger: "blur" },
- {
- validator(rule, value, callback) {
- var reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/;
- if (reg.test(value)) {
- callback();
- } else {
- callback(new Error("请输入不超过两位小数点的价格数值"));
- }
- },
- trigger: "blur",
- },
- ],
- },
- rulesItem: {
- priceTypeId: [
- {
- required: true,
- message: "请选择费用类型",
- trigger: ["blur", "change"],
- },
- ],
- price: [
- { required: true, message: "请输入费用金额", trigger: "blur" },
- {
- validator(rule, value, callback) {
- var reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/;
- if (reg.test(value)) {
- callback();
- } else {
- callback(new Error("请输入不超过两位小数点的价格数值"));
- }
- },
- trigger: "blur",
- },
- ],
- },
- // 视频商品表格数据------------------------------------------------------------------------start
- tableSetTSB: [
- { label: "排序", prop: "sort", scope: "inputs", width: "100" },
- { label: "科目名称", prop: "code" },
- { label: "课程名称", prop: "prefixName", width: "120" },
- { label: "科目", prop: "subjectName" },
- { label: "专业", prop: "categoryName" },
- { label: "院校", prop: "schoolName" },
- {
- label: "业务层次",
- prop1: "projectName",
- prop2: "businessName",
- scope: "busin",
- },
- { label: "教育类型", prop: "educationName" },
- {
- label: "发布状态",
- prop: "publishStatus",
- scope: "Status",
- width: "120",
- },
- ],
- tableSetTSBBOX: [
- { label: "课程编码", prop: "code" },
- { label: "名称前缀", prop: "prefixName", width: "120" },
- { label: "课程标题", prop: "courseName" },
- {
- label: "发布状态",
- prop: "publishStatus",
- scope: "Status",
- width: "120",
- },
- ],
- total: 0, //一共多少条
- pageSize: 10, //每页多少条数据
- currentPage: 1, //当前页码
- disCheckList: [],
- tableData: [],
- dialogVisibleTableBoxs: false,
- boxtableData: [],
- activeLists: [],
- auditionList: [],
- aboutJYBox: false,
- jYtableSet: [
- { label: "讲义编码", prop: "encoder" },
- { label: "讲义标题", prop: "handoutsName" },
- { label: "发布状态", prop: "status", scope: "Status" },
- ],
- jYtableData: [],
- jYactiveBoxs: false,
- templateRadio: "",
- handoutsArray: undefined,
- handoutsIdTable: "",
- // 视频商品表格数据------------------------------------------------------------------------end
- // 题库商品表格数据------------------------------------------------------------------------start
- tableSetTSB2: [
- { label: "排序", prop: "sort", scope: "inputs", width: "100" },
- { label: "题卷名称", prop: "name", width: "120" },
- { label: "题库类型", prop: "type", scope: "type" },
- // {
- // label: "发布状态",
- // prop: "publishStatus",
- // scope: "Status",
- // width: "120",
- // },
- ],
- tableSetTSBBOX2: [
- { label: "编码", prop: "code" },
- { label: "前缀", prop: "prefixName", width: "120" },
- { label: "名称", prop: "name" },
- { label: "题库类型", prop: "type", scope: "type" },
- {
- label: "发布状态",
- prop: "publishStatus",
- scope: "Status",
- width: "120",
- },
- ],
- total2: 0, //一共多少条
- pageSize2: 10, //每页多少条数据
- currentPage2: 1, //当前页码
- disCheckList2: {
- moduleCheck: [],
- chapterCheck: [],
- examCheck: [],
- },
- tableData2: [],
- dialogVisibleTableBoxs2: false,
- boxtableData2: [],
- activeLists2: {
- moduleCheck: [],
- chapterCheck: [],
- examCheck: [],
- },
- optionsNums: 1,
- optionsType: [
- {
- label: "模块卷",
- value: 1,
- },
- { label: "章卷", value: 2 },
- { label: "试卷", value: 3 },
- ],
- examConfigList: [],
- // 题库商品表格数据------------------------------------------------------------------------end
- };
- },
- created() {
- this.$modal.loading("正在导入数据,请稍后...");
- },
- watch: {
- handoutsIdTable: {
- handler(newValue, oldValue) {
- this.showTitles();
- },
- },
- },
- mounted() {
- this.getDict();
- this.getJyData();
- },
- methods: {
- avtives() {
- if (this.listData.educationTypeId) {
- for (let i = 0; i < this.eduTypeOptions.length; i++) {
- if (this.eduTypeOptions[i].id === this.listData.educationTypeId) {
- return this.eduTypeOptions[i].tireStatus.indexOf("3") != -1;
- }
- }
- }
- },
- avtivesMajor() {
- if (this.listData.educationTypeId) {
- for (let i = 0; i < this.eduTypeOptions.length; i++) {
- if (this.eduTypeOptions[i].id === this.listData.educationTypeId) {
- return this.eduTypeOptions[i].tireStatus.indexOf("4") != -1;
- }
- }
- }
- },
- //根据ID回显讲义标题
- showTitles() {
- const sta = this.jYtableData.some((item) => {
- return item.handoutsId == this.handoutsIdTable;
- });
- if (sta) {
- this.jYtableData.map((item) => {
- if (item.handoutsId == this.handoutsIdTable) {
- this.handoutsArray = item;
- }
- });
- } else {
- this.handoutsArray = undefined;
- }
- },
- //删除讲义
- delHandouts() {
- this.handoutsIdTable = "";
- },
- activejY() {
- this.handoutsIdTable = this.templateRadio;
- this.jYactiveBoxs = false;
- },
- getTemplateRow(index, row) {
- this.templateRadio = row.handoutsId;
- },
- getJyData() {
- this.$api.inquireCourseHandoutsList({ status: "1,0" }).then((res) => {
- this.jYtableData = res.rows;
- });
- },
- //确定讲义ID
- submitJYs() {
- this.listData.handoutsId = this.handoutsIdTable;
- this.aboutJYBox = false;
- },
- openJY() {
- this.aboutJYBox = true;
- this.handoutsIdTable = this.listData.handoutsId;
- },
- openJYActiveBox() {
- this.jYactiveBoxs = true;
- this.templateRadio = this.handoutsIdTable;
- },
- uploadArrays(arrays) {
- this.auditionList = arrays;
- },
- uploadArraysTK(arrays) {
- this.examConfigList = arrays;
- },
- openSet() {
- this.$refs.poppleSet.dialogVisible = true;
- },
- openSetTK() {
- this.$refs.poppleSetTk.dialogVisible = true;
- },
- async getDict() {
- await this.EducationType();
- await this.ProjectType();
- await this.businessList();
- await this.CourseSubject();
- await this.UserSchool();
- await this.CourseMajor();
- await this.supply();
- await this.paycost();
- await this.Certificate();
- this.search();
- },
- EducationType() {
- return new Promise((resolve, reject) => {
- this.$api.inquireCourseEducationType({ status: 1 }).then((res) => {
- this.eduTypeOptions = res.rows;
- resolve();
- });
- });
- },
- ProjectType() {
- return new Promise((resolve, reject) => {
- this.$api.inquireCourseProjectType({ status: 1 }).then((res) => {
- this.projectTypeOptions = res.rows;
- resolve();
- });
- });
- },
- businessList() {
- return new Promise((resolve, reject) => {
- this.$api.inquirebusinessList({ status: 1 }).then((res) => {
- this.courTypeOptions = res.rows;
- this.newCourTypeOptions = res.rows;
- resolve();
- });
- });
- },
- CourseSubject() {
- return new Promise((resolve, reject) => {
- this.$api.inquireCourseSubject({ status: 1 }).then((res) => {
- res.rows.map((item, index) => {
- var array = [];
- item.courseProjectTypes.map((items, indexs) => {
- array.push(items.id);
- });
- item.courseArrays = array;
- });
- this.sujectOption = res.rows;
- resolve();
- });
- });
- },
- UserSchool() {
- return new Promise((resolve, reject) => {
- this.$api.inquireUserSchool({ status: 1 }).then((res) => {
- res.rows.map((item, index) => {
- var array = [];
- item.courseProjectTypes.map((items, indexs) => {
- array.push(items.id);
- });
- item.courseArrays = array;
- });
- this.schoolOption = res.rows;
- resolve();
- });
- });
- },
- CourseMajor() {
- return new Promise((resolve, reject) => {
- this.$api.inquireCourseMajor({ status: 1 }).then((res) => {
- res.rows.map((item, index) => {
- var array = [];
- item.courseProjectTypeVo.map((items, indexs) => {
- array.push(items.id);
- });
- item.courseArrays = array;
- });
- this.majorOption = res.rows;
- resolve();
- });
- });
- },
- supply() {
- return new Promise((resolve, reject) => {
- this.$api.inquirepaysupply({ status: 1 }).then((res) => {
- this.supplyOption = res.rows;
- resolve();
- });
- });
- },
- paycost() {
- return new Promise((resolve, reject) => {
- this.$api.inquirepaycost({ status: 1 }).then((res) => {
- this.listitem[0].options = res.rows;
- resolve();
- });
- });
- },
- Certificate() {
- return new Promise((resolve, reject) => {
- this.$api.inquireBaseCertificate({ status: 1 }).then((res) => {
- this.certificateOption = res.rows;
- resolve();
- });
- });
- },
- search() {
- this.$api.obtainGoods(this.$route.query.id).then((res) => {
- res.data.standPriceJson = JSON.parse(res.data.standPriceJson);
- if (res.data.goodsAuditionConfig && res.data.goodsType == 1) {
- var goodsAuditionConfig = JSON.parse(res.data.goodsAuditionConfig);
- var arrays = [];
- goodsAuditionConfig.map((item) => {
- arrays.push({
- TypeId: "3-" + item.sectionId,
- menuId: item.sectionId,
- courseId: item.courseId,
- auditionMinute: item.auditionMinute,
- });
- });
- this.auditionList = arrays;
- }
- if (res.data.goodsExamConfig && res.data.goodsType == 2) {
- var arrays = [];
- var goodsExamConfig = JSON.parse(res.data.goodsExamConfig);
- goodsExamConfig.map((item) => {
- var ast = {};
- if (item.moduleExamId && item.chapterExamId && item.examId) {
- ast.TypeId =
- "3-" +
- item.moduleExamId +
- "-" +
- item.chapterExamId +
- "-" +
- item.examId;
- ast.moduleExamId = item.moduleExamId;
- ast.chapterExamId = item.chapterExamId;
- }
- if (!item.moduleExamId && item.chapterExamId && item.examId) {
- ast.TypeId = "3-" + item.chapterExamId + "-" + item.examId;
- ast.chapterExamId = item.chapterExamId;
- }
- if (!item.moduleExamId && !item.chapterExamId && item.examId) {
- ast.TypeId = "3-" + item.examId;
- }
- ast.examId = item.examId;
- ast.num = item.num;
- arrays.push(ast);
- });
- this.examConfigList = arrays;
- }
- if (res.data.certificateIds) {
- res.data.certificateIds = res.data.certificateIds
- .split(",")
- .map(Number);
- } else {
- res.data.certificateIds = [];
- }
- res.data.timeArrays = [
- this.$methodsTools.time10to13(res.data.validityStartTime, 2),
- this.$methodsTools.time10to13(res.data.validityEndTime, 2),
- ];
- res.data.year = res.data.year + "";
- this.listData = res.data;
- // //富文本编辑器神坑处理
- // this.$nextTick(function () {
- // let inputDom = document.querySelectorAll(".el-input__inner")[0];
- // inputDom.focus();
- // });
- if (res.data.goodsType) {
- this.getTableInfos(res.data.goodsType);
- }
- this.changeBusiness();
- this.$modal.closeLoading();
- });
- },
- getTableInfos(int) {
- if (int === 1) {
- this.$api.obtainCourseSgoodsId(this.$route.query.id).then((res) => {
- this.tableData = res.rows;
- });
- }
- if (int === 2) {
- this.$api
- .inquireGoodsbanklist({ goodsId: this.$route.query.id })
- .then((res) => {
- res.data.map((item) => {
- if (item.type === 1) {
- item.moduleExamId = item.majorId;
- }
- if (item.type === 2) {
- item.chapterExamId = item.majorId;
- }
- if (item.type === 3) {
- item.examId = item.majorId;
- }
- });
- this.tableData2 = res.data;
- });
- }
- },
- changeBusiness() {
- var arrays = [];
- this.courTypeOptions.map((item) => {
- if (item.educationId === this.listData.educationTypeId) {
- arrays.push(item);
- }
- });
- this.newCourTypeOptions = arrays;
- this.courTypeOptions.map((item) => {
- if (item.id === this.listData.businessId) {
- var newSujectOption = [];
- var newSchoolOption = [];
- var newMajorOption = [];
- this.sujectOption.map((items) => {
- if (items.courseArrays.indexOf(item.projectId) !== -1) {
- newSujectOption.push(items);
- }
- });
- this.schoolOption.map((items) => {
- if (items.courseArrays.indexOf(item.projectId) !== -1) {
- newSchoolOption.push(items);
- }
- });
- this.majorOption.map((items) => {
- if (items.courseArrays.indexOf(item.projectId) !== -1) {
- newMajorOption.push(items);
- }
- });
- this.newSujectOption = newSujectOption;
- this.newSchoolOption = newSchoolOption;
- this.newMajorOption = newMajorOption;
- }
- });
- },
- //改变教育类型
- changeEducationTypeId() {
- var arrays = [];
- this.courTypeOptions.map((item) => {
- if (item.educationId === this.listData.educationTypeId) {
- arrays.push(item);
- }
- });
- this.newCourTypeOptions = arrays;
- this.listData.businessId = "";
- },
- //改变业务层次触发
- changeBusinessId() {
- this.listData.schoolId = "";
- this.listData.majorId = "";
- this.listData.subjectId = "";
- this.courTypeOptions.map((item) => {
- if (item.id === this.listData.businessId) {
- this.listData.educationTypeId = item.educationId;
- var newSujectOption = [];
- var newSchoolOption = [];
- var newMajorOption = [];
- this.sujectOption.map((items) => {
- if (items.courseArrays.indexOf(item.projectId) !== -1) {
- newSujectOption.push(items);
- }
- });
- this.schoolOption.map((items) => {
- if (items.courseArrays.indexOf(item.projectId) !== -1) {
- newSchoolOption.push(items);
- }
- });
- this.majorOption.map((items) => {
- if (items.courseArrays.indexOf(item.projectId) !== -1) {
- newMajorOption.push(items);
- }
- });
- this.newSujectOption = newSujectOption;
- this.newSchoolOption = newSchoolOption;
- this.newMajorOption = newMajorOption;
- }
- });
- },
- getImgFile() {
- var self = this;
- var file = self.$refs.file.files[0];
- if (file === undefined) {
- self.$set(self.listData, "coverUrl", "");
- return;
- }
- if (file.size > 0.3 * 1024 * 1024) {
- self.$message.error("图片不得大于300kb");
- return;
- }
- var type = self.$refs.file.value.toLowerCase().split(".").splice(-1);
- if (
- type[0] != "jpg" &&
- type[0] != "png" &&
- type[0] != "jpeg" &&
- type[0] != "gif"
- ) {
- self.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
- self.$refs.file.value = "";
- return;
- }
- this.$upload.upload(file, 0).then((res) => {
- self.listData.coverUrl = res;
- });
- },
- clearImgs() {
- this.listData.coverUrl = "";
- },
- async submit(formName, int) {
- //多表单启动验证,这里有四个表单
- let formNameList = ["listData1", "listData2"];
- var result = true;
- for (let index = 0; index < formNameList.length; index++) {
- await this.$refs[formNameList[index]].validate((e) => {
- result = e;
- });
- if (!result) {
- break;
- }
- }
- if (!result) {
- this.$message.error("请填写必填信息");
- return;
- } else {
- if (
- this.listData.coverUrl === "" ||
- this.listData.coverUrl === null ||
- this.listData.coverUrl === undefined
- ) {
- this.$message.error("请上传节封面");
- return false;
- }
- //保存表单
- this.rulesTableSumbit(int);
- }
- },
- rulesTableSumbit(int) {
- var datas = JSON.parse(JSON.stringify(this.listData));
- if (int === 2) {
- if (this.listData.goodsStatus === 1) {
- datas.goodsStatus = 0;
- }
- if (this.listData.goodsStatus === 0) {
- datas.goodsStatus = 1;
- }
- }
- this.courTypeOptions.map((item) => {
- if (item.id === this.listData.businessId) {
- datas.projectId = item.projectId;
- }
- });
- datas.status = 1;
- datas.certificateIds = this.listData.certificateIds.toString();
- datas.validityStartTime = this.$methodsTools.time10to13(
- this.listData.timeArrays[0],
- 1
- );
- datas.validityEndTime = this.$methodsTools.time10to13(
- this.listData.timeArrays[1],
- 1
- );
- datas.standPriceJson = JSON.stringify(this.listData.standPriceJson);
- datas.standPrice = Number(this.listData.standPrice);
- datas.lowestPrice = Number(this.listData.lowestPrice);
- datas.lowestPrice = Number(this.listData.year);
- delete datas.timeArrays;
- if (this.listData.goodsType === 1) {
- var courseIdList = [];
- this.tableData.map((item) => {
- courseIdList.push({
- courseId: item.courseId,
- sort: Number(item.sort),
- });
- });
- var auditionListArray = [];
- this.auditionList.map((item) => {
- auditionListArray.push({
- auditionMinute: item.auditionMinute,
- courseId: item.courseId,
- sectionId: item.menuId,
- });
- });
- datas.auditionList = auditionListArray;
- datas.courseList = courseIdList;
- if (!this.listData.handoutsId) {
- datas.handoutsId = 0;
- }
- this.$api.editGoods(datas).then((res) => {
- this.$message.success("修改成功");
- setTimeout(() => {
- this.$router.go(-1);
- }, 300);
- });
- } else if (this.listData.goodsType === 2) {
- var courseIdList = [];
- this.tableData2.map((item) => {
- if (item.type === 1) {
- courseIdList.push({
- majorId: item.moduleExamId,
- sort: Number(item.sort),
- type: item.type,
- });
- }
- if (item.type === 2) {
- courseIdList.push({
- majorId: item.chapterExamId,
- sort: Number(item.sort),
- type: item.type,
- });
- }
- if (item.type === 3) {
- courseIdList.push({
- majorId: item.examId,
- sort: Number(item.sort),
- type: item.type,
- });
- }
- });
- datas.bankList = courseIdList;
- var examConfigListArray = [];
- this.examConfigList.map((item) => {
- examConfigListArray.push({
- num: item.num,
- chapterExamId: item.chapterExamId,
- examId: item.examId,
- moduleExamId: item.moduleExamId,
- });
- });
- datas.examConfigList = examConfigListArray;
- this.$api.editGoodsbank(datas).then((res) => {
- this.$message.success("修改成功");
- setTimeout(() => {
- this.$router.go(-1);
- }, 300);
- });
- } else {
- this.$message.warning("当前商品类型正在开发中...");
- }
- },
- backPage() {
- this.$router.go(-1);
- },
- openBoxs(int, item) {
- if (int === 1) {
- this.listitemData = {};
- } else {
- this.NUMBerS = this.listData.standPriceJson.indexOf(item);
- this.listitemData = JSON.parse(JSON.stringify(item));
- }
- this.statusBox = int;
- this.dialogVisible = true;
- this.$nextTick(() => {
- this.$refs.listitemData.clearValidate();
- });
- },
- submitForm(formName) {
- this.$refs[formName].validate((valid) => {
- if (valid) {
- this.rulesTable();
- } else {
- return false;
- }
- });
- },
- rulesTable() {
- if (this.statusBox === 2) {
- this.$set(
- this.listData.standPriceJson,
- this.NUMBerS,
- this.listitemData
- );
- // this.listData.standPriceJson[this.NUMBerS] = this.listitemData;
- } else {
- this.listitem[0].options.map((i, k) => {
- if (i.costId === Number(this.listitemData.priceTypeId)) {
- this.listitemData.priceTypeName = i.costName;
- }
- });
- this.listData.standPriceJson.push(this.listitemData);
- }
- this.dialogVisible = false;
- },
- delList(item) {
- this.listData.standPriceJson.splice(
- this.listData.standPriceJson.indexOf(item),
- 1
- );
- },
- checkListName(id) {
- var a = "";
- this.certificateOption.map((item, index) => {
- if (item.id === id) {
- a = item.certificateName;
- }
- });
- return a;
- },
- clearBtns(id) {
- this.listData.certificateIds.map((item, index) => {
- if (item === id) {
- this.listData.certificateIds.splice(index, 1);
- }
- });
- },
- //视频商品表格函数START
- getInfos() {
- this.$api
- .inquireCourseListS({
- status: 1,
- pageNum: this.currentPage,
- pageSize: this.pageSize,
- })
- .then((res) => {
- this.boxtableData = res.rows;
- this.total = res.total;
- });
- },
- editAddBoxs() {
- var self = this;
- this.$api
- .inquireCourseListS({
- status: 1,
- pageNum: this.currentPage,
- pageSize: this.pageSize,
- })
- .then((res) => {
- var aList = [];
- this.tableData.map((item) => {
- aList.push(item.courseId);
- });
- this.disCheckList = aList;
- this.boxtableData = res.rows;
- this.total = res.total;
- this.dialogVisibleTableBoxs = true;
- this.$nextTick(function () {
- self.$refs.multipleTable.clearSelection();
- });
- });
- },
- submitTab() {
- if (this.activeLists.length === 0) {
- this.dialogVisibleTableBoxs = false;
- return;
- }
- this.tableData = this.tableData.concat(this.activeLists);
- this.dialogVisibleTableBoxs = false;
- this.$message.success("添加成功");
- this.activeLists = [];
- },
- del(item, index) {
- this.tableData.splice(index, 1);
- this.$message.success("删除成功");
- },
- selectAll(value) {
- this.activeLists = value;
- },
- select(value) {
- this.activeLists = value;
- },
- checkboxT(row, index) {
- if (this.disCheckList.indexOf(row.courseId) !== -1) {
- return false;
- } else {
- return true;
- }
- },
- getRowKeys(row) {
- return row.courseId;
- },
- handleSizeChange(v) {
- this.pageSize = v;
- this.currentPage = 1;
- this.getInfos();
- },
- handleCurrentChange(v) {
- this.currentPage = v;
- this.getInfos();
- },
- //视频商品表格函数END
- //题库商品表格函数START
- getInfos2() {
- this.$api
- .inquireCourseListS({
- status: 1,
- pageNum: this.currentPage2,
- pageSize: this.pageSize2,
- })
- .then((res) => {
- this.boxtableData = res.rows;
- this.total = res.total;
- });
- },
- changeOptionsType2() {
- this.editAddBoxs2(1);
- },
- editAddBoxs2(int) {
- var self = this;
- if (self.optionsNums === 1) {
- self.$api
- .inquireBankModule({
- status: 1,
- pageNum: self.currentPage2,
- pageSize: self.pageSize2,
- })
- .then((res) => {
- var aList = [];
- self.tableData2.map((item) => {
- if (item.type === 1) {
- aList.push(item.moduleExamId);
- }
- });
- res.rows.forEach((item) => {
- item.ids = 1 + "-" + item.moduleExamId;
- item.type = 1;
- item.name = item.moduleName;
- item.sort = 0;
- });
- self.disCheckList2.moduleCheck = aList;
- self.boxtableData2 = res.rows;
- self.total2 = res.total;
- self.dialogVisibleTableBoxs2 = true;
- if (int === 1) {
- self.$nextTick(function () {
- self.$refs.multipleTable2.clearSelection();
- });
- }
- });
- }
- if (self.optionsNums === 2) {
- self.$api
- .inquirebankchapterList({
- status: 1,
- pageNum: self.currentPage2,
- pageSize: self.pageSize2,
- })
- .then((res) => {
- var aList = [];
- self.tableData2.map((item) => {
- if (item.type === 2) {
- aList.push(item.chapterExamId);
- }
- });
- res.rows.forEach((item) => {
- item.ids = 2 + "-" + item.chapterExamId;
- item.sort = 0;
- item.type = 2;
- });
- self.disCheckList2.chapterCheck = aList;
- self.boxtableData2 = res.rows;
- self.total2 = res.total;
- self.dialogVisibleTableBoxs2 = true;
- if (int === 1) {
- self.$nextTick(function () {
- self.$refs.multipleTable2.clearSelection();
- });
- }
- });
- }
- if (self.optionsNums === 3) {
- self.$api
- .inquirebankexamList({
- status: 1,
- pageNum: self.currentPage2,
- pageSize: self.pageSize2,
- })
- .then((res) => {
- var aList = [];
- self.tableData2.map((item) => {
- if (item.type === 3) {
- aList.push(item.examId);
- }
- });
- res.rows.forEach((item) => {
- item.ids = 3 + "-" + item.examId;
- item.sort = 0;
- item.type = 3;
- item.name = item.examName;
- });
- self.disCheckList2.examCheck = aList;
- self.boxtableData2 = res.rows;
- self.total2 = res.total;
- self.dialogVisibleTableBoxs2 = true;
- if (int === 1) {
- self.$nextTick(function () {
- self.$refs.multipleTable2.clearSelection();
- });
- }
- });
- }
- },
- submitTab2() {
- if (
- this.activeLists2.moduleCheck.length === 0 &&
- this.activeLists2.chapterCheck.length === 0 &&
- this.activeLists2.examCheck.length === 0
- ) {
- this.dialogVisibleTableBoxs2 = false;
- return;
- }
- if (this.activeLists2.moduleCheck.length) {
- this.tableData2 = this.tableData2.concat(this.activeLists2.moduleCheck);
- }
- if (this.activeLists2.chapterCheck.length) {
- this.tableData2 = this.tableData2.concat(
- this.activeLists2.chapterCheck
- );
- }
- if (this.activeLists2.examCheck.length) {
- this.tableData2 = this.tableData2.concat(this.activeLists2.examCheck);
- }
- this.dialogVisibleTableBoxs2 = false;
- this.$message.success("添加成功");
- this.activeLists2 = {
- moduleCheck: [],
- chapterCheck: [],
- examCheck: [],
- };
- },
- del2(item, index) {
- this.tableData2.splice(index, 1);
- this.$message.success("删除成功");
- },
- selectAll2(value) {
- var lis = {
- moduleCheck: [],
- chapterCheck: [],
- examCheck: [],
- };
- value.map((item) => {
- if (item.type === 1) {
- lis.moduleCheck.push(item);
- }
- if (item.type === 2) {
- lis.chapterCheck.push(item);
- }
- if (item.type === 3) {
- lis.examCheck.push(item);
- }
- });
- this.activeLists2 = lis;
- },
- select2(value) {
- var lis = {
- moduleCheck: [],
- chapterCheck: [],
- examCheck: [],
- };
- value.map((item) => {
- if (item.type === 1) {
- lis.moduleCheck.push(item);
- }
- if (item.type === 2) {
- lis.chapterCheck.push(item);
- }
- if (item.type === 3) {
- lis.examCheck.push(item);
- }
- });
- this.activeLists2 = lis;
- },
- checkboxT2(row, index) {
- if (this.optionsNums === 1) {
- if (this.disCheckList2.moduleCheck.indexOf(row.moduleExamId) !== -1) {
- return false;
- } else {
- return true;
- }
- }
- if (this.optionsNums === 2) {
- if (this.disCheckList2.chapterCheck.indexOf(row.chapterExamId) !== -1) {
- return false;
- } else {
- return true;
- }
- }
- if (this.optionsNums === 3) {
- if (this.disCheckList2.examCheck.indexOf(row.examId) !== -1) {
- return false;
- } else {
- return true;
- }
- }
- },
- getRowKeys2(row) {
- return row.ids;
- },
- handleSizeChange2(v) {
- this.pageSize = v;
- this.currentPage = 1;
- this.getInfos2();
- },
- handleCurrentChange2(v) {
- this.currentPage = v;
- this.getInfos2();
- },
- //题库商品表格函数END
- },
- };
- </script>
- <style lang="less" scoped>
- .boxsSTTs {
- margin: 10px 0px;
- border: 1px solid #a4a4a4;
- border-top: 2px solid rgb(179, 204, 255);
- padding: 20px 40px;
- }
- .fengs {
- border-bottom: 1px dashed #a4a4a4;
- color: #a4a4a4;
- padding: 4px 0px;
- margin-bottom: 20px;
- }
- .imgBoxins {
- width: 375px;
- height: 220px;
- text-align: center;
- img {
- height: 100%;
- }
- }
- .iconStsz {
- font-size: 40px;
- color: #67c23a;
- cursor: pointer;
- }
- .numInputs {
- width: 220px;
- }
- /deep/ .el-date-editor .el-range-separator {
- width: 7%;
- }
- .courseStyle {
- margin-top: 20px;
- margin-bottom: 10px;
- font-size: 14px;
- border-bottom: 2px solid rgb(179, 204, 255);
- }
- .clickSpan {
- color: blue;
- cursor: pointer;
- }
- .boxlefs {
- font-size: 14px;
- cursor: pointer;
- border-radius: 8px;
- border: 1px solid #a4a4a4;
- float: left;
- margin: 5px 10px;
- height: 30px;
- line-height: 30px;
- padding: 0px 10px;
- padding-right: 5px;
- margin: 5px 10px;
- }
- .dis_fs {
- display: flex;
- align-items: center;
- }
- </style>
|