|  | @@ -8,50 +8,25 @@
 | 
	
		
			
				|  |  |            </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" v-if="detailData.status == 1 && form.confirmStatus == 0"
 | 
	
		
			
				|  |  | -            class="el-button--small-yh " @click.stop="openEdit">编辑
 | 
	
		
			
				|  |  | -          </el-button>
 | 
	
		
			
				|  |  | -          <el-button type="primary" size="small" v-if="!form.id && detailData.status != 1" @click="editCustomer">
 | 
	
		
			
				|  |  | -            保存数据
 | 
	
		
			
				|  |  | -          </el-button>
 | 
	
		
			
				|  |  | -          <!--<el-button type="primary" size="small" v-if="form.id && detailData.status != 1 && form.confirmStatus == 0"-->
 | 
	
		
			
				|  |  | -          <!--  @click="fixSave">-->
 | 
	
		
			
				|  |  | -          <!--  保存数据-->
 | 
	
		
			
				|  |  | +          <!--<el-button type="info" icon="el-icon-printer" size="small" @click.stop="openReport()">报表打印-->
 | 
	
		
			
				|  |  |            <!--</el-button>-->
 | 
	
		
			
				|  |  | -          <el-button type="primary" size="small" v-if="form.id && detailData.status != 1 && form.confirmStatus == 0"
 | 
	
		
			
				|  |  | -            @click="submit">
 | 
	
		
			
				|  |  | -            提交
 | 
	
		
			
				|  |  | -          </el-button>
 | 
	
		
			
				|  |  | -          <el-button type="primary" size="small" v-if="form.confirmStatus == 1" @click="revoke">
 | 
	
		
			
				|  |  | -            撤销
 | 
	
		
			
				|  |  | +          <!--<el-button type="primary" size="small"-->
 | 
	
		
			
				|  |  | +          <!--  class="el-button--small-yh " @click.stop="openEdit">编辑-->
 | 
	
		
			
				|  |  | +          <!--</el-button>-->
 | 
	
		
			
				|  |  | +          <el-button type="primary" size="small" @click="editCustomer">
 | 
	
		
			
				|  |  | +            保存数据
 | 
	
		
			
				|  |  |            </el-button>
 | 
	
		
			
				|  |  |          </div>
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  | -      <!-- <containerTitle title="基础资料" style="margin-top: 60px"></containerTitle> -->
 | 
	
		
			
				|  |  |        <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="GYS" :disabled="detailData.status == 1"
 | 
	
		
			
				|  |  | +            <crop-select v-model="form.corpId" corpType="KH" :disabled="detailData.status == 1"
 | 
	
		
			
				|  |  |                @getCorpData="getCorpData"></crop-select>
 | 
	
		
			
				|  |  |            </template>
 | 
	
		
			
				|  |  | -               <template slot="storageId">
 | 
	
		
			
				|  |  | -                      <el-select v-model="form.storageId" placeholder="请选择" size="small" filterable @change="storageChange"
 | 
	
		
			
				|  |  | -                        :disabled="detailData.status == 1 || data.length > 0">
 | 
	
		
			
				|  |  | -                        <el-option v-for="item in storageoptions" :key="item.id" :label="item.cname" :value="item.id">
 | 
	
		
			
				|  |  | -                        </el-option>
 | 
	
		
			
				|  |  | -                      </el-select>
 | 
	
		
			
				|  |  | -                    </template>
 | 
	
		
			
				|  |  |          </avue-form>
 | 
	
		
			
				|  |  |        </trade-card>
 | 
	
		
			
				|  |  |        <trade-card title="商品信息" v-loading="loadingBtn">
 | 
	
		
			
				|  |  | -        <avue-form class="trading-form" v-model="form" :option="option2">
 | 
	
		
			
				|  |  | -          <template slot="thisUsedProfit">
 | 
	
		
			
				|  |  | -            <el-input-number v-model="form.thisUsedProfit" :disabled="detailData.status == 1" @change="amountChange"
 | 
	
		
			
				|  |  | -              placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input-number>
 | 
	
		
			
				|  |  | -          </template>
 | 
	
		
			
				|  |  | -        </avue-form>
 | 
	
		
			
				|  |  |          <avue-crud ref="crud" :option="optionList" :data="data" :table-loading="loading" @saveColumn="saveColumn"
 | 
	
		
			
				|  |  |            @resetColumn="resetColumn" :cell-style="cellStyle">
 | 
	
		
			
				|  |  |            <template slot="headerSerial">
 | 
	
	
		
			
				|  | @@ -66,26 +41,15 @@
 | 
	
		
			
				|  |  |              </el-select>
 | 
	
		
			
				|  |  |              <span v-else>{{ row.cname }}</span>
 | 
	
		
			
				|  |  |            </template>
 | 
	
		
			
				|  |  | -          <template slot="unitHeader" slot-scope="{column}">
 | 
	
		
			
				|  |  | -            <span style="color: #409EFF;cursor: pointer" @click.stop="$refs.dictbiz.open()">单位
 | 
	
		
			
				|  |  | -            </span>
 | 
	
		
			
				|  |  | -          </template>
 | 
	
		
			
				|  |  | -          <template slot="storageInQuantity" slot-scope="{ row, index }">
 | 
	
		
			
				|  |  | -            <el-input-number v-if="row.$cellEdit" min="0" v-model="row.storageInQuantity" @change="countChange(row)"
 | 
	
		
			
				|  |  | -              placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input-number>
 | 
	
		
			
				|  |  | -            <span v-else>{{ row.storageInQuantity }}</span>
 | 
	
		
			
				|  |  | -          </template>
 | 
	
		
			
				|  |  | -          <template slot="price" slot-scope="{ row, index }">
 | 
	
		
			
				|  |  | -            <el-input-number v-if="row.$cellEdit" v-model="row.price" min="0" @change="countChange(row)" placeholder="请输入"
 | 
	
		
			
				|  |  | -              size="small" :controls="false" style="width:100%;"></el-input-number>
 | 
	
		
			
				|  |  | -            <span v-else>{{ row.price }}</span>
 | 
	
		
			
				|  |  | -          </template>
 | 
	
		
			
				|  |  | -          <template slot="purchaseAmount" slot-scope="{ row, index }">
 | 
	
		
			
				|  |  | -            <el-input-number v-if="row.$cellEdit" v-model="row.purchaseAmount" min="0" @change="countChange(row)"
 | 
	
		
			
				|  |  | -              placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input-number>
 | 
	
		
			
				|  |  | -            <span v-else>{{ row.purchaseAmount }}</span>
 | 
	
		
			
				|  |  | -          </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="menu" slot-scope="{ row, index }">
 | 
	
		
			
				|  |  | +              <el-button size="small" type="text" :disabled="detailData.status == 1" @click="imgurlfun(row)">图片
 | 
	
		
			
				|  |  | +              </el-button>
 | 
	
		
			
				|  |  |              <el-button size="small" type="text" :disabled="detailData.status == 1" @click="rowCell(row, index)">{{
 | 
	
		
			
				|  |  |                  row.$cellEdit ? "保存" : "修改"
 | 
	
		
			
				|  |  |              }}</el-button>
 | 
	
	
		
			
				|  | @@ -94,34 +58,28 @@
 | 
	
		
			
				|  |  |            </template>
 | 
	
		
			
				|  |  |          </avue-crud>
 | 
	
		
			
				|  |  |        </trade-card>
 | 
	
		
			
				|  |  | -      <fee-info ref="feeInfo" :data="settlementList" :form="form" :detailData="detailData" @getPay="getPay"
 | 
	
		
			
				|  |  | -        v-loading="loadingBtn">
 | 
	
		
			
				|  |  | -      </fee-info>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |        <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>
 | 
	
		
			
				|  |  | -      <el-dialog :title="addressTitle" v-dialogDrag :visible.sync="addressVisible" class="avue-dialog avue-dialog--top"
 | 
	
		
			
				|  |  | -        width="50%" append-to-body>
 | 
	
		
			
				|  |  | -        <span>
 | 
	
		
			
				|  |  | -          <el-tabs v-model="activeName">
 | 
	
		
			
				|  |  | -            <el-tab-pane label="供应商地址" name="first">
 | 
	
		
			
				|  |  | -              <avue-form class="trading-form" v-model="form2" :option="optiontabs1"></avue-form>
 | 
	
		
			
				|  |  | -            </el-tab-pane>
 | 
	
		
			
				|  |  | -            <el-tab-pane label="物流地址" name="second">
 | 
	
		
			
				|  |  | -              <avue-form class="trading-form" v-model="form3" :option="optiontabs2"></avue-form>
 | 
	
		
			
				|  |  | -            </el-tab-pane>
 | 
	
		
			
				|  |  | -          </el-tabs>
 | 
	
		
			
				|  |  | -        </span>
 | 
	
		
			
				|  |  | -        <div class="avue-dialog__footer">
 | 
	
		
			
				|  |  | -          <el-button @click="addressVisible = false">取 消</el-button>
 | 
	
		
			
				|  |  | -          <el-button @click="addressVisible = false" type="primary">确 定</el-button>
 | 
	
		
			
				|  |  | -        </div>
 | 
	
		
			
				|  |  | -      </el-dialog>
 | 
	
		
			
				|  |  |        <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>
 | 
	
		
			
				|  |  |      </div>
 | 
	
		
			
				|  |  |    </div>
 | 
	
		
			
				|  |  |  </template>
 | 
	
	
		
			
				|  | @@ -129,18 +87,30 @@
 | 
	
		
			
				|  |  |  <script>
 | 
	
		
			
				|  |  |  import { optionList } from "./js/optionList";
 | 
	
		
			
				|  |  |  import { getDetails, submit, getCorpDetails, remove, getAllgoods, save, fixSave, revoke, collectPayment, getStoragelist } from "@/api/basicData/salesOrder";
 | 
	
		
			
				|  |  | -import feeInfo from "./components/feeInfo.vue";
 | 
	
		
			
				|  |  |  import reportDialog from "@/components/report-dialog/main";
 | 
	
		
			
				|  |  |  import { multiply, sum, subtract } from "@/util/calculate";
 | 
	
		
			
				|  |  | +import { getList as KHgetList} from "@/api/basicData/client";
 | 
	
		
			
				|  |  | +import {getList as getListpp } from "@/api/tirePartsMall/basicData/brandPage";
 | 
	
		
			
				|  |  | +import {
 | 
	
		
			
				|  |  | +    goodsTypeProjectListAll,
 | 
	
		
			
				|  |  | +} from "@/api/basicData/ServiceLtems";
 | 
	
		
			
				|  |  | +import {
 | 
	
		
			
				|  |  | +    corpequipmentarchivesDetail,
 | 
	
		
			
				|  |  | +    corpequipmentarchivesitemRemove,
 | 
	
		
			
				|  |  | +    corpequipmentarchivesSubmit
 | 
	
		
			
				|  |  | +} from "@/api/basicData/EquipmentArchives";
 | 
	
		
			
				|  |  | +import { getGoodstype } from "@/api/basicData/product";
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |    name: "index",
 | 
	
		
			
				|  |  |    data() {
 | 
	
		
			
				|  |  |      return {
 | 
	
		
			
				|  |  | +        // 图片的弹窗的开启
 | 
	
		
			
				|  |  | +        imgfalse:false,
 | 
	
		
			
				|  |  | +        imgtext:'',
 | 
	
		
			
				|  |  |        switchDialog: false,
 | 
	
		
			
				|  |  |        activeName: 'first',
 | 
	
		
			
				|  |  |        loadingBtn: false,
 | 
	
		
			
				|  |  |        addressTitle: null,
 | 
	
		
			
				|  |  | -      addressVisible: false,
 | 
	
		
			
				|  |  |        form: {},
 | 
	
		
			
				|  |  |        form2: {
 | 
	
		
			
				|  |  |        },
 | 
	
	
		
			
				|  | @@ -148,13 +118,14 @@ export default {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |        data: [],
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |        option: {
 | 
	
		
			
				|  |  |          menuBtn: false,
 | 
	
		
			
				|  |  |          labelWidth: 90,
 | 
	
		
			
				|  |  |          disabled: false,
 | 
	
		
			
				|  |  |          column: [
 | 
	
		
			
				|  |  |            {
 | 
	
		
			
				|  |  | -            label: "供应商名称",
 | 
	
		
			
				|  |  | +            label: "客户名称",
 | 
	
		
			
				|  |  |              prop: "corpId",
 | 
	
		
			
				|  |  |              rules: [
 | 
	
		
			
				|  |  |                {
 | 
	
	
		
			
				|  | @@ -166,58 +137,24 @@ export default {
 | 
	
		
			
				|  |  |              span: 8,
 | 
	
		
			
				|  |  |            },
 | 
	
		
			
				|  |  |            {
 | 
	
		
			
				|  |  | -            label: "送货地址",
 | 
	
		
			
				|  |  | -            prop: "arrivalAddress",
 | 
	
		
			
				|  |  | -            type: 'select',
 | 
	
		
			
				|  |  | -            dicData: [],
 | 
	
		
			
				|  |  | -            props: {
 | 
	
		
			
				|  |  | -              label: 'detailedAddress',
 | 
	
		
			
				|  |  | -              value: 'detailedAddress'
 | 
	
		
			
				|  |  | -            },
 | 
	
		
			
				|  |  | -            allowCreate: true,
 | 
	
		
			
				|  |  | -            filterable: true,
 | 
	
		
			
				|  |  | -            span: 16,
 | 
	
		
			
				|  |  | -          },
 | 
	
		
			
				|  |  | -          {
 | 
	
		
			
				|  |  | -            label: "采购日期",
 | 
	
		
			
				|  |  | -            prop: "businesDate",
 | 
	
		
			
				|  |  | -            type: "date",
 | 
	
		
			
				|  |  | -            format: "yyyy-MM-dd",
 | 
	
		
			
				|  |  | -            valueFormat: "yyyy-MM-dd 00:00:00",
 | 
	
		
			
				|  |  | -            span: 8,
 | 
	
		
			
				|  |  | -          },
 | 
	
		
			
				|  |  | -          {
 | 
	
		
			
				|  |  | -            label: "计划付款日期",
 | 
	
		
			
				|  |  | -            prop: "advanceCollectionDate",
 | 
	
		
			
				|  |  | +            label: "签约时间",
 | 
	
		
			
				|  |  | +            prop: "signingDateStart",
 | 
	
		
			
				|  |  |              type: "date",
 | 
	
		
			
				|  |  |              format: "yyyy-MM-dd",
 | 
	
		
			
				|  |  |              valueFormat: "yyyy-MM-dd 00:00:00",
 | 
	
		
			
				|  |  |              span: 8,
 | 
	
		
			
				|  |  |            },
 | 
	
		
			
				|  |  |            {
 | 
	
		
			
				|  |  | -            label: "收货日期",
 | 
	
		
			
				|  |  | -            prop: "requiredDeliveryDate",
 | 
	
		
			
				|  |  | +            label: "解约时间",
 | 
	
		
			
				|  |  | +            prop: "signingDateEnd",
 | 
	
		
			
				|  |  |              type: "date",
 | 
	
		
			
				|  |  |              format: "yyyy-MM-dd",
 | 
	
		
			
				|  |  |              valueFormat: "yyyy-MM-dd 00:00:00",
 | 
	
		
			
				|  |  |              span: 8,
 | 
	
		
			
				|  |  |            },
 | 
	
		
			
				|  |  | -                {
 | 
	
		
			
				|  |  | -                      label: "仓库",
 | 
	
		
			
				|  |  | -                      prop: "storageId",
 | 
	
		
			
				|  |  | -                      rules: [
 | 
	
		
			
				|  |  | -                        {
 | 
	
		
			
				|  |  | -                          required: true,
 | 
	
		
			
				|  |  | -                          message: "",
 | 
	
		
			
				|  |  | -                          trigger: "blur"
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | -                      ],
 | 
	
		
			
				|  |  | -                      span: 8,
 | 
	
		
			
				|  |  | -                    },
 | 
	
		
			
				|  |  |            {
 | 
	
		
			
				|  |  |              label: "备注",
 | 
	
		
			
				|  |  | -            prop: "orderRemark",
 | 
	
		
			
				|  |  | -            placeholder: "打印时显示",
 | 
	
		
			
				|  |  | +            prop: "remarks",
 | 
	
		
			
				|  |  |              type: "textarea",
 | 
	
		
			
				|  |  |              minRows: 3,
 | 
	
		
			
				|  |  |              span: 16,
 | 
	
	
		
			
				|  | @@ -390,9 +327,10 @@ export default {
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |          ]
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  | +        // 商品信息列表配置
 | 
	
		
			
				|  |  |        optionList: {},
 | 
	
		
			
				|  |  | +        // 商品产品下拉数据
 | 
	
		
			
				|  |  |        goodsoptions: [],
 | 
	
		
			
				|  |  | -      settlementList: [],
 | 
	
		
			
				|  |  |        orderFilesList: []
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |    },
 | 
	
	
		
			
				|  | @@ -402,70 +340,82 @@ export default {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    components: {
 | 
	
		
			
				|  |  | -    feeInfo,
 | 
	
		
			
				|  |  |      reportDialog
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    async created() {
 | 
	
		
			
				|  |  | -    this.optionList = await this.getColumnData(
 | 
	
		
			
				|  |  | -      this.getColumnName(214),
 | 
	
		
			
				|  |  | -      optionList
 | 
	
		
			
				|  |  | -    );
 | 
	
		
			
				|  |  | +    this.optionList = optionList
 | 
	
		
			
				|  |  | +      // 获取字典数据
 | 
	
		
			
				|  |  | +      this.getAllWorkDicts()
 | 
	
		
			
				|  |  | +      // 查看是否要id调用详情
 | 
	
		
			
				|  |  |      if (this.detailData.id) {
 | 
	
		
			
				|  |  |        this.getDetail(this.detailData.id);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      if (this.detailData.status == 1) {
 | 
	
		
			
				|  |  |        this.option.disabled = true;
 | 
	
		
			
				|  |  |        this.option2.disabled = true;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | -    this.getAllWorkDicts()
 | 
	
		
			
				|  |  | +      // 获取产品数据
 | 
	
		
			
				|  |  |      getAllgoods().then(res => {
 | 
	
		
			
				|  |  |        this.goodsoptions = res.data.data
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    methods: {
 | 
	
		
			
				|  |  | +      // 打印报表按钮事件
 | 
	
		
			
				|  |  |      openReport() {
 | 
	
		
			
				|  |  |        this.switchDialog = !this.switchDialog;
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      onClose(val) {
 | 
	
		
			
				|  |  |        this.switchDialog = val;
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +      // 获取下拉字典
 | 
	
		
			
				|  |  |      getAllWorkDicts() {
 | 
	
		
			
				|  |  | -      this.getWorkDicts("unit").then(res => {
 | 
	
		
			
				|  |  | -        this.findObject(this.optionList.column, "unit").dicData = res.data.data;
 | 
	
		
			
				|  |  | -      });
 | 
	
		
			
				|  |  | -      getStoragelist().then(res => {
 | 
	
		
			
				|  |  | -        this.storageoptions = res.data;
 | 
	
		
			
				|  |  | -        this.findObject(this.optionList.column, "storageId").dicData = res.data;
 | 
	
		
			
				|  |  | -      })
 | 
	
		
			
				|  |  | -      this.$refs.crud.init();
 | 
	
		
			
				|  |  | +        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
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      cellStyle() {
 | 
	
		
			
				|  |  |        return "padding:0;height:40px;";
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +      // 选择产品回调
 | 
	
		
			
				|  |  |      cnameChange(row) {
 | 
	
		
			
				|  |  |        if (row.cname) {
 | 
	
		
			
				|  |  |          this.goodsoptions.forEach(e => {
 | 
	
		
			
				|  |  |            if (e.cname == row.cname) {
 | 
	
		
			
				|  |  |              row.itemId = e.id
 | 
	
		
			
				|  |  | -            row.unit = e.unit
 | 
	
		
			
				|  |  | -            row.price = e.purchasePrice
 | 
	
		
			
				|  |  |              row.storageInQuantity = 1
 | 
	
		
			
				|  |  | -            row.amount = e.standardPrice
 | 
	
		
			
				|  |  |              row.purchasePrice = e.purchasePrice
 | 
	
		
			
				|  |  |              row.storageAmount = e.purchasePrice
 | 
	
		
			
				|  |  | +            row.goodsTypeId = e.goodsTypeId
 | 
	
		
			
				|  |  | +              row.goodsTypeName = e.goodsTypeName
 | 
	
		
			
				|  |  | +              row.specs = e.specs
 | 
	
		
			
				|  |  | +              row.brand = e.brand
 | 
	
		
			
				|  |  | +            row.remarks = e.remarks
 | 
	
		
			
				|  |  | +              row.exitDate = e.exitDate
 | 
	
		
			
				|  |  | +              row.repairReportDate = row.repairReportDate
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |          })
 | 
	
		
			
				|  |  |        } else {
 | 
	
		
			
				|  |  |          row.itemId = null
 | 
	
		
			
				|  |  | -        row.unit = null
 | 
	
		
			
				|  |  | -        row.price = null
 | 
	
		
			
				|  |  |          row.storageInQuantity = null
 | 
	
		
			
				|  |  | -        row.amount = null
 | 
	
		
			
				|  |  |          row.purchasePrice = null
 | 
	
		
			
				|  |  |          row.storageAmount = null
 | 
	
		
			
				|  |  | +          row.goodsTypeId = null
 | 
	
		
			
				|  |  | +          row.goodsTypeName = null
 | 
	
		
			
				|  |  | +          row.specs = null
 | 
	
		
			
				|  |  | +          row.brand = null
 | 
	
		
			
				|  |  | +          row.remarks = null
 | 
	
		
			
				|  |  | +          row.exitDate = null
 | 
	
		
			
				|  |  | +          row.repairReportDate = null
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | -      this.countChange(row)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      // this.countChange(row)
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      amountChange() {
 | 
	
		
			
				|  |  |        let val = 0
 | 
	
		
			
				|  |  |        this.data.forEach(e => {
 | 
	
	
		
			
				|  | @@ -474,61 +424,49 @@ export default {
 | 
	
		
			
				|  |  |          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)
 | 
	
		
			
				|  |  | -      })
 | 
	
		
			
				|  |  | -    },
 | 
	
		
			
				|  |  | +    // 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
 | 
	
		
			
				|  |  | -      getDetails({ id: id })
 | 
	
		
			
				|  |  | +      corpequipmentarchivesDetail({ id: id })
 | 
	
		
			
				|  |  |          .then(res => {
 | 
	
		
			
				|  |  |            this.form = res.data.data;
 | 
	
		
			
				|  |  | -          this.data = res.data.data.orderItemsList;
 | 
	
		
			
				|  |  | -          this.settlementList = res.data.data.settlementList;
 | 
	
		
			
				|  |  | +          this.data = res.data.data.corpEquipmentArchivesItemList;
 | 
	
		
			
				|  |  |            this.orderFilesList = res.data.data.orderFilesList ? res.data.data.orderFilesList : [];
 | 
	
		
			
				|  |  | -          this.getAddress(res.data.data)
 | 
	
		
			
				|  |  |          })
 | 
	
		
			
				|  |  |          .finally(() => {
 | 
	
		
			
				|  |  |            this.loadingBtn = false;
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +      // 客户下拉框
 | 
	
		
			
				|  |  |      getCorpData(row) {
 | 
	
		
			
				|  |  |        if (row) {
 | 
	
		
			
				|  |  | -        this.form.corpsName = row.cname
 | 
	
		
			
				|  |  | +        this.form.corpName = row.cname
 | 
	
		
			
				|  |  |          this.form.corpTel = row.tel
 | 
	
		
			
				|  |  | -        getCorpDetails({ id: row.id }).then(res => {
 | 
	
		
			
				|  |  | -          this.findObject(this.option.column, "arrivalAddress").dicData = res.data.data.corpsAddrList;
 | 
	
		
			
				|  |  | -        })
 | 
	
		
			
				|  |  |        } else {
 | 
	
		
			
				|  |  | -        this.form.corpsName = null
 | 
	
		
			
				|  |  | +        this.form.corpName = null
 | 
	
		
			
				|  |  |          this.form.corpTel = null
 | 
	
		
			
				|  |  | -        this.findObject(this.option.column, "arrivalAddress").dicData = []
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -       storageChange(row) {
 | 
	
		
			
				|  |  | -          // console.log(row)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        },
 | 
	
		
			
				|  |  | -    getAddress(row) {
 | 
	
		
			
				|  |  | -      getCorpDetails({ id: row.corpId }).then(res => {
 | 
	
		
			
				|  |  | -        this.findObject(this.option.column, "arrivalAddress").dicData = res.data.data.corpsAddrList;
 | 
	
		
			
				|  |  | -      })
 | 
	
		
			
				|  |  | -    },
 | 
	
		
			
				|  |  |      addRow() {
 | 
	
		
			
				|  |  | -            this.$refs["form"].validate((valid, done) => {
 | 
	
		
			
				|  |  | -              done();
 | 
	
		
			
				|  |  | -              if (valid) {
 | 
	
		
			
				|  |  | -                this.data.push({ $cellEdit: true, storageId: this.form.storageId })
 | 
	
		
			
				|  |  | -              } else {
 | 
	
		
			
				|  |  | -                return false;
 | 
	
		
			
				|  |  | -              }
 | 
	
		
			
				|  |  | -            });
 | 
	
		
			
				|  |  | +       this.$refs["form"].validate((valid, done) => {
 | 
	
		
			
				|  |  | +          done();
 | 
	
		
			
				|  |  | +          if (valid) {
 | 
	
		
			
				|  |  | +             this.data.push({ $cellEdit: true, storageId: this.form.storageId })
 | 
	
		
			
				|  |  | +          } else {
 | 
	
		
			
				|  |  | +             return false;
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +       });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      rowCell(row, index) {
 | 
	
		
			
				|  |  |        if (row.$cellEdit == true) {
 | 
	
	
		
			
				|  | @@ -537,6 +475,7 @@ export default {
 | 
	
		
			
				|  |  |          this.$set(row, "$cellEdit", true);
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +      // 删除
 | 
	
		
			
				|  |  |      rowDel(row, index) {
 | 
	
		
			
				|  |  |        this.$confirm("确定删除数据?", {
 | 
	
		
			
				|  |  |          confirmButtonText: "确定",
 | 
	
	
		
			
				|  | @@ -544,7 +483,7 @@ export default {
 | 
	
		
			
				|  |  |          type: "warning"
 | 
	
		
			
				|  |  |        }).then(() => {
 | 
	
		
			
				|  |  |          if (row.id) {
 | 
	
		
			
				|  |  | -          remove(row.id).then(res => {
 | 
	
		
			
				|  |  | +          corpequipmentarchivesitemRemove({ids:row.id}).then(res => {
 | 
	
		
			
				|  |  |              this.$message({
 | 
	
		
			
				|  |  |                type: "success",
 | 
	
		
			
				|  |  |                message: "删除成功!"
 | 
	
	
		
			
				|  | @@ -560,9 +499,6 @@ export default {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    getPay(row) {
 | 
	
		
			
				|  |  | -      this.getDetail(row.id);
 | 
	
		
			
				|  |  | -    },
 | 
	
		
			
				|  |  |      //修改提交触发
 | 
	
		
			
				|  |  |      editCustomer() {
 | 
	
		
			
				|  |  |        this.$refs["form"].validate((valid, done) => {
 | 
	
	
		
			
				|  | @@ -571,26 +507,73 @@ export default {
 | 
	
		
			
				|  |  |            if (this.data.length == 0) {
 | 
	
		
			
				|  |  |              return this.$message.error('请添加一条商品信息');
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  | -          if (this.settlementList.length > 0) {
 | 
	
		
			
				|  |  | -            for (let i = 0; i < this.settlementList.length; i++) {
 | 
	
		
			
				|  |  | -              if (!this.settlementList[i].id) {
 | 
	
		
			
				|  |  | -                return this.$message.error(`请保存第${i + 1}行的费用明细`);
 | 
	
		
			
				|  |  | -              }
 | 
	
		
			
				|  |  | +            // 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 {
 | 
	
		
			
				|  |  | +                    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
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            })
 | 
	
		
			
				|  |  | +            const obj = {
 | 
	
		
			
				|  |  | +                corpId:this.form.corpId,
 | 
	
		
			
				|  |  | +                corpName:this.form.corpName,
 | 
	
		
			
				|  |  | +                sysNo:null,
 | 
	
		
			
				|  |  | +                equipmentNumber:this.data.length,
 | 
	
		
			
				|  |  | +                maintenanceSecond:0,
 | 
	
		
			
				|  |  | +                signingDateStart:this.form.signingDateStart,
 | 
	
		
			
				|  |  | +                signingDateEnd:this.form.signingDateEnd,
 | 
	
		
			
				|  |  | +                remarks:this.form.remarks,
 | 
	
		
			
				|  |  | +                corpEquipmentArchivesItemList:arr
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -          }
 | 
	
		
			
				|  |  | -          this.loadingBtn = true;
 | 
	
		
			
				|  |  | -          save({ ...this.form, billType: 'CG', tradeType: 'YPJ', orderItemsList: this.data, settlementList: this.settlementList, orderFilesList: this.orderFilesList })
 | 
	
		
			
				|  |  | +            this.loadingBtn = true;
 | 
	
		
			
				|  |  | +            console.log(obj,519)
 | 
	
		
			
				|  |  | +            // 附件
 | 
	
		
			
				|  |  | +            console.log(this.orderFilesList,522)
 | 
	
		
			
				|  |  | +          corpequipmentarchivesSubmit({
 | 
	
		
			
				|  |  | +              ...obj,
 | 
	
		
			
				|  |  | +              orderFilesList: this.orderFilesList
 | 
	
		
			
				|  |  | +          })
 | 
	
		
			
				|  |  |              .then(res => {
 | 
	
		
			
				|  |  |                this.$message.success("保存成功");
 | 
	
		
			
				|  |  |                this.form = res.data.data;
 | 
	
		
			
				|  |  | -              this.data = res.data.data.orderItemsList;
 | 
	
		
			
				|  |  | -              this.settlementList = res.data.data.settlementList;
 | 
	
		
			
				|  |  | +              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();
 | 
	
		
			
				|  |  | -              this.$refs.feeInfo.refreshTable();
 | 
	
		
			
				|  |  |              })
 | 
	
		
			
				|  |  |              .finally(() => {
 | 
	
		
			
				|  |  |                this.loadingBtn = false;
 | 
	
	
		
			
				|  | @@ -600,6 +583,16 @@ export default {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +      // 查看图片
 | 
	
		
			
				|  |  | +      imgurlfun(row){
 | 
	
		
			
				|  |  | +        this.imgfalse = true
 | 
	
		
			
				|  |  | +          console.log(row.url)
 | 
	
		
			
				|  |  | +          this.imgtext = row.url
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  | +      imgfalseClose(){
 | 
	
		
			
				|  |  | +        this.imgtext = ''
 | 
	
		
			
				|  |  | +          this.imgfalse = false
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  |      fixSave() {
 | 
	
		
			
				|  |  |        this.$refs["form"].validate((valid, done) => {
 | 
	
		
			
				|  |  |          done();
 | 
	
	
		
			
				|  | @@ -607,20 +600,12 @@ export default {
 | 
	
		
			
				|  |  |            if (this.data.length == 0) {
 | 
	
		
			
				|  |  |              return this.$message.error('请添加一条商品信息');
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  | -          if (this.settlementList.length > 0) {
 | 
	
		
			
				|  |  | -            for (let i = 0; i < this.settlementList.length; i++) {
 | 
	
		
			
				|  |  | -              if (!this.settlementList[i].id) {
 | 
	
		
			
				|  |  | -                return this.$message.error(`请保存第${i + 1}行的费用明细`);
 | 
	
		
			
				|  |  | -              }
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -          }
 | 
	
		
			
				|  |  |            this.loadingBtn = true;
 | 
	
		
			
				|  |  |            fixSave({ ...this.form, billType: 'CG', tradeType: 'YPJ', orderItemsList: this.data, settlementList: this.settlementList, orderFilesList: this.orderFilesList })
 | 
	
		
			
				|  |  |              .then(res => {
 | 
	
		
			
				|  |  |                this.$message.success("修改成功");
 | 
	
		
			
				|  |  |                this.form = res.data.data;
 | 
	
		
			
				|  |  |                this.data = res.data.data.orderItemsList;
 | 
	
		
			
				|  |  | -              this.settlementList = res.data.data.settlementList;
 | 
	
		
			
				|  |  |                this.orderFilesList = res.data.data.orderFilesList ? res.data.data.orderFilesList : [];
 | 
	
		
			
				|  |  |              })
 | 
	
		
			
				|  |  |              .finally(() => {
 | 
	
	
		
			
				|  | @@ -638,20 +623,12 @@ export default {
 | 
	
		
			
				|  |  |            if (this.data.length == 0) {
 | 
	
		
			
				|  |  |              return this.$message.error('请添加一条商品信息');
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  | -          if (this.settlementList.length > 0) {
 | 
	
		
			
				|  |  | -            for (let i = 0; i < this.settlementList.length; i++) {
 | 
	
		
			
				|  |  | -              if (!this.settlementList[i].id) {
 | 
	
		
			
				|  |  | -                return this.$message.error(`请保存第${i + 1}行的费用明细`);
 | 
	
		
			
				|  |  | -              }
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -          }
 | 
	
		
			
				|  |  |            this.loadingBtn = true;
 | 
	
		
			
				|  |  |            submit({ ...this.form, billType: 'CG', tradeType: 'YPJ', orderItemsList: this.data, settlementList: this.settlementList, orderFilesList: this.orderFilesList })
 | 
	
		
			
				|  |  |              .then(res => {
 | 
	
		
			
				|  |  |                this.$message.success("提交成功");
 | 
	
		
			
				|  |  |                this.form = res.data.data;
 | 
	
		
			
				|  |  |                this.data = res.data.data.orderItemsList;
 | 
	
		
			
				|  |  | -              this.settlementList = res.data.data.settlementList;
 | 
	
		
			
				|  |  |                this.orderFilesList = res.data.data.orderFilesList ? res.data.data.orderFilesList : [];
 | 
	
		
			
				|  |  |                this.$emit("goBack");
 | 
	
		
			
				|  |  |              })
 | 
	
	
		
			
				|  | @@ -675,7 +652,6 @@ export default {
 | 
	
		
			
				|  |  |              this.$message.success("撤销成功");
 | 
	
		
			
				|  |  |              this.form = res.data.data;
 | 
	
		
			
				|  |  |              this.data = res.data.data.orderItemsList;
 | 
	
		
			
				|  |  | -            this.settlementList = res.data.data.settlementList
 | 
	
		
			
				|  |  |              this.openEdit()
 | 
	
		
			
				|  |  |            })
 | 
	
		
			
				|  |  |            .finally(() => {
 | 
	
	
		
			
				|  | @@ -718,7 +694,6 @@ export default {
 | 
	
		
			
				|  |  |        this.option = this.$options.data().option;
 | 
	
		
			
				|  |  |        this.option2 = this.$options.data().option2;
 | 
	
		
			
				|  |  |        this.$refs.crud.refreshTable();
 | 
	
		
			
				|  |  | -      this.$refs.feeInfo.refreshTable();
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //返回列表
 | 
	
		
			
				|  |  |      backToList() {
 |