Explorar el Código

部分新需求

cz hace 1 año
padre
commit
75e510036f

+ 3 - 3
src/components/byTable/index.vue

@@ -86,8 +86,8 @@
       </div>
 
       <div style="display: flex;align-items:center">
-        <el-input :placeholder="$t('common.pleaseEnterKeywords')" style="font-size: 14px" suffix-icon="search" size="mini"
-                  v-model="pagination.keyword" @keyup.enter="searchFn">
+        <el-input :placeholder="$t('common.pleaseEnterKeywords')" style="font-size: 14px" size="mini" v-model="pagination.keyword"
+                  @keyup.enter="searchFn">
         </el-input>
         <el-icon :size="16" style="cursor:pointer;margin-left: 10px" @click="searchFn">
           <Search />
@@ -422,7 +422,7 @@ export default defineComponent({
         "getList",
         Object.assign(props.filterParams, {
           ...props.pagination,
-          [props.searchKey]: props.pagination.keyword,
+          [props.searchKey]: props.pagination.keyword.trim(),
         })
       );
     };

+ 1 - 1
src/components/contractCom/selectPurchase.vue

@@ -305,7 +305,7 @@ const handleChange = (row) => {
   proxy.$router.push({
     path: "/platform_manage/process/processApproval",
     query: {
-      flowKey: "ehsd_purchase_update_flow",
+      flowKey: "purchase_update_flow",
       flowName: "采购合同变更",
       random: proxy.random(),
       businessId: row.id,

+ 77 - 29
src/components/process/SF/Contract.vue

@@ -239,7 +239,7 @@
               <template #default="{ row, $index }">
                 <div style="width:100%">
                   <div style="display:flex">
-                    <div style="writing-mode: vertical-rl;margin-right:10px;background:rgb(94 120 145);color:#fff;padding:5px 2px;border-radius:3px;line-height:21px"
+                    <div style="writing-mode: vertical-rl;margin-right:10px;background:rgb(94 120 145);color:#fff;padding:5px 2px;border-radius:3px;line-height:21px;;cursor:pointer"
                          @click="handleClickUploadOne($index)" v-if="!judgeStatus()">
                       {{row.isShowProductFile?'上  传  文  件':'取  消  上  传'}}
                     </div>
@@ -440,6 +440,7 @@ import SelectSample from "@/components/contractCom/selectSample.vue";
 import * as echarts from "echarts";
 import $bus from "@/bus/index.js";
 import { v4 as uuidv4 } from "uuid";
+import { async } from "@antv/x6/lib/registry/marker/main";
 const route = useRoute();
 const { proxy } = getCurrentInstance();
 // 接收父组件的传值
@@ -1477,7 +1478,7 @@ const handleClickUploadOne = (index) => {
 };
 
 const getAllData = (businessId) => {
-  proxy.post("/contract/detail", { id: businessId }).then((res) => {
+  proxy.post("/contract/detail", { id: businessId }).then(async (res) => {
     res.countryId = res.buyCountryId;
     res.provinceId = res.buyProvinceId;
     res.cityId = res.buyCityId;
@@ -1496,45 +1497,92 @@ const getAllData = (businessId) => {
         x.rowId = uuidv4();
       });
       getFileData();
-      let ids = formData.data.contractProductList.map((x) => x.id);
       let productIds = formData.data.contractProductList.map(
         (x) => x.productId
       );
-      proxy.getFileData({
+      // proxy.getFileData({
+      //   businessIdList: productIds,
+      //   data: formData.data.contractProductList,
+      //   att: "productId",
+      //   businessType: "0",
+      //   fileAtt: "productFile",
+      //   filePathAtt: "fileUrl",
+      // });
+
+      const productAllFile = await proxy.getFileData({
         businessIdList: productIds,
-        data: formData.data.contractProductList,
-        att: "productId",
-        businessType: "0",
-        fileAtt: "productFile",
-        filePathAtt: "fileUrl",
+        getAll: true,
       });
+      for (let i = 0; i < formData.data.contractProductList.length; i++) {
+        const ele = formData.data.contractProductList[i];
+        for (const key in productAllFile) {
+          if (
+            ele.productId == key &&
+            productAllFile[ele.productId] &&
+            productAllFile[ele.productId].length > 0
+          ) {
+            ele.productFile = productAllFile[ele.productId].filter(
+              (x) => x.businessType == "0"
+            );
+            if (ele.productFile && ele.productFile.length > 0) {
+              ele.fileUrl = ele.productFile[0].fileUrl;
+            }
+            break;
+          }
+        }
+      }
+      let ids = formData.data.contractProductList.map((x) => x.id);
       proxy
         .getFileData({
           businessIdList: ids,
           getAll: true,
         })
         .then((fileObj) => {
-          for (let i = 0; i < formData.data.contractProductList.length; i++) {
-            const ele = formData.data.contractProductList[i];
-            for (const key in fileObj) {
-              if (
-                ele.id == key &&
-                fileObj[ele.id] &&
-                fileObj[ele.id].length > 0
-              ) {
-                ele.fileListOne = fileObj[ele.id].filter(
-                  (x) => x.businessType == "0"
-                );
-                if (ele.fileListOne && ele.fileListOne.length > 0) {
-                  ele.imageUrl = ele.fileListOne[0].fileUrl;
+          if (fileObj && Object.keys(fileObj).length > 0) {
+            for (let i = 0; i < formData.data.contractProductList.length; i++) {
+              const ele = formData.data.contractProductList[i];
+              for (const key in fileObj) {
+                if (
+                  ele.id == key &&
+                  fileObj[ele.id] &&
+                  fileObj[ele.id].length > 0
+                ) {
+                  let imageUrlList = fileObj[ele.id].filter(
+                    (x) => x.businessType == "0"
+                  );
+                  if (imageUrlList && imageUrlList.length > 0) {
+                    ele.imageUrl = imageUrlList[0].fileUrl;
+                  }
+                  ele.prodFileList = fileObj[ele.id]
+                    .filter((x) => x.businessType == "1")
+                    .map((x) => ({ ...x, name: x.fileName, url: x.fileUrl }));
+                  if (ele.prodFileList && ele.prodFileList.length > 0) {
+                    ele.isShowProductFile = false;
+                  } else {
+                    ele.isShowProductFile = true;
+                    if (productAllFile[ele.productId]) {
+                      ele.fileListOne = productAllFile[ele.productId].filter(
+                        (x) => x.businessType == "2"
+                      );
+                    }
+                  }
                 }
-                ele.prodFileList = fileObj[ele.id]
-                  .filter((x) => x.businessType == "1")
-                  .map((x) => ({ ...x, name: x.fileName, url: x.fileUrl }));
-                if (ele.prodFileList && ele.prodFileList.length > 0) {
-                  ele.isShowProductFile = false;
-                } else {
-                  ele.isShowProductFile = true;
+              }
+            }
+          } else {
+            for (let i = 0; i < formData.data.contractProductList.length; i++) {
+              const ele = formData.data.contractProductList[i];
+              ele.isShowProductFile = true;
+              for (const key in productAllFile) {
+                if (
+                  ele.productId == key &&
+                  productAllFile[ele.productId] &&
+                  productAllFile[ele.productId].length > 0
+                ) {
+                  ele.fileListOne = productAllFile[ele.productId].filter(
+                    (x) => x.businessType == "2"
+                  );
+                  break;
                 }
               }
             }

+ 1837 - 0
src/components/process/SF/ContractChange.vue

@@ -0,0 +1,1837 @@
+<template>
+  <div style="width: 100%; padding: 0px 15px">
+    <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom">
+      <template #btn>
+        <div>
+          <el-button type="primary" v-if="
+              [30].includes(route.query.processType) || !route.query.processType
+            " @click="clickCopy(1)">复制合同</el-button>
+        </div>
+      </template>
+      <template #seller>
+        <div style="width: 100%">
+          <el-form-item prop="sellCorporationId" label="卖方信息" class="wid100">
+            <el-select v-model="formData.data.sellCorporationId" placeholder="请选择卖方公司" style="width: 100%" @change="sellCorporationIdChange"
+                       filterable>
+              <el-option v-for="item in corporationList" :key="item.value" :label="item.label" :value="item.value" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="地址" class="wid100">
+            <el-row style="width:100%">
+              <el-col :span="8">
+                <el-form-item label="" prop="sellCountryName" label-width="0px" class="margin-b-0 wid100">
+                  <el-input v-model="formData.data.sellCountryName" placeholder="请输入国家" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="" prop="sellProvinceName" label-width="0px" class="margin-b-0 wid100">
+                  <el-input v-model="formData.data.sellProvinceName" placeholder="请输入省/州" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="" prop="sellCityName" label-width="0px" class="margin-b-0 wid100">
+                  <el-input v-model="formData.data.sellCityName" placeholder="请输入城市" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form-item>
+
+          <el-form-item label="详细地址" prop="sellAddress" class="wid100">
+            <el-input v-model="formData.data.sellAddress" type="textarea">
+            </el-input>
+          </el-form-item>
+
+          <el-form-item label="联系人" class="wid100">
+            <el-row style="width:100%">
+              <el-col :span="8">
+                <el-form-item label="" prop="sellContactName" label-width="0px" class="margin-b-0 wid100">
+                  <el-input v-model="formData.data.sellContactName" placeholder="请输入联系人" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="16">
+                <el-form-item label="" prop="sellContactNumber" label-width="0px" class="margin-b-0 wid100">
+                  <el-input v-model="formData.data.sellContactNumber" placeholder="请输入联系人电话" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form-item>
+        </div>
+      </template>
+      <template #buyer>
+        <div style="width: 100%">
+          <el-form-item label="买方信息" prop="buyCorporationId" class="wid100">
+            <el-select v-model="formData.data.buyCorporationId" filterable remote reserve-keyword placeholder="请输入关键字" remote-show-suffix
+                       :remote-method="remoteMethod" :loading="loadingSearch" @input="remoteMethod" style="width: 100%" @change="changeCustomer" v-if="
+                  [30].includes(route.query.processType) ||
+                  !route.query.processType
+                " :disabled="!isEditList">
+              <el-option v-for="item in customerList" :key="item.value" :label="item.label" :value="item.value" />
+            </el-select>
+            <el-select v-model="formData.data.buyCorporationName" disabled v-else style="width: 100%">
+            </el-select>
+          </el-form-item>
+          <el-form-item label="地址" class="wid100" required>
+            <el-row style="width: 100%">
+              <el-col :span="6">
+                <el-form-item label="" prop="countryId" class="margin-b-0">
+                  <el-select v-model="formData.data.countryId" placeholder="国家" style="width:100%" filterable
+                             @change="(val) => getCityData(val, '20', true)" :disabled="!isEditList">
+                    <el-option v-for="item in countryData" :label="item.name" :value="item.id">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="" prop="provinceName" class="margin-b-0">
+                  <selectCity placeholder="省/洲" @change="(val) => getCityData(val, '30', true)" addressId="provinceId" addressName="provinceName"
+                              v-model="formData.data" :data="provinceData" :disabled="!isEditList">
+                  </selectCity>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="" prop="cityName" class="margin-b-0">
+                  <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData"
+                              :disabled="!isEditList">
+                  </selectCity>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="" prop="buyPostalCode" class="margin-b-0">
+                  <el-input v-model="formData.data.buyPostalCode" placeholder="请输入邮编" :disabled="!isEditList" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form-item>
+
+          <el-form-item label="详细地址" prop="buyAddress" class="wid100">
+            <el-input v-model="formData.data.buyAddress" type="textarea" :disabled="!isEditList">
+            </el-input>
+          </el-form-item>
+          <el-form-item label="联系人" class="wid100" required>
+            <el-row style="width: 100%">
+              <el-col :span="8">
+                <el-form-item label="" prop="buyContactName" label-width="0px" class="margin-b-0 wid100">
+                  <el-autocomplete v-model="formData.data.buyContactName" :fetch-suggestions="querySearchPerson" style="width:100%" clearable
+                                   class="inline-input w-50" placeholder="请输入联系人" @select="handlePerson" :disabled="!isEditList">
+                  </el-autocomplete>
+                </el-form-item>
+              </el-col>
+              <el-col :span="16">
+                <el-form-item label="" prop="buyContactNumber" label-width="0px" class="margin-b-0 wid100">
+                  <el-input v-model="formData.data.buyContactNumber" placeholder="请输入联系人电话" :disabled="!isEditList" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form-item>
+        </div>
+      </template>
+
+      <template #commodity>
+        <div style="width: 100%">
+          <el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px" v-if="!judgeStatus() && isEditList"
+                     :disabled="!formData.data.companyId">产品库</el-button>
+          <!-- default-expand-all -->
+          <el-table :data="formData.data.contractProductList" style="width: 100%;" row-key="rowId">
+            <el-table-column type="expand" width="50" align="center">
+              <template #default="scope">
+                <div style="padding-left:50px">
+                  <div style="margin-bottom:10px;">
+                    <TitleInfo content='BOM单:'></TitleInfo>
+                  </div>
+                  <el-table :data="scope.row.contractProductBomList" style="width: 100%;" border class="bom-table" row-key="materialId">
+                    <el-table-column label="图片" width="80">
+                      <template #default="{ row }">
+                        <div v-if="row.fileUrl">
+                          <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
+                        </div>
+                        <div v-else></div>
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="productCode" label="物料编码" width="190" />
+                    <el-table-column prop="productName" label="物料名称" min-width="200" />
+                    <el-table-column label="尺寸 (cm)" width="130">
+                      <template #default="{ row, $index }">
+                        <div style="width: 100%">
+                          {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
+                        </div>
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="quantity" label="数量" width="130">
+                      <template #default="{ row, $index }">
+                        <div style="width: 100%">
+                          <el-form-item v-if="isEditList"
+                                        :prop="'contractProductList.' + scope.$index + '.contractProductBomList.' + $index + '.quantity'"
+                                        :rules="rules.quantity" :inline-message="true" class="margin-b-0 wid100">
+                            <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
+                                             :controls="false" :min="1" />
+                          </el-form-item>
+                          <span v-else>{{row.quantity}}</span>
+                        </div>
+                      </template>
+                    </el-table-column>
+                    <!-- <el-table-column prop="allQuantity" label="总量" width="80" /> -->
+                    <!-- <el-table-column prop="price" label="单价" width="110">
+                      <template #default="{ row, $index }">
+                        <div style="width: 100%">
+                          ¥ {{row.price}}
+                        </div>
+                      </template>
+                    </el-table-column> -->
+                    <!-- <el-table-column prop="amount" label="小计" width="110">
+                      <template #default="{ row, $index }">
+                        <div style="width: 100%">
+                          ¥ {{row.amount}}
+                        </div>
+                      </template>
+                    </el-table-column> -->
+                    <el-table-column prop="remark" label="备注" width="180">
+                      <template #default="{ row, $index }">
+                        <div style="width: 100%">
+                          <el-form-item v-if="isEditList" :inline-message="true" class="margin-b-0 wid100">
+                            <el-input v-model="row.remark" placeholder="请输入" style="width: 100%" />
+                          </el-form-item>
+                          <span v-else>{{row.remark}}</span>
+                        </div>
+                      </template>
+                    </el-table-column>
+                    <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus() &&  isEditList">
+                      <template #default="{ row,$index }">
+                        <el-button type="primary" link @click="handleDeleteMaterial(scope.$index,$index)">删除</el-button>
+                      </template>
+                    </el-table-column>
+                  </el-table>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="商品图片" width="80">
+              <template #default="{ row }">
+                <div v-if="row.fileUrl">
+                  <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
+                </div>
+                <div v-else></div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="productCnName" label="商品名称" min-width="130" />
+            <el-table-column prop="productCode" label="商品编码" width="130" />
+            <el-table-column label="尺寸 (cm)" width="130">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="设计图稿" width="80">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-upload :action="uploadUrl" accept=".gif, .jpeg, .jpg, .png" :show-file-list="false" :data="uploadData"
+                             :before-upload="(file)=>handleBeforeUpload(file,$index)" :on-success="()=>handleSuccess($index)">
+                    <div v-loading="row.imgLoading">
+                      <img v-if="row.imageUrl" :src="row.imageUrl" class="pic" />
+                      <el-icon v-else class="avatar-uploader-icon">
+                        <Plus />
+                      </el-icon>
+                    </div>
+                  </el-upload>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="生产源文件" width="210">
+              <template #default="{ row, $index }">
+                <div style="width:100%">
+                  <div style="display:flex">
+                    <div style="writing-mode: vertical-rl;margin-right:10px;background:rgb(94 120 145);color:#fff;padding:5px 2px;border-radius:3px;line-height:21px;cursor:pointer"
+                         @click="handleClickUploadOne($index)" v-if="!judgeStatus()">
+                      {{row.isShowProductFile?'上  传  文  件':'取  消  上  传'}}
+                    </div>
+                    <div>
+                      <div v-if="row.isShowProductFile &&row.fileListOne && row.fileListOne.length > 0">
+                        <span class="el-click" @click="onPicture(row.fileListOne[0].fileUrl)">{{row.fileListOne[0].fileName}}</span>
+                      </div>
+                      <div v-else>
+                        <el-upload :file-list="row.prodFileList" :action="uploadUrl" :data="uploadData" :limit="1" :list-type="'text'"
+                                   :before-upload="(file)=>handleBeforeUploadOne(file,$index)" :on-success="()=>handleSuccessOne($index)"
+                                   :on-remove="(file)=>handleRemoveFile(file,$index)" :on-preview="onPreviewFile"
+                                   :on-exceed="()=>msgTip(`上传文件数量不可大于1`, 2)">
+                          <el-button text type="primary">上传</el-button>
+                        </el-upload>
+                      </div>
+                    </div>
+                  </div>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="数量" width="110">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'contractProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
+                                class="margin-b-0 wid100">
+                    <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
+                                     :controls="false" :min="0" @change="calculationAmount('quantity')" v-if="isEditList" />
+                    <div v-else> {{row.quantity}}</div>
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="单价" width="160">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'contractProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true"
+                                class="margin-b-0 wid100">
+                    <div style="display:flex;">
+                      <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
+                                       :controls="false" :min="0" @change="calculationAmount()" v-if="isEditList" />
+                      <div v-else>¥ {{row.price}}</div>
+                      <el-popover placement="top-start" :width="400" trigger="hover" @show="showEcharts(row,$index)">
+                        <template #default>
+                          <div>
+                            <div>
+                              <img src="@/assets/images/money1.png" alt="" class="img" /> <span
+                                    style="font-size:14px;font-weight:700;color:#000">销售指导价:</span>
+                              <div style="padding:5px 0px 0px 20px">
+                                {{row.currency}} {{moneyFormat(row.salePrice,2)}}
+                              </div>
+                            </div>
+                            <div style="margin-top:15px">
+                              <img src="@/assets/images/money2.png" alt="" class="img" /> <span
+                                    style="font-size:14px;font-weight:700;color:#000">客户近期购买价格:</span>
+                              <div style="padding:5px 0px 0px 20px">
+                                <div v-for="item in row.customerContractProductList">
+                                  <span>{{item.createTime.slice(0,10)}} </span>
+                                  <span style="margin-left:40px">{{item.code}} </span>
+                                  <span style="margin-left:40px"> {{item.currency}} {{moneyFormat(item.price,2)}} </span>
+                                </div>
+                              </div>
+                            </div>
+                            <div style="margin-top:15px">
+                              <img src="@/assets/images/money3.png" alt="" class="img" /> <span
+                                    style="font-size:14px;font-weight:700;color:#000">产品近期销售价格:</span>
+                              <div style="padding:5px 0px 0px 20px">
+                                <div v-for="item in row.contractProductList">
+                                  <span>{{item.createTime.slice(0,10)}} </span>
+                                  <span style="margin-left:40px">{{item.code}} </span>
+                                  <span style="margin-left:40px">{{item.currency}} {{moneyFormat(item.price,2)}} </span>
+                                </div>
+                              </div>
+                            </div>
+                            <div :ref="row.productId+$index" style="height:180px">
+                            </div>
+                          </div>
+                        </template>
+                        <template #reference>
+                          <div style="margin-left:10px;cursor:pointer;position:relative;top:4px">
+                            <el-icon :size="20" color="#85c1a6">
+                              <WarningFilled />
+                            </el-icon>
+                          </div>
+                        </template>
+                      </el-popover>
+                    </div>
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="amount" label="小计" width="110">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  ¥ {{row.amount}}
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="备注" min-width="200">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'contractProductList.' + $index + '.remark'" :inline-message="true" class="margin-b-0 wid100">
+                    <el-input v-model="row.remark" placeholder="请输入" style="width: 100%" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" width="140" align="center" fixed="right" v-if="!judgeStatus() && isEditList">
+              <template #default="{ $index }">
+                <el-button type="primary" link @click="handleClickSelectMaterial($index)">包材辅材</el-button>
+                <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </template>
+
+      <template #otherCharge>
+        <div style="width: 100%">
+          <el-button type="primary" @click="clickAdd()" plain style="margin-bottom: 16px" v-if="!judgeStatus()">添加行</el-button>
+          <el-table :data="formData.data.contractProjectList" style="width: 100%;">
+            <el-table-column label="收费项目" width="220">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'contractProjectList.' + $index + '.payName'" :rules="rules.payName" :inline-message="true"
+                                class="margin-b-0 wid100">
+                    <el-autocomplete v-model="row.payName" :fetch-suggestions="querySearch" clearable class="inline-input w-50"
+                                     placeholder="请输入收费项目" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column :label="'金额'" width="130">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'contractProjectList.' + $index + '.amount'" :rules="rules.amount" :inline-message="true"
+                                class="margin-b-0 wid100">
+                    <el-input-number onmousewheel="return false;" v-model="row.amount" placeholder="请输入金额" style="width: 100%" :precision="2"
+                                     :controls="false" :min="0" @change="totalAmount()" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="备注">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'contractProjectList.' + $index + '.remark'" class="margin-b-0 wid100">
+                    <el-input v-model="row.remark" placeholder="请输入备注" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus()">
+              <template #default="{ $index }">
+                <el-button type="primary" link @click="handleDelete($index)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </template>
+
+      <template #templateContent>
+        <div style="width: 100%">
+          <Editor :value="formData.data.templateContent" @updateValue="updateContent" :readOnly="judgeStatus()" ref="remarkEditor" />
+        </div>
+      </template>
+    </byForm>
+
+    <el-dialog v-if="openProductCompany" v-model="openProductCompany" title="产品库" width="90%" append-to-body>
+      <SelectProduct @selectProduct="selectProduct" :companyId="formData.data.companyId" :isRawMaterial="'1'"></SelectProduct>
+      <template #footer>
+        <el-button @click="openProductCompany = false" size="defualt" v-debounce>关 闭</el-button>
+      </template>
+    </el-dialog>
+
+    <el-dialog :title="'物料选择'" v-model="openSelectMaterial" width="90%" destroy-on-close>
+      <SelectMaterial :isNeRawMaterial="'1'" @selectMaterial="selectMaterial"></SelectMaterial>
+      <template #footer>
+        <el-button @click="openSelectMaterial = false" size="defualt" v-debounce>关 闭</el-button>
+      </template>
+    </el-dialog>
+
+    <!-- <el-dialog v-if="copyContract" v-model="copyContract" :title="copyType === 1 ? '合同选择' : '样品单选择'" width="90%" append-to-body>
+      <SelectContract @select="selectContract" v-if="copyType === 1"></SelectContract>
+      <SelectSample @select="selectContract" v-if="copyType === 2"></SelectSample>
+    </el-dialog> -->
+  </div>
+</template>
+
+<script setup>
+import byForm from "@/components/byForm/index";
+import SelectProduct from "@/components/product/SelectProduct.vue";
+import SelectMaterial from "@/components/product/SelectMaterial.vue";
+import Editor from "@/components/Editor/index.vue";
+import selectCity from "@/components/selectCity/index.vue";
+import { useRoute } from "vue-router";
+import SelectContract from "@/components/contractCom/selectContract.vue";
+import SelectSample from "@/components/contractCom/selectSample.vue";
+import * as echarts from "echarts";
+import $bus from "@/bus/index.js";
+import { v4 as uuidv4 } from "uuid";
+import { async } from "@antv/x6/lib/registry/marker/main";
+const route = useRoute();
+const { proxy } = getCurrentInstance();
+// 接收父组件的传值
+const props = defineProps({
+  queryData: Object,
+});
+const currencyData = computed(
+  () => proxy.useUserStore().allDict["account_currency"]
+);
+const fundsPaymentMethod = computed(
+  () => proxy.useUserStore().allDict["funds_payment_method"]
+);
+const shippingMethod = computed(
+  () => proxy.useUserStore().allDict["shipping_method"]
+);
+const companyId = computed(() => proxy.useUserStore().user.companyId);
+const accountList = ref([]);
+const customerList = ref([]);
+const templateList = ref([]);
+const corporationList = ref([]);
+const customerUserList = ref([]);
+const countryData = ref([]);
+const provinceData = ref([]);
+const cityData = ref([]);
+const treeData = ref([]);
+const openProductCompany = ref(false);
+const copyType = ref(1);
+const copyContract = ref(false);
+const indexValue = ref(-1);
+const openSelectMaterial = ref(false);
+const formData = reactive({
+  data: {
+    contractType: "2",
+    rate: 1,
+    contractProductList: [],
+    companyId: "",
+    templateContent: "",
+  },
+});
+const uploadData = ref({});
+const formDom = ref(null);
+const remarkEditor = ref(null);
+const judgeStatus = () => {
+  if (
+    route.query.processType == 20 ||
+    route.query.processType == 10 ||
+    props.queryData.processType == 20 ||
+    props.queryData.processType == 10
+  ) {
+    return true;
+  }
+  if (props.queryData.recordList && props.queryData.recordList.length > 0) {
+    let data = props.queryData.recordList.filter(
+      (item) => item.status === 2 && item.nodeType !== 1
+    );
+    if (data && data.length > 0) {
+      return true;
+    }
+  }
+  return false;
+};
+const formOption = reactive({
+  inline: true,
+  labelWidth: 120,
+  itemWidth: 100,
+  disabled: false,
+});
+const formConfig = computed(() => {
+  return [
+    // {
+    //   type: "slot",
+    //   slotName: "btn",
+    //   label: "",
+    //   itemWidth: 50,
+    // },
+    {
+      type: "title",
+      title: "基本信息",
+    },
+    {
+      type: "input",
+      prop: "code",
+      label: "合同号",
+      disabled: true,
+      isShow: formData.data.code ? true : false,
+    },
+    {
+      type: "select",
+      prop: "contractType",
+      label: "合同类型",
+      data: [
+        {
+          dictKey: "2",
+          dictValue: "内销",
+        },
+        {
+          dictKey: "1",
+          dictValue: "外销",
+        },
+      ],
+      itemWidth: 50,
+      fn: (val) => {
+        if (val == "2") {
+          formData.data.currency = currencyData.value[0].dictKey;
+          formData.data.rate = 1;
+        }
+        if (formData.data.sellCorporationId) {
+          sellCorporationIdChange(formData.data.sellCorporationId);
+        }
+        if (formData.data.shroffAccountId) {
+          changeShroffAccount(formData.data.shroffAccountId);
+        }
+      },
+    },
+    {
+      type: "treeSelect",
+      prop: "companyId",
+      label: "生产公司",
+      data: treeData.value,
+      propsTreeLabel: "deptName",
+      propsTreeValue: "deptId",
+      itemWidth: 50,
+      disabled: !isEditList.value,
+      fn: () => {
+        formData.data.contractProductList = [];
+      },
+    },
+    {
+      type: "title",
+      title: "贸易信息",
+      haveLine: true,
+    },
+    {
+      type: "slot",
+      slotName: "seller",
+      label: "",
+      itemWidth: 50,
+    },
+    {
+      type: "slot",
+      slotName: "buyer",
+      label: "",
+      itemWidth: 50,
+    },
+    {
+      type: "title",
+      title: "付款信息",
+      haveLine: true,
+    },
+    {
+      type: "select",
+      prop: "currency",
+      label: "币种",
+      data: currencyData.value,
+      itemWidth: 25,
+      disabled: formData.data.contractType == "2",
+    },
+    {
+      type: "number",
+      prop: "rate",
+      label: "汇率",
+      precision: 2,
+      min: 0,
+      controls: false,
+      itemWidth: 25,
+      disabled: formData.data.contractType == "2",
+    },
+    {
+      type: "select",
+      prop: "paymentMethod",
+      label: "付款方式",
+      data: fundsPaymentMethod.value,
+      itemWidth: 25,
+    },
+    {
+      type: "number",
+      prop: "advanceRatio",
+      label: "预付款比列(%)",
+      precision: 2,
+      min: 0,
+      controls: false,
+      itemWidth: 25,
+    },
+    {
+      type: "input",
+      prop: "remark",
+      label: "付款条件",
+      itemType: "textarea",
+      itemWidth: 50,
+    },
+    {
+      type: "select",
+      prop: "shroffAccountId",
+      label: "收款账号",
+      data: accountList.value,
+      itemWidth: 100,
+      fn: (val) => {
+        changeShroffAccount(val);
+      },
+    },
+    {
+      type: "input",
+      prop: "beneficiaryName",
+      label: " ",
+      placeholder: "请输入Beneficiary Name",
+      itemWidth: 50,
+      isShow: formData.data.contractType == "1",
+    },
+    {
+      type: "input",
+      prop: "beneficiaryAccountNumber",
+      label: " ",
+      placeholder: "请输入Beneficiary Account Number",
+      itemWidth: 50,
+      isShow: formData.data.contractType == "1",
+    },
+    {
+      type: "input",
+      prop: "beneficiaryBank",
+      label: " ",
+      placeholder: "请输入Beneficiary Bank",
+      itemWidth: 50,
+      isShow: formData.data.contractType == "1",
+    },
+    {
+      type: "input",
+      prop: "swiftCode",
+      label: " ",
+      placeholder: "请输入Swift Code",
+      itemWidth: 50,
+      isShow: formData.data.contractType == "1",
+    },
+    {
+      type: "input",
+      prop: "beneficiaryBankAddress",
+      label: " ",
+      placeholder: "请输入Beneficiary Bank Address",
+      itemWidth: 50,
+      isShow: formData.data.contractType == "1",
+    },
+    {
+      type: "input",
+      prop: "beneficiaryAddress",
+      label: " ",
+      placeholder: "请输入Beneficiary Address",
+      itemWidth: 50,
+      isShow: formData.data.contractType == "1",
+    },
+    {
+      type: "input",
+      prop: "accountName",
+      label: "户名",
+      placeholder: "请输入户名",
+      itemWidth: 50,
+      isShow: formData.data.contractType == "2",
+    },
+    {
+      type: "input",
+      prop: "openingBank",
+      label: "开户行",
+      placeholder: "请输入开户行",
+      itemWidth: 50,
+      isShow: formData.data.contractType == "2",
+    },
+    {
+      type: "input",
+      prop: "accountOpening",
+      label: "账号",
+      placeholder: "请输入账号",
+      itemWidth: 50,
+      isShow: formData.data.contractType == "2",
+    },
+    // {
+    //   type: "slot",
+    //   slotName: "payment",
+    //   label: "",
+    // },
+    {
+      type: "title",
+      title: "交付信息",
+      haveLine: true,
+    },
+    {
+      type: "date",
+      prop: "deliveryTime",
+      label: "交货期限",
+      itemWidth: 50,
+    },
+    {
+      type: "select",
+      prop: "transportMethod",
+      label: "运输方式",
+      data: shippingMethod.value,
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      prop: "transportRemark",
+      label: "运输说明",
+      itemWidth: 50,
+    },
+    // {
+    //   type: "slot",
+    //   slotName: "delivery",
+    //   label: "",
+    // },
+    {
+      type: "title",
+      title: "商品信息",
+      haveLine: true,
+    },
+    {
+      type: "slot",
+      slotName: "commodity",
+      label: "",
+    },
+    {
+      type: "title",
+      title: "其他收费项目",
+      haveLine: true,
+    },
+    {
+      type: "slot",
+      slotName: "otherCharge",
+      label: "",
+    },
+    {
+      type: "title",
+      title: "合同总金额",
+      haveLine: true,
+    },
+    {
+      type: "input",
+      prop: "amount",
+      label: "合同总金额",
+      itemWidth: 25,
+      disabled: true,
+    },
+    {
+      type: "title",
+      title: "合同模板",
+      haveLine: true,
+    },
+    {
+      type: "select",
+      prop: "contractTemplateId",
+      label: "合同模板",
+      data: templateList.value,
+      itemWidth: 50,
+      fn: (val) => {
+        proxy.post("/contractTemplate/detail", { id: val }).then((res) => {
+          formData.data.templateContent = res.templateContent;
+          remarkEditor.value.changeHtml(formData.data.templateContent);
+        });
+      },
+    },
+    {
+      type: "slot",
+      slotName: "templateContent",
+      prop: "templateContent",
+      label: "模板内容",
+      itemWidth: 100,
+      disabled: false,
+    },
+  ];
+});
+const rules = ref({
+  companyId: [{ required: true, message: "请选择生产公司", trigger: "change" }],
+  contractType: [
+    { required: true, message: "请选择合同类型", trigger: "change" },
+  ],
+  sellCorporationId: [
+    { required: true, message: "请选择卖方公司", trigger: "change" },
+  ],
+  buyCorporationId: [
+    { required: true, message: "请选择买方公司", trigger: "change" },
+  ],
+  countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
+  sellAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
+  buyAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
+  buyContactName: [
+    { required: true, message: "请输入联系人", trigger: ["change", "blur"] },
+  ],
+  buyContactNumber: [
+    { required: true, message: "请输入联系电话", trigger: "blur" },
+  ],
+  quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
+  price: [{ required: true, message: "请输入单价", trigger: "blur" }],
+  payName: [
+    { required: true, message: "请输入收费项目", trigger: ["change", "blur"] },
+  ],
+  currency: [{ required: true, message: "请选择币种", trigger: "change" }],
+  paymentMethod: [
+    { required: true, message: "请选择付款方式", trigger: "change" },
+  ],
+  advanceRatio: [
+    { required: true, message: "请输入预付比例", trigger: "blur" },
+  ],
+  transportMethod: [
+    { required: true, message: "请选择运输方式", trigger: "change" },
+  ],
+  // remark: [{ required: true, message: "请输入付款条件", trigger: "blur" }],
+  rate: [{ required: true, message: "请输入汇率", trigger: "blur" }],
+  shroffAccountId: [
+    { required: true, message: "请选择收款账号", trigger: "change" },
+  ],
+  // contractTemplateId: [
+  //   { required: true, message: "请选择模板", trigger: "change" },
+  // ],
+  templateContent: [
+    { required: true, message: "请输入模板内容", trigger: "blur" },
+  ],
+});
+const getDict = () => {
+  proxy
+    .post("/contractTemplate/page", {
+      pageNum: 1,
+      pageSize: 999,
+      templateType: "1",
+    })
+    .then((res) => {
+      templateList.value = res.rows.map((x) => ({
+        label: x.templateName,
+        value: x.id,
+      }));
+    });
+
+  proxy
+    .post("/customer/selPage", {
+      pageNum: 1,
+      pageSize: 50,
+    })
+    .then((res) => {
+      customerList.value = res.rows.map((x) => ({
+        ...x,
+        label: x.name,
+        value: x.id,
+      }));
+    });
+
+  proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    corporationList.value = res.rows.map((item) => {
+      return {
+        ...item,
+        label: item.name,
+        value: item.id,
+      };
+    });
+  });
+
+  proxy
+    .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
+    .then((res) => {
+      accountList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.alias,
+          value: item.id,
+        };
+      });
+    });
+
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      keyword: "",
+      tenantId: proxy.useUserStore().user.tenantId,
+      type: 0,
+    })
+    .then((res) => {
+      treeData.value = proxy.handleTree(res.data, "deptId");
+    });
+};
+const getCityData = (id, type, isChange) => {
+  proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
+    if (type === "20") {
+      provinceData.value = res;
+      if (isChange) {
+        formData.data.provinceId = "";
+        formData.data.provinceName = "";
+        formData.data.cityId = "";
+        formData.data.cityName = "";
+      }
+    } else if (type === "30") {
+      cityData.value = res;
+      if (isChange) {
+        formData.data.cityId = "";
+        formData.data.cityName = "";
+      }
+    } else {
+      countryData.value = res;
+    }
+  });
+};
+getDict();
+getCityData("0");
+
+const sellCorporationIdChange = (val) => {
+  if (val) {
+    proxy.post("/corporation/detail", { id: val }).then((res) => {
+      if (formData.data.contractType == "2") {
+        formData.data.sellCountryName = res.countryName;
+        formData.data.sellProvinceName = res.provinceName;
+        formData.data.sellCityName = res.cityName;
+        formData.data.sellAddress = res.address;
+        formData.data.sellContactName = res.contactName;
+        formData.data.sellContactNumber = res.contactPhone;
+      } else {
+        formData.data.sellCountryName = res.countryEnStr;
+        formData.data.sellProvinceName = res.provinceEnStr;
+        formData.data.sellCityName = res.cityEnStr;
+        formData.data.sellAddress = res.addressEn;
+        formData.data.sellContactName = res.contactName;
+        formData.data.sellContactNumber = res.contactPhone;
+      }
+    });
+  }
+};
+
+const changeCustomer = (val) => {
+  formData.data.contractProductList = [];
+  if (val) {
+    proxy.post("/customer/detail", { id: val }).then(
+      (res) => {
+        formData.data.buyCorporationName = res.name;
+        if (res.customerUserList && res.customerUserList.length > 0) {
+          formData.data.buyContactName = res.customerUserList[0].name;
+          if (res.customerUserList[0].contactJson) {
+            let contactJson = JSON.parse(res.customerUserList[0].contactJson);
+            if (contactJson && contactJson.length > 0) {
+              formData.data.buyContactNumber = contactJson[0].contactNo;
+            }
+          }
+          customerUserList.value = res.customerUserList.map((item) => {
+            return {
+              ...item,
+              value: item.name,
+            };
+          });
+        }
+        // 回填客户的账户信息
+        // formData.data.beneficiaryName = res.beneficiaryName;
+        // formData.data.beneficiaryBank = res.beneficiaryBank;
+        // formData.data.beneficiaryBankAddress = res.beneficiaryBankAddress;
+        // formData.data.beneficiaryAccountNumber = res.beneficiaryAccountNumber;
+        // formData.data.swiftCode = res.swiftCode;
+        // formData.data.beneficiaryAddress = res.beneficiaryAddress;
+
+        formData.data.countryId = res.countryId;
+        formData.data.provinceId = res.provinceId;
+        formData.data.cityId = res.cityId;
+        formData.data.buyPostalCode = res.zipCode;
+        formData.data.buyAddress = res.address;
+        getCityData(formData.data.countryId, "20");
+        if (formData.data.provinceId) {
+          getCityData(formData.data.provinceId, "30");
+        }
+      },
+      (err) => {
+        formData.data.countryId = "";
+        formData.data.provinceId = "";
+        formData.data.cityId = "";
+        formData.data.buyPostalCode = "";
+        formData.data.buyAddress = "";
+      }
+    );
+  } else {
+    formData.data.countryId = "";
+    formData.data.provinceId = "";
+    formData.data.cityId = "";
+    formData.data.buyPostalCode = "";
+    formData.data.buyAddress = "";
+  }
+};
+const createFilter = (queryString) => {
+  return (restaurant) => {
+    return (
+      restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
+    );
+  };
+};
+const querySearchPerson = (queryString, callback) => {
+  const results = queryString
+    ? customerUserList.value.filter(createFilter(queryString))
+    : customerUserList.value;
+  callback(results);
+};
+
+const handlePerson = (item) => {
+  if (item.contactJson) {
+    let data = JSON.parse(item.contactJson);
+    formData.data.buyContactNumber = data[0].contactNo;
+  }
+};
+
+const handleClickSelectMaterial = (index) => {
+  indexValue.value = index;
+  openSelectMaterial.value = true;
+};
+
+const contractProductBomList = ref([]);
+const selectProduct = async (goods) => {
+  if (goods && goods.id) {
+    let rowId = uuidv4();
+    let allFile = [];
+    let fileUrl = "";
+    if (goods.fileList && goods.fileList.length > 0) {
+      fileUrl = goods.fileList[0].fileUrl;
+    }
+    const fileData = await proxy.post("/fileInfo/getList", {
+      businessIdList: [goods.id],
+    });
+    if (fileData[goods.id] && fileData[goods.id].length > 0) {
+      allFile = fileData[goods.id];
+    } else {
+      allFile = [];
+    }
+    proxy.post("/productBomInfo/detail", { id: goods.id }).then((res) => {
+      if (res.productBomDetailList && res.productBomDetailList.length > 0) {
+        contractProductBomList.value = res.productBomDetailList.map((x) => ({
+          fileUrl: "",
+          materialId: x.materialId,
+          productName: x.materialName,
+          productCode: x.materialCode,
+          productLength: x.materialLength,
+          productWidth: x.materialWidth,
+          productHeight: x.materialHeight,
+          quantity: x.quantity || null,
+          allQuantity: "",
+          price: x.materialPrice || null,
+          amount: "",
+          fileList: [],
+          type: x.type,
+        }));
+        let fileListOne = [];
+        if (allFile && allFile.length > 0) {
+          fileListOne = allFile.filter((x) => x.businessType == "2");
+        }
+        formData.data.contractProductList.push({
+          fileUrl: fileUrl,
+          productId: goods.id,
+          productCnName: goods.name,
+          productCode: goods.customCode,
+          productLength: goods["length"],
+          productWidth: goods.width,
+          productHeight: goods.height,
+          prodFilePath: goods.prodFilePath,
+          quantity: null,
+          price: goods.price || null,
+          amount: "",
+          remark: "",
+          fileList: [],
+          isShowProductFile: true,
+          fileListOne: fileListOne,
+          prodFileList: [],
+          contractProductBomList: contractProductBomList.value,
+          rowId: rowId,
+        });
+        proxy.msgTip("添加成功", 1);
+        changeProductPrice();
+        let ids = contractProductBomList.value.map((x) => x.materialId);
+        proxy.getFile(
+          ids,
+          contractProductBomList.value,
+          "materialId",
+          "fileList",
+          "fileUrl"
+        );
+      } else {
+        return proxy.msgTip("该产品未配置BOM", 2);
+      }
+    });
+  } else {
+    return proxy.msgTip("选择错误", 2);
+  }
+};
+
+const selectMaterial = (goods) => {
+  let flag = formData.data.contractProductList[
+    indexValue.value
+  ].contractProductBomList.some((x) => x.materialId == goods.id);
+  if (!flag) {
+    let fileUrl = "";
+    if (goods.fileList && goods.fileList.length > 0) {
+      fileUrl = goods.fileList[0].fileUrl;
+    }
+    formData.data.contractProductList[
+      indexValue.value
+    ].contractProductBomList.push({
+      fileUrl: fileUrl,
+      materialId: goods.id,
+      productName: goods.name,
+      productCode: goods.customCode,
+      productLength: goods["length"],
+      productWidth: goods.width,
+      productHeight: goods.height,
+      quantity: null,
+      price: goods.price || null,
+      amount: "",
+      fileList: [],
+      type: 2,
+    });
+    proxy.msgTip("选择成功");
+  } else {
+    proxy.msgTip("该物料已选择", 2);
+  }
+};
+
+const changeProductPrice = () => {
+  let productIds = formData.data.contractProductList.map((x) => x.productId);
+  if (productIds && productIds.length > 0) {
+    proxy
+      .post("/contract/getProductPriceInfo", {
+        productIds: productIds,
+        customerId: formData.data.buyCorporationId
+          ? formData.data.buyCorporationId
+          : "",
+      })
+      .then((res) => {
+        for (let i = 0; i < formData.data.contractProductList.length; i++) {
+          const iele = formData.data.contractProductList[i];
+          for (const key in res) {
+            if (key == iele.productId) {
+              iele.salePrice = res[key].price;
+              iele.currency = res[key].currency;
+              iele.saleCostPrice = res[key].costPrice;
+              iele.contractProductList = res[key].contractProductList
+                .map((x) => ({
+                  createTime: x.createTime || "",
+                  price: x.price,
+                  currency: x.currency,
+                }))
+                .filter((y, index) => index < 3);
+              iele.contractProductListOne = res[key].contractProductList.map(
+                (x) => ({
+                  createTime: x.createTime || "",
+                  price: x.price,
+                  currency: x.currency,
+                })
+              );
+              iele.customerContractProductList = res[
+                key
+              ].customerContractProductList.map((x) => ({
+                createTime: x.createTime || "",
+                price: x.price,
+                currency: x.currency,
+              }));
+            }
+          }
+        }
+      });
+  }
+};
+const updateContent = (val) => {
+  formData.data.templateContent = val;
+};
+const onPicture = (path) => {
+  window.open(path, "_blank");
+};
+const handleRemove = (index) => {
+  formData.data.contractProductList.splice(index, 1);
+  totalAmount();
+};
+
+const handleDeleteMaterial = (index, sonIndex) => {
+  formData.data.contractProductList[index].contractProductBomList.splice(
+    sonIndex,
+    1
+  );
+};
+
+const calculationAmount = (att = "") => {
+  nextTick(() => {
+    if (
+      formData.data.contractProductList &&
+      formData.data.contractProductList.length > 0
+    ) {
+      for (let i = 0; i < formData.data.contractProductList.length; i++) {
+        let money = 0;
+        money = parseFloat(
+          Number(formData.data.contractProductList[i].quantity) *
+            Number(formData.data.contractProductList[i].price)
+        ).toFixed(2);
+        formData.data.contractProductList[i].amount = money;
+      }
+    }
+    nextTick(() => {
+      totalAmount();
+    });
+  });
+};
+
+const totalAmount = () => {
+  let money = 0;
+  if (
+    formData.data.contractProductList &&
+    formData.data.contractProductList.length > 0
+  ) {
+    for (let i = 0; i < formData.data.contractProductList.length; i++) {
+      if (formData.data.contractProductList[i].amount) {
+        money = parseFloat(
+          Number(money) + Number(formData.data.contractProductList[i].amount)
+        ).toFixed(2);
+      }
+    }
+  }
+  if (
+    formData.data.contractProjectList &&
+    formData.data.contractProjectList.length > 0
+  ) {
+    for (let i = 0; i < formData.data.contractProjectList.length; i++) {
+      if (formData.data.contractProjectList[i].amount) {
+        money = parseFloat(
+          Number(money) + Number(formData.data.contractProjectList[i].amount)
+        ).toFixed(2);
+      }
+    }
+  }
+  formData.data.amount = money;
+};
+const clickAdd = () => {
+  if (
+    formData.data.contractProjectList &&
+    formData.data.contractProjectList.length > 0
+  ) {
+    formData.data.contractProjectList.push({
+      payName: "",
+      amount: null,
+      remark: "",
+    });
+  } else {
+    formData.data.contractProjectList = [
+      { payName: "", amount: null, remark: "" },
+    ];
+  }
+};
+const handleDelete = (index) => {
+  formData.data.contractProjectList.splice(index, 1);
+  totalAmount();
+};
+
+const querySearch = (queryString, callback) => {
+  proxy.post("/quotationPay/page", { payName: queryString }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      res.rows = res.rows.map((item) => {
+        return {
+          ...item,
+          value: item.payName,
+        };
+      });
+      callback(res.rows);
+    } else {
+      callback([]);
+    }
+  });
+};
+
+const handleBeforeUpload = async (file, index) => {
+  formData.data.contractProductList[index].imgLoading = true;
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  uploadData.value = res.uploadBody;
+  formData.data.contractProductList[index].fileList = [
+    {
+      id: res.id,
+      fileName: res.fileName,
+      fileUrl: res.fileUrl,
+      uploadState: false,
+    },
+  ];
+  formData.data.contractProductList[index].fileData = res;
+  return true;
+};
+
+const handleBeforeUploadOne = async (file, index) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  file.id = res.id;
+  file.fileUrl = res.fileUrl;
+  uploadData.value = res.uploadBody;
+  formData.data.contractProductList[index].fileData = res;
+  return true;
+};
+
+const handleSuccess = (index) => {
+  if (
+    formData.data.contractProductList[index].fileData &&
+    formData.data.contractProductList[index].fileData.fileUrl
+  ) {
+    formData.data.contractProductList[index].uploadState = true;
+    formData.data.contractProductList[index].imageUrl =
+      formData.data.contractProductList[index].fileData.fileUrl;
+  }
+  setTimeout(() => {
+    formData.data.contractProductList[index].imgLoading = false;
+  }, 400);
+};
+
+const handleSuccessOne = (index) => {
+  if (
+    formData.data.contractProductList[index].fileData &&
+    formData.data.contractProductList[index].fileData.fileUrl
+  ) {
+    let file = formData.data.contractProductList[index].fileData;
+    formData.data.contractProductList[index].prodFileList.push({
+      id: file.id,
+      fileName: file.fileName,
+      name: file.fileName,
+      url: file.fileUrl,
+      fileUrl: file.fileUrl,
+    });
+    formData.data.contractProductList[index].fileData = {};
+  }
+};
+
+const handleRemoveFile = (file, index) => {
+  let sonIndex = formData.data.contractProductList[
+    index
+  ].prodFileList.findIndex((x) => x.id == file.id || x.id == file.raw.id);
+  if (sonIndex > -1) {
+    formData.data.contractProductList[index].prodFileList.splice(sonIndex, 1);
+  }
+};
+const onPreviewFile = (file) => {
+  if (file && file.fileUrl) {
+    window.open(file.fileUrl, "_blank");
+  } else {
+    window.open(file.raw.fileUrl, "_blank");
+  }
+};
+const loadingSearch = ref(false);
+const remoteMethod = (keyword) => {
+  if (keyword && typeof keyword === "string") {
+    loadingSearch.value = true;
+    proxy.post("/customer/selPage", { keyword }).then((res) => {
+      customerList.value = res.rows.map((x) => ({
+        ...x,
+        label: x.name,
+        value: x.id,
+      }));
+      loadingSearch.value = false;
+    });
+  }
+  return;
+};
+
+const handleSubmit = async () => {
+  let flag = await formDom.value.handleSubmit(() => {});
+  if (flag) {
+    if (
+      formData.data.contractProductList &&
+      formData.data.contractProductList.length > 0
+    ) {
+      return true;
+    } else {
+      proxy.msgTip("请添加至少一件商品", 2);
+      return false;
+    }
+  } else {
+    // setTimeout(() => {
+    //   const errorDiv = document.getElementsByClassName("is-error");
+    //   errorDiv[0].scrollIntoView();
+    // }, 0);
+  }
+  return flag;
+};
+
+const getFormData = () => {
+  return proxy.deepClone(formData.data);
+};
+// 向父组件暴露
+defineExpose({
+  getFormData,
+  handleSubmit,
+});
+
+const changeShroffAccount = (val) => {
+  if (val) {
+    let data = accountList.value.find((item) => item.value == val);
+    if (formData.data.contractType == "2") {
+      if (data) {
+        formData.data.beneficiaryName = "";
+        formData.data.beneficiaryBank = "";
+        formData.data.beneficiaryBankAddress = "";
+        formData.data.beneficiaryAccountNumber = "";
+        formData.data.swiftCode = "";
+        formData.data.beneficiaryAddress = "";
+        formData.data.accountName = data.name;
+        formData.data.openingBank = data.openingBank;
+        formData.data.accountOpening = data.accountOpening;
+      }
+    } else {
+      if (data) {
+        formData.data.accountName = "";
+        formData.data.openingBank = "";
+        formData.data.accountOpening = "";
+        formData.data.beneficiaryName = data.beneficiaryName;
+        formData.data.beneficiaryBank = data.beneficiaryBank;
+        formData.data.beneficiaryBankAddress = data.beneficiaryBankAddress;
+        formData.data.beneficiaryAccountNumber = data.beneficiaryAccountNumber;
+        formData.data.swiftCode = data.swiftCode;
+        formData.data.beneficiaryAddress = data.beneficiaryAddress;
+      }
+    }
+  }
+};
+
+const handleClickUpload = async (att, flag, index) => {
+  let res = null;
+  let path = "";
+  if (flag) {
+    proxy.msgTip("请稍后", 2);
+    res = await proxy.post("/fileService/createTempFolder");
+    if (res && res.path) {
+      formData.data.contractProductList[index][att] = res.path;
+      path = res.path;
+    }
+  } else {
+    path = formData.data.contractProductList[index][att];
+  }
+  let a = document.createElement("a");
+  a.href = "printer://" + "ftp://121.37.194.75/" + path + "/";
+  a.style.display = "none";
+  document.body.appendChild(a);
+  a.click();
+  document.body.removeChild(a);
+};
+
+const handleClickUploadOne = (index) => {
+  formData.data.contractProductList[index].isShowProductFile =
+    !formData.data.contractProductList[index].isShowProductFile;
+  if (formData.data.contractProductList[index].isShowProductFile) {
+    formData.data.contractProductList[index].prodFileList = [];
+    formData.data.contractProductList[index].fileData = {};
+  }
+};
+
+const getAllData = (businessId) => {
+  proxy.post("/contract/detail", { id: businessId }).then(async (res) => {
+    res.countryId = res.buyCountryId;
+    res.provinceId = res.buyProvinceId;
+    res.cityId = res.buyCityId;
+    if (res.grossProfitInfoList && res.grossProfitInfoList.length > 0) {
+      $bus.emit("getGrossData", res.grossProfitInfoList);
+    }
+    for (const key in res) {
+      formData.data[key] = res[key];
+    }
+    remarkEditor.value.changeHtml(formData.data.templateContent);
+    if (
+      formData.data.contractProductList &&
+      formData.data.contractProductList.length > 0
+    ) {
+      formData.data.contractProductList.forEach((x) => {
+        x.rowId = uuidv4();
+      });
+      getFileData();
+      let productIds = formData.data.contractProductList.map(
+        (x) => x.productId
+      );
+      // proxy.getFileData({
+      //   businessIdList: productIds,
+      //   data: formData.data.contractProductList,
+      //   att: "productId",
+      //   businessType: "0",
+      //   fileAtt: "productFile",
+      //   filePathAtt: "fileUrl",
+      // });
+
+      const productAllFile = await proxy.getFileData({
+        businessIdList: productIds,
+        getAll: true,
+      });
+      for (let i = 0; i < formData.data.contractProductList.length; i++) {
+        const ele = formData.data.contractProductList[i];
+        for (const key in productAllFile) {
+          if (
+            ele.productId == key &&
+            productAllFile[ele.productId] &&
+            productAllFile[ele.productId].length > 0
+          ) {
+            ele.productFile = productAllFile[ele.productId].filter(
+              (x) => x.businessType == "0"
+            );
+            if (ele.productFile && ele.productFile.length > 0) {
+              ele.fileUrl = ele.productFile[0].fileUrl;
+            }
+            break;
+          }
+        }
+      }
+      let ids = formData.data.contractProductList.map((x) => x.id);
+      proxy
+        .getFileData({
+          businessIdList: ids,
+          getAll: true,
+        })
+        .then((fileObj) => {
+          if (fileObj && Object.keys(fileObj).length > 0) {
+            for (let i = 0; i < formData.data.contractProductList.length; i++) {
+              const ele = formData.data.contractProductList[i];
+              for (const key in fileObj) {
+                if (
+                  ele.id == key &&
+                  fileObj[ele.id] &&
+                  fileObj[ele.id].length > 0
+                ) {
+                  let imageUrlList = fileObj[ele.id].filter(
+                    (x) => x.businessType == "0"
+                  );
+                  if (imageUrlList && imageUrlList.length > 0) {
+                    ele.imageUrl = imageUrlList[0].fileUrl;
+                  }
+                  ele.prodFileList = fileObj[ele.id]
+                    .filter((x) => x.businessType == "1")
+                    .map((x) => ({ ...x, name: x.fileName, url: x.fileUrl }));
+                  if (ele.prodFileList && ele.prodFileList.length > 0) {
+                    ele.isShowProductFile = false;
+                  } else {
+                    ele.isShowProductFile = true;
+                    if (productAllFile[ele.productId]) {
+                      ele.fileListOne = productAllFile[ele.productId].filter(
+                        (x) => x.businessType == "2"
+                      );
+                    }
+                  }
+                }
+              }
+            }
+          } else {
+            for (let i = 0; i < formData.data.contractProductList.length; i++) {
+              const ele = formData.data.contractProductList[i];
+              ele.isShowProductFile = true;
+              for (const key in productAllFile) {
+                if (
+                  ele.productId == key &&
+                  productAllFile[ele.productId] &&
+                  productAllFile[ele.productId].length > 0
+                ) {
+                  ele.fileListOne = productAllFile[ele.productId].filter(
+                    (x) => x.businessType == "2"
+                  );
+                  break;
+                }
+              }
+            }
+          }
+        });
+      changeProductPrice();
+    }
+    if (formData.data.countryId) {
+      getCityData(formData.data.countryId, "20");
+    }
+    if (formData.data.provinceId) {
+      getCityData(formData.data.provinceId, "30");
+    }
+  });
+};
+
+const getFileData = () => {
+  let ids = [];
+  formData.data.contractProductList.map((x) => {
+    // ids.push(x.productId);
+    x.contractProductBomList.map((y) => {
+      ids.push(y.materialId);
+    });
+  });
+  ids = Array.from(new Set(ids));
+  proxy
+    .post("/fileInfo/getList", {
+      businessIdList: ids,
+    })
+    .then((fileObj) => {
+      formData.data.contractProductList.map((x) => {
+        // if (fileObj[x.productId] && fileObj[x.productId].length > 0) {
+        //   x.fileUrl = fileObj[x.productId][0].fileUrl;
+        // }
+        x.contractProductBomList.map((y) => {
+          y.fileList = fileObj[y.materialId] || [];
+          if (y.fileList && y.fileList.length > 0) {
+            y.fileUrl = y.fileList[0].fileUrl;
+          }
+        });
+      });
+    });
+};
+const getPriceSheetData = (id) => {
+  proxy.post("/extQuotation/detail", { id }).then((res) => {
+    formData.data = res;
+    formData.data = {
+      templateContent: "",
+      quotationId: res.id,
+      companyId: res.companyId,
+      buyCorporationId: res.buyCorporationId,
+      buyAddress: res.buyAddress,
+      buyPostalCode: res.buyPostalCode,
+      buyContactName: res.buyContactName,
+      buyContactNumber: res.buyContactNumber,
+      amount: res.amount,
+    };
+    if (res.type == 1) {
+      formData.data.contractType = "2";
+      if (currencyData.value && currencyData.value.length > 0) {
+        formData.data.currency = currencyData.value[0].dictKey;
+      }
+      formData.data.rate = 1;
+    } else {
+      formData.data.contractType = "1";
+    }
+    formData.data.contractProductList = res.quotationProductList.map((x) => ({
+      quotationProductId: x.id,
+      fileUrl: "",
+      productId: x.productId,
+      productCnName: x.productName,
+      productCode: x.productCode,
+      productLength: x.productLength,
+      productWidth: x.productWidth,
+      productHeight: x.productHeight,
+      prodFilePath: x.productProdImgPath,
+      quantity: x.quantity,
+      price: x.price,
+      amount: x.amount,
+      fileList: [],
+      contractProductBomList: x.quotationProductBomList.map((y) => {
+        y.quotationProductBomId = y.id;
+        delete y.id;
+        return y;
+      }),
+      rowId: uuidv4(),
+    }));
+    changeProductPrice();
+    getFileData();
+    formData.data.countryId = res.buyCountryId;
+    formData.data.provinceId = res.buyProvinceId;
+    formData.data.cityId = res.buyCityId;
+    if (formData.data.countryId) {
+      getCityData(formData.data.countryId, "20");
+    }
+    if (formData.data.provinceId) {
+      getCityData(formData.data.provinceId, "30");
+    }
+  });
+};
+// 是否能编辑修改产品列表
+const isEditList = ref(true);
+onMounted(() => {
+  if (currencyData.value && currencyData.value.length > 0) {
+    formData.data.currency = currencyData.value[0].dictKey;
+  }
+  formOption.disabled = judgeStatus();
+  // 报价转销售订单
+  if (route.query && route.query.priceSheetId) {
+    getPriceSheetData(route.query.priceSheetId);
+    isEditList.value = false;
+  } else if (route.query && route.query.businessId && route.query.processType) {
+    let businessId = route.query.businessId;
+    getAllData(businessId);
+  } else if (
+    route.query &&
+    route.query.businessId &&
+    !route.query.processType
+  ) {
+    let businessId = route.query.businessId;
+    getAllData(businessId);
+  }
+});
+
+// watch(
+//   () => props.queryData,
+//   (val) => {
+//     nextTick(() => {
+//       formOption.disabled = judgeStatus();
+//     });
+//     if (val.businessId && val.processType) {
+//       getAllData(val.businessId);
+//     }
+//   },
+//   {
+//     deep: true,
+//     immediate: true,
+//   }
+// );
+
+const showPriceInfo = () => {
+  if (props.queryData.processType) {
+    return false;
+  }
+  if (route.query.processType) {
+    return false;
+  } else {
+    return true;
+  }
+};
+const optionTwo = reactive({
+  data: {
+    tooltip: {
+      trigger: "axis",
+    },
+    // legend: {
+    //   data: ["价格"],
+    // },
+    grid: {
+      left: "3%",
+      right: "4%",
+      top: "10%",
+      bottom: "3%",
+      containLabel: true,
+    },
+    // toolbox: {
+    //   feature: {
+    //     saveAsImage: {},
+    //   },
+    // },
+    xAxis: {
+      type: "category",
+      boundaryGap: false,
+      data: [],
+    },
+    yAxis: {
+      type: "value",
+    },
+    series: [
+      {
+        name: "价格",
+        type: "line",
+        data: [],
+      },
+    ],
+  },
+});
+const showEcharts = (row, index) => {
+  let myChart = null;
+  myChart = echarts.init(proxy.$refs[row.productId + index]);
+  window.addEventListener("resize", () => {
+    myChart.resize();
+  });
+  if (row.contractProductListOne && row.contractProductListOne.length > 0) {
+    optionTwo.data.xAxis.data = row.contractProductListOne.map((item) => {
+      return item.createTime.slice(0, 10);
+    });
+    optionTwo.data.series[0].data = row.contractProductListOne.map((item) => {
+      return item.price;
+    });
+  } else {
+    optionTwo.data.xAxis.data = [];
+    optionTwo.data.series[0].data = [];
+  }
+  myChart.setOption(optionTwo.data);
+  myChart.resize();
+};
+
+const clickCopy = (type) => {
+  copyType.value = type;
+  copyContract.value = true;
+};
+</script>
+
+<style lang="scss" scoped>
+.img {
+  object-fit: contain;
+  width: 16px;
+  height: 16px;
+  vertical-align: middle;
+}
+.pic {
+  object-fit: contain;
+  width: 50px;
+  height: 50px;
+  cursor: pointer;
+  vertical-align: middle;
+}
+.el-icon.avatar-uploader-icon {
+  font-size: 20px;
+  color: #8c939d;
+  width: 50px;
+  height: 50px;
+  text-align: center;
+  border: 1px dashed var(--el-border-color);
+}
+.ql-editor {
+  padding: 0px;
+}
+:deep(.el-upload-list) {
+  margin: 0px !important;
+  position: relative;
+  top: -8px;
+  left: -8px;
+}
+:deep(.el-upload-list--text .el-upload-list__item) {
+  min-width: 150px !important;
+}
+:deep(.bom-table .el-table__body-wrapper .el-table__body .el-table__row) {
+  background: #f4f4f5 !important;
+}
+</style>

+ 1174 - 0
src/components/process/SF/PurchaseChange.vue

@@ -0,0 +1,1174 @@
+<template>
+  <div style="width: 100%; padding: 0px 15px">
+    <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom">
+      <template #btn>
+        <div>
+          <el-button type="primary" v-if="
+              [30].includes(route.query.processType) || !route.query.processType
+            " @click="clickCopy(1)">复制合同</el-button>
+        </div>
+      </template>
+      <template #seller>
+        <div style="width: 100%">
+          <el-form-item prop="buyCorporationId" label="买方信息" class="wid100">
+            <el-select v-model="formData.data.buyCorporationId" placeholder="请选择买方公司" style="width: 100%" @change="buyCorporationIdChange" filterable>
+              <el-option v-for="item in corporationList" :key="item.value" :label="item.label" :value="item.value" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="地址" class="wid100">
+            <el-row style="width:100%">
+              <el-col :span="8">
+                <el-form-item label="" prop="buyCountryName" label-width="0px" class="margin-b-0 wid100">
+                  <el-input v-model="formData.data.buyCountryName" placeholder="请输入国家" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="" prop="buyProvinceName" label-width="0px" class="margin-b-0 wid100">
+                  <el-input v-model="formData.data.buyProvinceName" placeholder="请输入省/州" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="" prop="buyCityName" label-width="0px" class="margin-b-0 wid100">
+                  <el-input v-model="formData.data.buyCityName" placeholder="请输入城市" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form-item>
+
+          <el-form-item label="详细地址" prop="buyAddress" class="wid100">
+            <el-input v-model="formData.data.buyAddress" type="textarea">
+            </el-input>
+          </el-form-item>
+
+          <el-form-item label="联系人" class="wid100">
+            <el-row style="width:100%">
+              <el-col :span="8">
+                <el-form-item label="" prop="buyContactName" label-width="0px" class="margin-b-0 wid100">
+                  <el-input v-model="formData.data.buyContactName" placeholder="请输入联系人" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="16">
+                <el-form-item label="" prop="buyContactNumber" label-width="0px" class="margin-b-0 wid100">
+                  <el-input v-model="formData.data.buyContactNumber" placeholder="请输入联系人电话" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form-item>
+        </div>
+      </template>
+      <template #buyer>
+        <div style="width: 100%">
+          <el-form-item label="卖方信息" prop="sellCorporationId" class="wid100">
+            <el-select v-model="formData.data.sellCorporationId" filterable remote reserve-keyword placeholder="请输入关键字" remote-show-suffix
+                       :remote-method="remoteMethod" :loading="loadingSearch" @input="remoteMethod" style="width: 100%" @change="changeSupplier" v-if="
+                  [30].includes(route.query.processType) ||
+                  !route.query.processType
+                ">
+              <el-option v-for="item in supplierList" :key="item.value" :label="item.label" :value="item.value" />
+            </el-select>
+            <el-select v-model="formData.data.sellCorporationName" disabled v-else style="width: 100%">
+            </el-select>
+          </el-form-item>
+          <el-form-item label="地址" class="wid100" required>
+            <el-row style="width: 100%">
+              <el-col :span="6">
+                <el-form-item label="" prop="countryId" class="margin-b-0">
+                  <el-select v-model="formData.data.countryId" placeholder="国家" filterable @change="(val) => getCityData(val, '20', true)">
+                    <el-option v-for="item in countryData" :label="item.name" :value="item.id">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="" prop="provinceName" class="margin-b-0">
+                  <selectCity placeholder="省/洲" @change="(val) => getCityData(val, '30', true)" addressId="provinceId" addressName="provinceName"
+                              v-model="formData.data" :data="provinceData">
+                  </selectCity>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="" prop="cityName" class="margin-b-0">
+                  <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData">
+                  </selectCity>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="" prop="sellPostalCode" class="margin-b-0">
+                  <el-input v-model="formData.data.sellPostalCode" placeholder="请输入邮编" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form-item>
+
+          <el-form-item label="详细地址" prop="sellAddress" class="wid100">
+            <el-input v-model="formData.data.sellAddress" type="textarea">
+            </el-input>
+          </el-form-item>
+          <el-form-item label="联系人" class="wid100" required>
+            <el-row style="width: 100%">
+              <el-col :span="8">
+                <el-form-item label="" prop="sellContactName" label-width="0px" class="margin-b-0 wid100">
+                  <el-input v-model="formData.data.sellContactName" clearable placeholder="请输入联系人">
+                  </el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="16">
+                <el-form-item label="" prop="sellContactNumber" label-width="0px" class="margin-b-0 wid100">
+                  <el-input v-model="formData.data.sellContactNumber" placeholder="请输入联系人电话" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form-item>
+        </div>
+      </template>
+
+      <template #commodity>
+        <div style="width: 100%">
+          <el-table :data="formData.data.purchaseProductList" style="width: 100%; ">
+            <el-table-column label="商品图片" width="80">
+              <template #default="{ row }">
+                <div v-if="row.fileUrl">
+                  <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
+                </div>
+                <div v-else></div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="productName" label="商品名称" min-width="130" />
+            <el-table-column prop="productCode" label="商品编码" width="130" />
+            <el-table-column label="尺寸 (cm)" width="140">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="数量" prop="subscribeCount" width="100" v-if="route.query.ids" />
+            <el-table-column label="已采购数量" prop="purchaseCount" width="100" v-if="route.query.ids" />
+            <el-table-column label="采购数量" width="130">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'purchaseProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
+                                class="margin-b-0 wid100">
+                    <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
+                                     :controls="false" :min="0" @change="calculationAmount('quantity')" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="单价" width="160">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'purchaseProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true"
+                                class="margin-b-0 wid100">
+                    <div style="display:flex;">
+                      <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
+                                       :controls="false" :min="0" @change="calculationAmount()" />
+                      <el-popover placement="top-start" :width="400" trigger="hover" @show="showEcharts(row,$index)">
+                        <template #default>
+                          <div>
+                            <div>
+                              <img src="@/assets/images/money1.png" alt="" class="img" />
+                              <span style="font-size:14px;font-weight:700;color:#000"> 该供应商近期采购单价:</span>
+                              <div style="padding:5px 0px 0px 20px">
+                                <div v-for="(item,index) in row.supplyPurchaseProductPriceList" :key="index">
+                                  <span>{{item.createTime.slice(0,10)}} </span>
+                                  <span style="margin-left:40px">CNY {{moneyFormat(item.price,2)}} </span>
+                                </div>
+                              </div>
+                            </div>
+
+                            <div style="margin-top:15px">
+                              <img src="@/assets/images/money2.png" alt="" class="img" />
+                              <span style="font-size:14px;font-weight:700;color:#000"> 供货推荐:</span>
+                              <div style="padding:5px 0px 0px 20px">
+                                <div v-for="(item,index) in row.topPriceList   " :key="index">
+                                  <span>{{item.supplierName}} </span>
+                                  <span style="margin-left:40px"> CNY {{moneyFormat(item.price,2)}} </span>
+                                </div>
+                              </div>
+                            </div>
+
+                            <div style="margin-top:15px">
+                              <img src="@/assets/images/money3.png" alt="" class="img" />
+                              <span style="font-size:14px;font-weight:700;color:#000"> 近期采购单价:</span>
+                              <div style="padding:5px 0px 0px 20px">
+                                <div v-for="(item,index) in row.purchaseProductPriceList   " :key="index">
+                                  <span>{{item.createTime.slice(0,10)}} </span>
+                                  <span style="margin-left:40px"> CNY {{moneyFormat(item.price,2)}} </span>
+                                </div>
+                              </div>
+                            </div>
+                            <div :ref="row.productId+$index" :id="row.productId+$index" style="height:180px">
+                            </div>
+                          </div>
+                        </template>
+                        <template #reference>
+                          <div style="margin-left:10px;cursor:pointer;position:relative;top:4px">
+                            <el-icon :size="20" color="#85c1a6">
+                              <WarningFilled />
+                            </el-icon>
+                          </div>
+                        </template>
+                      </el-popover>
+                    </div>
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="amount" label="小计" width="120" />
+            <el-table-column label="备注" width="200">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'purchaseProductList.' + $index + '.remark'" :inline-message="true" class="margin-b-0 wid100">
+                    <el-input v-model="row.remark" placeholder="请输入" style="width: 100%" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus()">
+              <template #default="{ $index }">
+                <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </template>
+
+      <template #otherCharge>
+        <div style="width: 100%">
+          <el-button type="primary" @click="clickAdd()" plain style="margin-bottom: 16px" v-if="!judgeStatus()">添加行</el-button>
+          <el-table :data="formData.data.purchaseProjectList" style="width: 100%;">
+            <el-table-column label="收费项目" width="220">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'purchaseProjectList.' + $index + '.payName'" :rules="rules.payName" :inline-message="true"
+                                class="margin-b-0 wid100">
+                    <el-autocomplete v-model="row.payName" :fetch-suggestions="querySearch" clearable class="inline-input w-50"
+                                     placeholder="请输入收费项目" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="备注">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'purchaseProjectList.' + $index + '.remark'" class="margin-b-0 wid100">
+                    <el-input v-model="row.remark" placeholder="请输入备注" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column :label="'金额'" width="130">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'purchaseProjectList.' + $index + '.amount'" :rules="rules.amount" :inline-message="true"
+                                class="margin-b-0 wid100">
+                    <el-input-number onmousewheel="return false;" v-model="row.amount" placeholder="请输入金额" style="width: 100%" :precision="2"
+                                     :controls="false" :min="0" @change="totalAmount()" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus()">
+              <template #default="{ $index }">
+                <el-button type="primary" link @click="handleDelete($index)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </template>
+
+      <template #templateContent>
+        <div style="width: 100%">
+          <Editor :value="formData.data.remark" @updateValue="updateContent" :readOnly="judgeStatus()" ref="remarkEditor" />
+        </div>
+      </template>
+
+    </byForm>
+
+  </div>
+</template>
+
+<script setup>
+import byForm from "@/components/byForm/index";
+import selectCity from "@/components/selectCity/index.vue";
+import { useRoute } from "vue-router";
+import Editor from "@/components/Editor/index.vue";
+import * as echarts from "echarts";
+import $bus from "@/bus/index.js";
+import moment from "moment";
+
+const route = useRoute();
+const { proxy } = getCurrentInstance();
+// 接收父组件的传值
+const props = defineProps({
+  queryData: Object,
+});
+const invoiceType = computed(
+  () => proxy.useUserStore().allDict["invoice_type"]
+);
+const fundsPaymentMethod = computed(
+  () => proxy.useUserStore().allDict["funds_payment_method"]
+);
+const shippingMethod = computed(
+  () => proxy.useUserStore().allDict["shipping_method"]
+);
+// const companyId = computed(() => proxy.useUserStore().user.companyId);
+const deliveryType = ref([
+  {
+    label: "买方地址",
+    value: "1",
+  },
+  {
+    label: "工厂交付",
+    value: "2",
+  },
+  {
+    label: "其他",
+    value: "3",
+  },
+]);
+const supplierList = ref([]);
+const corporationList = ref([]);
+const templateList = ref([]);
+const customerUserList = ref([]);
+const countryData = ref([]);
+const provinceData = ref([]);
+const cityData = ref([]);
+
+const openProductCompany = ref(false);
+const copyType = ref(1);
+const copyContract = ref(false);
+const formData = reactive({
+  data: {
+    purchaseProductList: [],
+    remark: "",
+  },
+});
+const uploadData = ref({});
+const formDom = ref(null);
+const judgeStatus = () => {
+  if (route.query.processType == 20 || route.query.processType == 10) {
+    return true;
+  }
+  if (props.queryData.recordList && props.queryData.recordList.length > 0) {
+    let data = props.queryData.recordList.filter(
+      (item) => item.status === 2 && item.nodeType !== 1
+    );
+    if (data && data.length > 0) {
+      return true;
+    }
+  }
+  return false;
+};
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  disabled: false,
+});
+const formConfig = computed(() => {
+  return [
+    // {
+    //   type: "slot",
+    //   slotName: "btn",
+    //   label: "",
+    //   itemWidth: 50,
+    // },
+    {
+      type: "title",
+      title: "基本信息",
+      isShow: formData.data.code ? true : false,
+    },
+    {
+      type: "input",
+      prop: "code",
+      label: "合同号",
+      isShow: formData.data.code ? true : false,
+      disabled: true,
+    },
+    {
+      type: "title",
+      title: "贸易信息",
+      haveLine: formData.data.code ? true : false,
+    },
+    {
+      type: "slot",
+      slotName: "seller",
+      label: "",
+      itemWidth: 50,
+    },
+    {
+      type: "slot",
+      slotName: "buyer",
+      label: "",
+      itemWidth: 50,
+    },
+    {
+      type: "title",
+      title: "付款信息",
+      haveLine: true,
+    },
+    {
+      type: "select",
+      prop: "paymentMethod",
+      label: "付款方式",
+      data: fundsPaymentMethod.value,
+      itemWidth: 25,
+    },
+    {
+      type: "select",
+      prop: "invoiceType",
+      label: "发票类型",
+      data: invoiceType.value,
+      itemWidth: 25,
+    },
+    {
+      type: "title",
+      title: "交付信息",
+      haveLine: true,
+    },
+    // {
+    //   type: "radio",
+    //   prop: "ss",
+    //   label: "交货类型",
+    //   border: true,
+    //   data: deliveryType.value,
+    //   itemWidth: 50,
+    // },
+    {
+      type: "select",
+      prop: "deliveryType",
+      label: "交货类型",
+      border: true,
+      data: deliveryType.value,
+      itemWidth: 50,
+      fn: () => {
+        changeAddress();
+      },
+    },
+    {
+      type: "input",
+      prop: "address",
+      itemType: "text",
+      label: "详细地址",
+      itemWidth: 50,
+    },
+    {
+      type: "date",
+      itemType: "date",
+      prop: "deliveryTime",
+      label: "交付日期",
+      itemWidth: 50,
+      disabledFn: (date) => {
+        return moment(date).isBefore(moment());
+      },
+    },
+    {
+      type: "number",
+      prop: "warranty",
+      label: "质保期 (天)",
+      precision: 0,
+      min: 0,
+      controls: false,
+      itemWidth: 50,
+    },
+    // {
+    //   type: "select",
+    //   prop: "transportMethod",
+    //   label: "运输方式",
+    //   data: shippingMethod.value,
+    //   itemWidth: 50,
+    // },
+
+    // {
+    //   type: "slot",
+    //   slotName: "delivery",
+    //   label: "",
+    // },
+    {
+      type: "title",
+      title: "采购明细",
+      haveLine: true,
+    },
+    {
+      type: "slot",
+      slotName: "commodity",
+      label: "",
+    },
+    {
+      type: "title",
+      title: "其他收费项目",
+      haveLine: true,
+    },
+    {
+      type: "slot",
+      slotName: "otherCharge",
+      label: "",
+    },
+    {
+      type: "title",
+      title: "合同总金额",
+      haveLine: true,
+    },
+    {
+      type: "input",
+      prop: "amount",
+      label: "合同总金额",
+      itemWidth: 25,
+      disabled: true,
+    },
+    {
+      type: "title",
+      title: "合同模板",
+      haveLine: true,
+    },
+    {
+      type: "select",
+      prop: "contractTemplateId",
+      label: "合同模板",
+      data: templateList.value,
+      itemWidth: 50,
+      fn: (val) => {
+        proxy.post("/contractTemplate/detail", { id: val }).then((res) => {
+          formData.data.remark = res.templateContent;
+          remarkEditor.value.changeHtml(formData.data.remark);
+        });
+      },
+    },
+    {
+      type: "slot",
+      slotName: "templateContent",
+      prop: "remark",
+      label: "模板内容",
+      itemWidth: 100,
+      disabled: false,
+    },
+  ];
+});
+const rules = ref({
+  buyCorporationId: [
+    { required: true, message: "请选择买方公司", trigger: "change" },
+  ],
+  buyAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
+  buyContactName: [
+    { required: true, message: "请输入联系人", trigger: ["change", "blur"] },
+  ],
+  buyContactNumber: [
+    { required: true, message: "请输入联系电话", trigger: "blur" },
+  ],
+  sellCorporationId: [
+    { required: true, message: "请选择卖方公司", trigger: "change" },
+  ],
+  countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
+  sellAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
+  sellContactName: [
+    { required: true, message: "请输入联系人", trigger: ["change", "blur"] },
+  ],
+  sellContactNumber: [
+    { required: true, message: "请输入联系电话", trigger: "blur" },
+  ],
+  quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
+  price: [{ required: true, message: "请输入单价", trigger: "blur" }],
+  invoiceType: [
+    { required: true, message: "请选择发票类型", trigger: "change" },
+  ],
+  paymentMethod: [
+    { required: true, message: "请选择付款方式", trigger: "change" },
+  ],
+  deliveryType: [
+    { required: true, message: "请选择交货类型", trigger: "change" },
+  ],
+  address: [{ required: true, message: "请输入详细地址", trigger: ["blur"] }],
+  deliveryTime: [
+    { required: true, message: "请选择交付日期", trigger: "change" },
+  ],
+  // warranty: [{ required: true, message: "请选择质保期 (天)", trigger: "blur" }],
+  payName: [{ required: true, message: "请输入收费项目", trigger: ["blur"] }],
+  amount: [{ required: true, message: "请输入金额", trigger: "blur" }],
+  remark: [{ required: true, message: "请输入条款内容", trigger: "blur" }],
+});
+const getDict = () => {
+  proxy
+    .post("/supplierInfo/page", {
+      pageNum: 1,
+      pageSize: 50,
+    })
+    .then((res) => {
+      supplierList.value = res.rows.map((x) => ({
+        ...x,
+        label: x.name,
+        value: x.id,
+      }));
+    });
+
+  proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    corporationList.value = res.rows.map((item) => {
+      return {
+        ...item,
+        label: item.name,
+        value: item.id,
+      };
+    });
+  });
+  proxy
+    .post("/contractTemplate/page", {
+      pageNum: 1,
+      pageSize: 999,
+      templateType: "2",
+    })
+    .then((res) => {
+      templateList.value = res.rows.map((item) => {
+        return {
+          label: item.templateName,
+          value: item.id,
+        };
+      });
+    });
+};
+
+const changeAddress = () => {
+  if (formData.data.deliveryType === "1") {
+    let buyCountryName = "";
+    if (formData.data.buyCountryName) {
+      buyCountryName = formData.data.buyCountryName;
+    }
+    let buyProvinceName = "";
+    if (formData.data.buyProvinceName) {
+      buyProvinceName = formData.data.buyProvinceName;
+    }
+    let buyCityName = "";
+    if (formData.data.buyCityName) {
+      buyCityName = formData.data.buyCityName;
+    }
+    let buyAddress = "";
+    if (formData.data.buyAddress) {
+      buyAddress = formData.data.buyAddress;
+    }
+    formData.data.address =
+      buyCountryName +
+      ", " +
+      buyProvinceName +
+      ", " +
+      buyCityName +
+      "," +
+      buyAddress;
+  } else if (formData.data.deliveryType === "2") {
+    let countryName = "";
+    if (formData.data.countryId) {
+      let data = countryData.value.filter(
+        (item) => item.id === formData.data.countryId
+      );
+      if (data && data.length > 0) countryName = data[0].chineseName;
+    }
+    let provinceName = "";
+    if (formData.data.provinceId) {
+      let data = provinceData.value.filter(
+        (item) => item.id === formData.data.provinceId
+      );
+      if (data && data.length > 0) provinceName = data[0].name;
+    } else {
+      if (formData.data.provinceName) {
+        provinceName = formData.data.provinceName;
+      }
+    }
+    let cityName = "";
+    if (formData.data.cityId) {
+      let data = cityData.value.filter(
+        (item) => item.id === formData.data.cityId
+      );
+      if (data && data.length > 0) cityName = data[0].name;
+    } else {
+      if (formData.data.cityName) {
+        cityName = formData.data.cityName;
+      }
+    }
+    let sellAddress = "";
+    if (formData.data.sellAddress) {
+      sellAddress = formData.data.sellAddress;
+    }
+    formData.data.address =
+      countryName + ", " + provinceName + ", " + cityName + "," + sellAddress;
+  } else if (formData.data.deliveryType === "3") {
+    formData.data.address = "";
+  }
+};
+
+const getCityData = (id, type, isChange) => {
+  proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
+    if (type === "20") {
+      provinceData.value = res;
+      if (isChange) {
+        formData.data.provinceId = "";
+        formData.data.provinceName = "";
+        formData.data.cityId = "";
+        formData.data.cityName = "";
+      }
+    } else if (type === "30") {
+      cityData.value = res;
+      if (isChange) {
+        formData.data.cityId = "";
+        formData.data.cityName = "";
+      }
+    } else {
+      countryData.value = res;
+    }
+  });
+};
+getDict();
+getCityData("0");
+
+const buyCorporationIdChange = (val) => {
+  if (val) {
+    proxy.post("/corporation/detail", { id: val }).then((res) => {
+      formData.data.buyCountryName = res.countryName;
+      formData.data.buyProvinceName = res.provinceName;
+      formData.data.buyCityName = res.cityName;
+      formData.data.buyAddress = res.address;
+      formData.data.buyContactName = res.contactName;
+      formData.data.buyContactNumber = res.contactPhone;
+      changeAddress();
+    });
+  }
+};
+
+const changeSupplier = (val) => {
+  changeProductPrice();
+  formData.data.countryId = "";
+  formData.data.provinceId = "";
+  formData.data.cityId = "";
+  formData.data.sellAddress = "";
+  formData.data.sellContactName = "";
+  formData.data.sellContactNumber = "";
+  if (val) {
+    let data = supplierList.value.filter((item) => item.id === val);
+    if (data && data.length > 0) {
+      formData.data.countryId = data[0].countryId;
+      formData.data.provinceId = data[0].provinceId;
+      formData.data.cityId = data[0].cityId;
+      formData.data.sellAddress = data[0].areaDetail;
+      formData.data.sellPostalCode = data[0].postalCode;
+      formData.data.sellContactName = data[0].contactPerson;
+      formData.data.sellContactNumber = data[0].contactNumber;
+      if (formData.data.countryId) {
+        getCityData(formData.data.countryId, "20");
+      }
+      if (formData.data.provinceId) {
+        getCityData(formData.data.provinceId, "30");
+      }
+      setTimeout(() => changeAddress(), 1500);
+    }
+  }
+};
+
+const changeProductPrice = () => {
+  let productIds = formData.data.purchaseProductList.map((x) => x.productId);
+  if (productIds && productIds.length > 0) {
+    proxy
+      .post("/ehsdPurchase/getProductPriceInfo", {
+        productIds: productIds,
+        sellCorporationId: formData.data.sellCorporationId
+          ? formData.data.sellCorporationId
+          : "",
+      })
+      .then((resOne) => {
+        for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
+          const iele = formData.data.purchaseProductList[i];
+          for (const key in resOne) {
+            if (iele.productId == key) {
+              iele.purchaseProductPriceList = resOne[key].purchaseProductList
+                .map((x) => ({
+                  createTime: x.createTime || "",
+                  price: x.price,
+                }))
+                .filter((y, index) => index < 3);
+              iele.purchaseProductPriceListOne = resOne[
+                key
+              ].purchaseProductList.map((x) => ({
+                createTime: x.createTime || "",
+                price: x.price,
+              }));
+              iele.topPriceList = resOne[key].topPriceList
+                .map((x) => ({
+                  supplierName: x.supplierName,
+                  price: x.price,
+                }))
+                .filter((y, index) => index < 3);
+
+              iele.supplyPurchaseProductPriceList = resOne[
+                key
+              ].supplyPurchaseProductList
+                .map((x) => ({
+                  createTime: x.createTime || "",
+                  price: x.price,
+                }))
+                .filter((y, index) => index < 3);
+            }
+          }
+        }
+      });
+  }
+};
+const onPicture = (path) => {
+  window.open(path, "_blank");
+};
+const handleRemove = (index) => {
+  formData.data.purchaseProductList.splice(index, 1);
+  totalAmount();
+};
+const calculationAmount = (att = "") => {
+  nextTick(() => {
+    if (
+      formData.data.purchaseProductList &&
+      formData.data.purchaseProductList.length > 0
+    ) {
+      for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
+        let money = 0;
+        money = parseFloat(
+          Number(formData.data.purchaseProductList[i].quantity) *
+            Number(formData.data.purchaseProductList[i].price)
+        ).toFixed(2);
+        formData.data.purchaseProductList[i].amount = money;
+      }
+    }
+    nextTick(() => {
+      totalAmount();
+    });
+  });
+};
+
+const totalAmount = () => {
+  let money = 0;
+  if (
+    formData.data.purchaseProductList &&
+    formData.data.purchaseProductList.length > 0
+  ) {
+    for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
+      if (formData.data.purchaseProductList[i].amount) {
+        money = parseFloat(
+          Number(money) + Number(formData.data.purchaseProductList[i].amount)
+        ).toFixed(2);
+      }
+    }
+  }
+  if (
+    formData.data.purchaseProjectList &&
+    formData.data.purchaseProjectList.length > 0
+  ) {
+    for (let i = 0; i < formData.data.purchaseProjectList.length; i++) {
+      if (formData.data.purchaseProjectList[i].amount) {
+        money = parseFloat(
+          Number(money) + Number(formData.data.purchaseProjectList[i].amount)
+        ).toFixed(2);
+      }
+    }
+  }
+  formData.data.amount = money;
+};
+const clickAdd = () => {
+  if (
+    formData.data.purchaseProjectList &&
+    formData.data.purchaseProjectList.length > 0
+  ) {
+    formData.data.purchaseProjectList.push({
+      payName: "",
+      amount: null,
+      remark: "",
+    });
+  } else {
+    formData.data.purchaseProjectList = [
+      { payName: "", amount: null, remark: "" },
+    ];
+  }
+};
+const handleDelete = (index) => {
+  formData.data.purchaseProjectList.splice(index, 1);
+  totalAmount();
+};
+
+const querySearch = (queryString, callback) => {
+  proxy.post("/quotationPay/page", { payName: queryString }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      res.rows = res.rows.map((item) => {
+        return {
+          ...item,
+          value: item.payName,
+        };
+      });
+      callback(res.rows);
+    } else {
+      callback([]);
+    }
+  });
+};
+
+const loadingSearch = ref(false);
+const remoteMethod = (keyword) => {
+  if (keyword && typeof keyword === "string") {
+    loadingSearch.value = true;
+    proxy.post("/supplierInfo/page", { keyword }).then((res) => {
+      supplierList.value = res.rows.map((x) => ({
+        ...x,
+        label: x.name,
+        value: x.id,
+      }));
+      loadingSearch.value = false;
+    });
+  }
+  return;
+};
+
+const handleSubmit = async () => {
+  let flag = await formDom.value.handleSubmit(() => {});
+  if (flag) {
+    for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
+      const e = formData.data.purchaseProductList[i];
+      if (e.quantity + e.purchaseCount > e.subscribeCount) {
+        proxy.msgTip("采购数量加已采购数量不可大于采购量", 2);
+        return false;
+      }
+    }
+    return true;
+  } else {
+    // setTimeout(() => {
+    //   const errorDiv = document.getElementsByClassName("is-error");
+    //   errorDiv[0].scrollIntoView();
+    // }, 0);
+  }
+  return flag;
+};
+
+const updateContent = (val) => {
+  formData.data.remark = val;
+};
+const remarkEditor = ref(null);
+const changeContractTemplate = (val) => {
+  if (val) {
+    proxy.post("/contractTemplate/detail", { id: val }).then((res) => {
+      remarkEditor.value.changeHtml(res.templateContent);
+    });
+  }
+};
+
+const getFormData = () => {
+  return proxy.deepClone(formData.data);
+};
+// 向父组件暴露
+defineExpose({
+  getFormData,
+  handleSubmit,
+});
+
+const getAllData = (businessId) => {
+  if (businessId) {
+    proxy.post("/ehsdPurchase/detail", { id: businessId }).then((res) => {
+      res.countryId = res.sellCountryId;
+      res.provinceId = res.sellProvinceId;
+      res.cityId = res.sellCityId;
+      if (res.grossProfitInfoList && res.grossProfitInfoList.length > 0) {
+        $bus.emit("getGrossData", res.grossProfitInfoList);
+      }
+      for (let key in res) {
+        if (!["ehsdPurchaseProductList", "purchaseArrivalList"].includes(key)) {
+          formData.data[key] = res[key];
+        }
+      }
+      remarkEditor.value.changeHtml(formData.data.remark);
+      if (
+        formData.data.purchaseProductList &&
+        formData.data.purchaseProductList.length > 0
+      ) {
+        let ids = formData.data.purchaseProductList.map((x) => x.productId);
+        proxy.getFile(
+          ids,
+          formData.data.purchaseProductList,
+          "productId",
+          "fileList",
+          "fileUrl"
+        );
+        changeProductPrice();
+      }
+      if (formData.data.countryId) {
+        getCityData(formData.data.countryId, "20");
+      }
+      if (formData.data.provinceId) {
+        getCityData(formData.data.provinceId, "30");
+      }
+    });
+  }
+};
+
+const getProductList = (ids) => {
+  if (ids && ids.length > 0) {
+    proxy.post("/subscribeDetail/detail", { ids }).then((res) => {
+      if (res && res.length > 0) {
+        formData.data.purchaseProductList = res.map((item) => {
+          let dataResourceId =
+            item.dataType == 0 ? item.id : item.contractDetailId;
+          return {
+            productId: item.productId,
+            contractId: item.contractId,
+            productName: item.productName,
+            productCode: item.productCustomCode,
+            productLength: item.productLength,
+            productWidth: item.productWidth,
+            productHeight: item.productHeight,
+            subscribeCount: item.count || 0,
+            purchaseCount: item.purchaseCount || 0,
+            quantity: null,
+            price: "",
+            amount: "",
+            remark: "",
+            fileUrl: "",
+            dataResource: item.dataType,
+            dataResourceId: dataResourceId,
+            subscribeDetailId: item.id,
+          };
+        });
+        formData.data.dataResource =
+          formData.data.purchaseProductList[0].dataResource;
+        if (formData.data.purchaseProductList[0].dataType == 0) {
+          formData.data.dataResourceId = res[0].subscribeId;
+        } else {
+          formData.data.dataResourceId = res[0].contractId;
+        }
+        let productIdList = res.map((x) => x.productId);
+        proxy
+          .post("/fileInfo/getList", {
+            businessIdList: productIdList,
+          })
+          .then((fileObj) => {
+            for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
+              const e = formData.data.purchaseProductList[i];
+              for (const key in fileObj) {
+                if (e.productId === key) {
+                  if (fileObj[key] && fileObj[key].length > 0) {
+                    e.fileUrl = fileObj[key][0].fileUrl;
+                  }
+                }
+              }
+            }
+          });
+
+        changeProductPrice();
+      }
+    });
+  }
+};
+onMounted(() => {
+  formOption.disabled = judgeStatus();
+  if (route.query && route.query.ids) {
+    let ids = route.query.ids.split(",");
+    getProductList(ids);
+  }
+  if (route.query.businessId && route.query.processType) {
+    getAllData(route.query.businessId);
+  } else if (route.query.businessId) {
+    getAllData(route.query.businessId);
+  }
+});
+
+// watch(
+//   () => props.queryData,
+//   (val) => {
+//     nextTick(() => {
+//       formOption.disabled = judgeStatus();
+//     });
+//     if (val.businessId && val.processType) {
+//       getAllData(val.businessId);
+//     }
+//   },
+//   {
+//     deep: true,
+//     immediate: true,
+//   }
+// );
+
+const optionTwo = reactive({
+  data: {
+    tooltip: {
+      trigger: "axis",
+    },
+    // legend: {
+    //   data: ["价格"],
+    // },
+    grid: {
+      left: "3%",
+      right: "4%",
+      top: "10%",
+      bottom: "3%",
+      containLabel: true,
+    },
+    // toolbox: {
+    //   feature: {
+    //     saveAsImage: {},
+    //   },
+    // },
+    xAxis: {
+      type: "category",
+      boundaryGap: false,
+      data: [],
+    },
+    yAxis: {
+      type: "value",
+    },
+    series: [
+      {
+        name: "价格",
+        type: "line",
+        data: [],
+      },
+    ],
+  },
+});
+const showEcharts = (row, index) => {
+  let myChart = null;
+  myChart = echarts.init(document.getElementById(row.productId + index));
+  window.addEventListener("resize", () => {
+    myChart.resize();
+  });
+  if (
+    row.purchaseProductPriceListOne &&
+    row.purchaseProductPriceListOne.length > 0
+  ) {
+    optionTwo.data.xAxis.data = row.purchaseProductPriceListOne.map((item) => {
+      return item.createTime.slice(0, 10);
+    });
+    optionTwo.data.series[0].data = row.purchaseProductPriceListOne.map(
+      (item) => {
+        return item.price;
+      }
+    );
+  } else {
+    optionTwo.data.xAxis.data = [];
+    optionTwo.data.series[0].data = [];
+  }
+  myChart.setOption(optionTwo.data);
+  myChart.resize();
+};
+
+const clickCopy = (type) => {
+  copyType.value = type;
+  copyContract.value = true;
+};
+</script>
+
+<style lang="scss" scoped>
+.img {
+  object-fit: contain;
+  width: 16px;
+  height: 16px;
+  vertical-align: middle;
+}
+.pic {
+  object-fit: contain;
+  width: 50px;
+  height: 50px;
+  cursor: pointer;
+  vertical-align: middle;
+}
+
+.ql-editor {
+  padding: 0px;
+}
+</style>

+ 3 - 1
src/main.js

@@ -67,7 +67,8 @@ import {
   getFile,
   getFileData,
   downloadFile,
-  isCurrentCompanyData
+  isCurrentCompanyData,
+  openImg
 } from '@/utils/util'
 
 // 分页组件
@@ -102,6 +103,7 @@ app.config.globalProperties.msgConfirm = msgConfirm
 app.config.globalProperties.getFile = getFile
 app.config.globalProperties.getFileData = getFileData
 app.config.globalProperties.isCurrentCompanyData = isCurrentCompanyData
+app.config.globalProperties.openImg = openImg
 app.config.globalProperties.downloadFile = downloadFile
 app.config.globalProperties.postTwo = postTwo
 app.config.globalProperties.download = download

+ 6 - 0
src/utils/util.js

@@ -86,6 +86,12 @@ export function getFileData(option = {}) {
 
 }
 
+export function openImg(fileUrl) {
+  if (fileUrl) {
+    window.open(fileUrl, "_blank");
+  }
+}
+
 export function isCurrentCompanyData(companyId) {
   const currentCompanyId = useUserStore().user.companyId
   if (companyId && (currentCompanyId == companyId)) {

+ 1 - 1
src/views/EHSD/procurement/purchasedEHSD/index.vue

@@ -422,7 +422,7 @@ const handleChange = (row) => {
   proxy.$router.push({
     path: "/platform_manage/process/processApproval",
     query: {
-      flowKey: "ehsd_purchase_update_flow",
+      flowKey: "purchase_update_flow",
       flowName: "采购合同变更",
       random: proxy.random(),
       businessId: row.id,

+ 13 - 13
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -584,19 +584,19 @@ const config = computed(() => {
           //     clickHandoverSlip(row);
           //   },
           // },
-          // row.status == 30
-          //   ? {
-          //       attrs: {
-          //         label: "变更",
-          //         type: "primary",
-          //         text: true,
-          //       },
-          //       el: "button",
-          //       click() {
-          //         clickAlteration(row);
-          //       },
-          //     }
-          //   : {},
+          row.status == 30
+            ? {
+                attrs: {
+                  label: "变更",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  clickAlteration(row);
+                },
+              }
+            : {},
           row.status == 30 && row.orderDistributeStatus != 1
             ? {
                 attrs: {

+ 219 - 0
src/views/EHSD/saleContract/dailyReport/index.vue

@@ -0,0 +1,219 @@
+<template>
+  <div class="pageIndexClass">
+    <div style="background-color: #fff; padding: 15px 15px 0">
+      <el-form :inline="true" :model="sourceList.pagination">
+        <el-form-item label="">
+          <el-radio-group v-model="sourceList.pagination.current" size="default" @change="changeCurrent">
+            <el-radio-button label="本日" />
+            <el-radio-button label="本周" />
+            <el-radio-button label="本月" />
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="其他">
+          <el-date-picker v-model="sourceList.pagination.beginTime" type="date" placeholder="开始日期" value-format="YYYY-MM-DD 00:00:00"
+                          :disabled-date="disabledFn" />
+          <div style="padding:0 10px">
+            -
+          </div>
+          <el-date-picker v-model="sourceList.pagination.endTime" type="date" placeholder="结束日期" value-format="YYYY-MM-DD 23:59:59"
+                          :disabled-date="disabledFn" />
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="onQuery" class="query">搜索</el-button>
+          <el-button @click="onReset">重置</el-button>
+          <!-- <el-button @click="aa">定位到今日</el-button> -->
+        </el-form-item>
+      </el-form>
+    </div>
+    <div style="background:#fff;padding:15px;margin-top:10px">
+      <el-table :data="sourceList.data" :height="tableHeight" style="width: 100%" v-loading="loading">
+        <el-table-column prop="name" label="组别" min-width="110" fixed="left">
+          <template #default="{ row, $index }">
+            <div>
+              随机啊啊啊啊
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="name" label="业务员" width="80" fixed="left" />
+
+        <template v-if="dayList && dayList.length>0">
+          <el-table-column v-for="col in dayList" :key="col" :label="col" align="center" :class-name="today==col?'isToday':''">
+            <el-table-column prop="address" label="系统" width="100" align="right" :class-name="today==col?'isToday':''">
+              <template #default="{ row, $index }">
+                <div style="width: 100%" :class="today==col?'isToday':''">
+                  <!-- {{col}} -->999,999.00
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="address" label="聚水潭" width="100" align="right" :class-name="today==col?'isToday':''">
+              <template #default="{ row, $index }">
+                <div style="width: 100%" :class="today==col?'isToday':''">
+                  {{col}}
+                </div>
+              </template>
+            </el-table-column>
+          </el-table-column>
+        </template>
+
+        <el-table-column width="90" align="right" fixed="right">
+          <template #header>
+            <div>
+              系统
+              <br>
+              月累计
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column width="90" align="right" fixed="right">
+          <template #header>
+            <div>
+              聚水潭
+              <br>
+              月累计
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column width="90" align="right" fixed="right">
+          <template #header>
+            <div>
+              合计
+              <br>
+              月累计
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="address" label="月目标" width="90" align="right" fixed="right" />
+        <el-table-column prop="address" label="月达成率" width="90" align="right" fixed="right" />
+        <el-table-column prop="address" label="排名" width="60" align="right" fixed="right" />
+      </el-table>
+    </div>
+
+  </div>
+</template>
+
+<script setup>
+import byTable from "@/components/byTable/index";
+import { getMonthBetween } from "@/utils/date.js";
+import moment from "moment";
+const { proxy } = getCurrentInstance();
+const tableHeight = ref(0);
+const getTableHeight = () => {
+  tableHeight.value = window.innerHeight - 150 - 79;
+};
+getTableHeight();
+window.addEventListener("resize", () => {
+  getTableHeight();
+});
+const today = ref(moment().format("yyyy-MM-DD"));
+const beginTime = ref(
+  moment().startOf("month").format("yyyy-MM-DD") + " 00:00:00"
+);
+const endTime = ref(moment().endOf("month").format("YYYY-MM-DD") + " 23:59:59");
+const weekBegin = ref(
+  moment().startOf("week").format("yyyy-MM-DD") + " 00:00:00"
+);
+const weekEnd = ref(moment().endOf("week").format("yyyy-MM-DD") + " 23:59:59");
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    beginTime: "",
+    endTime: "",
+    current: "本月",
+  },
+});
+const loading = ref(false);
+const getList = (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/contract/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+
+const dayList = ref([]);
+const onQuery = () => {
+  if (
+    sourceList.value.pagination.beginTime &&
+    sourceList.value.pagination.endTime
+  ) {
+    dayList.value = getMonthBetween(
+      sourceList.value.pagination.beginTime.slice(0, 10),
+      sourceList.value.pagination.endTime.slice(0, 10)
+    );
+  }
+  getList();
+};
+
+const changeCurrent = (val) => {
+  switch (val) {
+    case "本日":
+      sourceList.value.pagination.beginTime = today.value + " 00:00:00";
+      sourceList.value.pagination.endTime = today.value + " 23:59:59";
+      break;
+    case "本周":
+      sourceList.value.pagination.beginTime = weekBegin.value;
+      sourceList.value.pagination.endTime = weekEnd.value;
+      break;
+    case "本月":
+      sourceList.value.pagination.beginTime = beginTime.value;
+      sourceList.value.pagination.endTime = endTime.value;
+      break;
+  }
+  onQuery();
+};
+
+const onReset = () => {
+  sourceList.value.pagination.current = "本月";
+  sourceList.value.pagination.beginTime = beginTime.value;
+  sourceList.value.pagination.endTime = endTime.value;
+  onQuery();
+};
+onReset();
+
+const nowYearMonth = ref(moment().format("YYYY-MM-DD"));
+// const disabledFn=  (date)=>{
+//   let now =moment(date)
+//   if(moment(date) > moment(beginTime.value) || ){
+
+//   }
+// }
+
+const aa = () => {
+  let eles = document.querySelectorAll(".isToday");
+  if (eles && eles[0]) {
+    eles[0].scrollIntoView();
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+:deep(
+    .el-table .el-table__header-wrapper th,
+    .el-table .el-table__fixed-header-wrapper th
+  ) {
+  height: auto !important;
+}
+:deep(.el-table th.el-table__cell) {
+  background: #fff !important;
+}
+:deep(.el-table .el-table__cell) {
+  padding: 0 !important;
+}
+.query {
+  background: #20b2aa;
+  color: #fff;
+  border: 1px solid #20b2aa;
+}
+.isToday {
+  // background: red !important;
+  // color: #fff !important;
+  color: #409eff;
+}
+</style>

+ 7 - 7
src/views/MES/productionBoard/equipmentCapacity/index.vue

@@ -98,7 +98,7 @@ const getOption = () => {
   return {
     title: {
       show: true,
-      text: "设备名称:设备1\n\n当天标刻数量:10\n\n在线工作时长(分钟):100",
+      text: "设备名称:设备1\n\n当天标刻数量:10\n\n在线工作时长(分钟):1000",
       bottom: "-2%",
       left: "center",
       textStyle: {
@@ -144,14 +144,14 @@ const getOption = () => {
         },
         data: [
           {
-            value: 1200,
+            value: 1000,
             name: "工作时长",
             itemStyle: {
               color: "#F9CB19",
             },
           },
           {
-            value: 300,
+            value: 440,
             name: "",
             itemStyle: {
               color: "#268EFF",
@@ -335,9 +335,9 @@ onMounted(() => {
 
   option2 = getOption();
   option2.title.text =
-    "设备名称:设备2\n\n当天标刻数量:1\n\n在线工作时长(分钟):50";
+    "设备名称:设备2\n\n当天标刻数量:1\n\n在线工作时长(分钟):600";
   option2.series[0].data[0].value = 600;
-  option2.series[0].data[1].value = 900;
+  option2.series[0].data[1].value = 840;
   pie_2Chart = echarts.init(pie_2.value);
   window.addEventListener("resize", () => {
     pie_2Chart.resize();
@@ -347,8 +347,8 @@ onMounted(() => {
 
   option3 = getOption();
   option3.title.text =
-    "设备名称:设备3\n\n当天标刻数量:20\n\n在线工作时长(分钟):200";
-  option3.series[0].data[0].value = 1300;
+    "设备名称:设备3\n\n当天标刻数量:20\n\n在线工作时长(分钟):1240";
+  option3.series[0].data[0].value = 1240;
   option3.series[0].data[1].value = 200;
   pie_3Chart = echarts.init(pie_3.value);
   window.addEventListener("resize", () => {

+ 29 - 22
src/views/MES/supplementaryOrder/index.vue

@@ -6,23 +6,9 @@
               
         ]" @get-list="getList">
 
-        <template #list="{ item }">
-          <div style="width:100%">
-            <span v-for="(product ,index) in item.produceOrderDetailList" style="margin-right:15px">
-              <el-popover placement="top-start" :width="300" trigger="hover">
-                <div>
-                  <div>产品编码:{{product.productCode}}</div>
-                  <div>产品名称:{{product.productName}}</div>
-                  <div>产品尺寸:{{product.productLength}}cm*{{product.productWidth}}cm*{{product.productHeight}}cm</div>
-                </div>
-                <template #reference>
-                  <el-progress type="circle" :percentage="(Number(product.finishQuantity) / Number(product.quantity))*100" width="60"
-                               :status="(Number(product.finishQuantity) / Number(product.quantity))*100 == 100 ? 'success' : ''" />
-                </template>
-              </el-popover>
-
-            </span>
-
+        <template #pic="{item}">
+          <div style="width: 100%">
+            <img v-if="item.fileUrl" :src="item.fileUrl" class="pic" @click="openImg(item.fileUrl)" />
           </div>
         </template>
 
@@ -75,11 +61,11 @@ const statusData = ref([
   },
 ]);
 const selectConfig = computed(() => [
-  // {
-  //   label: "报损类型",
-  //   prop: "type",
-  //   data: statusData.value,
-  // },
+  {
+    label: "报损类型",
+    prop: "type",
+    data: statusData.value,
+  },
 ]);
 const config = computed(() => {
   return [
@@ -116,6 +102,14 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "图片",
+        slot: "pic",
+        align: "center",
+        width: 80,
+      },
+    },
+    {
+      attrs: {
         label: "物品编号",
         prop: "materialCode",
         width: 160,
@@ -222,6 +216,19 @@ const getList = async (req) => {
       setTimeout(() => {
         loading.value = false;
       }, 200);
+
+      const productIdList = res.rows.map((x) => x.materialId);
+      // 请求文件数据并回显
+      if (productIdList.length > 0) {
+        proxy.getFileData({
+          businessIdList: productIdList,
+          data: sourceList.value.data,
+          att: "materialId",
+          businessType: "0",
+          fileAtt: "fileList",
+          filePathAtt: "fileUrl",
+        });
+      }
     });
 };
 

+ 2 - 2
src/views/finance/fundManage/account/index.vue

@@ -75,7 +75,7 @@ const config = computed(() => {
   return [
     {
       attrs: {
-        label: "归属公司",
+        label: "企业信息",
         prop: "corporationName",
       },
     },
@@ -224,7 +224,7 @@ const formConfig = computed(() => {
     {
       type: "select",
       prop: "corporationId",
-      label: "归属公司",
+      label: "企业信息",
       data: corporationList.value,
     },
     {

+ 9 - 9
src/views/iot/base/equipment/index.vue

@@ -178,15 +178,15 @@ const formOption = reactive({
 const byform = ref(null);
 
 const formConfig = computed(() => [
-  {
-    type: "treeSelect",
-    prop: "companyId",
-    label: "归属公司",
-    data: treeData.value,
-    propsTreeLabel: "deptName",
-    propsTreeValue: "deptId",
-    itemWidth: 100,
-  },
+  // {
+  //   type: "treeSelect",
+  //   prop: "companyId",
+  //   label: "归属公司",
+  //   data: treeData.value,
+  //   propsTreeLabel: "deptName",
+  //   propsTreeValue: "deptId",
+  //   itemWidth: 100,
+  // },
   {
     type: "input",
     prop: "deviceCode",

+ 15 - 104
src/views/process/processApproval/index.vue

@@ -22,96 +22,29 @@
         </template>
 
         <!-- 销售合同 -->
-        <template v-else-if="flowForm.flowKey == 'contract_flow'">
-          <!-- <ContractEHSD ref="makeDom" :queryData="queryData.data" @auxiliaryChange="(e) => getAuxiliaryData(e)"></ContractEHSD> -->
-          <Contract ref="makeDom" :queryData="queryData.data"></Contract>
-        </template>
+        <Contract ref="makeDom" :queryData="queryData.data" v-else-if="flowForm.flowKey == 'contract_flow'"></Contract>
 
         <!-- 销售合同变更 -->
-        <template v-else-if="flowForm.flowKey == 'contract_update_flow'">
-          <ContractChangeEHSD ref="makeDom" :queryData="queryData.data" @auxiliaryChange="(e) => getAuxiliaryData(e)"></ContractChangeEHSD>
-        </template>
+        <ContractChange ref="makeDom" :queryData="queryData.data" v-else-if="flowForm.flowKey == 'contract_update_flow'"></ContractChange>
 
         <!-- 申购 -->
-        <!-- <SendSubscribe ref="makeDom" @auxiliaryChange="(e) => getAuxiliaryData(e)" v-else-if="flowForm.flowKey == 'subscribe_flow'"
-                       :queryData="queryData.data"></SendSubscribe> -->
         <Subscribe ref="makeDom" :queryData="queryData.data" v-else-if="flowForm.flowKey == 'subscribe_flow'"></Subscribe>
 
-        <!-- 样品单采购、交接单采购 -->
-        <template v-else-if="flowForm.flowKey == 'ehsd_purchase_flow'">
-
-          <!-- <PurchaseEHSD ref="makeDom" :queryData="queryData.data" v-if="flowForm.submitType === '10'" @auxiliaryChange="(e) => getAuxiliaryData(e)">
-          </PurchaseEHSD> -->
-          <!-- <SendPurchase
-            ref="makeDom"
-            :queryData="queryData.data"
-            v-else
-            @auxiliaryChange="(e) => getAuxiliaryData(e)"
-          ></SendPurchase> -->
-        </template>
-
-        <template v-else-if="flowForm.flowKey == 'purchase_flow'">
-          <Purchase ref="makeDom" :queryData="queryData.data"> </Purchase>
-          <!-- <SendPurchase ref="makeDom" :queryData="queryData.data" @auxiliaryChange="(e) => getAuxiliaryData(e)"></SendPurchase> -->
-        </template>
+        <!-- 采购 -->
+        <Purchase ref="makeDom" :queryData="queryData.data" v-else-if="flowForm.flowKey == 'purchase_flow'"> </Purchase>
 
-        <PurchaseChangeEHSD ref="makeDom" :queryData="queryData.data" v-else-if="flowForm.flowKey == 'ehsd_purchase_update_flow'"
-                            @auxiliaryChange="(e) => getAuxiliaryData(e)"></PurchaseChangeEHSD>
+        <!-- 采购变更 -->
+        <PurchaseChange ref="makeDom" :queryData="queryData.data" v-else-if="flowForm.flowKey == 'purchase_update_flow'"> </PurchaseChange>
 
         <!-- 采购付款 -->
-        <PurchasePayment ref="makeDom" @auxiliaryChange="(e) => getAuxiliaryData(e)" v-else-if="flowForm.flowKey == 'pay_flow'"
-                         :queryData="queryData.data"></PurchasePayment>
+        <PurchasePayment ref="makeDom" v-else-if="flowForm.flowKey == 'pay_flow'" :queryData="queryData.data"></PurchasePayment>
 
         <!-- 请款 -->
         <SendFunds ref="makeDom" v-else-if="flowForm.flowKey == 'account_request_funds_flow'" :queryData="queryData.data"></SendFunds>
 
         <!-- 取消到账认领 -->
-        <CancelClaim ref="makeDom" v-else-if="flowForm.flowKey == 'claim_del_flow'" :queryData="queryData.data"></CancelClaim>
+        <!-- <CancelClaim ref="makeDom" v-else-if="flowForm.flowKey == 'claim_del_flow'" :queryData="queryData.data"></CancelClaim> -->
       </div>
-      <!-- <div class="bottom" v-if="isShowSubmitDom">
-        <div class="commons-title title">处理意见</div>
-        <el-form :model="flowForm" :rules="flowRules" ref="flowFormDom">
-          <el-form-item prop="remark" label-width="0px" label="">
-            <el-input
-              type="textarea"
-              placeholder="请输入"
-              v-model="flowForm.remark"
-            >
-            </el-input>
-          </el-form-item>
-          <el-form-item prop="remark" label-width="80px" label="附件上传">
-            <el-upload
-              v-model:fileList="flowForm.fileList"
-              :action="uploadUrl"
-              :data="uploadData"
-              multiple
-              :before-upload="uploadFile"
-              :on-success="handleSuccess"
-              :on-preview="onPreviewFile"
-            >
-              <el-button>选择</el-button>
-            </el-upload>
-          </el-form-item>
-          <el-form-item>
-            <el-button
-              type="primary"
-              v-if="approvalRecordData.buttonInfoList.length == 0"
-              @click="handleSubmit"
-              :loading="btnLoading"
-              >提交</el-button
-            >
-            <el-button
-              type="primary"
-              v-else
-              v-for="i in approvalRecordData.buttonInfoList"
-              :key="i.type"
-              :loading="btnLoading"
-              @click="handleSubmit(i.type)"
-              >{{ i.name }}</el-button
-            >
-          </el-form-item>
-        </el-form>
-      </div> -->
     </div>
     <div class="right-card">
       <el-tabs v-model="activeName" class="demo-tabs">
@@ -218,42 +151,20 @@
 <script setup name="ProcessApproval">
 import useTagsViewStore from "@/store/modules/tagsView.js";
 import { useRouter, useRoute } from "vue-router";
-import Contract from "@/components/process/SF/Contract";
+
 import PriceSheet from "@/components/process/SF/PriceSheet";
-import Purchase from "@/components/process/SF/Purchase";
+
+import Contract from "@/components/process/SF/Contract";
+import ContractChange from "@/components/process/SF/ContractChange";
+
 import Subscribe from "@/components/process/SF/Subscribe";
+import Purchase from "@/components/process/SF/Purchase";
+import PurchaseChange from "@/components/process/SF/PurchaseChange";
 
 // 消息提示
 import { ElMessage, ElMessageBox } from "element-plus";
 //决策辅助
 import auxiliary from "./auxiliary";
-// 报价单-EHSD
-import PriceSheetEHSD from "@/components/process/EHSD/PriceSheet";
-// 销售合同-EHSD
-import ContractEHSD from "@/components/process/EHSD/Contract";
-// 销售合同变更-EHSD
-import ContractChangeEHSD from "@/components/process/EHSD/ContractChange";
-// 样品单-EHSD
-import SampleEHSD from "@/components/process/EHSD/Sample";
-// 样品单变更-EHSD
-import SampleChangeEHSD from "@/components/process/EHSD/SampleChange";
-// 采购交接单-EHSD
-import PurchaseEHSD from "@/components/process/EHSD/Purchase";
-// 采购交接单-EHSD
-import PurchaseChangeEHSD from "@/components/process/EHSD/PurchaseChange";
-// 取消认领-EHSD
-import CancelClaim from "@/components/process/EHSD/CancelClaim";
-
-//申购发起
-import SendSubscribe from "@/components/process/SendSubscribe";
-//采购发起
-import SendPurchase from "@/components/process/SendPurchase";
-//请款发起
-import SendFunds from "@/components/process/SendFunds";
-// 采购付款
-import PurchasePayment from "@/components/process/PurchasePayment";
-
-import { computed, nextTick, ref, watch } from "vue";
 
 import useUserStore from "@/store/modules/user";
 const userInfo = useUserStore();

+ 24 - 3
src/views/purchaseManage/purchaseManage/purchase/index.vue

@@ -33,6 +33,19 @@
           </div>
           <div v-else></div>
         </template>
+
+        <template #purchaseCount="{item}">
+          <div style="width:100%;font-weight:700">
+            {{item.purchaseCount}}
+          </div>
+        </template>
+
+        <template #count="{item}">
+          <div style="width:100%;font-weight:700">
+            {{item.count}}
+          </div>
+        </template>
+
         <template #prodTag="{ item }">
           <div style="width: 100%">
             <el-tag style="margin-right: 8px" type="success" v-for="(tag, index) in item.prodTags" :key="index"
@@ -184,6 +197,7 @@ const config = computed(() => {
         checkAtt: "isCheck",
         isJudge: true,
         width: 60,
+        fixed: "left",
       },
     },
     {
@@ -241,15 +255,22 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "采购数量",
+        label: "生产需求量",
         prop: "count",
         width: 100,
       },
     },
     {
       attrs: {
-        label: "已采购数量",
-        prop: "purchaseCount",
+        label: "需采购量",
+        slot: "count",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "已采购量",
+        slot: "purchaseCount",
         width: 100,
       },
     },

+ 3 - 3
src/views/purchaseManage/purchasePayment/invoice/index.vue

@@ -15,10 +15,10 @@
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
         <template #information>
           <el-table :data="formData.data.invoiceDetailsList" style="width: 100%; margin-top: 16px">
-            <el-table-column prop="code" label="采购合同" width="140" />
+            <el-table-column prop="code" label="采购合同" min-width="140" />
             <el-table-column prop="amount" label="合同金额" width="120" />
             <el-table-column prop="sumInvoiceMoney" label="已收发票金额" width="120" />
-            <el-table-column label="关联金额">
+            <el-table-column label="关联金额" width="140">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'invoiceDetailsList.' + $index + '.money'" :rules="rules.money" :inline-message="true">
                   <el-input-number onmousewheel="return false;" v-model="row.money" placeholder="请输入关联金额" style="width: 100%" :precision="2"
@@ -283,7 +283,7 @@ const openModal = (val) => {
 const changeSupply = (val) => {
   if (val) {
     proxy
-      .get("/purchase/getNoInvoiceListBySupplyId", { supplyId: val })
+      .get("/ehsdPurchase/getNoInvoiceListBySupplyId", { supplyId: val })
       .then((res) => {
         if (res.data && res.data.length > 0) {
           formData.data.invoiceDetailsList = res.data.map((item) => {

+ 48 - 7
src/views/purchaseSales/outAndInWarehouse/manualDelivery/index.vue

@@ -8,6 +8,13 @@
             action: () => openModal(),
           },
         ]" @get-list="getList">
+
+        <template #pic="{item}">
+          <div style="width: 100%">
+            <img v-if="item.fileUrl" :src="item.fileUrl" class="pic" @click="openImg(item.fileUrl)" />
+          </div>
+        </template>
+
       </byTable>
     </div>
 
@@ -17,6 +24,13 @@
           <div style="width: 100%">
             <el-button type="primary" @click="clickAdd()">添加明细</el-button>
             <el-table :data="formData.data.list" style="width: 100%; margin-top: 16px">
+              <el-table-column label="图片" width="70" align="center">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <img v-if="row.fileUrl" :src="row.fileUrl" class="pic" @click="openImg(row.fileUrl)" />
+                  </div>
+                </template>
+              </el-table-column>
               <el-table-column prop="productCode" label="编码" width="160" />
               <el-table-column prop="productName" label="名称" min-width="160" />
               <el-table-column label="尺寸 (cm)" min-width="100">
@@ -140,6 +154,14 @@ const config = computed(() => {
   return [
     {
       attrs: {
+        label: "操作时间",
+        prop: "createTime",
+        width: 160,
+        fixed: "left",
+      },
+    },
+    {
+      attrs: {
         label: "单号",
         prop: "code",
         width: 120,
@@ -165,6 +187,14 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "图片",
+        slot: "pic",
+        align: "center",
+        width: 80,
+      },
+    },
+    {
+      attrs: {
         label: "物品编码",
         prop: "productCustomCode",
         width: 160,
@@ -261,13 +291,6 @@ const config = computed(() => {
         width: 110,
       },
     },
-    {
-      attrs: {
-        label: "操作时间",
-        prop: "createTime",
-        width: 160,
-      },
-    },
   ];
 });
 const getDict = () => {
@@ -306,6 +329,19 @@ const getList = async (req) => {
       setTimeout(() => {
         loading.value = false;
       }, 200);
+
+      const productIdList = res.rows.map((x) => x.productId);
+      // 请求文件数据并回显
+      if (productIdList.length > 0) {
+        proxy.getFileData({
+          businessIdList: productIdList,
+          data: sourceList.value.data,
+          att: "productId",
+          businessType: "0",
+          fileAtt: "fileList",
+          filePathAtt: "fileUrl",
+        });
+      }
     });
 };
 getDict();
@@ -458,7 +494,12 @@ const select = (item) => {
 };
 
 const selectGood = (row) => {
+  let fileUrl = "";
+  if (row.fileList && row.fileList.length > 0) {
+    fileUrl = row.fileList[0].fileUrl;
+  }
   formData.data.list.push({
+    fileUrl: fileUrl,
     productCode: row.productCustomCode,
     productId: row.productId,
     productName: row.productName,

+ 46 - 13
src/views/purchaseSales/outAndInWarehouse/manualWarehousing/index.vue

@@ -8,6 +8,13 @@
             action: () => openModal(),
           },
         ]" @get-list="getList">
+
+        <template #pic="{item}">
+          <div style="width: 100%">
+            <img v-if="item.fileUrl" :src="item.fileUrl" class="pic" @click="openImg(item.fileUrl)" />
+          </div>
+        </template>
+
       </byTable>
     </div>
 
@@ -140,6 +147,14 @@ const config = computed(() => {
   return [
     {
       attrs: {
+        label: "操作时间",
+        prop: "createTime",
+        width: 160,
+        fixed: "left",
+      },
+    },
+    {
+      attrs: {
         label: "单号",
         prop: "code",
         width: 120,
@@ -165,6 +180,14 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "图片",
+        slot: "pic",
+        align: "center",
+        width: 80,
+      },
+    },
+    {
+      attrs: {
         label: "物品编码",
         prop: "productCustomCode",
         width: 160,
@@ -235,13 +258,6 @@ const config = computed(() => {
         width: 110,
       },
     },
-    {
-      attrs: {
-        label: "操作时间",
-        prop: "createTime",
-        width: 160,
-      },
-    },
   ];
 });
 const getDict = () => {
@@ -279,6 +295,8 @@ const getDict = () => {
     .then((res) => {
       lendData.value = res.rows.map((x) => ({
         label:
+          x.code +
+          " " +
           x.expectRestitutionTime.slice(0, 10) +
           " " +
           x.exWarehousePerson +
@@ -289,16 +307,17 @@ const getDict = () => {
     });
 
   proxy
-    .post("/stockJournal/page", {
+    .post("/reportLossesDetails/page", {
       pageNum: 1,
       pageSize: 9999,
-      isSeek: 0,
-      type: "5",
+      type: "2",
     })
     .then((res) => {
-      console.log(res.rows, "sss");
       lendDataOne.value = res.rows.map((x) => ({
-        label: x.code,
+        label:
+          // x.code +
+          // " " +
+          x.repoTime.slice(0, 10) + " " + x.respUserName + " 数量" + x.quantity,
         value: x.id,
       }));
     });
@@ -314,6 +333,19 @@ const getList = async (req) => {
       setTimeout(() => {
         loading.value = false;
       }, 200);
+
+      const productIdList = res.rows.map((x) => x.productId);
+      // 请求文件数据并回显
+      if (productIdList.length > 0) {
+        proxy.getFileData({
+          businessIdList: productIdList,
+          data: sourceList.value.data,
+          att: "productId",
+          businessType: "0",
+          fileAtt: "fileList",
+          filePathAtt: "fileUrl",
+        });
+      }
     });
 };
 getDict();
@@ -383,7 +415,7 @@ const formConfig = computed(() => {
     {
       type: "select",
       prop: "borrowId",
-      label: "借单",
+      label: "借出单",
       data: lendData.value,
       filterable: true,
       itemWidth: 50,
@@ -429,6 +461,7 @@ const rules = ref({
   remarks: [{ required: true, message: "请输入备注", trigger: "blur" }],
 });
 const openModal = () => {
+  getDict();
   formData.data = {
     type: "",
     list: [],

+ 27 - 0
src/views/purchaseSales/outAndInWarehouse/record/index.vue

@@ -10,6 +10,12 @@
             action: () => deriveExcel(),
           }, -->
 
+        <template #pic="{item}">
+          <div style="width: 100%">
+            <img v-if="item.fileUrl" :src="item.fileUrl" class="pic" @click="openImg(item.fileUrl)" />
+          </div>
+        </template>
+
       </byTable>
     </div>
 
@@ -235,6 +241,14 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "图片",
+        slot: "pic",
+        align: "center",
+        width: 80,
+      },
+    },
+    {
+      attrs: {
         label: "物品编码",
         prop: "productCustomCode",
         width: 150,
@@ -331,6 +345,19 @@ const getList = async (req) => {
       setTimeout(() => {
         loading.value = false;
       }, 200);
+
+      const productIdList = res.rows.map((x) => x.productId);
+      // 请求文件数据并回显
+      if (productIdList.length > 0) {
+        proxy.getFileData({
+          businessIdList: productIdList,
+          data: sourceList.value.data,
+          att: "productId",
+          businessType: "0",
+          fileAtt: "fileList",
+          filePathAtt: "fileUrl",
+        });
+      }
     });
 };
 getDict();

+ 28 - 0
src/views/purchaseSales/outAndInWarehouse/waitingForDelivery/index.vue

@@ -3,6 +3,13 @@
     <div class="content">
       <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :selectConfig="selectConfig"
                highlight-current-row @get-list="getList">
+
+        <template #pic="{item}">
+          <div style="width: 100%">
+            <img v-if="item.fileUrl" :src="item.fileUrl" class="pic" @click="openImg(item.fileUrl)" />
+          </div>
+        </template>
+
       </byTable>
     </div>
 
@@ -170,6 +177,14 @@ const config = computed(() => {
     // },
     {
       attrs: {
+        label: "图片",
+        slot: "pic",
+        align: "center",
+        width: 80,
+      },
+    },
+    {
+      attrs: {
         label: "物品编码",
         prop: "productCustomCode",
         width: 140,
@@ -268,6 +283,19 @@ const getList = async (req) => {
       setTimeout(() => {
         loading.value = false;
       }, 200);
+
+      const productIdList = res.rows.map((x) => x.productId);
+      // 请求文件数据并回显
+      if (productIdList.length > 0) {
+        proxy.getFileData({
+          businessIdList: productIdList,
+          data: sourceList.value.data,
+          att: "productId",
+          businessType: "0",
+          fileAtt: "fileList",
+          filePathAtt: "fileUrl",
+        });
+      }
     });
 };
 getDict();

+ 28 - 0
src/views/purchaseSales/outAndInWarehouse/waitingForStorage/index.vue

@@ -3,6 +3,13 @@
     <div class="content">
       <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :selectConfig="selectConfig"
                highlight-current-row @get-list="getList">
+
+        <template #pic="{item}">
+          <div style="width: 100%">
+            <img v-if="item.fileUrl" :src="item.fileUrl" class="pic" @click="openImg(item.fileUrl)" />
+          </div>
+        </template>
+
       </byTable>
     </div>
 
@@ -147,6 +154,14 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "图片",
+        slot: "pic",
+        align: "center",
+        width: 80,
+      },
+    },
+    {
+      attrs: {
         label: "物品编码",
         prop: "productCustomCode",
         width: 140,
@@ -245,6 +260,19 @@ const getList = async (req) => {
       setTimeout(() => {
         loading.value = false;
       }, 200);
+
+      const productIdList = res.rows.map((x) => x.productId);
+      // 请求文件数据并回显
+      if (productIdList.length > 0) {
+        proxy.getFileData({
+          businessIdList: productIdList,
+          data: sourceList.value.data,
+          att: "productId",
+          businessType: "0",
+          fileAtt: "fileList",
+          filePathAtt: "fileUrl",
+        });
+      }
     });
 };
 getDict();

+ 53 - 4
src/views/purchaseSales/stockManage/inventory/index.vue

@@ -23,8 +23,7 @@
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
         <template #products>
           <div style="width: 100%">
-            <el-button type="primary" @click="openProduct = true" style="margin-bottom: 10px" v-if="modalType == 'add'"
-                       :disabled="!formData.data.warehouseId">
+            <el-button type="primary" @click="clickAdd()" style="margin-bottom: 10px" v-if="modalType == 'add'">
               添加物品
             </el-button>
             <el-table :data="formData.data.list" :row-class-name="changeClass">
@@ -68,8 +67,10 @@
       </template>
     </el-dialog>
     <el-dialog v-if="openProduct" v-model="openProduct" title="物品选择" width="90%" append-to-body>
-      <SelectAllGood @selectGood="selectMaterial"></SelectAllGood>
+      <InventoryInquiry :selectStatus="true" :warehouseId="formData.data.warehouseId" @selectGood="selectGood" :key="formData.data.warehouseId">
+      </InventoryInquiry>
 
+      <!-- <SelectAllGood @selectGood="selectMaterial"></SelectAllGood> -->
       <!-- <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
         <el-tab-pane label="产品" name="first">
           <SelectProduct @selectProduct="selectMaterial"></SelectProduct>
@@ -80,6 +81,7 @@
 
       </el-tabs> -->
     </el-dialog>
+
   </div>
 </template>
 
@@ -90,7 +92,9 @@ import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { computed, defineComponent, ref } from "vue";
 import useUserStore from "@/store/modules/user";
-import SelectAllGood from "@/components/product/SelectAllGood";
+import InventoryInquiry from "@/views/purchaseSales/outAndInWarehouse/inventoryInquiry/index";
+
+// import SelectAllGood from "@/components/product/SelectAllGood";
 // import SelectMaterial from "@/components/product/SelectMaterial.vue";
 // import SelectProduct from "@/components/product/SelectProduct.vue";
 const activeName = ref("first");
@@ -418,6 +422,37 @@ const pushGoods = (goods) => {
   }
 };
 
+const clickAdd = () => {
+  if (formData.data.warehouseId) {
+    openProduct.value = true;
+  } else {
+    ElMessage("请先选择仓库");
+  }
+};
+
+const selectGood = (row) => {
+  let flag = formData.data.list.some((x) => x.productId == row.productId);
+  if (!flag) {
+    let fileUrl = "";
+    if (row.fileList && row.fileList.length > 0) {
+      fileUrl = row.fileList[0].fileUrl;
+    }
+    formData.data.list.push({
+      fileUrl: fileUrl,
+      productCode: row.productCustomCode,
+      productId: row.productId,
+      productName: row.productName,
+      productLength: row.productLength,
+      productWidth: row.productWidth,
+      productHeight: row.productHeight,
+      quantity: row.quantity,
+      checkQuantity: null,
+    });
+    proxy.msgTip("选择成功");
+  } else {
+    proxy.msgTip("该物品已选择", 2);
+  }
+};
 const selectMaterial = (row) => {
   let flag = formData.data.list.some((x) => x.productId == row.id);
   if (!flag) {
@@ -546,10 +581,24 @@ const handleClickCode = (row) => {
         x.result = "正常";
       }
     });
+
     formData.data = {
       warehouseId: row.warehouseId,
       list: res.list,
     };
+
+    const productIdList = formData.data.list.map((x) => x.productId);
+    // 请求文件数据并回显
+    if (productIdList.length > 0) {
+      proxy.getFileData({
+        businessIdList: productIdList,
+        data: formData.data.list,
+        att: "productId",
+        businessType: "0",
+        fileAtt: "fileList",
+        filePathAtt: "fileUrl",
+      });
+    }
     dialogVisible.value = true;
   });
 };