|  | @@ -27,10 +27,11 @@
 | 
	
		
			
				|  |  |        </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>
 | 
	
		
			
				|  |  | +          <!--<template slot="corpName">-->
 | 
	
		
			
				|  |  | +          <!--  <!–<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
 | 
	
	
		
			
				|  | @@ -85,8 +86,6 @@
 | 
	
		
			
				|  |  |        <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>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      </div>
 | 
	
	
		
			
				|  | @@ -97,7 +96,7 @@
 | 
	
		
			
				|  |  |  import { optionList } from "./js/optionList";
 | 
	
		
			
				|  |  |  import reportDialog from "@/components/report-dialog/main";
 | 
	
		
			
				|  |  |  import { multiply, sum, subtract } from "@/util/calculate";
 | 
	
		
			
				|  |  | -import {getList as yhgetList} from "@/api/system/user";
 | 
	
		
			
				|  |  | +import {getList as yhgetList, userList} from "@/api/system/user";
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import {
 | 
	
		
			
				|  |  |      maintenanceDetail,
 | 
	
	
		
			
				|  | @@ -105,13 +104,16 @@ import {
 | 
	
		
			
				|  |  |      maintenanceFeesRemove, maintenanceRevokeDispatchingWorkers,
 | 
	
		
			
				|  |  |      maintenanceSubmit
 | 
	
		
			
				|  |  |  } from "@/api/basicData/maintenanceQ";
 | 
	
		
			
				|  |  | -import { getGoodstype } from "@/api/basicData/product";
 | 
	
		
			
				|  |  | -import { getList as CPgetList } from "@/api/basicData/product";
 | 
	
		
			
				|  |  | +import {
 | 
	
		
			
				|  |  | +    bladeUserList,
 | 
	
		
			
				|  |  | +    corpequipmentarchivesitemList,
 | 
	
		
			
				|  |  | +    corpequipmentarchivesList,
 | 
	
		
			
				|  |  | +} from "@/api/basicData/EquipmentArchives";
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |    name: "index",
 | 
	
		
			
				|  |  |    data() {
 | 
	
		
			
				|  |  |      return {
 | 
	
		
			
				|  |  | -      switchDialog: false,
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |        loadingBtn: false,
 | 
	
		
			
				|  |  |        addressTitle: null,
 | 
	
		
			
				|  |  |        form: {},
 | 
	
	
		
			
				|  | @@ -129,7 +131,13 @@ export default {
 | 
	
		
			
				|  |  |          column: [
 | 
	
		
			
				|  |  |            {
 | 
	
		
			
				|  |  |              label: "客户名称",
 | 
	
		
			
				|  |  | -            prop: "corpId",
 | 
	
		
			
				|  |  | +            prop: "corpName",
 | 
	
		
			
				|  |  | +            type: "select",
 | 
	
		
			
				|  |  | +              dicData:[],
 | 
	
		
			
				|  |  | +            props: {
 | 
	
		
			
				|  |  | +                label: 'corpName',
 | 
	
		
			
				|  |  | +                value: 'corpName'
 | 
	
		
			
				|  |  | +            },
 | 
	
		
			
				|  |  |              rules: [
 | 
	
		
			
				|  |  |                {
 | 
	
		
			
				|  |  |                  required: true,
 | 
	
	
		
			
				|  | @@ -137,8 +145,23 @@ export default {
 | 
	
		
			
				|  |  |                  trigger: "blur"
 | 
	
		
			
				|  |  |                }
 | 
	
		
			
				|  |  |              ],
 | 
	
		
			
				|  |  | -            span: 16,
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +              change: (val) => {
 | 
	
		
			
				|  |  | +                if(val.value == '') return
 | 
	
		
			
				|  |  | +                  for(let item of val.column.dicData) {
 | 
	
		
			
				|  |  | +                      if (val.value == item.corpName){
 | 
	
		
			
				|  |  | +                          this.form.corpId = item.corpId
 | 
	
		
			
				|  |  | +                          this.form.corpTel = item.contactsTel
 | 
	
		
			
				|  |  | +                          this.form.deviceAddress = item.address
 | 
	
		
			
				|  |  | +                          this.form.corpDescribe = item.corpName
 | 
	
		
			
				|  |  | +                          // 设备名称
 | 
	
		
			
				|  |  | +                          corpequipmentarchivesitemList({pid:item.id}).then(res=>{
 | 
	
		
			
				|  |  | +                              this.findObject(this.option.column, "deviceName").dicData = res.data.data.records
 | 
	
		
			
				|  |  | +                          })
 | 
	
		
			
				|  |  | +                          break;
 | 
	
		
			
				|  |  | +                      }
 | 
	
		
			
				|  |  | +                  }
 | 
	
		
			
				|  |  | +              },
 | 
	
		
			
				|  |  | +            span: 8,
 | 
	
		
			
				|  |  |            },
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  label: "客户电话",
 | 
	
	
		
			
				|  | @@ -153,35 +176,40 @@ export default {
 | 
	
		
			
				|  |  |                  ],
 | 
	
		
			
				|  |  |              },
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  | +                label: "单号",
 | 
	
		
			
				|  |  | +                prop: "sysNo",
 | 
	
		
			
				|  |  | +                disabled:true,
 | 
	
		
			
				|  |  | +                span: 8,
 | 
	
		
			
				|  |  | +            },
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  |                  label: "设备名称",
 | 
	
		
			
				|  |  | -                prop: "deviceId",
 | 
	
		
			
				|  |  | +                prop: "deviceName",
 | 
	
		
			
				|  |  |                  dicData:[],
 | 
	
		
			
				|  |  |                  dataType: "string",
 | 
	
		
			
				|  |  |                  type: "select",
 | 
	
		
			
				|  |  |                  props: {
 | 
	
		
			
				|  |  |                      label: 'cname',
 | 
	
		
			
				|  |  | -                    value: 'id'
 | 
	
		
			
				|  |  | +                    value: 'cname'
 | 
	
		
			
				|  |  |                  },
 | 
	
		
			
				|  |  | -                rules: [
 | 
	
		
			
				|  |  | -                    {
 | 
	
		
			
				|  |  | -                        required: true,
 | 
	
		
			
				|  |  | -                        message: "",
 | 
	
		
			
				|  |  | -                        trigger: "blur"
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                ],
 | 
	
		
			
				|  |  | -                span: 12,
 | 
	
		
			
				|  |  | +                span: 8,
 | 
	
		
			
				|  |  |                  change: (val) => {
 | 
	
		
			
				|  |  |                      val.column.dicData.map(item=>{
 | 
	
		
			
				|  |  | -                        if (val.value == item.id){
 | 
	
		
			
				|  |  | -                            this.form.deviceName = item.cname
 | 
	
		
			
				|  |  | +                        if (val.value == item.cname){
 | 
	
		
			
				|  |  | +                            this.form.deviceId = item.id
 | 
	
		
			
				|  |  | +                            this.form.deviceDescribe = item.cname
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                            this.form.categoryitem = item.categoryitem
 | 
	
		
			
				|  |  | +                            this.form.categoryitemId = item.categoryitemId
 | 
	
		
			
				|  |  | +                            this.form.factoryId = item.factoryId
 | 
	
		
			
				|  |  | +                            this.form.factoryName = item.factoryName
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      })
 | 
	
		
			
				|  |  |                  },
 | 
	
		
			
				|  |  |              },
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  | -                label: "设备地址",
 | 
	
		
			
				|  |  | +                label: "地址",
 | 
	
		
			
				|  |  |                  prop: "deviceAddress",
 | 
	
		
			
				|  |  | -                span: 12,
 | 
	
		
			
				|  |  | +                span: 8,
 | 
	
		
			
				|  |  |                  rules: [
 | 
	
		
			
				|  |  |                      {
 | 
	
		
			
				|  |  |                          required: true,
 | 
	
	
		
			
				|  | @@ -191,6 +219,14 @@ export default {
 | 
	
		
			
				|  |  |                  ],
 | 
	
		
			
				|  |  |              },
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  | +                label: "报修日期",
 | 
	
		
			
				|  |  | +                prop: "repairReportDate",
 | 
	
		
			
				|  |  | +                type: "date",
 | 
	
		
			
				|  |  | +                format: "yyyy-MM-dd",
 | 
	
		
			
				|  |  | +                valueFormat: "yyyy-MM-dd 00:00:00",
 | 
	
		
			
				|  |  | +                span: 8,
 | 
	
		
			
				|  |  | +            },
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  |                  label: "故障描述",
 | 
	
		
			
				|  |  |                  prop: "faultDescribe",
 | 
	
		
			
				|  |  |                  type: "textarea",
 | 
	
	
		
			
				|  | @@ -204,36 +240,24 @@ export default {
 | 
	
		
			
				|  |  |                  dataType: "string",
 | 
	
		
			
				|  |  |                  type: "select",
 | 
	
		
			
				|  |  |                  props: {
 | 
	
		
			
				|  |  | -                    label: 'name',
 | 
	
		
			
				|  |  | +                    label: 'realName',
 | 
	
		
			
				|  |  |                      value: 'id'
 | 
	
		
			
				|  |  |                  },
 | 
	
		
			
				|  |  | -                rules: [
 | 
	
		
			
				|  |  | -                    {
 | 
	
		
			
				|  |  | -                        required: true,
 | 
	
		
			
				|  |  | -                        message: "",
 | 
	
		
			
				|  |  | -                        trigger: "blur"
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                ],
 | 
	
		
			
				|  |  |                  span: 8,
 | 
	
		
			
				|  |  |                  change: (val) => {
 | 
	
		
			
				|  |  | -                    val.column.dicData.map(item=>{
 | 
	
		
			
				|  |  | +                    if(val.value == '') return
 | 
	
		
			
				|  |  | +                    for(let item of val.column.dicData) {
 | 
	
		
			
				|  |  |                          if (val.value == item.id){
 | 
	
		
			
				|  |  |                              this.form.maintenanceWorkerName = item.name
 | 
	
		
			
				|  |  | +                            this.form.maintenanceWorkerTel = item.phone
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  | -                    })
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  |                  },
 | 
	
		
			
				|  |  |              },
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  label: "维修工电话",
 | 
	
		
			
				|  |  |                  prop: "maintenanceWorkerTel",
 | 
	
		
			
				|  |  |                  span: 8,
 | 
	
		
			
				|  |  | -                rules: [
 | 
	
		
			
				|  |  | -                    {
 | 
	
		
			
				|  |  | -                        required: true,
 | 
	
		
			
				|  |  | -                        message: "",
 | 
	
		
			
				|  |  | -                        trigger: "blur"
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                ],
 | 
	
		
			
				|  |  |              },
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  label: "维修金额",
 | 
	
	
		
			
				|  | @@ -242,33 +266,36 @@ export default {
 | 
	
		
			
				|  |  |                  span: 8,
 | 
	
		
			
				|  |  |                  type: "number",
 | 
	
		
			
				|  |  |              },
 | 
	
		
			
				|  |  | -          {
 | 
	
		
			
				|  |  | -            label: "报修日期",
 | 
	
		
			
				|  |  | -            prop: "repairReportDate",
 | 
	
		
			
				|  |  | -            type: "date",
 | 
	
		
			
				|  |  | -            format: "yyyy-MM-dd",
 | 
	
		
			
				|  |  | -            valueFormat: "yyyy-MM-dd 00:00:00",
 | 
	
		
			
				|  |  | -            span: 8,
 | 
	
		
			
				|  |  | -          },
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  | -                label: "状态",
 | 
	
		
			
				|  |  | -                prop: "status",
 | 
	
		
			
				|  |  | -                dataType: "string",
 | 
	
		
			
				|  |  | -                type: "select",
 | 
	
		
			
				|  |  | -                disabled:true,
 | 
	
		
			
				|  |  | -                dicUrl: "/api/blade-system/dict-biz/dictionary?code=state_Q",
 | 
	
		
			
				|  |  | -                props: {
 | 
	
		
			
				|  |  | -                    label: "dictValue",
 | 
	
		
			
				|  |  | -                    value: "dictKey"
 | 
	
		
			
				|  |  | -                },
 | 
	
		
			
				|  |  | +                label: "客户描述",
 | 
	
		
			
				|  |  | +                prop: "corpDescribe",
 | 
	
		
			
				|  |  | +                type: "textarea",
 | 
	
		
			
				|  |  | +                minRows: 3,
 | 
	
		
			
				|  |  |                  span: 8,
 | 
	
		
			
				|  |  | +                change:(val)=>{
 | 
	
		
			
				|  |  | +                    if (!this.form.corpId){
 | 
	
		
			
				|  |  | +                        this.form.corpName = val.value
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            },
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                label: "设备描述",
 | 
	
		
			
				|  |  | +                prop: "deviceDescribe",
 | 
	
		
			
				|  |  | +                type: "textarea",
 | 
	
		
			
				|  |  | +                minRows: 3,
 | 
	
		
			
				|  |  | +                span: 8,
 | 
	
		
			
				|  |  | +                change:(val)=>{
 | 
	
		
			
				|  |  | +                    if (!this.form.deviceId) {
 | 
	
		
			
				|  |  | +                        this.form.deviceName = val.value
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  |              },
 | 
	
		
			
				|  |  |            {
 | 
	
		
			
				|  |  |              label: "备注",
 | 
	
		
			
				|  |  |              prop: "remarks",
 | 
	
		
			
				|  |  |              type: "textarea",
 | 
	
		
			
				|  |  |              minRows: 3,
 | 
	
		
			
				|  |  | -            span: 16,
 | 
	
		
			
				|  |  | +            span: 8,
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |          ]
 | 
	
		
			
				|  |  |        },
 | 
	
	
		
			
				|  | @@ -305,23 +332,16 @@ export default {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    methods: {
 | 
	
		
			
				|  |  | -      // 打印报表按钮事件
 | 
	
		
			
				|  |  | -    openReport() {
 | 
	
		
			
				|  |  | -      this.switchDialog = !this.switchDialog;
 | 
	
		
			
				|  |  | -    },
 | 
	
		
			
				|  |  | -    onClose(val) {
 | 
	
		
			
				|  |  | -      this.switchDialog = val;
 | 
	
		
			
				|  |  | -    },
 | 
	
		
			
				|  |  |        // 获取下拉字典
 | 
	
		
			
				|  |  |      getAllWorkDicts() {
 | 
	
		
			
				|  |  |          // 获取地址信息
 | 
	
		
			
				|  |  |          // 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
 | 
	
		
			
				|  |  | +        // 获取客户名称(档案列表)
 | 
	
		
			
				|  |  | +        corpequipmentarchivesList().then(res=>{
 | 
	
		
			
				|  |  | +            this.findObject(this.option.column, "corpName").dicData = res.data.data.records
 | 
	
		
			
				|  |  |          })
 | 
	
		
			
				|  |  | -        CPgetList().then(res=>{
 | 
	
		
			
				|  |  | -            this.findObject(this.option.column, "deviceId").dicData = res.data.data.records
 | 
	
		
			
				|  |  | +        bladeUserList({roleAlias:'维修工'}).then(res=>{
 | 
	
		
			
				|  |  | +            this.findObject(this.option.column, "maintenanceWorkerId").dicData = res.data.data
 | 
	
		
			
				|  |  |          })
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      cellStyle() {
 | 
	
	
		
			
				|  | @@ -427,14 +447,27 @@ export default {
 | 
	
		
			
				|  |  |          this.amountblur()
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    //修改提交触发1 派工2 撤销派工3
 | 
	
		
			
				|  |  | +    //修改提交触发0 派工1 撤销派工2
 | 
	
		
			
				|  |  |      editCustomer(index) {
 | 
	
		
			
				|  |  |        this.$refs["form"].validate((valid, done) => {
 | 
	
		
			
				|  |  |          done();
 | 
	
		
			
				|  |  |          if (valid) {
 | 
	
		
			
				|  |  | -          if (this.data.length == 0) {
 | 
	
		
			
				|  |  | -            return this.$message.error('请添加一条维修项目');
 | 
	
		
			
				|  |  | +          if (!this.form.corpName) {
 | 
	
		
			
				|  |  | +              return this.$message.error('请维护客户描述');
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  | +            if (!this.form.deviceDescribe) {
 | 
	
		
			
				|  |  | +                return this.$message.error('请维护设备描述');
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            if(index == 1) {
 | 
	
		
			
				|  |  | +                if (!this.form.maintenanceWorkerId) {
 | 
	
		
			
				|  |  | +                    return this.$message.error('请选择维修工');
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                if (!this.form.maintenanceWorkerTel) {
 | 
	
		
			
				|  |  | +                    return this.$message.error('请填写维修工电话');
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              let arr = this.data.map(item=>{
 | 
	
		
			
				|  |  |                  return {
 | 
	
		
			
				|  |  |                      id:item.id?item.id:null,
 | 
	
	
		
			
				|  | @@ -470,6 +503,14 @@ export default {
 | 
	
		
			
				|  |  |                  settlementAmount:this.form.settlementAmount?this.form.settlementAmount:0,
 | 
	
		
			
				|  |  |                  remarks:this.form.remarks,
 | 
	
		
			
				|  |  |                  status:this.form.status,
 | 
	
		
			
				|  |  | +                categoryitem:this.form.categoryitem, // 功能分类
 | 
	
		
			
				|  |  | +                factoryId:this.form.factoryId, // 工厂
 | 
	
		
			
				|  |  | +                factoryName:this.form.factoryName, // 工厂
 | 
	
		
			
				|  |  | +                deviceDescribe:this.form.deviceDescribe,
 | 
	
		
			
				|  |  | +                corpDescribe:this.form.corpDescribe,
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                categoryitemId:this.form.categoryitemId,
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |                  maintenanceFees:arr,
 | 
	
		
			
				|  |  |                  maintenanceFiles:list
 | 
	
		
			
				|  |  |              }
 |