1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108 |
- <template>
- <div>
- <div class="borderless">
- <div class="customer-head">
- <div class="customer-back">
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
- @click="backToList">返回列表
- </el-button>
- </div>
- <div class="add-customer-btn">
- <!--<el-button type="info" icon="el-icon-printer" size="small" @click.stop="openReport()">报表打印-->
- <!--</el-button>-->
- <el-button type="primary" size="small"
- class="el-button--small-yh" :disabled="!option.disabled" @click.stop="openEdit">编辑
- </el-button>
- <el-button type="primary" size="small" :disabled="option.disabled" @click="editCustomer">
- 保存数据
- </el-button>
- </div>
- </div>
- <trade-card title="基础资料" style="margin-top: 60px" v-loading="loadingBtn">
- <avue-form ref="form" class="trading-form" v-model="form" :option="option">
- <template slot="corpId">
- <crop-select v-model="form.corpId" corpType="KH" :disabled="option.disabled"
- @getCorpData="getCorpData"></crop-select>
- </template>
- </avue-form>
- </trade-card>
- <trade-card title="设备信息" v-loading="loadingBtn">
- <avue-crud ref="crud" :option="optionList" :data="data" :table-loading="loading" @saveColumn="saveColumn"
- @resetColumn="resetColumn" :cell-style="cellStyle">
- <template slot="headerSerial">
- <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
- :disabled="option.disabled" circle></el-button>
- </template>
- <template slot="code" slot-scope="{ row, index }">
- <el-input v-if="row.$cellEdit" v-model="row.code"
- placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input>
- <span v-else>{{ row.code }}</span>
- </template>
- <template slot-scope="{ row, index }" slot="maintenanceSecond">
- <el-link type="primary" @click="maintenanceSecondC(row)">{{ row.maintenanceSecond }}</el-link>
- </template>
- <template slot="remarks" slot-scope="{ row, index }">
- <el-input v-if="row.$cellEdit" v-model="row.remarks"
- placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input>
- <span v-else>{{ row.remarks }}</span>
- </template>
- <template slot="exitDate" slot-scope="{ row, index }">
- <el-date-picker
- v-if="row.$cellEdit"
- v-model="row.exitDate"
- type="date"
- value-format="yyyy-MM-dd"
- size="small"
- placeholder="选择日期">
- </el-date-picker>
- <span v-else>{{ row.exitDate }}</span>
- </template>
- <template slot="maintenanceDate" slot-scope="{ row, index }">
- <el-date-picker
- v-if="row.$cellEdit"
- v-model="row.maintenanceDate"
- type="date"
- value-format="yyyy-MM-dd"
- size="small"
- placeholder="选择日期">
- </el-date-picker>
- <span v-else>{{ row.maintenanceDate }}</span>
- </template>
- <template slot="menu" slot-scope="{ row, index }">
- <el-button size="small" type="text" v-if="row.url" @click="imgurlfun(row)">信息码
- </el-button>
- <el-button
- :disabled="option.disabled"
- size="small"
- type="text"
- @click="annexOpen(row, index)"
- >附 件
- </el-button>
- <el-button size="small" type="text" :disabled="option.disabled" @click="rowCell(row, index)">{{
- row.$cellEdit ? "保存" : "修改"
- }}</el-button>
- <el-button size="small" type="text" :disabled="option.disabled" @click="rowDel(row, index)">删除
- </el-button>
- </template>
- </avue-crud>
- </trade-card>
- <containerTitle title="上传附件"></containerTitle>
- <c-upload v-loading="loadingBtn" typeUpload="SBDAFJ"
- deleteUrl="/api/blade-client/corpequipmentarchivesfiles/remove" :data="maintenanceFiles" display
- :enumerationValue="35.1"></c-upload>
- <!--<containerTitle title="上传附件"></containerTitle>-->
- <!--<c-upload v-loading="loadingBtn" typeUpload="CD"-->
- <!-- deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="orderFilesList" display-->
- <!-- :enumerationValue="35.1" :disabled="detailData.status == 1"></c-upload>-->
- <dictbiz-dialog ref="dictbiz" title="添加单位" code="unit" parentId="1585962784498225154" @closed="getAllWorkDicts">
- </dictbiz-dialog>
- <!--打印组件-->
- <report-dialog :switchDialog="switchDialog" :reportId="archivesId" reportName="汽保--信息码" @onClose="onClose()">
- </report-dialog>
- <!--图片查看-->
- <el-dialog
- title="信息码"
- :visible.sync="imgfalse"
- width="50%"
- append-to-body
- :before-close="imgfalseClose">
- <div>
- <div>
- <el-button type="info" icon="el-icon-printer" size="small" @click.stop="openReport()">打印
- </el-button>
- </div>
- <img :src="imgtext" alt="">
- </div>
- </el-dialog>
- <el-dialog title="导入项目" append-to-body class="el-dialogDeep" :visible.sync="productVisible" width="80%"
- :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" @close="closeGoods">
- <el-row>
- <el-col :span="5" style="height: 100%;overflow-y: auto">
- <div>
- <el-scrollbar>
- <basic-container>
- <avue-tree :option="productOption" :data="productDataGoods" @node-click="productnodeClick" />
- </basic-container>
- </el-scrollbar>
- </div>
- </el-col>
- <el-col :span="19">
- <basic-container>
- <avue-crud ref="productCrud" :option="optionTwo" :data="productListShow" :page.sync="productPage"
- :search.sync="productSearch" @selection-change="productSelection" @search-change="goodsSearch"
- @current-change="productCurrent" @size-change="productSize"
- @refresh-change="productRefresh" :table-loading="loading"
- @saveColumn="productSave" @resetColumn="productReset" :cell-style="cellStyle">
- <template slot="menuLeft" slot-scope="{size}">
- <el-tabs v-model="activeName" @tab-click="tabHandle">
- <el-tab-pane label="查询结果" name="searchList"></el-tab-pane>
- <el-tab-pane label="已选定数据" name="importStaging"></el-tab-pane>
- </el-tabs>
- </template>
- <template slot-scope="scope" slot="menu">
- <el-button type="text" icon="el-icon-edit" size="small"
- @click.stop="importStagList(scope.row, scope.index)" v-if="activeName == 'searchList'"
- :disabled="goodsListSave.findIndex(item => item.id == scope.row.id) !== -1">选择
- </el-button>
- <el-button type="text" icon="el-icon-delete" size="small"
- @click.stop="removeStagList(scope.row, scope.index)" v-else>移除
- </el-button>
- </template>
- </avue-crud>
- </basic-container>
- </el-col>
- </el-row>
- <span slot="footer" class="dialog-footer">
- <el-button @click="productVisible = false">取 消</el-button>
- <el-button type="primary" @click="importGoods">导入</el-button>
- </span>
- </el-dialog>
- </div>
- <el-dialog
- title="附件"
- :visible.sync="enclosure"
- append-to-body
- width="70%">
- <c-upload-Two
- typeUpload="GZ"
- :basic="true"
- deleteUrl="/api/blade-client/corpequipmentarchivesfiles/remove"
- :data="orderList"
- :enumerationValue="111"
- ></c-upload-Two>
- <span slot="footer" class="dialog-footer">
- <el-button @click="enclosure = false" size="small">取 消</el-button>
- <el-button type="primary" @click="saveAnnex" size="small">保 存</el-button>
- </span>
- </el-dialog>
- <el-dialog
- title="维修信息"
- :visible.sync="maintenanceSecondList"
- width="80%"
- append-to-body>
- <el-table :data="maintenanceData" style="width: 100%">
- <el-table-column prop="repairReportDate" label="报修日期"></el-table-column>
- <el-table-column prop="completeDate" label="完成日期"> </el-table-column>
- <el-table-column prop="maintenanceWorkerName" label="维修工">
- <template v-slot:default="scope">
- <el-link type="primary" @click="maintenanceWorkerNameClick(scope.row.id)">{{scope.row.maintenanceWorkerName}}</el-link>
- </template>
- </el-table-column>
- <el-table-column prop="maintenanceWorkerTel" label="维修电话"> </el-table-column>
- <el-table-column prop="maintenanceAmount" label="维修金额" width="180"> </el-table-column>
- </el-table>
- <el-pagination
- @size-change="getMaintenanceList"
- @current-change="getMaintenanceList"
- :current-page.sync="mPcurrent"
- :page-sizes="[10, 20, 30, 40]"
- :page-size="mPageSize"
- layout="sizes, prev, pager, next"
- :total="mDtotal"
- style="display: flex;
- justify-content: flex-end;">
- </el-pagination>
- <span slot="footer" class="dialog-footer">
- <el-button type="primary" @click="maintenanceSecondList = false">关 闭</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import { optionList } from "./js/optionList";
- import { optionTwo } from "./js/optionListTwo";
- import reportDialog from "@/components/report-dialog/main";
- import { multiply, sum, subtract } from "@/util/calculate";
- import { getListNew } from "@/api/basicData/product";
- import {getList as GYSgetList} from "@/api/basicData/client";
- import {getList as getListpp } from "@/api/tirePartsMall/basicData/brandPage";
- import {
- projectGoodsSubmit
- } from "@/api/basicData/ServiceLtems";
- import {
- corpequipmentarchivesDetail,
- corpequipmentarchivesitemRemove,
- corpequipmentarchivesSubmit,
- deleteImg
- } from "@/api/basicData/EquipmentArchives";
- import { getGoodstype } from "@/api/basicData/product";
- import {getFee, saveFile} from "../../api/landTransportation";
- import {getDictionary} from "../../api/system/dictbiz";
- import {maintenanceList} from "../../api/basicData/maintenanceQ";
- import router from "../../router/router";
- import {listAllP} from "../../api/tirePartsMall/basicData/listingManagement";
- export default {
- name: "index",
- data() {
- return {
- // 维修次数弹窗
- maintenanceSecondList: false,
- // 维修信息list
- maintenanceData: [],
- // 总共数量
- mDtotal: 0,
- // 每页数量
- mPageSize: 10,
- // 当前页
- mPcurrent: 1,
- // 图片的弹窗的开启
- imgfalse:false,
- imgtext:'',
- switchDialog: false,
- loadingBtn: false,
- addressTitle: null,
- form: {},
- form2: {
- },
- form3: {
- },
- data: [],
- enclosure: false,
- orderList: [],
- option: {
- menuBtn: false,
- labelWidth: 90,
- disabled: false,
- column: [
- {
- label: "客户",
- prop: "corpId",
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ],
- span: 16,
- },
- {
- label: "电话",
- prop: "contactsTel",
- search: true,
- overHidden: true,
- span: 8,
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ],
- },
- {
- label: "地址",
- prop: "address",
- overHidden: true,
- span: 8,
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ],
- },
- {
- label: "联系人",
- prop: "contacts",
- search: true,
- overHidden: true,
- span: 8,
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ],
- },
- {
- label: "编号",
- prop: "sysNo",
- search: true,
- overHidden: true,
- disabled:true,
- span: 8,
- },
- {
- label: "设备数量",
- prop: "equipmentNumber",
- disabled:true,
- overHidden: true,
- span: 4,
- },
- {
- label: "维修次数",
- prop: "maintenanceSecond",
- disabled:true,
- span: 4,
- },
- {
- label: "合同起",
- prop: "signingDateStart",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd 00:00:00",
- span: 8,
- },
- {
- label: "合同止",
- prop: "signingDateEnd",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd 00:00:00",
- span: 8,
- },
- {
- label: "备注",
- prop: "remarks",
- type: "textarea",
- minRows: 3,
- span: 16,
- }
- ]
- },
- // 附件
- maintenanceFiles: [],
- optiontabs1: {
- menuBtn: false,
- labelWidth: 90,
- column: [
- {
- label: "简称",
- prop: "a",
- type: "select",
- span: 24,
- },
- {
- label: "地址",
- prop: "b",
- type: "select",
- span: 24,
- },
- {
- label: "详细地址",
- prop: "c",
- span: 24,
- },
- {
- label: "邮编",
- prop: "d",
- span: 24,
- },
- {
- label: "备注",
- prop: "e",
- type: 'textarea',
- minRows: 3,
- span: 24,
- },
- {
- label: "地址智能识别",
- prop: "ad",
- placeholder: "例:上海市徐汇区枫林街道斜土路100号",
- type: "textarea",
- minRows: 3,
- span: 24,
- }
- ]
- },
- optiontabs2: {
- menuBtn: false,
- labelWidth: 80,
- column: [
- {
- label: "目的地",
- prop: "a",
- type: "select",
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ],
- span: 24,
- },
- {
- label: "物流公司",
- prop: "b",
- span: 24,
- },
- {
- label: "电话",
- prop: "c",
- span: 24,
- },
- {
- label: "地址",
- prop: "d",
- span: 24,
- },
- {
- label: "详细地址",
- prop: "e",
- span: 24,
- },
- {
- label: "邮编",
- prop: "f",
- span: 24,
- },
- {
- label: "备注",
- prop: "remarks",
- type: "textarea",
- minRows: 3,
- span: 24,
- },
- {
- label: "地址智能识别",
- prop: "g",
- type: "textarea",
- minRows: 3,
- span: 24,
- }
- ]
- },
- // 商品信息列表配置
- optionList: {},
- // 商品产品下拉数据
- goodsoptions: [],
- // 附件
- orderFilesList: [],
- // 导入项目的弹窗
- productVisible:false,
- // 产品左侧类别
- productOption: {
- addBtn: false,
- menu: false,
- size: "small",
- props: {
- labelText: "标题",
- label: "title",
- value: "value",
- }
- },
- // 产品左侧是数据
- productDataGoods:[],
- // 产品弹窗列表
- optionTwo:optionTwo,
- productPage:{
- pageSize: 20,
- currentPage: 1,
- total: 0,
- pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
- },
- productListShow:[],
- // 暂存的数据
- goodsListSave:[],
- // 产品弹窗tabs切换
- activeName:'searchList',
- // 弹窗选中的数据
- tableData:[],
- productSearch:{},
- loading:false,
- dataId: '',
- // 设备id
- archivesId: '',
- };
- },
- props: {
- detailData: {
- type: Object
- }
- },
- components: {
- reportDialog
- },
- async created() {
- this.optionList = optionList
- // 获取字典数据
- this.getAllWorkDicts()
- // 查看是否要id调用详情
- if (this.detailData.id) {
- this.option.disabled = true
- this.getDetail(this.detailData.id);
- }
- if (this.detailData.status == 1) {
- this.option.disabled = true;
- }
- // 获取产品数据
- // getAllgoods().then(res => {
- // this.goodsoptions = res.data.data
- // });
- },
- methods: {
- getMaintenanceList(pageSize) {
- this.mPageSize = pageSize
- this.maintenanceSecondC()
- },
- // 维修次数点击事件
- maintenanceSecondC(row) {
- this.archivesId = row.id
- var params = {
- archivesId: this.form.id,
- deviceId: row.srcId
- }
- maintenanceList(this.mPcurrent, this.mPageSize, params).then(res => {
- this.mDtotal = res.data.data.total
- this.mPcurrent = res.data.data.current;
- this.maintenanceData = res.data.data.records
- })
- this.maintenanceSecondList = true
- },
- // 打印报表按钮事件
- openReport() {
- this.switchDialog = !this.switchDialog;
- },
- onClose(val) {
- this.switchDialog = val;
- },
- // 跳转路由
- maintenanceWorkerNameClick(id) {
- router.push({path: '/maintenanceQ/index/', query: {id: id}})
- },
- // 获取下拉字典
- getAllWorkDicts() {
- // 获取地址信息
- // this.findObject(this.option.column, "address").dicData = JSON.parse(localStorage.getItem('areaTypeTree'))
- getGoodstype().then(res => {
- this.findObject(this.optionList.column, "goodsTypeId").dicData = res.data.data;
- });
- // 获取品牌数据
- // getListpp().then(res=>{
- // this.findObject(this.optionList.column, "brand").dicData = res.data.data.records
- // this.findObject(this.optionTwo.column, "brand").dicData = res.data.data.records
- // })
- // 品牌
- var type = {
- type: 'PP'
- }
- listAllP(type).then(res => {
- this.findObject(this.optionTwo.column, "brandId").dicData = res.data.data.records
- })
- // 获取供应商厂家数据
- GYSgetList(1,20, {corpType:'GYS'}).then(res=>{
- this.findObject(this.optionTwo.column, "corpId").dicData = res.data.data.records
- })
- },
- cellStyle() {
- return "padding:0;height:40px;";
- },
- //打开附件
- annexOpen(row, index) {
- this.dataId = index
- this.orderList = row.filesList?row.filesList:[];
- for (let order of this.orderList) {
- order.paymentType = order.typeFiles
- }
- this.enclosure = true
- },
- //保存
- saveAnnex() {
- for (const key in this.orderList) {
- this.orderList[key].sort = Number(key) + 1
- this.orderList[key].typeFiles = this.orderList[key].paymentType
- }
- this.data[this.dataId].filesList = this.orderList;
- this.enclosure = false
- // saveFile({
- // id: this.formAnnex.id,
- // fileList: this.orderList
- // }).then(res => {
- // console.log(res)
- // this.$message.success("保存成功");
- // this.annexOpen(this.formAnnex)
- // })
- },
- amountChange() {
- let val = 0
- this.data.forEach(e => {
- val = sum(val, e.amount)
- this.form.purchaseAmount = val
- this.form.orderAmount = subtract(this.form.purchaseAmount, this.form.thisUsedProfit)
- })
- },
- // countChange(row) {
- // row.amount = multiply(row.price, row.storageInQuantity)
- // row.storageAmount = multiply(row.purchaseAmount, row.storageInQuantity)
- // let val = 0
- // this.data.forEach(e => {
- // val = sum(val, e.amount)
- // this.form.purchaseAmount = val
- // this.form.orderAmount = subtract(this.form.purchaseAmount, this.form.thisUsedProfit)
- // })
- // },
- // 获取详情数据
- getDetail(id) {
- this.loadingBtn = true
- corpequipmentarchivesDetail({ id: id })
- .then(res => {
- this.form = res.data.data;
- this.data = res.data.data.corpEquipmentArchivesItemList;
- this.maintenanceFiles = res.data.data.filesList;
- // this.orderFilesList = res.data.data.orderFilesList ? res.data.data.orderFilesList : [];
- })
- .finally(() => {
- this.loadingBtn = false;
- });
- },
- // 客户下拉框
- getCorpData(row) {
- if (row) {
- this.form.corpName = row.cname
- this.form.contactsTel = row.tel
- // 地址和联系人
- this.form.address = row.details
- this.form.contacts = row.attn
- } else {
- this.form.corpName = null
- this.form.contactsTel = null
- }
- },
- addRow() {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- // this.data.push({ $cellEdit: true, storageId: this.form.storageId })
- this.tableData = []
- this.goodsListSave = []
- // 获取产品弹窗的左侧类型
- this.getGoodstypefun()
- var dict = {
- code : 'unit'
- }
- getDictionary(dict).then(res => {
- this.findObject(this.optionTwo.column, "unit").dicData = res.data.data;
- })
- this.productonLoad(this.productPage, this.productSearch);
- this.productVisible = true
- } else {
- return false;
- }
- });
- },
- rowCell(row, index) {
- if (row.$cellEdit == true) {
- this.$set(row, "$cellEdit", false);
- } else {
- this.$set(row, "$cellEdit", true);
- }
- },
- // 删除
- rowDel(row, index) {
- this.$confirm("确定删除数据?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (row.id) {
- corpequipmentarchivesitemRemove({ids:row.id}).then(res => {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- this.data.splice(index, 1);
- });
- } else {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- this.data.splice(index, 1);
- }
- this.form.equipmentNumber = this.data.length
- });
- },
- //修改提交触发
- editCustomer() {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- if (this.data.length == 0) {
- return this.$message.error('请添加一条商品信息');
- }
- // corpId 客户id
- // corpName 客户名称
- // sysNo 编号
- // equipmentNumber 设备数量
- // maintenance_second 维修次数
- // signingDate_start 签约开始时间
- // signingDate_end 签约结束时间
- // remarks 备注(收费指示)
- // updateUser 修改人
- // createUser 创建人
- // createTime 创建时间
- // updateTime 修改时间
- // status 状态(0 正常 1停用)
- // corpEquipmentArchivesItemList 设备明细
- // cname 设备名称
- // code 设备编码
- // brand 品牌
- // specs 规格尺寸
- // category 产品类别
- // categoryitem 产品分类
- // url 图片
- // goodsTypeId 商品类型id
- // exitDate 出场日期
- // repairReportDate 报修日期
- // brandId 品牌id
- let arr = this.data.map(item=>{
- return {
- id:item.id?item.id:null,
- cname:item.cname,
- code:item.code,
- brand:item.brand,
- brandId:item.brandId,
- specs:item.specs,
- remarks:item.remarks,
- goodsTypeId:item.goodsTypeId,
- srcId:item.srcId,
- // goodsTypeName:item.goodsTypeName,
- maintenanceSecond:item.maintenanceSecond?item.maintenanceSecond:0,
- exitDate:item.exitDate?item.exitDate + ' 00:00:00':item.exitDate,
- maintenanceDate:item.maintenanceDate?item.maintenanceDate + ' 00:00:00':item.maintenanceDate,
- repairReportDate:item.repairReportDate,
- url:item.url?item.url:null,
- factoryId:item.factoryId?item.factoryId:null,
- factoryName:item.factoryName?item.factoryName:null,
- categoryitem:item.categoryitem?item.categoryitem:null,
- equipmentDescribe:item.equipmentDescribe?item.equipmentDescribe:null,
- filesList:item.filesList
- }
- })
- for (const key in this.maintenanceFiles) {
- this.maintenanceFiles[key].sort = Number(key) + 1
- this.maintenanceFiles[key].typeFiles = this.maintenanceFiles[key].paymentType
- }
- const obj = {
- id:this.form.id?this.form.id:null,
- corpId:this.form.corpId,
- corpName:this.form.corpName,
- sysNo:null,
- equipmentNumber:this.data.length,
- maintenanceSecond:this.form.maintenanceSecond?this.form.maintenanceSecond:0,
- signingDateStart:this.form.signingDateStart,
- signingDateEnd:this.form.signingDateEnd,
- contacts:this.form.contacts,
- contactsTel:this.form.contactsTel,
- address:this.form.address,
- remarks:this.form.remarks,
- corpEquipmentArchivesItemList:arr,
- filesList:this.maintenanceFiles
- }
- this.loadingBtn = true;
- // 附件
- // console.log(this.orderFilesList,522)
- corpequipmentarchivesSubmit({
- ...obj,
- })
- .then(res => {
- this.$message.success("保存成功");
- this.form = res.data.data;
- this.data = res.data.data.corpEquipmentArchivesItemList;
- // this.orderFilesList = res.data.data.orderFilesList ? res.data.data.orderFilesList : [];
- this.detailData.status = 1
- this.option.disabled = true;
- this.$refs.crud.refreshTable();
- })
- .finally(() => {
- this.loadingBtn = false;
- });
- } else {
- return false;
- }
- });
- },
- // 查看图片
- imgurlfun(row){
- this.imgfalse = true
- this.archivesId = row.id
- this.imgtext = row.url
- },
- imgfalseClose(){
- this.imgtext = ''
- this.imgfalse = false
- },
- async saveColumn() {
- const inSave = optionList
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- });
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
- }
- },
- async resetColumn() {
- this.optionList = optionList;
- const inSave = optionList
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- });
- this.getAllWorkDicts()
- this.$message.success("重置成功");
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
- }
- },
- openEdit() {
- // this.detailData.status = 2
- this.option.disabled = false
- this.option = this.$options.data().option;
- this.$refs.crud.refreshTable();
- },
- //返回列表
- backToList() {
- this.$emit("goBack");
- },
- // ---------------------------------产品弹窗----------------------------------------
- // 产品弹窗导入
- importGoods(){
- if (this.goodsListSave.length > 0) {
- for (let item of this.goodsListSave) {
- const srcId = item.id
- delete item.id
- this.data.push({
- $cellEdit: true,
- storageId: this.form.storageId,
- factoryId:item.corpId,
- srcId:srcId,
- factoryName:item.corpName,
- ...item,
- equipmentDescribe:item.cname,
- })
- }
- }else {
- for (let item of this.tableData) {
- const srcId = item.id
- delete item.id
- this.data.push({
- $cellEdit: true,
- storageId: this.form.storageId,
- srcId:srcId,
- factoryId:item.corpId,
- factoryName:item.corpName,
- ...item,
- equipmentDescribe:item.cname,
- })
- }
- }
- this.form.equipmentNumber = this.data.length
- this.productVisible = false
- },
- // 产品选择左侧数据
- productnodeClick(data){
- this.productSearch.goodsTypeId = data.value
- this.productPage.currentPage = 1;
- this.productonLoad(this.productPage, this.productSearch);
- },
- // 产品弹窗的列表数据获取
- productonLoad(page, params = {}){
- let data = this.deepClone(Object.assign(params, this.productSearch));
- this.loading = true;
- getListNew(
- page.currentPage,
- page.pageSize,
- data
- ).then(res=>{
- // this.productListShow = res.data.data.records ? res.data.data.records : [];
- this.productListShow = res.data.data.records
- this.productPage.total = res.data.data.total;
- this.$nextTick(() => {
- this.$refs.productCrud.doLayout();
- });
- }).finally(() => {
- this.loading = false;
- });
- },
- // 标签页切换
- tabHandle(data) {
- if (data.name == 'searchList') {
- this.productListShow = this.data;
- // this.productSearch.total = this.pageList.total
- this.productonLoad(this.productPage,this.productSearch);
- } else if (data.name == 'importStaging') {
- this.productListShow = this.goodsListSave;
- this.productSearch.total = 0
- }
- },
- // 获取产品左侧数据
- getGoodstypefun(){
- getGoodstype().then(res => {
- this.productDataGoods = res.data.data;
- });
- },
- // 弹窗选中的数据
- importStagList(row, index) {
- this.goodsListSave.push(row);
- },
- // 产品弹窗移除
- removeStagList(row, index) {
- this.goodsListSave.splice(row.$index, 1)
- },
- // 产品弹窗刷新触发
- productRefresh(){
- // this.treeDeptId = '';
- this.productPage.currentPage = 1;
- this.productonLoad(this.productPage,this.productSearch);
- },
- // 产品弹窗选择触发
- productSelection(list) {
- this.tableData = list
- },
- // 产品弹窗搜索按钮触发
- goodsSearch(params, done) {
- // this.treeDeptId = '';
- this.productonLoad(this.productPage,params);
- done()
- },
- // 产品弹窗分页
- productCurrent(val){
- this.productPage.currentPage = val;
- },
- productSize(val){
- this.productPage.currentPage = 1;
- this.productPage.pageSize = val;
- },
- // 产品弹窗的重置和保存
- productSave(){
- const inSave = optionTwo
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.productCrud.doLayout();
- });
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs.productCrud.$refs.dialogColumn.columnBox = false;
- }
- },
- productReset(){
- this.optionTwo = optionTwo;
- const inSave = option
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.productCrud.doLayout();
- });
- this.getAllWorkDicts()
- this.$message.success("重置成功");
- this.$refs.productCrud.$refs.dialogColumn.columnBox = false;
- }
- },
- // 关闭弹窗的回调
- closeGoods() {
- this.productDataGoods = [];
- // this.treeDeptId = "";
- this.activeName = "searchList";
- },
- },
- watch: {
- // data: function (rows) {
- // let val = 0
- // rows.forEach(e => {
- // val = sum(val, e.amount)
- // this.form.purchaseAmount = val
- // this.form.orderAmount = subtract(this.form.purchaseAmount, this.form.thisUsedProfit)
- // })
- // }
- }
- };
- </script>
- <style lang="scss" scoped>
- .trading-form ::v-deep .el-form-item {
- margin-bottom: 8px !important;
- }
- ::v-deep .el-dialog__body {
- padding: 0px 20px 15px 20px;
- }
- ::v-deep .el-form-item__error {
- display: none !important;
- }
- .img-form ::v-deep .el-form-item {
- height: 150px;
- line-height: 150px;
- margin-bottom: 8px !important;
- }
- .img-form ::v-deep .avue-upload__icon {
- font-size: 20px;
- width: 150px;
- height: 150px;
- line-height: 150px;
- }
- ::v-deep .el-table .cell {
- padding: 0 2px !important;
- }
- ::v-deep .avue-crud .el-table .el-form-item__label {
- left: -1px;
- }
- .addressTabs {
- display: flex;
- justify-content: center;
- span {
- width: 100px;
- font-size: 18px;
- font-weight: 600;
- text-align: center;
- }
- }
- </style>
|