123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963 |
- <template>
- <el-dialog
- v-dialogDrag
- :fullscreen="dialogFull"
- :title="!dataForm.Id ? '车辆注册' : '修改'"
- :close-on-click-modal="false"
- :visible.sync="visible"
- width="80%"
- >
- <template slot="title">
- <div class="avue-crud__dialog__header">
- <span class="el-dialog__title">
- <span
- style="
- display: inline-block;
- width: 3px;
- height: 20px;
- margin-right: 5px;
- float: left;
- margin-top: 2px;
- "
- ></span>
- 车辆注册
- </span>
- <div class="avue-crud__dialog__menu enlarge" @click="full">
- <i
- style="
- cursor: pointer;
- display: block;
- width: 12px;
- height: 12px;
- border: 1px solid #909399;
- border-top: 3px solid #909399;
- margin-top: -3px;
- "
- ></i>
- </div>
- </div>
- </template>
- <el-form
- :model="dataFormD"
- :rules="dataRule"
- ref="dataFormD"
- @keyup.enter.native="dataFormSubmit()"
- label-width="125px"
- >
- <el-form-item label="车队名称" prop="fleetCompanyId" style="width: 325px">
- <el-select
- v-model="dataFormD.fleetCompanyId"
- :disabled="doNot"
- placeholder="请选择"
- @change="changeCar(dataFormD.fleetCompanyId)"
- >
- <el-option
- v-for="item in optionsProjectTypeItem"
- :key="item.fId"
- :label="item.fName"
- :value="item.fId"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="车牌号" prop="carNum" style="width: 325px">
- <el-input
- v-model="dataFormD.carNum"
- style="width: 200px"
- :disabled="doNot"
- placeholder="车牌号"
- ></el-input>
- </el-form-item>
- <el-form-item label="驾驶员" prop="driverId" style="width: 325px">
- <el-select
- v-model="dataFormD.driverId"
- :disabled="doNot"
- placeholder="驾驶员"
- @change="changeDriverId"
- style="width: 200px"
- >
- <el-option
- v-for="item in driverMans"
- :key="item.fId"
- :label="item.fName"
- :value="item.fId"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="挂号" prop="hangNum" style="width: 325px">
- <el-input
- v-model="dataFormD.hangNum"
- style="width: 200px"
- :disabled="doNot"
- placeholder="挂号"
- ></el-input>
- </el-form-item>
- <el-form-item label="燃油类型" prop="fuelType" style="width: 325px">
- <el-input
- v-model="dataFormD.fuelType"
- style="width: 200px"
- :disabled="doNot"
- placeholder="燃油类型"
- ></el-input>
- </el-form-item>
- <el-form-item label="车辆类型" prop="carType" style="width: 325px">
- <el-input
- v-model="dataFormD.carType"
- style="width: 200px"
- :disabled="doNot"
- placeholder="车辆类型"
- ></el-input>
- </el-form-item>
- <el-form-item label="车辆名称" prop="carName" style="width: 325px">
- <el-input
- v-model="dataFormD.carName"
- style="width: 200px"
- :disabled="doNot"
- placeholder="车辆名称"
- ></el-input>
- </el-form-item>
- <el-form-item label="车辆品牌" prop="carBrand" style="width: 325px">
- <el-input
- v-model="dataFormD.carBrand"
- style="width: 200px"
- :disabled="doNot"
- placeholder="车辆品牌"
- ></el-input>
- </el-form-item>
- <el-form-item
- label="制造单位"
- prop="manufactureUnit"
- style="width: 325px"
- >
- <el-input
- v-model="dataFormD.manufactureUnit"
- style="width: 200px"
- :disabled="doNot"
- placeholder="制造单位"
- ></el-input>
- </el-form-item>
- <el-form-item
- label="发证机关"
- prop="officeOfCertificate"
- style="width: 325px"
- >
- <el-input
- v-model="dataFormD.officeOfCertificate"
- style="width: 200px"
- :disabled="doNot"
- placeholder="发证机关"
- ></el-input>
- </el-form-item>
- <el-form-item
- label="牵引车辆型号"
- prop="pullCarType"
- style="width: 325px"
- >
- <el-input
- v-model="dataFormD.pullCarType"
- style="width: 200px"
- :disabled="doNot"
- placeholder="牵引车辆型号"
- ></el-input>
- </el-form-item>
- <el-form-item
- label="牵引车车架号"
- prop="pullCarShelfNum"
- style="width: 325px"
- >
- <el-input
- v-model="dataFormD.pullCarShelfNum"
- style="width: 200px"
- :disabled="doNot"
- placeholder="牵引车车架号"
- ></el-input>
- </el-form-item>
- <el-form-item label="挂车型号" prop="mountCarType" style="width: 325px">
- <el-input
- v-model="dataFormD.mountCarType"
- style="width: 200px"
- :disabled="doNot"
- placeholder="挂车型号"
- ></el-input>
- </el-form-item>
- <el-form-item label="挂车车架号" prop="mountCarNum" style="width: 325px">
- <el-input
- v-model="dataFormD.mountCarNum"
- style="width: 200px"
- :disabled="doNot"
- placeholder="挂车车架号"
- ></el-input>
- </el-form-item>
- <el-form-item label="发动机型号" prop="engine" style="width: 325px">
- <el-input
- v-model="dataFormD.engine"
- style="width: 200px"
- :disabled="doNot"
- placeholder="发动机型号"
- ></el-input>
- </el-form-item>
- <el-form-item label="核载人数" prop="carLoadPersion" style="width: 325px">
- <el-input
- v-model="dataFormD.carLoadPersion"
- style="width: 200px"
- :disabled="doNot"
- placeholder="核载人数"
- ></el-input>
- </el-form-item>
- <el-form-item label="购车日期" prop="buyCarDate" style="width: 325px">
- <!-- <el-input v-model="dataForm.buyCarDate" placeholder="购车日期"></el-input>-->
- <el-date-picker
- style="width: 200px"
- value-format="yyyy-MM-dd HH:mm:ss"
- v-model="dataFormD.buyCarDate"
- type="date"
- :disabled="doNot"
- placeholder="创建时间"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="注册日期" prop="regiestDate" style="width: 325px">
- <!-- <el-input v-model="dataForm.regiestDate" placeholder="注册日期"></el-input>-->
- <el-date-picker
- style="width: 200px"
- value-format="yyyy-MM-dd HH:mm:ss"
- v-model="dataFormD.regiestDate"
- type="date"
- :disabled="doNot"
- placeholder="创建时间"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="报废日期" prop="abandonDate" style="width: 325px">
- <!-- <el-input v-model="dataForm.abandonDate" placeholder="报废日期"></el-input>-->
- <el-date-picker
- style="width: 200px"
- value-format="yyyy-MM-dd HH:mm:ss"
- v-model="dataFormD.abandonDate"
- type="date"
- :disabled="doNot"
- placeholder="创建时间"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="外阔尺寸mm" prop="outerSize" style="width: 325px">
- <el-input
- v-model="dataFormD.outerSize"
- style="width: 200px"
- :disabled="doNot"
- placeholder="外阔尺寸mm"
- ></el-input>
- </el-form-item>
- <el-form-item label="总重量kg" prop="sumWeight" style="width: 325px">
- <el-input
- v-model="dataFormD.sumWeight"
- style="width: 200px"
- :disabled="doNot"
- placeholder="总重量kg"
- ></el-input>
- </el-form-item>
- <el-form-item label="核定重量kg" prop="vouchWeight" style="width: 325px">
- <el-input
- v-model="dataFormD.vouchWeight"
- style="width: 200px"
- :disabled="doNot"
- placeholder="核定重量kg"
- ></el-input>
- </el-form-item>
- <el-form-item label="装备质量kg" prop="equipWeight" style="width: 325px">
- <el-input
- v-model="dataFormD.equipWeight"
- style="width: 200px"
- :disabled="doNot"
- placeholder="装备质量kg"
- ></el-input>
- </el-form-item>
- </el-form>
- <el-collapse accordion>
- <el-form label-width="200px">
- <el-collapse-item title="图片上传">
- <div style="width: 50%; float: left">
- <el-form-item label="行驶证头图片" style="width: 100%">
- <el-upload
- style="width: 300px; float: left"
- :action="uploadImgUrl"
- :on-preview="handlePreview"
- :on-remove="
- (res, file) => {
- handleRemove(0, res, file);
- }
- "
- :before-remove="beforeRemove"
- :on-success="
- (res, file) => {
- handleAvatarSuccess(1, res, file);
- }
- "
- multiple
- :disabled="doNot"
- :limit="1"
- :headers="headers"
- :on-exceed="handleExceed"
- >
- <el-button size="small" :disabled="doNot" type="primary"
- >点击上传</el-button
- >
- <el-button
- size="small"
- :disabled="doNot"
- type="primary"
- v-if="fTmsorderbillsattachs[0].attachUrl"
- @click="preview(0)"
- >预览</el-button
- >
- </el-upload>
- </el-form-item>
- <el-form-item label="运营证头图片" style="width: 100%">
- <el-upload
- style="width: 300px"
- :action="uploadImgUrl"
- :on-preview="handlePreview"
- :on-remove="
- (res, file) => {
- handleRemove(2, res, file);
- }
- "
- :before-remove="beforeRemove"
- :on-success="
- (res, file) => {
- handleAvatarSuccess(3, res, file);
- }
- "
- multiple
- :disabled="doNot"
- :limit="1"
- :headers="headers"
- :on-exceed="handleExceed"
- >
- <el-button size="small" :disabled="doNot" type="primary"
- >点击上传</el-button
- >
- <el-button
- size="small"
- :disabled="doNot"
- type="primary"
- v-if="fTmsorderbillsattachs[2].attachUrl"
- @click="preview(2)"
- >预览</el-button
- >
- </el-upload>
- </el-form-item>
- <el-form-item label="营运挂载图片" style="width: 100%">
- <el-upload
- style="width: 300px"
- :action="uploadImgUrl"
- :on-preview="handlePreview"
- :on-remove="
- (res, file) => {
- handleRemove(4, res, file);
- }
- "
- :before-remove="beforeRemove"
- :on-success="
- (res, file) => {
- handleAvatarSuccess(5, res, file);
- }
- "
- multiple
- :disabled="doNot"
- :limit="1"
- :headers="headers"
- :on-exceed="handleExceed"
- >
- <el-button size="small" :disabled="doNot" type="primary"
- >点击上传</el-button
- >
- <el-button
- size="small"
- :disabled="doNot"
- type="primary"
- v-if="fTmsorderbillsattachs[4].attachUrl"
- @click="preview(4)"
- >预览</el-button
- >
- </el-upload>
- </el-form-item>
- <el-form-item label="二级维护图片" style="width: 100%">
- <el-upload
- style="width: 300px"
- :action="uploadImgUrl"
- :on-preview="handlePreview"
- :on-remove="
- (res, file) => {
- handleRemove(6, res, file);
- }
- "
- :before-remove="beforeRemove"
- :on-success="
- (res, file) => {
- handleAvatarSuccess(7, res, file);
- }
- "
- multiple
- :disabled="doNot"
- :limit="1"
- :headers="headers"
- :on-exceed="handleExceed"
- >
- <el-button size="small" :disabled="doNot" type="primary"
- >点击上传</el-button
- >
- <el-button
- size="small"
- :disabled="doNot"
- type="primary"
- v-if="fTmsorderbillsattachs[6].attachUrl"
- @click="preview(6)"
- >预览</el-button
- >
- </el-upload>
- </el-form-item>
- <el-form-item label="承运人保险图片" style="width: 100%">
- <el-upload
- style="width: 300px"
- :action="uploadImgUrl"
- :on-preview="handlePreview"
- :on-remove="
- (res, file) => {
- handleRemove(8, res, file);
- }
- "
- :before-remove="beforeRemove"
- :on-success="
- (res, file) => {
- handleAvatarSuccess(9, res, file);
- }
- "
- multiple
- :disabled="doNot"
- :limit="1"
- :headers="headers"
- :on-exceed="handleExceed"
- >
- <el-button size="small" :disabled="doNot" type="primary"
- >点击上传</el-button
- >
- <el-button
- size="small"
- :disabled="doNot"
- type="primary"
- v-if="fTmsorderbillsattachs[8].attachUrl"
- @click="preview(8)"
- >预览</el-button
- >
- </el-upload>
- </el-form-item>
- </div>
- <div style="width: 50%; float: left">
- <el-form-item label="行驶证挂件图片" style="width: 100%">
- <el-upload
- style="width: 300px"
- :action="uploadImgUrl"
- :on-preview="handlePreview"
- :on-remove="
- (res, file) => {
- handleRemove(1, res, file);
- }
- "
- :before-remove="beforeRemove"
- :on-success="
- (res, file) => {
- handleAvatarSuccess(2, res, file);
- }
- "
- multiple
- :disabled="doNot"
- :limit="1"
- :headers="headers"
- :on-exceed="handleExceed"
- >
- <el-button size="small" :disabled="doNot" type="primary"
- >点击上传</el-button
- >
- <el-button
- size="small"
- :disabled="doNot"
- type="primary"
- v-if="fTmsorderbillsattachs[1].attachUrl"
- @click="preview(1)"
- >预览</el-button
- >
- </el-upload>
- </el-form-item>
- <el-form-item label="技术评定证书图片" style="width: 100%">
- <el-upload
- style="width: 300px"
- :action="uploadImgUrl"
- :on-preview="handlePreview"
- :on-remove="
- (res, file) => {
- handleRemove(3, res, file);
- }
- "
- :before-remove="beforeRemove"
- :on-success="
- (res, file) => {
- handleAvatarSuccess(4, res, file);
- }
- "
- multiple
- :disabled="doNot"
- :limit="1"
- :headers="headers"
- :on-exceed="handleExceed"
- >
- <el-button size="small" :disabled="doNot" type="primary"
- >点击上传</el-button
- >
- <el-button
- size="small"
- :disabled="doNot"
- type="primary"
- v-if="fTmsorderbillsattachs[3].attachUrl"
- @click="preview(3)"
- >预览</el-button
- >
- </el-upload>
- </el-form-item>
- <el-form-item label="二级维护图片" style="width: 100%">
- <el-upload
- style="width: 300px"
- :action="uploadImgUrl"
- :on-preview="handlePreview"
- :on-remove="
- (res, file) => {
- handleRemove(5, res, file);
- }
- "
- :before-remove="beforeRemove"
- :on-success="
- (res, file) => {
- handleAvatarSuccess(6, res, file);
- }
- "
- multiple
- :disabled="doNot"
- :limit="1"
- :headers="headers"
- :on-exceed="handleExceed"
- >
- <el-button size="small" :disabled="doNot" type="primary"
- >点击上传</el-button
- >
- <el-button
- size="small"
- :disabled="doNot"
- type="primary"
- v-if="fTmsorderbillsattachs[5].attachUrl"
- @click="preview(5)"
- >预览</el-button
- >
- </el-upload>
- </el-form-item>
- <el-form-item label="商业保险图片1" style="width: 100%">
- <el-upload
- style="width: 300px"
- :action="uploadImgUrl"
- :on-preview="handlePreview"
- :on-remove="
- (res, file) => {
- handleRemove(7, res, file);
- }
- "
- :before-remove="beforeRemove"
- :on-success="
- (res, file) => {
- handleAvatarSuccess(8, res, file);
- }
- "
- multiple
- :disabled="doNot"
- :limit="1"
- :headers="headers"
- :on-exceed="handleExceed"
- >
- <el-button size="small" :disabled="doNot" type="primary"
- >点击上传</el-button
- >
- <el-button
- size="small"
- :disabled="doNot"
- type="primary"
- v-if="fTmsorderbillsattachs[7].attachUrl"
- @click="preview(7)"
- >预览</el-button
- >
- </el-upload>
- </el-form-item>
- </div>
- </el-collapse-item>
- </el-form>
- </el-collapse>
- <span slot="footer" class="dialog-footer">
- <el-button type="info" @click="handleUpdata" v-if="hide">修改</el-button>
- <el-button @click="visible = false">取消</el-button>
- <el-button type="primary" :disabled="doNot" @click="dataFormSubmit"
- >确定</el-button
- >
- </span>
- </el-dialog>
- </template>
- <script>
- import {
- preservation,
- company,
- lookOver,
- driverMsglist,
- } from "@/api/fleet/carManage";
- import { getToken } from "@/utils/auth";
- import Vue from "vue";
- Vue.directive("dialogDrag", {
- bind(el, binding, vnode, oldVnode) {
- const dialogHeaderEl = el.querySelector(".el-dialog__header");
- const dragDom = el.querySelector(".el-dialog");
- const enlarge = el.querySelector(".enlarge");
- dialogHeaderEl.style.cursor = "move";
- // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
- const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
- if (enlarge) {
- enlarge.onclick = (e) => {
- dragDom.style.top = "0px";
- dragDom.style.left = "0px";
- };
- }
- dialogHeaderEl.onmousedown = (e) => {
- // 鼠标按下,计算当前元素距离可视区的距离
- const disX = e.clientX - dialogHeaderEl.offsetLeft;
- const disY = e.clientY - dialogHeaderEl.offsetTop;
- // 获取到的值带px 正则匹配替换
- let styL, styT;
- // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
- if (sty.left.includes("%")) {
- styL =
- +document.body.clientWidth * (+sty.left.replace(/\%/g, "") / 100);
- styT =
- +document.body.clientHeight * (+sty.top.replace(/\%/g, "") / 100);
- } else {
- styL = +sty.left.replace(/\px/g, "");
- styT = +sty.top.replace(/\px/g, "");
- }
- document.onmousemove = function (e) {
- // 通过事件委托,计算移动的距离
- const l = e.clientX - disX;
- const t = e.clientY - disY;
- // 移动当前元素
- if (t + styT >= 0) {
- dragDom.style.top = `${t + styT}px`;
- }
- dragDom.style.left = `${l + styL}px`;
- // 将此时的位置传出去
- // binding.value({x:e.pageX,y:e.pageY})
- };
- document.onmouseup = function (e) {
- document.onmousemove = null;
- document.onmouseup = null;
- };
- };
- },
- });
- export default {
- props: {
- dataForm: {
- type: Object,
- require: false,
- },
- },
- data() {
- return {
- hide: false,
- dialogFull: false,
- driverMans: [],
- fTmsorderbillsattachs: [
- { attachUrl: "", attachName: "", actId: "" },
- { attachUrl: "", attachName: "", actId: "" },
- { attachUrl: "", attachName: "", actId: "" },
- { attachUrl: "", attachName: "", actId: "" },
- { attachUrl: "", attachName: "", actId: "" },
- { attachUrl: "", attachName: "", actId: "" },
- { attachUrl: "", attachName: "", actId: "" },
- { attachUrl: "", attachName: "", actId: "" },
- { attachUrl: "", attachName: "", actId: "" },
- ],
- doNot: true,
- imageUrl: "",
- dataFormD: {},
- visible: false,
- msg: "",
- uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
- headers: {
- Authorization: "Bearer " + getToken(),
- },
- dataRule: {
- fleetCompanyId: [
- { required: true, message: "请输入车队id", trigger: "blur" },
- ],
- carNum: [{ required: true, message: "请输入车牌号", trigger: "blur" }],
- },
- optionsProjectTypeItem: [],
- };
- },
- created() {
- this.handleSelect();
- },
- methods: {
- changeCar(id) {
- driverMsglist({ fPid: id, fStatus: 0 }).then((data) => {
- this.driverMans = data;
- });
- this.dataFormD.driverId=null
- },
- full() {
- this.dialogFull = !this.dialogFull;
- },
- // 选择司机时
- changeDriverId (val) {
- for (let driver in this.driverMans) {
- if (this.driverMans[driver].fId == val) {
- this.dataFormD.driverTel = this.driverMans[driver].fTel
- this.dataFormD.driverName = this.driverMans[driver].fName
- }
- }
- },
- handleUpdata() {
- this.doNot = false;
- },
- handleAvatarSuccess(actid, res, file) {
- switch (actid) {
- case 1:
- this.simplification(actid - 1, res);
- break;
- case 2:
- this.simplification(actid - 1, res);
- break;
- case 3:
- this.simplification(actid - 1, res);
- break;
- case 4:
- this.simplification(actid - 1, res);
- break;
- case 5:
- this.simplification(actid - 1, res);
- break;
- case 6:
- this.simplification(actid - 1, res);
- break;
- case 7:
- this.simplification(actid - 1, res);
- break;
- case 8:
- this.simplification(actid - 1, res);
- break;
- case 9:
- this.simplification(actid - 1, res);
- break;
- default:
- this.$message.error("未知错误,请稍后再试");
- }
- },
- simplification(index, res) {
- console.log(index);
- this.fTmsorderbillsattachs[index].actId = Number(index + 1);
- this.fTmsorderbillsattachs[index].attachUrl = res.url;
- this.fTmsorderbillsattachs[index].attachName = res.fileName;
- },
- handleRemove(actid, file, fileList) {
- this.fTmsorderbillsattachs[actid].attachUrl = "";
- this.fTmsorderbillsattachs[actid].attachName = "";
- this.fTmsorderbillsattachs[actid].actId = "";
- },
- handlePreview(file) {
- this.$message.success("如需预览请点击预览");
- },
- handleExceed(files, fileList) {
- this.$message.warning(`当前限制选择 1 个文件件`);
- },
- beforeRemove(file, fileList) {
- return this.$confirm(`确定移除 ${file.name}?`);
- },
- init() {
- this.hide = true;
- this.visible = true;
- this.changeCar();
- this.handleSelect();
- if (this.dataForm.Id) {
- lookOver(this.dataForm.Id).then((data) => {
- this.doNot = true;
- this.dataFormD = data.data.fleetCarManage;
- if (data.data.fTmsorderbillsattachs) {
- this.fTmsorderbillsattachs = data.data.fTmsorderbillsattachs;
- }
- // this.optionsProjectTypeItem = data.data.fleetCompanyMsg;
- // if (data.data.fleetCompanyMsg){
- // this.handleSelect()
- // }
- });
- } else {
- this.dataFormD = {
- fleetCompanyId: "",
- carNum: "",
- driverId:"",
- driverName: "",
- driverTel:"",
- hangNum: "",
- fuelType: "",
- carType: "",
- carName: "",
- carBrand: "",
- manufactureUnit: "",
- officeOfCertificate: "",
- pullCarType: "",
- pullCarShelfNum: "",
- mountCarType: "",
- mountCarNum: "",
- engine: "",
- carLoadPersion: "",
- buyCarDate: "",
- regiestDate: "",
- abandonDate: "",
- outerSize: "",
- sumWeight: "",
- vouchWeight: "",
- equipWeight: "",
- };
- this.fTmsorderbillsattachs = [
- { attachUrl: "", attachName: "", actId: "" },
- { attachUrl: "", attachName: "", actId: "" },
- { attachUrl: "", attachName: "", actId: "" },
- { attachUrl: "", attachName: "", actId: "" },
- { attachUrl: "", attachName: "", actId: "" },
- { attachUrl: "", attachName: "", actId: "" },
- { attachUrl: "", attachName: "", actId: "" },
- { attachUrl: "", attachName: "", actId: "" },
- { attachUrl: "", attachName: "", actId: "" },
- ];
- this.hide = false;
- this.doNot = false;
- }
- },
- preview(actid) {
- console.log(this.fTmsorderbillsattachs);
- window.open(this.fTmsorderbillsattachs[actid].attachUrl);
- },
- handleSelect(query) {
- company(query).then((data) => {
- this.optionsProjectTypeItem = data.rows;
- });
- },
- // 表单提交
- dataFormSubmit() {
- this.$refs["dataFormD"].validate((valid) => {
- if (valid) {
- let formDatae = new window.FormData();
- formDatae.append(
- "fTmsorderbillsattachs",
- JSON.stringify(this.fTmsorderbillsattachs)
- );
- formDatae.append("fleetCarManage", JSON.stringify(this.dataFormD));
- preservation(formDatae).then((data) => {
- if (data && data.code === 200) {
- this.$message({
- message: "操作成功",
- type: "success",
- duration: 1500,
- onClose: () => {
- this.visible = false;
- this.$emit("refreshDataList");
- },
- });
- } else {
- this.$message.error(data.msg);
- }
- });
- }
- });
- },
- },
- };
- </script>
- <style scoped>
- .el-form-item {
- width: 49%;
- margin-bottom: 20px;
- display: inline-block;
- }
- .el-select {
- display: block;
- }
- .upload-demo {
- margin-left: 50px;
- }
- .avatar-uploader .el-upload {
- border: 1px dashed #d9d9d9;
- border-radius: 6px;
- cursor: pointer;
- position: relative;
- overflow: hidden;
- }
- .avatar-uploader .el-upload:hover {
- border-color: #409eff;
- }
- .avatar-uploader-icon {
- font-size: 28px;
- color: #8c939d;
- width: 178px;
- height: 178px;
- line-height: 178px;
- text-align: center;
- }
- .avatar {
- width: 178px;
- height: 178px;
- display: block;
- }
- </style>
- <style lang="scss">
- .avue-crud__dialog__header {
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- -webkit-box-pack: justify;
- -ms-flex-pack: justify;
- justify-content: space-between;
- }
- .el-dialog__title {
- color: rgba(0, 0, 0, 0.85);
- font-weight: 500;
- word-wrap: break-word;
- }
- .avue-crud__dialog__menu {
- padding-right: 20px;
- float: left;
- }
- </style>
|