|
|
@@ -10,10 +10,17 @@
|
|
|
<div class="add-customer-btn">
|
|
|
<!--<el-button type="info" icon="el-icon-printer" size="small" @click.stop="openReport()">报表打印-->
|
|
|
<!--</el-button>-->
|
|
|
+ <el-button v-if="form.dispatchingWorkers == 2" type="warning" size="small" :disabled="option.disabled" @click="editCustomer(2)">
|
|
|
+ 撤销派工
|
|
|
+ </el-button>
|
|
|
+ <el-button v-else type="warning" size="small" :disabled="option.disabled && (form.dispatchingWorkers == 0 || form.dispatchingWorkers == 1)" @click="editCustomer(1)">
|
|
|
+ 派工
|
|
|
+ </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 type="primary" size="small" :disabled="option.disabled" @click="editCustomer(0)">
|
|
|
保存数据
|
|
|
</el-button>
|
|
|
</div>
|
|
|
@@ -24,9 +31,14 @@
|
|
|
<crop-select v-model="form.corpId" corpType="KH" :disabled="option.disabled"
|
|
|
@getCorpData="getCorpData"></crop-select>
|
|
|
</template>
|
|
|
+
|
|
|
+ <template slot="maintenanceAmount">
|
|
|
+ <el-input v-model="form.maintenanceAmount" type="number" disabled
|
|
|
+ placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input>
|
|
|
+ </template>
|
|
|
</avue-form>
|
|
|
</trade-card>
|
|
|
- <trade-card title="商品信息" v-loading="loadingBtn">
|
|
|
+ <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">
|
|
|
@@ -34,15 +46,25 @@
|
|
|
: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 slot="costName" slot-scope="{ row, index }">
|
|
|
+ <el-input v-if="row.$cellEdit" v-model="row.costName"
|
|
|
+ placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input>
|
|
|
+ <span v-else>{{ row.costName }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="amount" slot-scope="{ row, index }">
|
|
|
+ <el-input v-if="row.$cellEdit" v-model="row.amount"
|
|
|
+ placeholder="请输入" size="small" :controls="false" style="width:100%;"
|
|
|
+ @blur="amountblur">
|
|
|
+ </el-input>
|
|
|
+ <span v-else>{{ row.amount }}</span>
|
|
|
+ </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="menu" slot-scope="{ row, index }">
|
|
|
- <el-button size="small" type="text" v-if="row.url" @click="imgurlfun(row)">信息码
|
|
|
- </el-button>
|
|
|
<el-button size="small" type="text" :disabled="option.disabled" @click="rowCell(row, index)">{{
|
|
|
row.$cellEdit ? "保存" : "修改"
|
|
|
}}</el-button>
|
|
|
@@ -52,100 +74,43 @@
|
|
|
</avue-crud>
|
|
|
</trade-card>
|
|
|
|
|
|
- <!--<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>-->
|
|
|
+ <containerTitle title="上传附件"></containerTitle>
|
|
|
+ <c-upload v-loading="loadingBtn" typeUpload="CD"
|
|
|
+ deleteUrl="/api/blade-sales-part/maintenanceFiles/remove" :data="maintenanceFiles" display
|
|
|
+ :enumerationValue="35.1"></c-upload>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<dictbiz-dialog ref="dictbiz" title="添加单位" code="unit" parentId="1585962784498225154" @closed="getAllWorkDicts">
|
|
|
</dictbiz-dialog>
|
|
|
|
|
|
<report-dialog :switchDialog="switchDialog" :reportId="form.id" reportName="配件系统-采购单" @onClose="onClose()">
|
|
|
</report-dialog>
|
|
|
|
|
|
- <!--图片查看-->
|
|
|
- <el-dialog
|
|
|
- title="信息码"
|
|
|
- :visible.sync="imgfalse"
|
|
|
- width="50%"
|
|
|
- append-to-body
|
|
|
- :before-close="imgfalseClose">
|
|
|
- <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" @on-load="productonLoad" :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>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { optionList } from "./js/optionList";
|
|
|
-import { optionTwo } from "./js/optionListTwo";
|
|
|
-import { getDetails, submit, getCorpDetails, remove, getAllgoods, save, fixSave, revoke, collectPayment, getStoragelist } from "@/api/basicData/salesOrder";
|
|
|
import reportDialog from "@/components/report-dialog/main";
|
|
|
import { multiply, sum, subtract } from "@/util/calculate";
|
|
|
-import { getList as KHgetList} from "@/api/basicData/client";
|
|
|
-import { getList } from "@/api/basicData/product";
|
|
|
-import {getList as getListpp } from "@/api/tirePartsMall/basicData/brandPage";
|
|
|
-import {
|
|
|
- projectGoodsSubmit
|
|
|
-} from "@/api/basicData/ServiceLtems";
|
|
|
+import {getList as yhgetList} from "@/api/system/user";
|
|
|
+
|
|
|
import {
|
|
|
- corpequipmentarchivesDetail,
|
|
|
- corpequipmentarchivesitemRemove,
|
|
|
- corpequipmentarchivesSubmit
|
|
|
-} from "@/api/basicData/EquipmentArchives";
|
|
|
+ maintenanceDetail,
|
|
|
+ maintenanceDispatchingWorkers,
|
|
|
+ maintenanceFeesRemove, maintenanceRevokeDispatchingWorkers,
|
|
|
+ maintenanceSubmit
|
|
|
+} from "@/api/basicData/maintenanceQ";
|
|
|
import { getGoodstype } from "@/api/basicData/product";
|
|
|
+import { getList as CPgetList } from "@/api/basicData/product";
|
|
|
export default {
|
|
|
name: "index",
|
|
|
data() {
|
|
|
return {
|
|
|
- // 图片的弹窗的开启
|
|
|
- imgfalse:false,
|
|
|
- imgtext:'',
|
|
|
switchDialog: false,
|
|
|
loadingBtn: false,
|
|
|
addressTitle: null,
|
|
|
@@ -165,7 +130,6 @@ export default {
|
|
|
{
|
|
|
label: "客户名称",
|
|
|
prop: "corpId",
|
|
|
-
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
|
@@ -173,196 +137,138 @@ export default {
|
|
|
trigger: "blur"
|
|
|
}
|
|
|
],
|
|
|
- span: 8,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "签约时间",
|
|
|
- prop: "signingDateStart",
|
|
|
- type: "date",
|
|
|
- format: "yyyy-MM-dd",
|
|
|
- valueFormat: "yyyy-MM-dd 00:00:00",
|
|
|
- span: 8,
|
|
|
+ span: 16,
|
|
|
+
|
|
|
},
|
|
|
+ {
|
|
|
+ label: "客户电话",
|
|
|
+ prop: "corpTel",
|
|
|
+ span: 8,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "设备名称",
|
|
|
+ prop: "deviceId",
|
|
|
+ dicData:[],
|
|
|
+ dataType: "string",
|
|
|
+ type: "select",
|
|
|
+ props: {
|
|
|
+ label: 'cname',
|
|
|
+ value: 'id'
|
|
|
+ },
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ span: 12,
|
|
|
+ change: (val) => {
|
|
|
+ val.column.dicData.map(item=>{
|
|
|
+ if (val.value == item.id){
|
|
|
+ this.form.deviceName = item.cname
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "设备地址",
|
|
|
+ prop: "deviceAddress",
|
|
|
+ span: 12,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "故障描述",
|
|
|
+ prop: "faultDescribe",
|
|
|
+ type: "textarea",
|
|
|
+ minRows: 3,
|
|
|
+ span: 24,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "维修工名称",
|
|
|
+ prop: "maintenanceWorkerId",
|
|
|
+ dicData:[],
|
|
|
+ dataType: "string",
|
|
|
+ type: "select",
|
|
|
+ props: {
|
|
|
+ label: 'name',
|
|
|
+ value: 'id'
|
|
|
+ },
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ span: 8,
|
|
|
+ change: (val) => {
|
|
|
+ val.column.dicData.map(item=>{
|
|
|
+ if (val.value == item.id){
|
|
|
+ this.form.maintenanceWorkerName = item.name
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "维修工电话",
|
|
|
+ prop: "maintenanceWorkerTel",
|
|
|
+ span: 8,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "维修金额",
|
|
|
+ prop: "maintenanceAmount",
|
|
|
+ disabled:true,
|
|
|
+ span: 8,
|
|
|
+ type: "number",
|
|
|
+ },
|
|
|
{
|
|
|
- label: "解约时间",
|
|
|
- prop: "signingDateEnd",
|
|
|
+ label: "报修日期",
|
|
|
+ prop: "repairReportDate",
|
|
|
type: "date",
|
|
|
format: "yyyy-MM-dd",
|
|
|
valueFormat: "yyyy-MM-dd 00:00:00",
|
|
|
span: 8,
|
|
|
},
|
|
|
- {
|
|
|
- label: "备注",
|
|
|
- prop: "remarks",
|
|
|
- type: "textarea",
|
|
|
- minRows: 3,
|
|
|
- span: 16,
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- option2: {
|
|
|
- menuBtn: false,
|
|
|
- labelWidth: 80,
|
|
|
- disabled: false,
|
|
|
- column: [
|
|
|
- {
|
|
|
- label: "税率",
|
|
|
- prop: "exchangeRate",
|
|
|
- type: "select",
|
|
|
- props: {
|
|
|
- label: "dictValue",
|
|
|
- value: "dictKey"
|
|
|
+ {
|
|
|
+ label: "状态",
|
|
|
+ prop: "status",
|
|
|
+ dataType: "string",
|
|
|
+ type: "select",
|
|
|
+ disabled:true,
|
|
|
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=state_Q",
|
|
|
+ props: {
|
|
|
+ label: "dictValue",
|
|
|
+ value: "dictKey"
|
|
|
+ },
|
|
|
+ span: 8,
|
|
|
},
|
|
|
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=tax_rate",
|
|
|
- span: 4,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "采购总数量",
|
|
|
- prop: "storageQuantity",
|
|
|
- disabled: true,
|
|
|
- span: 4,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "成本",
|
|
|
- prop: "costAmount",
|
|
|
- disabled: true,
|
|
|
- span: 4,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "毛利",
|
|
|
- prop: "grossProfit",
|
|
|
- disabled: true,
|
|
|
- span: 4,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "订单金额",
|
|
|
- prop: "purchaseAmount",
|
|
|
- disabled: true,
|
|
|
- span: 4,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "优惠金额",
|
|
|
- prop: "thisUsedProfit",
|
|
|
- span: 4,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "合同金额",
|
|
|
- prop: "orderAmount",
|
|
|
- disabled: true,
|
|
|
- span: 8,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "应付金额",
|
|
|
- prop: "balanceAmount",
|
|
|
- disabled: true,
|
|
|
- span: 8,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "已付金额",
|
|
|
- prop: "settlmentAmount",
|
|
|
- disabled: true,
|
|
|
- span: 8,
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- 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,
|
|
|
+ span: 16,
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
@@ -371,42 +277,8 @@ export default {
|
|
|
// 商品产品下拉数据
|
|
|
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:{},
|
|
|
-
|
|
|
+ maintenanceFiles: [],
|
|
|
loading:false,
|
|
|
-
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
|
@@ -417,6 +289,7 @@ export default {
|
|
|
components: {
|
|
|
reportDialog
|
|
|
},
|
|
|
+
|
|
|
async created() {
|
|
|
this.optionList = optionList
|
|
|
// 获取字典数据
|
|
|
@@ -426,15 +299,10 @@ export default {
|
|
|
this.option.disabled = true
|
|
|
this.getDetail(this.detailData.id);
|
|
|
}
|
|
|
-
|
|
|
if (this.detailData.status == 1) {
|
|
|
this.option.disabled = true;
|
|
|
- this.option2.disabled = true;
|
|
|
}
|
|
|
- // 获取产品数据
|
|
|
- // getAllgoods().then(res => {
|
|
|
- // this.goodsoptions = res.data.data
|
|
|
- // });
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
// 打印报表按钮事件
|
|
|
@@ -446,17 +314,27 @@ export default {
|
|
|
},
|
|
|
// 获取下拉字典
|
|
|
getAllWorkDicts() {
|
|
|
- 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.option.column, "deviceAddress").dicData = JSON.parse(localStorage.getItem('areaTypeTree'))
|
|
|
+ // 获取维修工信息
|
|
|
+ yhgetList().then(res=>{
|
|
|
+ this.findObject(this.option.column, "maintenanceWorkerId").dicData = res.data.data.records
|
|
|
+ })
|
|
|
+ CPgetList().then(res=>{
|
|
|
+ this.findObject(this.option.column, "deviceId").dicData = res.data.data.records
|
|
|
})
|
|
|
},
|
|
|
cellStyle() {
|
|
|
return "padding:0;height:40px;";
|
|
|
},
|
|
|
+ // 维修项目的失焦事件
|
|
|
+ amountblur(){
|
|
|
+ let sum = 0
|
|
|
+ this.data.map(item=>{
|
|
|
+ sum += Number(item.amount)
|
|
|
+ })
|
|
|
+ this.form.maintenanceAmount = sum
|
|
|
+ },
|
|
|
|
|
|
amountChange() {
|
|
|
let val = 0
|
|
|
@@ -479,11 +357,11 @@ export default {
|
|
|
// 获取详情数据
|
|
|
getDetail(id) {
|
|
|
this.loadingBtn = true
|
|
|
- corpequipmentarchivesDetail({ id: id })
|
|
|
+ maintenanceDetail({ id: id })
|
|
|
.then(res => {
|
|
|
this.form = res.data.data;
|
|
|
- this.data = res.data.data.corpEquipmentArchivesItemList;
|
|
|
- // this.orderFilesList = res.data.data.orderFilesList ? res.data.data.orderFilesList : [];
|
|
|
+ this.data = res.data.data.maintenanceFees;
|
|
|
+ this.maintenanceFiles = res.data.data.maintenanceFiles ? res.data.data.maintenanceFiles : [];
|
|
|
})
|
|
|
.finally(() => {
|
|
|
this.loadingBtn = false;
|
|
|
@@ -501,28 +379,30 @@ export default {
|
|
|
},
|
|
|
|
|
|
addRow() {
|
|
|
+ // this.data.push({ $cellEdit: true, storageId: this.form.storageId })
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
done();
|
|
|
if (valid) {
|
|
|
- // this.data.push({ $cellEdit: true, storageId: this.form.storageId })
|
|
|
- this.tableData = []
|
|
|
- this.goodsListSave = []
|
|
|
- // 获取产品弹窗的左侧类型
|
|
|
- this.getGoodstypefun()
|
|
|
- this.productVisible = true
|
|
|
+ this.data.push({ $cellEdit: true, storageId: this.form.storageId })
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
rowCell(row, index) {
|
|
|
+ if (!row.costName) {
|
|
|
+ return this.$message.warning('维修项目不能为空');
|
|
|
+ }
|
|
|
+ if (!row.amount) {
|
|
|
+ return this.$message.warning('金额不能我空');
|
|
|
+ }
|
|
|
if (row.$cellEdit == true) {
|
|
|
this.$set(row, "$cellEdit", false);
|
|
|
} else {
|
|
|
this.$set(row, "$cellEdit", true);
|
|
|
}
|
|
|
},
|
|
|
- // 删除
|
|
|
+ // 费用删除
|
|
|
rowDel(row, index) {
|
|
|
this.$confirm("确定删除数据?", {
|
|
|
confirmButtonText: "确定",
|
|
|
@@ -530,7 +410,7 @@ export default {
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
if (row.id) {
|
|
|
- corpequipmentarchivesitemRemove({ids:row.id}).then(res => {
|
|
|
+ maintenanceFeesRemove({ids:row.id}).then(res => {
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
message: "删除成功!"
|
|
|
@@ -544,101 +424,106 @@ export default {
|
|
|
});
|
|
|
this.data.splice(index, 1);
|
|
|
}
|
|
|
+ this.amountblur()
|
|
|
});
|
|
|
},
|
|
|
- //修改提交触发
|
|
|
- editCustomer() {
|
|
|
+ //修改提交触发1 派工2 撤销派工3
|
|
|
+ editCustomer(index) {
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
done();
|
|
|
if (valid) {
|
|
|
if (this.data.length == 0) {
|
|
|
- return this.$message.error('请添加一条商品信息');
|
|
|
+ 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,
|
|
|
- specs:item.specs,
|
|
|
- remarks:item.remarks,
|
|
|
- goodsTypeId:item.goodsTypeId,
|
|
|
- goodsTypeName:item.goodsTypeName,
|
|
|
- exitDate:item.exitDate,
|
|
|
- repairReportDate:item.repairReportDate
|
|
|
+ costId:item.costId?item.costId:null,
|
|
|
+ costName:item.costName,
|
|
|
+ amount:item.amount,
|
|
|
+ number:1,
|
|
|
+ price:item.amount,
|
|
|
+ currency:'CNY',
|
|
|
+ settlementAmount:item.settlementAmount?item.settlementAmount:0,
|
|
|
+ remarks:item.remarks
|
|
|
}
|
|
|
})
|
|
|
+ let list = this.maintenanceFiles.map(item=>{
|
|
|
+ item.sort = 1
|
|
|
+ return item
|
|
|
+ })
|
|
|
const obj = {
|
|
|
id:this.form.id?this.form.id:null,
|
|
|
+ sysNo:this.form.sysNo?this.form.sysNo:null,
|
|
|
+ deviceId:this.form.deviceId,
|
|
|
+ deviceName:this.form.deviceName,
|
|
|
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,
|
|
|
+ corpTel:this.form.corpTel,
|
|
|
+ deviceAddress:this.form.deviceAddress,
|
|
|
+ faultDescribe:this.form.faultDescribe,
|
|
|
+ maintenanceWorkerId:this.form.maintenanceWorkerId,
|
|
|
+ maintenanceWorkerName:this.form.maintenanceWorkerName,
|
|
|
+ maintenanceWorkerTel:this.form.maintenanceWorkerTel,
|
|
|
+ maintenanceAmount:this.form.maintenanceAmount,
|
|
|
+ repairReportDate:this.form.repairReportDate,
|
|
|
+ settlementAmount:this.form.settlementAmount?this.form.settlementAmount:0,
|
|
|
remarks:this.form.remarks,
|
|
|
- corpEquipmentArchivesItemList:arr
|
|
|
+ status:this.form.status,
|
|
|
+ maintenanceFees:arr,
|
|
|
+ maintenanceFiles:list
|
|
|
}
|
|
|
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.option2.disabled = true;
|
|
|
- this.$refs.crud.refreshTable();
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- this.loadingBtn = false;
|
|
|
- });
|
|
|
+
|
|
|
+ this.maintenanceSubmitfun(obj,index)
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- // 查看图片
|
|
|
- imgurlfun(row){
|
|
|
- this.imgfalse = true
|
|
|
- this.imgtext = row.url
|
|
|
+ // 派工接口
|
|
|
+ maintenanceDispatchingWorkersfun(obj){
|
|
|
+ maintenanceDispatchingWorkers(obj).then(res=>{
|
|
|
+ this.$message.success("派工成功");
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.data = res.data.data.maintenanceFees;
|
|
|
+ this.maintenanceFiles = res.data.data.maintenanceFiles ? res.data.data.maintenanceFiles : [];
|
|
|
+ this.option.disabled = true;
|
|
|
+ })
|
|
|
},
|
|
|
- imgfalseClose(){
|
|
|
- this.imgtext = ''
|
|
|
- this.imgfalse = false
|
|
|
+ // 撤销派工
|
|
|
+ maintenanceRevokeDispatchingWorkersfun(obj){
|
|
|
+ maintenanceRevokeDispatchingWorkers(obj).then(res=>{
|
|
|
+ this.$message.success("撤销派工成功");
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.data = res.data.data.maintenanceFees;
|
|
|
+ this.maintenanceFiles = res.data.data.maintenanceFiles ? res.data.data.maintenanceFiles : [];
|
|
|
+ this.option.disabled = true;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 保存接口
|
|
|
+ maintenanceSubmitfun(obj,index){
|
|
|
+ maintenanceSubmit(obj).then(res => {
|
|
|
+ this.form = res.data.data;
|
|
|
+ // this.data = res.data.data.maintenanceFees;
|
|
|
+ // this.maintenanceFiles = res.data.data.maintenanceFiles ? res.data.data.maintenanceFiles : [];
|
|
|
+ this.detailData.status = 1
|
|
|
+ this.option.disabled = true;
|
|
|
+
|
|
|
+ if (index == 0) {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ this.getDetail(this.form.id)
|
|
|
+ }else if (index == 1) {
|
|
|
+ this.maintenanceDispatchingWorkersfun(obj)
|
|
|
+ }else if (index == 2) {
|
|
|
+ this.maintenanceRevokeDispatchingWorkersfun(obj)
|
|
|
+ }else {}
|
|
|
+ this.$refs.crud.refreshTable();
|
|
|
+ }).finally(() => {
|
|
|
+ this.loadingBtn = false;
|
|
|
+ });
|
|
|
},
|
|
|
+
|
|
|
async saveColumn() {
|
|
|
const inSave = optionList
|
|
|
if (inSave) {
|
|
|
@@ -665,143 +550,14 @@ export default {
|
|
|
openEdit() {
|
|
|
// this.detailData.status = 2
|
|
|
this.option.disabled = false
|
|
|
- this.option = this.$options.data().option;
|
|
|
- this.option2 = this.$options.data().option2;
|
|
|
- this.$refs.crud.refreshTable();
|
|
|
+ // 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) {
|
|
|
- delete item.id
|
|
|
- this.data.push({
|
|
|
- $cellEdit: true,
|
|
|
- storageId: this.form.storageId,
|
|
|
- ...item
|
|
|
- })
|
|
|
- }
|
|
|
- }else {
|
|
|
- for (let item of this.tableData) {
|
|
|
- delete item.id
|
|
|
- this.data.push({
|
|
|
- $cellEdit: true,
|
|
|
- storageId: this.form.storageId,
|
|
|
- ...item
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- 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;
|
|
|
- getList(
|
|
|
- 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;
|
|
|
- // this.findObject(this.option2.column, "parentId").dicData = 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) {
|