Browse Source

多个页面搬迁

cz 1 year ago
parent
commit
f64241ecf4

+ 2 - 2
src/components/PDF/productionPDF.vue

@@ -70,8 +70,8 @@ const props = defineProps({
 const handlePrintPdf = (row) => {
   proxy.post("/productionTaskDetail/detail", { id: row.id }).then((res) => {
     console.log(res, "ada");
-    res.productionTaskDetailRecordList =
-      res.productionTaskDetailRecordList.reverse();
+    // res.productionTaskDetailRecordList =
+    //   res.productionTaskDetailRecordList.reverse();
     res.endCompleteTime =
       res.productionTaskDetailRecordList[
         res.productionTaskDetailRecordList.length - 1

+ 1 - 1
src/components/byForm/index.vue

@@ -556,7 +556,7 @@ loadInit();
 .form-title {
   font-size: 14px;
   font-weight: bold;
-  margin: 15px 0;
+  /* margin: 15px 0; */
   color: #333333;
 }
 .by-form .el-form--inline .el-form-item {

+ 29 - 12
src/views/JXSK/production/qrDetails/index.vue

@@ -188,7 +188,7 @@
           </el-form-item>
           <el-form-item prop="fileList" label="售后附件">
             <div style="width: 100%">
-              <el-upload
+              <!-- <el-upload
                 v-model:fileList="afterSalesForm.fileList"
                 action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
                 :data="uploadData"
@@ -196,14 +196,28 @@
                 :before-upload="uploadFile"
               >
                 <el-button>选择</el-button>
-              </el-upload>
-              <!-- <input
+              </el-upload> -->
+              <input
                 type="file"
                 accept="image/*"
                 capture="camera"
                 multiple
                 @change="handleFileChange"
-              /> -->
+              />
+
+              <div
+                v-if="
+                  afterSalesForm.fileList && afterSalesForm.fileList.length > 0
+                "
+              >
+                <div
+                  v-for="item in afterSalesForm.fileList"
+                  :key="item.id"
+                  style="margin-top: 3px"
+                >
+                  {{ item.fileName }}
+                </div>
+              </div>
             </div>
           </el-form-item>
         </div>
@@ -321,9 +335,9 @@ const submit = () => {
   proxy.$refs.afterSalesRef.validate((valid) => {
     if (valid) {
       loading.value = true;
-      afterSalesForm.value.fileList = afterSalesForm.value.fileList.map(
-        (x) => x.raw
-      );
+      // afterSalesForm.value.fileList = afterSalesForm.value.fileList.map(
+      //   (x) => x.raw
+      // );
       request({
         url: "/open/afterSales/add",
         headers: {
@@ -378,7 +392,7 @@ onMounted(() => {
   });
 });
 
-const handleFileChange = (e) => {
+const handleFileChange = async (e) => {
   const file = e.target.files[0];
   request({
     url: "/open/afterSales/fileInfo/getSing",
@@ -388,17 +402,20 @@ const handleFileChange = (e) => {
     method: "post",
     data: { fileName: file.name },
   }).then((res) => {
+    let forms = new FormData();
+    forms.append("policy", res.data.uploadBody.policy);
+    forms.append("AccessKeyId", res.data.uploadBody.AccessKeyId);
+    forms.append("signature", res.data.uploadBody.signature);
+    forms.append("key", res.data.uploadBody.key);
+    forms.append("file", file);
     request({
       url: "https://winfaster.obs.cn-south-1.myhuaweicloud.com",
       headers: {
         isToken: false,
       },
       method: "post",
-      data: { ...res.data.uploadBody, file },
+      data: forms,
     }).then(() => {
-      file.id = res.data.id;
-      file.fileUrl = res.data.fileUrl;
-      file.fileName = res.data.fileName;
       afterSalesForm.value.fileList.push({
         id: res.data.id,
         fileName: res.data.fileName,

+ 115 - 13
src/views/JXSK/production/schedule/index.vue

@@ -53,18 +53,19 @@
     </el-dialog>
 
     <el-dialog
-      :title="'查看工序附件'"
+      :title="'查看详情'"
       v-model="dialogVisibleOne"
       width="700"
       destroy-on-close
     >
       <div>
+        <TitleInfo content="生产工序"></TitleInfo>
         <div
           v-for="(item, index) in allData"
           :key="item.id"
           style="margin-bottom: 20px"
         >
-          <div style="margin-top: 5px">
+          <div style="margin-top: 5px; font-weight: 700">
             工序名称:{{ item.productionProcessesName }}
           </div>
           <div style="margin-top: 5px">
@@ -75,37 +76,92 @@
           </div>
           <div style="margin-top: 5px">工序结束时间:{{ item.createTime }}</div>
           <div style="margin-top: 5px">
-            上传附件:
-            <span
-              v-for="file in item.fileList"
-              :key="file.id"
-              style="margin-right: 20px; cursor: pointer; color: #409eff"
-              @click="handleOpenFile(file)"
-              >{{ file.fileName }}</span
+            完工拍摄:
+            <div
+              class="att-box"
+              v-if="item.fileList && item.fileList.length > 0"
             >
+              <div v-for="file in item.fileList" :key="file.id">
+                <div v-if="isImg(file.fileUrl)" @click="handleOpenFile(file)">
+                  <img :src="file.fileUrl" alt="" class="img" />
+                </div>
+                <div class="att-item" v-else @click="handleOpenFile(file)">
+                  <img
+                    src="@/assets/images/icon_dz.svg"
+                    style="cursor: pointer"
+                    fit="scale-down"
+                  />
+                  <div class="att-name">
+                    {{ file.fileName }}
+                  </div>
+                </div>
+              </div>
+            </div>
           </div>
+        </div>
+        <TitleInfo content="生产资料"></TitleInfo>
+        <div v-for="(item, index) in allData" :key="item.id">
           <div style="margin-top: 5px">
-            工序附件:
-            <span
+            {{ item.productionProcessesName }}工序附件:
+            <!-- <span
               v-for="file in item.fileListOne"
               :key="file.id"
               style="margin-right: 20px; cursor: pointer; color: #409eff"
               @click="handleOpenFile(file)"
               >{{ file.fileName }}</span
+            > -->
+            <div
+              class="att-box"
+              v-if="item.fileListOne && item.fileListOne.length > 0"
             >
+              <div v-for="file in item.fileListOne" :key="file.id">
+                <div v-if="isImg(file.fileUrl)" @click="handleOpenFile(file)">
+                  <img :src="file.fileUrl" alt="" class="img" />
+                </div>
+                <div class="att-item" v-else @click="handleOpenFile(file)">
+                  <img
+                    src="@/assets/images/icon_dz.svg"
+                    style="cursor: pointer"
+                    fit="scale-down"
+                  />
+                  <div class="att-name">
+                    {{ file.fileName }}
+                  </div>
+                </div>
+              </div>
+            </div>
           </div>
         </div>
-        <TitleInfo content="生产资料"></TitleInfo>
 
         <div style="margin-top: 5px">
           工单附件:
-          <span
+          <!-- <span
             v-for="file in fileData.fileListThree"
             :key="file.id"
             style="margin-right: 20px; cursor: pointer; color: #409eff"
             @click="handleOpenFile(file)"
             >{{ file.fileName }}</span
+          > -->
+          <div
+            class="att-box"
+            v-if="fileData.fileListThree && fileData.fileListThree.length > 0"
           >
+            <div v-for="file in fileData.fileListThree" :key="file.id">
+              <div v-if="isImg(file.fileUrl)" @click="handleOpenFile(file)">
+                <img :src="file.fileUrl" alt="" class="img" />
+              </div>
+              <div class="att-item" v-else @click="handleOpenFile(file)">
+                <img
+                  src="@/assets/images/icon_dz.svg"
+                  style="cursor: pointer"
+                  fit="scale-down"
+                />
+                <div class="att-name">
+                  {{ file.fileName }}
+                </div>
+              </div>
+            </div>
+          </div>
         </div>
       </div>
       <template #footer>
@@ -540,6 +596,18 @@ const getDtl = (row) => {
 const handleOpenFile = (file) => {
   window.open(file.fileUrl, "_blank");
 };
+
+const isImg = (url) => {
+  let suffix = "";
+  const flieArr = url.split(".");
+  suffix = flieArr[flieArr.length - 1];
+  console.log(suffix, "asda");
+  if (suffix != "") {
+    suffix = suffix.toLocaleLowerCase(); //图片格式
+  }
+  const imglist = ["png", "jpg", "jpeg", "bmp", "gif"];
+  return imglist.includes(suffix);
+};
 </script>
 
 <style lang="scss" scoped>
@@ -555,4 +623,38 @@ const handleOpenFile = (file) => {
 .disActive {
   background: #fa9841;
 }
+.att-box {
+  padding: 8px 0;
+  display: flex;
+  flex-wrap: wrap;
+  align-items: center;
+  .att-item {
+    width: 200px;
+    background-color: #eeeeee;
+    height: 28px;
+    line-height: 26px;
+    margin-right: 16px;
+    padding-left: 8px;
+    display: flex;
+    margin-top: 10px;
+    cursor: pointer;
+    // margin-bottom: 8px;
+  }
+  .img {
+    width: 70px;
+    height: 70px;
+    vertical-align: middle;
+    object-fit: contain;
+    margin-right: 16px;
+    cursor: pointer;
+  }
+  .att-name {
+    padding-left: 8px;
+    width: 150px;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    cursor: pointer;
+  }
+}
 </style>

+ 1 - 1
src/views/JXSK/production/task/index.vue

@@ -132,7 +132,7 @@
             </div>
             <div
               style="
-                font-size: 16px;
+                font-size: 14px;
                 font-weight: 700;
                 color: #000;
                 margin-top: 10px;

+ 9 - 9
src/views/JXSK/production/workOrder/index.vue

@@ -473,18 +473,18 @@
         <el-button @click="informationDialog = false" size="large"
           >取 消</el-button
         >
+        <el-button
+          type="primary"
+          @click="submitInformationForm(0)"
+          size="large"
+          :loading="submitLoading"
+          v-if="!showUploadSubmitOne"
+        >
+          暂 存
+        </el-button>
         <span v-if="!showUploadSubmitOne">
           <el-button
             type="primary"
-            @click="submitInformationForm(0)"
-            size="large"
-            :loading="submitLoading"
-          >
-            暂 存
-          </el-button>
-
-          <el-button
-            type="primary"
             @click="submitInformationForm(1)"
             size="large"
             :loading="submitLoading"

+ 57 - 2
src/views/JXSK/salesMange/contract/index.vue

@@ -296,6 +296,7 @@ import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import SelectProduct from "@/components/product/SelectProduct";
 import ContractPDF from "@/components/PDF/jxstContractPDF.vue";
+import { computed } from "vue";
 
 const { proxy } = getCurrentInstance();
 const loading = ref(false);
@@ -309,6 +310,17 @@ const sourceList = ref({
     keyword: "",
   },
 });
+const isSettled = ref([
+  {
+    label: "已结清",
+    value: "1",
+  },
+  {
+    label: "未结清",
+    value: "0",
+  },
+]);
+
 const dialogVisible = ref(false);
 const modalType = ref("add");
 const rules = ref({
@@ -331,7 +343,13 @@ const rules = ref({
   unitPrice: [{ required: true, message: "请输入单价", trigger: "blur" }],
   quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
 });
-const selectConfig = reactive([]);
+const selectConfig = computed(() => [
+  {
+    label: "是否已结清",
+    prop: "isSettled",
+    data: isSettled.value,
+  },
+]);
 const config = computed(() => {
   return [
     {
@@ -388,6 +406,16 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "是否已结清",
+        prop: "isSettled",
+        width: 100,
+      },
+      render(type) {
+        return proxy.dictValueLabel(type, isSettled.value);
+      },
+    },
+    {
+      attrs: {
         label: "备注",
         prop: "remark",
       },
@@ -395,13 +423,40 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: "120",
+        width: "200",
         align: "center",
       },
       renderHTML(row) {
         return [
           {
             attrs: {
+              label: "结清",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              ElMessageBox.confirm("是否确认结清?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+              }).then(() => {
+                proxy
+                  .post("/salesContract/settle", {
+                    id: row.id,
+                  })
+                  .then(() => {
+                    ElMessage({
+                      message: "操作成功",
+                      type: "success",
+                    });
+                    getList();
+                  });
+              });
+            },
+          },
+          {
+            attrs: {
               label: "查看",
               type: "primary",
               text: true,

File diff suppressed because it is too large
+ 503 - 558
src/views/finance/fundManage/flow/index.vue


+ 61 - 2
src/views/purchaseSales/outAndInWarehouse/inventoryInquiry/index.vue

@@ -7,6 +7,7 @@
         :config="config"
         :loading="loading"
         :selectConfig="selectConfig"
+        :statConfig="selectStatus ? [] : statConfig"
         highlight-current-row
         :action-list="[
           selectStatus
@@ -18,6 +19,19 @@
         ]"
         @get-list="getList"
       >
+        <template #quantity="{ item }">
+          <div style="width: 100%; text-align: center">
+            <div
+              v-if="item.quantity < Number(item.stockThreshold)"
+              style="color: red; font-weight: 700"
+            >
+              {{ item.quantity }}
+            </div>
+            <div v-else>
+              {{ item.quantity }}
+            </div>
+          </div>
+        </template>
         <template #btn="{ item }">
           <div style="width: 100%; text-align: center">
             <el-button
@@ -80,6 +94,7 @@ const sourceList = ref({
     pageSize: 10,
     keyword: "",
     id: "",
+    isStockThreshold: "0",
   },
 });
 const productUnit = ref([]);
@@ -104,6 +119,16 @@ const selectConfig = computed(() => {
       prop: "id",
       data: warehouseList.value,
     },
+    // {
+    //   label: "库存预警",
+    //   prop: "isStockThreshold",
+    //   data: [
+    //     {
+    //       label: "不过滤",
+    //       value: "0",
+    //     },
+    //   ],
+    // },
   ];
 });
 const config = computed(() => {
@@ -160,7 +185,7 @@ const config = computed(() => {
       attrs: {
         label: "单位",
         prop: "productUnit",
-        width: 120,
+        width: 80,
       },
       render(unit) {
         return proxy.dictDataEcho(unit, productUnit.value);
@@ -168,8 +193,15 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "安全库存",
+        prop: "stockThreshold",
+        width: 140,
+      },
+    },
+    {
+      attrs: {
         label: "库存数量",
-        prop: "quantity",
+        slot: "quantity",
         width: 140,
       },
     },
@@ -240,6 +272,33 @@ const getList = async (req) => {
 };
 getDict();
 getList();
+const headerData = ref({
+  stockThresholdQuantity: 0,
+});
+const getHeaderData = () => {
+  proxy.get("/stock/getHeadStatistic").then((res) => {
+    headerData.value = res.data;
+  });
+};
+
+const statConfig = computed(() => [
+  {
+    label: "统计",
+    data: [
+      {
+        label: "库存预警",
+        type: 2,
+        num: headerData.value.stockThresholdQuantity,
+        click: () => {
+          sourceList.value.pagination.isStockThreshold =
+            sourceList.value.pagination.isStockThreshold == "0" ? "1" : "0";
+          getList();
+        },
+      },
+    ],
+  },
+]);
+getHeaderData();
 const checkTheFlow = (item) => {
   proxy.$router.replace({
     path: "/purchaseSales/stockManage/record",

+ 0 - 34
src/views/purchaseSales/stockManage/inventory/index.vue

@@ -240,40 +240,6 @@ const config = computed(() => {
         prop: "anomalyNum",
       },
     },
-    // {
-    //   attrs: {
-    //     label: "操作",
-    //     width: "200",
-    //     align: "right",
-    //   },
-    //   // 渲染 el-button,一般用在最后一列。
-    //   renderHTML(row) {
-    //     return [
-    //       {
-    //         attrs: {
-    //           label: "接收",
-    //           type: "primary",
-    //           text: true,
-    //         },
-    //         el: "button",
-    //         click() {
-    //           getDtl(row);
-    //         },
-    //       },
-    //       {
-    //         attrs: {
-    //           label: "打印",
-    //           type: "primary",
-    //           text: true,
-    //         },
-    //         el: "button",
-    //         click() {
-    //           getDtl(row);
-    //         },
-    //       },
-    //     ];
-    //   },
-    // },
   ];
 });
 

+ 247 - 63
src/views/salesMange/saleContract/claim/index.vue

@@ -8,34 +8,138 @@
       highlight-current-row
       :selectConfig="selectConfig"
       :action-list="[]"
-      @get-list="getList">
-      <template #money="{ item }"> {{ item.currency }} {{ moneyFormat(item.amount) }} </template>
+      @get-list="getList"
+    >
+      <template #money="{ item }">
+        {{ item.currency }} {{ moneyFormat(item.amount) }}
+      </template>
       <template #isClaim="{ item }">
         <div style="width: 100%">
           <span v-if="item.isClaim == 0">未认领</span>
-          <a style="color: #409eff; cursor: pointer" @click="clickRecord(item)" v-else-if="item.isClaim == 1">已认领</a>
-          <a style="color: #409eff; cursor: pointer" @click="clickRecord(item)" v-else>部分认领</a>
+          <a
+            style="color: #409eff; cursor: pointer"
+            @click="clickRecord(item)"
+            v-else-if="item.isClaim == 1"
+            >已认领</a
+          >
+          <a
+            style="color: #409eff; cursor: pointer"
+            @click="clickRecord(item)"
+            v-else
+            >部分认领</a
+          >
         </div>
       </template>
     </byTable>
 
-    <el-dialog title="认领" v-if="dialogVisible" v-model="dialogVisible" width="500" v-loading="loading">
-      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
+    <el-dialog
+      title="认领"
+      v-if="dialogVisible"
+      v-model="dialogVisible"
+      width="50%"
+      v-loading="loading"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
         <template #detail>
           <div style="width: 100%">
-            <el-button type="primary" style="margin-bottom: 10px" @click="dialogVisibleOne = true">选择合同</el-button>
+            <el-button
+              type="primary"
+              style="margin-bottom: 10px"
+              @click="dialogVisibleOne = true"
+              >选择合同</el-button
+            >
             <el-table :data="formData.data.claimContractList">
-              <el-table-column prop="contractCode" label="合同编码" />
+              <el-table-column
+                prop="contractCode"
+                label="合同编码"
+                width="140"
+              />
+              <el-table-column label="合同金额" width="140">
+                <template #default="{ row, $index }">
+                  {{ row.currency }}{{ moneyFormat(row.contractTotal, 2) }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="sumContractNotClaimMoney"
+                label="未结清金额"
+                width="100"
+              />
               <el-table-column prop="money" label="关联金额" min-width="150">
                 <template #default="{ row, $index }">
-                  <el-form-item :prop="'claimContractList.' + $index + '.money'" :rules="rules.money" :inline-message="true">
-                    <el-input-number v-model="row.money" :precision="2" :controls="false" :min="0" onmousewheel="return false;" />
+                  <el-form-item
+                    :prop="'claimContractList.' + $index + '.money'"
+                    :rules="rules.money"
+                    :inline-message="true"
+                  >
+                    <el-input-number
+                      v-model="row.money"
+                      :precision="2"
+                      :controls="false"
+                      :min="0"
+                      onmousewheel="return false;"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="claimType"
+                label="到账类型"
+                min-width="150"
+              >
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'claimContractList.' + $index + '.claimType'"
+                    :rules="rules.claimType"
+                    :inline-message="true"
+                  >
+                    <el-select v-model="row.claimType" style="width: 100%">
+                      <el-option
+                        v-for="item in claimTypeList"
+                        :key="item.value"
+                        :label="item.label"
+                        :value="item.value"
+                      />
+                    </el-select>
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="contractMoney"
+                label="换算金额"
+                min-width="150"
+              >
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'claimContractList.' + $index + '.contractMoney'"
+                    :rules="rules.contractMoney"
+                    :inline-message="true"
+                  >
+                    <el-input-number
+                      v-model="row.contractMoney"
+                      :precision="2"
+                      :controls="false"
+                      :min="0"
+                      onmousewheel="return false;"
+                    />
                   </el-form-item>
                 </template>
               </el-table-column>
-              <el-table-column prop="zip" label="操作" width="100">
+              <el-table-column
+                prop="zip"
+                label="操作"
+                width="60"
+                align="center"
+              >
                 <template #default="{ $index }">
-                  <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
+                  <el-button type="primary" link @click="handleRemove($index)"
+                    >删除</el-button
+                  >
                 </template>
               </el-table-column>
             </el-table>
@@ -52,7 +156,8 @@
               :on-preview="handlePreview"
               :on-remove="handleRemove"
               :on-success="handleSuccess"
-              :before-upload="handleBeforeUpload">
+              :before-upload="handleBeforeUpload"
+            >
               <el-button type="primary">选择</el-button>
             </el-upload>
             <div>
@@ -64,7 +169,8 @@
                   v-for="(item, index) in fileListCopy"
                   :key="index"
                   closable
-                  @close="handleClose(index)">
+                  @close="handleClose(index)"
+                >
                   {{ item.fileName }}
                 </el-tag>
               </div>
@@ -74,20 +180,53 @@
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm('byform')" size="large" :loading="submitLoading"> 确 定 </el-button>
+        <el-button
+          type="primary"
+          @click="submitForm('byform')"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
       </template>
     </el-dialog>
 
-    <el-dialog title="合同选择" v-if="dialogVisibleOne" v-model="dialogVisibleOne" width="80%" v-loading="loading" destroy-on-close>
-      <ContractSelect @handleSelectContrct="handleSelectContrct"></ContractSelect>
+    <el-dialog
+      title="合同选择"
+      v-if="dialogVisibleOne"
+      v-model="dialogVisibleOne"
+      width="80%"
+      v-loading="loading"
+      destroy-on-close
+    >
+      <ContractSelect
+        @handleSelectContrct="handleSelectContrct"
+      ></ContractSelect>
     </el-dialog>
 
-    <el-dialog title="认领记录" v-if="openRecord" v-model="openRecord" width="500">
-      <byForm :formConfig="formRecordConfig" :formOption="formOption" v-model="rowData.data">
+    <el-dialog
+      title="认领记录"
+      v-if="openRecord"
+      v-model="openRecord"
+      width="500"
+    >
+      <byForm
+        :formConfig="formRecordConfig"
+        :formOption="formOption"
+        v-model="rowData.data"
+      >
         <template #recordList>
           <div>
-            <div style="width: 100%" v-if="rowData.data.recordList && rowData.data.recordList.length > 0">
-              <div v-for="(item, index) in rowData.data.recordList" :key="index">
+            <div
+              style="width: 100%"
+              v-if="
+                rowData.data.recordList && rowData.data.recordList.length > 0
+              "
+            >
+              <div
+                v-for="(item, index) in rowData.data.recordList"
+                :key="index"
+              >
                 <div style="color: #ccc">{{ item.createTime }}</div>
                 <div>认领人: {{ item.claimUserName }}</div>
                 <div>合同编号: {{ item.contractCode }}</div>
@@ -112,7 +251,7 @@ import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { computed, ref } from "vue";
 import useUserStore from "@/store/modules/user";
-import ContractSelect from "@/views/salesMange/saleContract/contractSelect/index";
+import ContractSelect from "@/views/salesMange/saleContract/jxstContractSelect/index";
 
 const { proxy } = getCurrentInstance();
 const uploadData = ref({});
@@ -135,6 +274,11 @@ let dialogVisibleOne = ref(false);
 let modalType = ref("add");
 let rules = ref({
   money: [{ required: true, message: "请输入关联金额", trigger: "blur" }],
+  claimType: [{ required: true, message: "请选择到账类型", trigger: "change" }],
+  moneyCny: [{ required: true, message: "请输入换算 CNY", trigger: "blur" }],
+  contractMoney: [
+    { required: true, message: "请输入换算金额", trigger: "blur" },
+  ],
 });
 const claim = ref([
   {
@@ -150,12 +294,19 @@ const claim = ref([
     value: "2",
   },
 ]);
-const selectConfig = reactive([
+const claimTypeList = ref([]);
+const accountList = ref([]);
+const selectConfig = computed(() => [
   {
     label: "认领状态",
     prop: "isClaim",
     data: claim.value,
   },
+  {
+    label: "账户名称",
+    prop: "accountManagementId",
+    data: accountList.value,
+  },
 ]);
 const config = computed(() => {
   return [
@@ -247,24 +398,33 @@ const config = computed(() => {
                 },
                 el: "button",
                 click() {
-                  ElMessageBox.confirm("是否确定取消认领?", "提示", {
-                    confirmButtonText: "确定",
-                    cancelButtonText: "取消",
-                    type: "warning",
-                  }).then(() => {
-                    // 删除
-                    proxy
-                      .post("/claim/delete", {
-                        id: row.id,
-                      })
-                      .then((res) => {
-                        ElMessage({
-                          message: "操作成功",
-                          type: "success",
-                        });
-                        getList();
-                      });
+                  proxy.$router.replace({
+                    path: "/platform_manage/process/processApproval",
+                    query: {
+                      flowKey: "claim_del_flow",
+                      flowName: "取消认领发起",
+                      random: proxy.random(),
+                      businessId: row.id,
+                    },
                   });
+                  // ElMessageBox.confirm("是否确定取消认领?", "提示", {
+                  //   confirmButtonText: "确定",
+                  //   cancelButtonText: "取消",
+                  //   type: "warning",
+                  // }).then(() => {
+                  //   // 删除
+                  //   proxy
+                  //     .post("/claim/delete", {
+                  //       id: row.id,
+                  //     })
+                  //     .then((res) => {
+                  //       ElMessage({
+                  //         message: "操作成功",
+                  //         type: "success",
+                  //       });
+                  //       getList();
+                  //     });
+                  // });
                 },
               }
             : {},
@@ -347,16 +507,19 @@ const formConfig = reactive([
     label: "上传附件",
   },
 ]);
+
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/accountRunningWater/page", sourceList.value.pagination).then((message) => {
-    sourceList.value.data = message.rows;
-    sourceList.value.pagination.total = message.total;
-    setTimeout(() => {
-      loading.value = false;
-    }, 200);
-  });
+  proxy
+    .post("/accountRunningWater/page", sourceList.value.pagination)
+    .then((message) => {
+      sourceList.value.data = message.rows;
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
 };
 const submitForm = () => {
   byform.value.handleSubmit((valid) => {
@@ -375,6 +538,12 @@ const submitForm = () => {
           type: "info",
         });
       }
+      // if (!(e.moneyCny > 0)) {
+      //   return ElMessage({
+      //     message: "换算CNY不能为0!",
+      //     type: "info",
+      //   });
+      // }
     }
     const total = list.reduce((total, x) => (total += Number(x.money)), 0);
     if (total > Number(formData.data.waitAmount)) {
@@ -405,42 +574,48 @@ const submitForm = () => {
   });
 };
 const rowCurrency = ref("");
+const rowRate = ref("");
 const getDtl = (row) => {
   rowCurrency.value = row.currency;
+  rowRate.value = row.rate;
   proxy.get(`/claim/sumClaimMoney?businessId=${row.id}`).then((res) => {
     modalType.value = "edit";
     dialogVisible.value = true;
     formData.data = {
       businessId: row.id,
-      rate: row.rate,
       status: row.status + "",
       currency: row.currency,
-      waitAmount: Math.round((Number(row.amount) - Number(res.data))* 100) / 100,
+      waitAmount: Number(row.amount) - Number(res.data),
       accountManagementId: row.accountManagementId,
       accountManagementName: row.accountManagementName,
       claimTime: row.transactionTime,
       claimContractList: [],
+      rate: rowRate.value,
     };
     dialogVisible.value = true;
   });
 };
 
-const warehouseType = ref([]);
 const getDict = () => {
   proxy
-    .post("/dictTenantData/page", {
-      pageNum: 1,
-      pageSize: 999,
-      tenantId: useUserStore().user.tenantId,
-      dictCode: "warehouse_type",
-    })
+    .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
     .then((res) => {
-      warehouseType.value = res.rows;
-      formConfig[0].data = res.rows.map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
-      }));
+      if (res.rows && res.rows.length > 0) {
+        accountList.value = res.rows.map((item) => {
+          return {
+            label: item.alias,
+            value: item.id,
+          };
+        });
+      }
     });
+
+  proxy.getDictOne(["claim_type"]).then((res) => {
+    claimTypeList.value = res["claim_type"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
 };
 const handleBeforeUpload = async (file) => {
   const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
@@ -471,17 +646,26 @@ const handleRemove = (index) => {
   });
 };
 const handleSelectContrct = (row) => {
-  const flag = formData.data.claimContractList.some((x) => x.contractId === row.id);
+  const flag = formData.data.claimContractList.some(
+    (x) => x.contractId === row.id
+  );
   if (flag)
     return ElMessage({
       message: "该合同已选择",
       type: "info",
     });
   formData.data.claimContractList.push({
+    dataType: row.dataType,
     contractId: row.id,
     contractCode: row.code,
     money: 0,
-    currency: rowCurrency.value,
+    currency: row.currency,
+    rate: rowRate.value,
+    claimType: "",
+    moneyCny: null,
+    contractTotal: row.amount,
+    sumContractNotClaimMoney: row.sumContractNotClaimMoney,
+    contractMoney: null,
   });
   return ElMessage({
     message: "选择成功",

+ 829 - 0
src/views/salesMange/saleContract/jxstContractSelect/index.vue

@@ -0,0 +1,829 @@
+<template>
+  <div class="tenant">
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :selectConfig="selectConfig"
+        :table-events="{
+          select: select,
+        }"
+        :action-list="[
+          {
+            text: '添加合同',
+            action: () => openModal('add'),
+          },
+        ]"
+        @get-list="getList"
+      >
+      </byTable>
+    </div>
+    <el-dialog
+      :title="modalType == 'add' ? '添加合同' : '查看合同'"
+      v-model="dialogVisible"
+      width="80%"
+      v-loading="loading"
+      destroy-on-close
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
+        <template #seller>
+          <div style="width: 100%">
+            <el-form-item label="卖方公司" prop="sellCorporationId" required>
+              <el-select
+                v-model="formData.data.sellCorporationId"
+                @change="changeSellId"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in corporationList"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                />
+              </el-select>
+            </el-form-item>
+            <el-row>
+              <el-col :span="24">
+                <el-row style="margin-top: 20px; width: 100%">
+                  <el-col :span="7">
+                    <el-form-item label="地址" prop="sellCountryName">
+                      <el-input
+                        v-model="formData.data.sellCountryName"
+                        placeholder="请输入国家"
+                      />
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="1"></el-col>
+                  <el-col :span="7">
+                    <el-form-item label=" " prop="sellProvinceName">
+                      <el-input
+                        v-model="formData.data.sellProvinceName"
+                        placeholder="请输入省/州"
+                      />
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="1"></el-col>
+                  <el-col :span="8">
+                    <el-form-item label=" " prop="sellCityName">
+                      <el-input
+                        v-model="formData.data.sellCityName"
+                        placeholder="请输入城市"
+                      />
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+                <el-row style="margin-top: 20px; width: 100%">
+                  <el-col :span="24">
+                    <el-form-item prop="sellAddress">
+                      <el-input
+                        v-model="formData.data.sellAddress"
+                        type="textarea"
+                      >
+                      </el-input>
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+              </el-col>
+            </el-row>
+          </div>
+        </template>
+        <template #shroffAccountId>
+          <div style="width: 100%; margin-top: -30px; margin-bottom: 30px">
+            <el-form-item label="收款账号" prop="shroffAccountId" required>
+              <el-select
+                v-model="formData.data.shroffAccountId"
+                placeholder="请选择收款账号"
+                @change="changeShroffAccount"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in accountList"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                />
+              </el-select>
+            </el-form-item>
+
+            <el-row style="margin-top: 20px">
+              <el-col :span="11">
+                <el-form-item label="账户名" prop="sellAccountName">
+                  <el-input
+                    v-model="formData.data.sellAccountName"
+                    placeholder="请输入账户名"
+                  />
+                </el-form-item>
+                <div style="height: 20px"></div>
+                <el-form-item label="账号" prop="sellAccountOpening">
+                  <el-input
+                    v-model="formData.data.sellAccountOpening"
+                    placeholder="请输入账号"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="1"></el-col>
+              <el-col :span="12">
+                <el-form-item label="开户行" prop="sellOpeningBank">
+                  <el-input
+                    v-model="formData.data.sellOpeningBank"
+                    placeholder="请输入开户行"
+                  />
+                </el-form-item>
+                <div style="height: 20px"></div>
+                <el-form-item label="银行号" prop="sellInterbankNumber">
+                  <el-input
+                    v-model="formData.data.sellInterbankNumber"
+                    placeholder="请输入银行号"
+                  />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </div>
+        </template>
+        <template #products>
+          <div style="width: 100%">
+            <el-button type="primary" plain @click="openProduct = true">
+              添加明细
+            </el-button>
+            <el-table
+              :data="formData.data.salesContractDetailsList"
+              style="margin-top: 10px"
+            >
+              <el-table-column
+                prop="productName"
+                label="产品名称"
+                width="280"
+              />
+              <el-table-column
+                prop="productSpec"
+                label="规格型号"
+                width="100"
+              />
+              <el-table-column prop="isCustomized" label="是否定制" width="120">
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="
+                      'salesContractDetailsList.' + $index + '.isCustomized'
+                    "
+                    :rules="rules.isCustomized"
+                    :inline-message="true"
+                  >
+                    <el-select
+                      v-model="row.isCustomized"
+                      class="m-2"
+                      placeholder="请选择"
+                    >
+                      <el-option key="1" label="是" value="1" />
+                      <el-option key="0" label="否" value="0" />
+                    </el-select>
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column prop="unitPrice" label="单价" width="130">
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'salesContractDetailsList.' + $index + '.unitPrice'"
+                    :rules="rules.unitPrice"
+                    :inline-message="true"
+                  >
+                    <el-input-number
+                      onmousewheel="return false;"
+                      v-model="row.unitPrice"
+                      :precision="2"
+                      :controls="false"
+                      :min="0"
+                      @change="changeAmount"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column prop="quantity" label="数量" width="130">
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'salesContractDetailsList.' + $index + '.quantity'"
+                    :rules="rules.quantity"
+                    :inline-message="true"
+                  >
+                    <el-input-number
+                      onmousewheel="return false;"
+                      v-model="row.quantity"
+                      :precision="0"
+                      :controls="false"
+                      :min="0"
+                      @change="changeAmount"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column prop="total" label="金额小计" width="100" />
+              <el-table-column prop="productRemark" label="备注">
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="
+                      'salesContractDetailsList.' + $index + '.productRemark'
+                    "
+                    :rules="rules.productRemark"
+                    :inline-message="true"
+                  >
+                    <el-input
+                      v-model="row.productRemark"
+                      placeholder="请输入"
+                      type="textarea"
+                      :rows="3"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column prop="zip" label="操作" width="60">
+                <template #default="{ $index }">
+                  <el-button type="primary" link @click="handleRemove($index)"
+                    >删除</el-button
+                  >
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm()"
+          size="large"
+          :loading="submitLoading"
+          v-if="modalType == 'add'"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+
+    <el-dialog v-model="openProduct" title="选择产品" width="70%">
+      <SelectProduct @handleSelect="handleSelect"></SelectProduct>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="openProduct = false">取消</el-button>
+        </span>
+      </template>
+    </el-dialog>
+
+    <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="640">
+      <ContractPDF :rowData="rowData"></ContractPDF>
+      <template #footer>
+        <el-button @click="openPrint = false" size="large">取消</el-button>
+        <el-button v-print="printObj" size="large">打印</el-button>
+        <el-button type="primary" @click="clickDownload()" size="large"
+          >下载PDF</el-button
+        >
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import { ElMessage, ElMessageBox } from "element-plus";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import SelectProduct from "@/components/product/SelectProduct";
+import ContractPDF from "@/components/PDF/jxstContractPDF.vue";
+import { computed } from "vue";
+
+const { proxy } = getCurrentInstance();
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+  },
+});
+const isSettled = ref([
+  {
+    label: "已结清",
+    value: "1",
+  },
+  {
+    label: "未结清",
+    value: "0",
+  },
+]);
+
+const dialogVisible = ref(false);
+const modalType = ref("add");
+const rules = ref({
+  customerId: [
+    { required: true, message: "请选择客户名称", trigger: "change" },
+  ],
+  shroffAccountId: [
+    { required: true, message: "请选择收款账户", trigger: "change" },
+  ],
+  deliveryDate: [
+    { required: true, message: "请选择交货期限", trigger: "change" },
+  ],
+  payMethod: [{ required: true, message: "请选择付款方式", trigger: "change" }],
+  freightPayer: [
+    { required: true, message: "请选择运费支付方", trigger: "change" },
+  ],
+  isCustomized: [
+    { required: true, message: "请选择是否定制", trigger: "change" },
+  ],
+  unitPrice: [{ required: true, message: "请输入单价", trigger: "blur" }],
+  quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
+});
+const selectConfig = computed(() => [
+  {
+    label: "是否已结清",
+    prop: "isSettled",
+    data: isSettled.value,
+  },
+]);
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "合同号",
+        prop: "code",
+      },
+    },
+    {
+      attrs: {
+        label: "客户名称",
+        prop: "customerName",
+      },
+    },
+
+    {
+      attrs: {
+        label: "合同金额",
+        prop: "contractAmount",
+      },
+      render(contractAmount) {
+        return proxy.moneyFormat(contractAmount, 2);
+      },
+    },
+    {
+      attrs: {
+        label: "签订时间",
+        prop: "createTime",
+      },
+    },
+    {
+      attrs: {
+        label: "交货期限",
+        prop: "deliveryDate",
+      },
+    },
+    {
+      attrs: {
+        label: "付款方式",
+        prop: "payMethod",
+      },
+      render(payMethod) {
+        return proxy.dictValueLabel(payMethod, payMethodData.value);
+      },
+    },
+    {
+      attrs: {
+        label: "运费支付方",
+        prop: "freightPayer",
+      },
+      render(freightPayer) {
+        return proxy.dictValueLabel(freightPayer, freightPayerData.value);
+      },
+    },
+    {
+      attrs: {
+        label: "是否已结清",
+        prop: "isSettled",
+        width: 100,
+      },
+      render(type) {
+        return proxy.dictValueLabel(type, isSettled.value);
+      },
+    },
+    {
+      attrs: {
+        label: "备注",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "200",
+        align: "center",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "选择",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              handleSelect(row);
+            },
+          },
+
+          // {
+          //   attrs: {
+          //     label: "结清",
+          //     type: "primary",
+          //     text: true,
+          //   },
+          //   el: "button",
+          //   click() {
+          //     ElMessageBox.confirm("是否确认结清?", "提示", {
+          //       confirmButtonText: "确定",
+          //       cancelButtonText: "取消",
+          //       type: "warning",
+          //     }).then(() => {
+          //       proxy
+          //         .post("/salesContract/settle", {
+          //           id: row.id,
+          //         })
+          //         .then(() => {
+          //           ElMessage({
+          //             message: "操作成功",
+          //             type: "success",
+          //           });
+          //           getList();
+          //         });
+          //     });
+          //   },
+          // },
+          // {
+          //   attrs: {
+          //     label: "查看",
+          //     type: "primary",
+          //     text: true,
+          //   },
+          //   el: "button",
+          //   click() {
+          //     getDtl(row);
+          //   },
+          // },
+          // {
+          //   attrs: {
+          //     label: "打印",
+          //     type: "primary",
+          //     text: true,
+          //   },
+          //   el: "button",
+          //   click() {
+          //     clickPrint(row);
+          //   },
+          // },
+        ];
+      },
+    },
+  ];
+});
+const formData = reactive({
+  data: {},
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const formConfig = computed(() => {
+  return [
+    {
+      type: "slot",
+      slotName: "seller",
+      label: "",
+    },
+    {
+      type: "slot",
+      slotName: "shroffAccountId",
+      label: "",
+    },
+    {
+      type: "select",
+      prop: "customerId",
+      label: "客户名称",
+      required: true,
+      filterable: true,
+      data: customerData.value,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "date",
+      itemType: "date",
+      prop: "deliveryDate",
+      label: "交货期限",
+      required: true,
+      itemWidth: 30,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      prop: "deliveryDateRemark",
+      label: "交货期备注",
+      itemWidth: 70,
+    },
+    {
+      type: "select",
+      prop: "payMethod",
+      label: "付款方式",
+      required: true,
+      data: payMethodData.value,
+      itemWidth: 30,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      prop: "payMethodRemark",
+      label: "付款方式备注",
+      itemWidth: 70,
+    },
+    {
+      type: "select",
+      prop: "freightPayer",
+      label: "运费支付方",
+      required: true,
+      data: freightPayerData.value,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      prop: "remark",
+      label: "备注",
+    },
+    {
+      type: "number",
+      disabled: true,
+      prop: "contractAmount",
+      label: "合同总金额",
+      precision: 2,
+      min: 0,
+      controls: false,
+      itemWidth: 30,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "slot",
+      slotName: "products",
+      label: "合同明细",
+    },
+  ];
+});
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/salesContract/page", sourceList.value.pagination)
+    .then((message) => {
+      sourceList.value.data = message.rows;
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
+};
+const openModal = () => {
+  dialogVisible.value = true;
+  modalType.value = "add";
+  formOption.disabled = false;
+  formData.data = {
+    salesContractDetailsList: [],
+  };
+};
+
+const submitForm = () => {
+  byform.value.handleSubmit(() => {
+    if (!formData.data.salesContractDetailsList.length > 0) {
+      return ElMessage({
+        message: "请添加合同明细",
+        type: "info",
+      });
+    }
+    submitLoading.value = true;
+    proxy
+      .post("/flowProcess/initiate", {
+        flowKey: "jxst_sales_contract_flow",
+        data: formData.data,
+      })
+      .then(
+        () => {
+          ElMessage({
+            message: "添加成功",
+            type: "success",
+          });
+          dialogVisible.value = false;
+          submitLoading.value = false;
+          getList();
+        },
+        (err) => {
+          console.log(err);
+          submitLoading.value = false;
+        }
+      );
+  });
+};
+const getDtl = (row) => {
+  modalType.value = "detail";
+  formOption.disabled = true;
+  proxy.post("/salesContract/detail", { id: row.id }).then((res) => {
+    if (res && res.contractDetailsList.length > 0) {
+      res.salesContractDetailsList = res.contractDetailsList;
+    } else {
+      res.salesContractDetailsList = [];
+    }
+    formData.data = res;
+    changeAmount();
+    dialogVisible.value = true;
+  });
+};
+
+const customerData = ref([]);
+const accountList = ref([]);
+const corporationList = ref([]);
+const payMethodData = ref([]);
+const freightPayerData = ref([
+  {
+    label: "甲方",
+    value: "0",
+  },
+  {
+    label: "乙方",
+    value: "1",
+  },
+]);
+const getDict = () => {
+  proxy.post("/customer/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
+    customerData.value = res.rows.map((x) => ({
+      label: x.name,
+      value: x.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.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    corporationList.value = res.rows.map((item) => {
+      return {
+        ...item,
+        label: item.name,
+        value: item.id,
+      };
+    });
+  });
+  proxy.getDict(["funds_payment_method"]).then((res) => {
+    payMethodData.value = res["funds_payment_method"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+};
+getDict();
+getList();
+const openProduct = ref(false);
+// const handleSelect = (row) => {
+//   formData.data.salesContractDetailsList.push({
+//     productName: row.name,
+//     productSpec: row.spec,
+//     productId: row.id,
+//     quantity: null,
+//   });
+//   return ElMessage({
+//     message: "选择成功",
+//     type: "success",
+//   });
+//   // const flag = formData.data.salesContractDetailsList.some(
+//   //   (x) => x.productId === row.id
+//   // );
+//   // if (!flag) {
+//   //   formData.data.salesContractDetailsList.push({
+//   //     productName: row.name + ` (${row.spec})`,
+//   //     productId: row.id,
+//   //     quantity: null,
+//   //   });
+//   //   return ElMessage({
+//   //     message: "选择成功",
+//   //     type: "success",
+//   //   });
+//   // }
+//   // return ElMessage({
+//   //   message: "该产品已选择",
+//   //   type: "info",
+//   // });
+// };
+const handleRemove = (index) => {
+  formData.data.salesContractDetailsList.splice(index, 1);
+  changeAmount();
+};
+
+const changeAmount = () => {
+  let total = 0;
+  for (let i = 0; i < formData.data.salesContractDetailsList.length; i++) {
+    const e = formData.data.salesContractDetailsList[i];
+    e.total = "";
+    if (e.quantity && e.unitPrice) {
+      e.total = parseFloat(Number(e.quantity) * Number(e.unitPrice)).toFixed(2);
+    }
+    total += Number(e.total);
+  }
+  formData.data.contractAmount = parseFloat(total).toFixed(2);
+};
+const changeSellId = (val) => {
+  if (val) {
+    proxy.post("/corporation/detail", { id: val }).then((detailCorporation) => {
+      if (detailCorporation.countryName) {
+        formData.data.sellCountryName = detailCorporation.countryName;
+      }
+      if (detailCorporation.provinceName) {
+        formData.data.sellProvinceName = detailCorporation.provinceName;
+      }
+      if (detailCorporation.cityName) {
+        formData.data.sellCityName = detailCorporation.cityName;
+      }
+      if (detailCorporation.address) {
+        formData.data.sellAddress = detailCorporation.address;
+      }
+    });
+  }
+};
+const changeShroffAccount = (val) => {
+  if (val) {
+    let data = accountList.value.filter((item) => item.value === val);
+    if (data && data.length > 0) {
+      formData.data.sellAccountName = data[0].name;
+      formData.data.sellOpeningBank = data[0].openingBank;
+      formData.data.sellInterbankNumber = data[0].interbankNumber;
+      formData.data.sellAccountOpening = data[0].accountOpening;
+    }
+  }
+};
+const rowData = ref({});
+const openPrint = ref(false);
+const clickPrint = (row) => {
+  rowData.value = {
+    id: row.id,
+  };
+  openPrint.value = true;
+};
+const printObj = ref({
+  id: "pdfDom",
+  popTitle: "",
+  extraCss:
+    "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
+  extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
+});
+const clickDownload = () => {
+  proxy.getPdf("购销合同PDF文件");
+};
+
+const handleSelect = (row) => {
+  proxy.$emit("handleSelectContrct", row);
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>

Some files were not shown because too many files changed in this diff