瀏覽代碼

jxst新需求

cz 1 年之前
父節點
當前提交
8fecb8e12c

+ 291 - 0
src/components/PDF/jxstContractPDF.vue

@@ -0,0 +1,291 @@
+<template>
+  <div>
+    <div id="pdfDom" ref="pdfDom" style="font-family: 'msyh'">
+      <div>
+        <div class="title">购销合同</div>
+        <div style="display: flex; margin-bottom: 20px">
+          <div style="width: 50%; padding-right: 20px">
+            <div style="display: flex">
+              <div>甲 方:</div>
+              <div style="border-bottom: 1px solid #000; flex: 1">
+                {{ pdfData.customerName }}
+              </div>
+            </div>
+
+            <div style="display: flex; margin-top: 10px">
+              <div>乙 方:</div>
+              <div style="border-bottom: 1px solid #000; flex: 1">
+                {{ pdfData.sellCorporationName }}
+              </div>
+            </div>
+          </div>
+          <div style="width: 50%">
+            <div style="display: flex">
+              <div>合 同 编 号:</div>
+              <div style="border-bottom: 1px solid #000; flex: 1">
+                {{ pdfData.code }}
+              </div>
+            </div>
+
+            <div style="display: flex; margin-top: 10px">
+              <div>签 订 日 期:</div>
+              <div style="border-bottom: 1px solid #000; flex: 1">
+                {{ pdfData.createTime }}
+              </div>
+            </div>
+          </div>
+        </div>
+        <div style="text-indent: 2em">
+          兹因甲方向乙方订购以下产品,根据《中华人民共和国合同法》及相关法律、法规双方协商一致,签订合同。
+        </div>
+        <table border="1" style="width: 100%" class="table">
+          <tr>
+            <td style="width: 50px">序号</td>
+            <td>产品名称型号</td>
+            <td style="width: 60px">单位</td>
+            <td style="width: 60px">数量</td>
+            <td style="width: 80px">单价</td>
+            <td style="width: 80px">金额</td>
+            <td style="width: 80px">备注</td>
+          </tr>
+          <tr v-for="(row, index) in pdfData.contractDetailsList" :key="row.id">
+            <td style="width: 50px">{{ index + 1 }}</td>
+            <td>{{ row.productName }}({{ row.productSpec }})</td>
+            <td style="width: 60px">{{ row.productUnit }}</td>
+            <td style="width: 60px">{{ row.quantity }}</td>
+            <td style="width: 80px">
+              {{ row.unitPrice }}
+            </td>
+            <td style="width: 80px">
+              {{ parseFloat(row.quantity * row.unitPrice).toFixed(2) }}
+            </td>
+            <td style="width: 80px">
+              {{ row.productRemark }}
+            </td>
+          </tr>
+          <tr>
+            <td colspan="2">合计人民币:{{ pdfData.contractAmount }}</td>
+            <td colspan="5">
+              大写:{{ NumberToChinese(pdfData.contractAmount) }}
+            </td>
+          </tr>
+        </table>
+        <div>
+          <div style="margin-top: 8px">
+            1、交货期:{{ pdfData.deliveryDateRemark }}
+          </div>
+          <div style="margin-top: 8px">
+            2、付款方式:{{ pdfData.payMethodRemark }}
+          </div>
+          <div style="margin-top: 8px">3、备注:{{ pdfData.remark }}</div>
+          <div style="margin-top: 8px">
+            4、运费由{{ pdfData.freightPayer == "0" ? "甲方" : "乙方" }}支付。
+          </div>
+          <div style="margin-top: 8px">
+            5、如有质量问题,于货到一星期内以书面形式提出,机器于货到起保修一年(不含机器易损件及人为因素损坏),甲方不得自挪位设备,否则由此产生的一切后果由甲方承担。
+          </div>
+          <div style="margin-top: 8px">
+            6、违约处理,本合同经甲乙双方签字或盖章生效,双方各执一份需严格遵照执行,因本合同履行双方发生争议,根据《合同法》由违约方承担责任并友好协商解决。
+          </div>
+          <div style="display: flex; margin-top: 20px">
+            <div style="width: 50%; padding-right: 20px">
+              <div style="display: flex">
+                <div>买方(盖章):</div>
+                <div style="border-bottom: 1px solid #000; flex: 1">
+                  {{ pdfData.customerName }}
+                </div>
+              </div>
+              <div style="display: flex; margin-top: 10px">
+                <div>地 址:</div>
+                <div style="border-bottom: 1px solid #000; flex: 1">
+                  {{ pdfData.buyCountryName }},{{ pdfData.buyProvinceName }},{{
+                    pdfData.buyCityName
+                  }},{{ pdfData.buyAddress }}
+                </div>
+              </div>
+              <div style="display: flex; margin-top: 10px">
+                <div>电 话:</div>
+                <div style="border-bottom: 1px solid #000; flex: 1"></div>
+              </div>
+              <div style="display: flex; margin-top: 10px">
+                <div>手 机:</div>
+                <div style="border-bottom: 1px solid #000; flex: 1">
+                  {{ pdfData.contactNo }}
+                </div>
+              </div>
+              <div style="display: flex; margin-top: 10px">
+                <div>税 号:</div>
+                <div style="border-bottom: 1px solid #000; flex: 1">
+                  {{ pdfData.buyDutyParagraph }}
+                </div>
+              </div>
+              <div style="display: flex; margin-top: 10px">
+                <div>开 户 行:</div>
+                <div style="border-bottom: 1px solid #000; flex: 1">
+                  {{ pdfData.customerBank }}
+                </div>
+              </div>
+              <div style="display: flex; margin-top: 10px">
+                <div>行 号:</div>
+                <div style="border-bottom: 1px solid #000; flex: 1">
+                  {{ pdfData.customerSwiftCode }}
+                </div>
+              </div>
+              <div style="display: flex; margin-top: 10px">
+                <div>账 号:</div>
+                <div style="border-bottom: 1px solid #000; flex: 1">
+                  {{ pdfData.customerAccountNumber }}
+                </div>
+              </div>
+              <div style="display: flex; margin-top: 30px">
+                <div>签 字:</div>
+                <div style="border-bottom: 1px solid #000; flex: 1"></div>
+              </div>
+            </div>
+            <div style="width: 50%">
+              <div style="display: flex">
+                <div>供 方:</div>
+                <div style="border-bottom: 1px solid #000; flex: 1">
+                  {{ pdfData.sellCorporationName }}
+                </div>
+              </div>
+              <div style="display: flex; margin-top: 10px">
+                <div>地 址:</div>
+                <div style="border-bottom: 1px solid #000; flex: 1">
+                  {{ pdfData.sellCountryName }},{{
+                    pdfData.sellProvinceName
+                  }},{{ pdfData.sellCityName }},{{ pdfData.sellAddress }}
+                </div>
+              </div>
+              <div style="display: flex; margin-top: 10px">
+                <div>电 话:</div>
+                <div style="border-bottom: 1px solid #000; flex: 1">
+                  {{ pdfData.sellCorporationNumber }}
+                </div>
+              </div>
+              <div style="display: flex; margin-top: 10px">
+                <div>手 机:</div>
+                <div style="border-bottom: 1px solid #000; flex: 1"></div>
+              </div>
+              <div style="display: flex; margin-top: 10px">
+                <div>税 号:</div>
+                <div style="border-bottom: 1px solid #000; flex: 1">
+                  {{ pdfData.sellTaxationCode }}
+                </div>
+              </div>
+              <div style="display: flex; margin-top: 10px">
+                <div>开 户 行:</div>
+                <div style="border-bottom: 1px solid #000; flex: 1">
+                  {{ pdfData.sellOpeningBank }}
+                </div>
+              </div>
+              <div style="display: flex; margin-top: 10px">
+                <div>行 号:</div>
+                <div style="border-bottom: 1px solid #000; flex: 1">
+                  {{ pdfData.sellInterbankNumber }}
+                </div>
+              </div>
+              <div style="display: flex; margin-top: 10px">
+                <div>账 号:</div>
+                <div style="border-bottom: 1px solid #000; flex: 1">
+                  {{ pdfData.sellAccountOpening }}
+                </div>
+              </div>
+              <div style="display: flex; margin-top: 30px">
+                <div>签 字:</div>
+                <div style="border-bottom: 1px solid #000; flex: 1"></div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { NumberToChinese } from "@/utils/util.js";
+const { proxy } = getCurrentInstance();
+const pdfData = ref({});
+const props = defineProps({
+  rowData: Object,
+});
+const productUnit = ref([]);
+proxy.getDictOne(["unit"]).then((res) => {
+  productUnit.value = res["unit"].map((x) => ({
+    label: x.dictValue,
+    value: x.dictKey,
+  }));
+});
+const handlePrintPdf = (row) => {
+  proxy.post("/salesContract/detail", { id: row.id }).then((res) => {
+    console.log(res, "ada");
+    if (res.customerUserList && res.customerUserList.length > 0) {
+      let data = res.customerUserList[0];
+      if (data.contactJson) {
+        data.contactJson = JSON.parse(data.contactJson);
+        const current = data.contactJson.find((x) => x.type == "mobile");
+        if (current && current.contactNo) {
+          res.contactNo = current.contactNo;
+        }
+      }
+    }
+    pdfData.value = res;
+  });
+};
+
+if (props.rowData && props.rowData.id) {
+  handlePrintPdf(props.rowData);
+}
+
+watch(
+  () => props.rowData.id,
+  (val) => {
+    if (props.rowData && props.rowData.id) {
+      handlePrintPdf(props.rowData);
+    }
+  }
+);
+</script>
+
+<style lang="scss" scoped>
+#pdfDom {
+  font-size: 12px;
+  color: #000000;
+  padding: 60px 30px;
+  .title {
+    font-size: 16px;
+    font-weight: 700;
+    // margin-top: 10px;
+    margin-bottom: 20px;
+    text-align: center;
+    letter-spacing: 10px;
+  }
+  .table {
+    // width: calc(100% + 2px) !important;
+    border-collapse: collapse;
+    border-spacing: 0;
+    // margin-left: -1px;
+    // margin-right: -1px;
+
+    td {
+      text-align: center;
+      padding: 5px 10px;
+    }
+    // tr td:last-child {
+    //   border-right: 0 !important;
+    // }
+  }
+  .flex-top-bottom {
+    display: flex;
+    justify-content: space-between;
+    margin: 5px 0px;
+  }
+  .padding-10px {
+    padding: 0px 10px;
+  }
+  .margin-top-5px {
+    margin-top: 5px;
+  }
+}
+</style>

+ 18 - 14
src/components/product/treeList.vue

@@ -31,8 +31,13 @@
       >
         <template #default="{ node, data }">
           <div class="custom-tree-node">
-            <div style="flex: 1">{{ node.label}}</div>
-            <div class="icon-warp" style="float: right; width: 71px; margin-left: 10px" v-if="node.label != '全部'" v-show="activeNode == data.id">
+            <div style="flex: 1">{{ node.label }}</div>
+            <!-- v-show="activeNode == data.id" -->
+            <div
+              class="icon-warp"
+              style="float: right; width: 71px; margin-left: 10px"
+              v-if="node.label != '全部'"
+            >
               <el-icon :size="17" @click.stop="() => edit(node, data)">
                 <Edit />
               </el-icon>
@@ -106,15 +111,15 @@ const props = defineProps({
 const search = ref("");
 const emit = defineEmits(["update:modelValue"]);
 const { proxy } = getCurrentInstance();
-let activeNode = ref('1');
+let activeNode = ref("1");
 const treeChange = (e, data) => {
   let el = document.getElementsByClassName("el-tree")[0].firstElementChild;
-  console.log(el)
-  if(e.id != 1) {
+  console.log(el);
+  if (e.id != 1) {
     //删除el的is-current class name
-    el.classList.remove('is-current')
+    el.classList.remove("is-current");
   }
-  activeNode.value = e.id
+  activeNode.value = e.id;
   if (proxy.type == "radio") {
     emit("update:modelValue", e.id);
     emit("change", e);
@@ -260,9 +265,9 @@ const handleMouseOver = (data) => {
 //为class为el-tree的第一个子元素添加一个is-current
 const addClass = () => {
   let el = document.getElementsByClassName("el-tree")[0].firstElementChild;
-  if(proxy.data.length > 0) {
+  if (proxy.data.length > 0) {
     el.classList.add("is-current");
-  } else{
+  } else {
     setTimeout(() => {
       addClass();
     }, 300);
@@ -271,7 +276,6 @@ const addClass = () => {
 onMounted(() => {
   addClass();
 });
-
 </script>
 
 <style lang="scss">
@@ -283,9 +287,9 @@ onMounted(() => {
   font-size: 14px;
   padding-right: 8px;
 }
-.custom-tree-node:hover{
-  .icon-warp{
-    display:block!important;
+.custom-tree-node:hover {
+  .icon-warp {
+    display: block !important;
   }
 }
 .treeList {
@@ -313,7 +317,7 @@ onMounted(() => {
     overflow-x: auto;
     .el-tree {
       .el-tree-node__content {
-        width:min-content;
+        width: min-content;
         min-width: 260px;
       }
 

+ 249 - 4
src/views/JXSK/salesMange/contract/index.vue

@@ -35,6 +35,118 @@
         :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"
+              >
+                <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="13">
+                <el-row style="margin-top: 20px; width: 100%">
+                  <el-col :span="8">
+                    <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="7">
+                    <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%">
+            <el-form-item label="收款账号" prop="shroffAccountId" required>
+              <el-select
+                v-model="formData.data.shroffAccountId"
+                placeholder="请选择收款账号"
+                @change="changeShroffAccount"
+              >
+                <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="6">
+                <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="6">
+                <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">
@@ -102,7 +214,22 @@
                 </template>
               </el-table-column>
               <el-table-column prop="total" label="金额小计" width="120" />
-
+              <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="请输入"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
               <el-table-column prop="zip" label="操作" width="80">
                 <template #default="{ $index }">
                   <el-button type="primary" link @click="handleRemove($index)"
@@ -136,6 +263,17 @@
         </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>
 
@@ -144,6 +282,7 @@ 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";
 
 const { proxy } = getCurrentInstance();
 const loading = ref(false);
@@ -163,6 +302,9 @@ const rules = ref({
   customerId: [
     { required: true, message: "请选择客户名称", trigger: "change" },
   ],
+  shroffAccountId: [
+    { required: true, message: "请选择收款账户", trigger: "change" },
+  ],
   deliveryDate: [
     { required: true, message: "请选择交货期限", trigger: "change" },
   ],
@@ -240,7 +382,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: "80",
+        width: "120",
         align: "center",
       },
       renderHTML(row) {
@@ -256,6 +398,17 @@ const config = computed(() => {
               getDtl(row);
             },
           },
+          {
+            attrs: {
+              label: "打印",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              clickPrint(row);
+            },
+          },
         ];
       },
     },
@@ -274,6 +427,16 @@ const byform = ref(null);
 const formConfig = computed(() => {
   return [
     {
+      type: "slot",
+      slotName: "seller",
+      label: "",
+    },
+    {
+      type: "slot",
+      slotName: "shroffAccountId",
+      label: "",
+    },
+    {
       type: "select",
       prop: "customerId",
       label: "客户名称",
@@ -305,7 +468,7 @@ const formConfig = computed(() => {
     {
       type: "number",
       disabled: true,
-      prop: "total",
+      prop: "contractAmount",
       label: "合同总金额",
       precision: 2,
       min: 0,
@@ -317,6 +480,18 @@ const formConfig = computed(() => {
     {
       type: "input",
       itemType: "textarea",
+      prop: "deliveryDateRemark",
+      label: "交货期备注",
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      prop: "payMethodRemark",
+      label: "付款方式备注",
+    },
+    {
+      type: "input",
+      itemType: "textarea",
       prop: "remark",
       label: "备注",
     },
@@ -396,6 +571,8 @@ const getDtl = (row) => {
 };
 
 const customerData = ref([]);
+const accountList = ref([]);
+const corporationList = ref([]);
 const payMethodData = ref([]);
 const freightPayerData = ref([
   {
@@ -414,6 +591,27 @@ const getDict = () => {
       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,
@@ -459,7 +657,54 @@ const changeAmount = () => {
     }
     total += Number(e.total);
   }
-  formData.data.total = parseFloat(total).toFixed(2);
+  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文件");
 };
 </script>
 

文件差異過大導致無法顯示
+ 527 - 136
src/views/customer/file/index.vue


+ 9 - 7
src/views/production/project/processes/index.vue

@@ -313,13 +313,15 @@ const submitForm = () => {
 const getDtl = (row) => {
   modalType.value = "edit";
   proxy.post("/productionProcesses/detail", { id: row.id }).then((res) => {
-    fileList.value = [
-      {
-        id: "",
-        fileName: res.fileName,
-        path: "",
-      },
-    ];
+    fileList.value = res.fileName
+      ? [
+          {
+            id: "",
+            fileName: res.fileName,
+            path: "",
+          },
+        ]
+      : [];
     formData.data = res;
     dialogVisible.value = true;
   });

+ 198 - 88
src/views/publicModule/companyConfig/index.vue

@@ -16,26 +16,49 @@
           action: () => openModal('add'),
         },
       ]"
-      @get-list="getList">
-      <template #timeSlot="{ item }"> {{ item.startDate }} - {{ item.stopDate }} </template>
+      @get-list="getList"
+    >
+      <template #timeSlot="{ item }">
+        {{ item.startDate }} - {{ item.stopDate }}
+      </template>
     </byTable>
-    <el-dialog :title="modalType == 'add' ? '添加公司' : '编辑公司'" v-if="dialogVisible" v-model="dialogVisible" width="600" v-loading="loading">
-      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
+    <el-dialog
+      :title="modalType == 'add' ? '添加公司' : '编辑公司'"
+      v-if="dialogVisible"
+      v-model="dialogVisible"
+      width="600"
+      v-loading="loading"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
         <template #timeGanger>
           <div style="width: 100%">
             <el-row :gutter="10">
               <el-col :span="11">
-                <el-input v-model="formData.data.startDate" placeholder="请输入" />
+                <el-input
+                  v-model="formData.data.startDate"
+                  placeholder="请输入"
+                />
               </el-col>
               <el-col :span="2" style="text-align: center"> To </el-col>
               <el-col :span="11">
-                <el-input v-model="formData.data.stopDate" placeholder="请输入" />
+                <el-input
+                  v-model="formData.data.stopDate"
+                  placeholder="请输入"
+                />
               </el-col>
             </el-row>
           </div>
         </template>
         <template #allAddress>
-          <el-row style="width: 100%;display: flex;justify-content: space-between;">
+          <el-row
+            style="width: 100%; display: flex; justify-content: space-between"
+          >
             <el-col :span="7">
               <el-form-item prop="countryId">
                 <el-select
@@ -82,7 +105,6 @@
                   >
                   </el-option>
                 </el-select>
-                
               </el-form-item>
             </el-col>
             <el-col :span="7">
@@ -112,33 +134,46 @@
           <el-row style="margin-top: 20px; width: 100%">
             <el-col :span="24">
               <el-form-item prop="address">
-                <el-input v-model="formData.data.address" type="textarea"> </el-input>
+                <el-input v-model="formData.data.address" type="textarea">
+                </el-input>
               </el-form-item>
             </el-col>
           </el-row>
         </template>
         <template #allAddressEnglish>
-          <el-row style="width: 100%;display: flex;justify-content: space-between;">
+          <el-row
+            style="width: 100%; display: flex; justify-content: space-between"
+          >
             <el-col :span="7">
               <el-form-item prop="countryEnStr">
-                <el-input v-model="formData.data.countryEnStr" placeholder="请输入国家 (英文)" />
+                <el-input
+                  v-model="formData.data.countryEnStr"
+                  placeholder="请输入国家 (英文)"
+                />
               </el-form-item>
             </el-col>
             <el-col :span="7">
               <el-form-item prop="provinceEnStr">
-                <el-input v-model="formData.data.provinceEnStr" placeholder="请输入省/洲 (英文)" />
+                <el-input
+                  v-model="formData.data.provinceEnStr"
+                  placeholder="请输入省/洲 (英文)"
+                />
               </el-form-item>
             </el-col>
             <el-col :span="7">
               <el-form-item prop="cityEnStr">
-                <el-input v-model="formData.data.cityEnStr" placeholder="请输入城市 (英文)" />
+                <el-input
+                  v-model="formData.data.cityEnStr"
+                  placeholder="请输入城市 (英文)"
+                />
               </el-form-item>
             </el-col>
           </el-row>
           <el-row style="margin-top: 20px; width: 100%">
             <el-col :span="24">
               <el-form-item prop="addressEn">
-                <el-input v-model="formData.data.addressEn" type="textarea"> </el-input>
+                <el-input v-model="formData.data.addressEn" type="textarea">
+                </el-input>
               </el-form-item>
             </el-col>
           </el-row>
@@ -154,19 +189,30 @@
                     :data="uploadDataOne"
                     :show-file-list="false"
                     :on-success="enterpriseLogoListSuccess"
-                    :before-upload="uploadFileOne">
+                    :before-upload="uploadFileOne"
+                  >
                     <el-image
-                      v-if="formData.data.enterpriseLogoList && formData.data.enterpriseLogoList.length > 0"
+                      v-if="
+                        formData.data.enterpriseLogoList &&
+                        formData.data.enterpriseLogoList.length > 0
+                      "
                       :src="formData.data.enterpriseLogoList[0].fileUrl"
                       fit="scale-down"
-                      class="avatar" />
-                    <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
+                      class="avatar"
+                    />
+                    <el-icon v-else class="avatar-uploader-icon"
+                      ><Plus
+                    /></el-icon>
                   </el-upload>
-                  <el-button 
-                    class="delete-btn" 
-                    type="danger" 
-                    v-if="formData.data.enterpriseLogoList && formData.data.enterpriseLogoList.length > 0"
-                    @click="formData.data.enterpriseLogoList = []">
+                  <el-button
+                    class="delete-btn"
+                    type="danger"
+                    v-if="
+                      formData.data.enterpriseLogoList &&
+                      formData.data.enterpriseLogoList.length > 0
+                    "
+                    @click="formData.data.enterpriseLogoList = []"
+                  >
                     删除
                   </el-button>
                 </el-form-item>
@@ -179,19 +225,30 @@
                     :data="uploadDataTwo"
                     :show-file-list="false"
                     :on-success="larSignListSuccess"
-                    :before-upload="uploadFileTwo">
+                    :before-upload="uploadFileTwo"
+                  >
                     <el-image
-                      v-if="formData.data.larSignList && formData.data.larSignList.length > 0"
+                      v-if="
+                        formData.data.larSignList &&
+                        formData.data.larSignList.length > 0
+                      "
                       :src="formData.data.larSignList[0].fileUrl"
                       fit="scale-down"
-                      class="avatar" />
-                    <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
+                      class="avatar"
+                    />
+                    <el-icon v-else class="avatar-uploader-icon"
+                      ><Plus
+                    /></el-icon>
                   </el-upload>
-                  <el-button 
-                    class="delete-btn" 
-                    type="danger" 
-                    v-if="formData.data.larSignList && formData.data.larSignList.length > 0"
-                    @click="formData.data.larSignList = []">
+                  <el-button
+                    class="delete-btn"
+                    type="danger"
+                    v-if="
+                      formData.data.larSignList &&
+                      formData.data.larSignList.length > 0
+                    "
+                    @click="formData.data.larSignList = []"
+                  >
                     删除
                   </el-button>
                 </el-form-item>
@@ -204,19 +261,30 @@
                     :data="uploadDataThree"
                     :show-file-list="false"
                     :on-success="officialSealListSuccess"
-                    :before-upload="uploadFileThree">
+                    :before-upload="uploadFileThree"
+                  >
                     <el-image
-                      v-if="formData.data.officialSealList && formData.data.officialSealList.length > 0"
+                      v-if="
+                        formData.data.officialSealList &&
+                        formData.data.officialSealList.length > 0
+                      "
                       :src="formData.data.officialSealList[0].fileUrl"
                       fit="scale-down"
-                      class="avatar" />
-                    <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
+                      class="avatar"
+                    />
+                    <el-icon v-else class="avatar-uploader-icon"
+                      ><Plus
+                    /></el-icon>
                   </el-upload>
-                  <el-button 
-                    class="delete-btn" 
-                    type="danger" 
-                     v-if="formData.data.officialSealList && formData.data.officialSealList.length > 0"
-                    @click="formData.data.officialSealList = []">
+                  <el-button
+                    class="delete-btn"
+                    type="danger"
+                    v-if="
+                      formData.data.officialSealList &&
+                      formData.data.officialSealList.length > 0
+                    "
+                    @click="formData.data.officialSealList = []"
+                  >
                     删除
                   </el-button>
                 </el-form-item>
@@ -229,19 +297,30 @@
                     :data="uploadDataFour"
                     :show-file-list="false"
                     :on-success="contractSealListSuccess"
-                    :before-upload="uploadFileFour">
+                    :before-upload="uploadFileFour"
+                  >
                     <el-image
-                      v-if="formData.data.contractSealList && formData.data.contractSealList.length > 0"
+                      v-if="
+                        formData.data.contractSealList &&
+                        formData.data.contractSealList.length > 0
+                      "
                       :src="formData.data.contractSealList[0].fileUrl"
                       fit="scale-down"
-                      class="avatar" />
-                    <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
+                      class="avatar"
+                    />
+                    <el-icon v-else class="avatar-uploader-icon"
+                      ><Plus
+                    /></el-icon>
                   </el-upload>
-                  <el-button 
-                    class="delete-btn" 
-                    type="danger" 
-                    v-if="formData.data.contractSealList && formData.data.contractSealList.length > 0" 
-                    @click="formData.data.contractSealList = []">
+                  <el-button
+                    class="delete-btn"
+                    type="danger"
+                    v-if="
+                      formData.data.contractSealList &&
+                      formData.data.contractSealList.length > 0
+                    "
+                    @click="formData.data.contractSealList = []"
+                  >
                     删除
                   </el-button>
                 </el-form-item>
@@ -252,7 +331,13 @@
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button type="primary" v-no-double-click="submitForm" size="large" :loading="submitLoading">确 定</el-button>
+        <el-button
+          type="primary"
+          v-no-double-click="submitForm"
+          size="large"
+          :loading="submitLoading"
+          >确 定</el-button
+        >
       </template>
     </el-dialog>
   </div>
@@ -280,7 +365,9 @@ let modalType = ref("add");
 let rules = ref({
   name: [{ required: true, message: "请输入公司名称", trigger: "blur" }],
   countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
-  countryEnStr: [{ required: true, message: "请输入国家 (英文)", trigger: "blur" }],
+  countryEnStr: [
+    { required: true, message: "请输入国家 (英文)", trigger: "blur" },
+  ],
 });
 const { proxy } = getCurrentInstance();
 const contactInformationType = ref([]);
@@ -376,11 +463,15 @@ const config = computed(() => {
             },
             el: "button",
             click() {
-              ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
-                confirmButtonText: "确定",
-                cancelButtonText: "取消",
-                type: "warning",
-              }).then(() => {
+              ElMessageBox.confirm(
+                "此操作将永久删除该数据, 是否继续?",
+                "提示",
+                {
+                  confirmButtonText: "确定",
+                  cancelButtonText: "取消",
+                  type: "warning",
+                }
+              ).then(() => {
                 proxy
                   .post("/corporation/delete", {
                     id: row.id,
@@ -478,6 +569,14 @@ const formConfig = computed(() => {
       prop: "taxpayerQualification",
       label: "纳税人资质",
       data: contactInformationType.value,
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      prop: "taxationCode",
+      label: "税号",
+      itemType: "text",
+      itemWidth: 50,
     },
     {
       type: "input",
@@ -500,27 +599,31 @@ const formConfig = computed(() => {
   ];
 });
 const getDict = () => {
-  proxy.getDictOne(["enterprise_type", "taxpayer_qualification"]).then((res) => {
-    enterpriseType.value = res["enterprise_type"].map((x) => ({
-      label: x.dictValue,
-      value: x.dictKey,
-    }));
-    contactInformationType.value = res["taxpayer_qualification"].map((x) => ({
-      label: x.dictValue,
-      value: x.dictKey,
-    }));
-  });
+  proxy
+    .getDictOne(["enterprise_type", "taxpayer_qualification"])
+    .then((res) => {
+      enterpriseType.value = res["enterprise_type"].map((x) => ({
+        label: x.dictValue,
+        value: x.dictKey,
+      }));
+      contactInformationType.value = res["taxpayer_qualification"].map((x) => ({
+        label: x.dictValue,
+        value: x.dictKey,
+      }));
+    });
 };
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/corporation/page", sourceList.value.pagination).then((message) => {
-    sourceList.value.data = message.rows;
-    sourceList.value.pagination.total = message.total;
-    setTimeout(() => {
-      loading.value = false;
-    }, 200);
-  });
+  proxy
+    .post("/corporation/page", sourceList.value.pagination)
+    .then((message) => {
+      sourceList.value.data = message.rows;
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
 };
 const countryData = ref([]);
 const provinceData = ref([]);
@@ -594,18 +697,26 @@ const getDtl = (row) => {
     if (formData.data.provinceId) {
       getCityData(formData.data.provinceId, "30");
     }
-    proxy.post("/fileInfo/getList", { businessIdList: [res.id], fileType: 1 }).then((resFile) => {
-      formData.data.enterpriseLogoList = resFile[res.id];
-    });
-    proxy.post("/fileInfo/getList", { businessIdList: [res.id], fileType: 2 }).then((resFile) => {
-      formData.data.larSignList = resFile[res.id];
-    });
-    proxy.post("/fileInfo/getList", { businessIdList: [res.id], fileType: 3 }).then((resFile) => {
-      formData.data.officialSealList = resFile[res.id];
-    });
-    proxy.post("/fileInfo/getList", { businessIdList: [res.id], fileType: 4 }).then((resFile) => {
-      formData.data.contractSealList = resFile[res.id];
-    });
+    proxy
+      .post("/fileInfo/getList", { businessIdList: [res.id], fileType: 1 })
+      .then((resFile) => {
+        formData.data.enterpriseLogoList = resFile[res.id];
+      });
+    proxy
+      .post("/fileInfo/getList", { businessIdList: [res.id], fileType: 2 })
+      .then((resFile) => {
+        formData.data.larSignList = resFile[res.id];
+      });
+    proxy
+      .post("/fileInfo/getList", { businessIdList: [res.id], fileType: 3 })
+      .then((resFile) => {
+        formData.data.officialSealList = resFile[res.id];
+      });
+    proxy
+      .post("/fileInfo/getList", { businessIdList: [res.id], fileType: 4 })
+      .then((resFile) => {
+        formData.data.contractSealList = resFile[res.id];
+      });
     dialogVisible.value = true;
   });
 };
@@ -711,13 +822,12 @@ const remoteMethod = (keyword, type) => {
   }
   return;
 };
-
 </script>
 
 <style lang="scss" scoped>
 .tenant {
   padding: 20px;
-  .delete-btn{
+  .delete-btn {
     margin-top: 10px;
     margin-left: 25px;
   }

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

@@ -27,6 +27,18 @@
         :rules="rules"
         ref="submit"
       >
+        <template #file>
+          <div style="width: 100%">
+            <el-upload
+              v-model:fileList="formData.data.fileList"
+              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+              multiple
+              :on-preview="onPreviewFile"
+            >
+              <el-button type="primary" plain disabled>选择</el-button>
+            </el-upload>
+          </div>
+        </template>
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
@@ -328,6 +340,11 @@ const formConfig = computed(() => {
       min: 1,
       controls: false,
     },
+    {
+      type: "slot",
+      slotName: "file",
+      label: "工序图片",
+    },
   ];
 });
 const rules = ref({
@@ -367,10 +384,38 @@ const submitForm = () => {
       );
   });
 };
+const showType = ref(-1);
 const clickOperation = (row) => {
+  showType.value = row.businessType;
   formData.data = row;
   loadingDialog.value = false;
   dialogVisible.value = true;
+  if (showType.value == 2) {
+    proxy
+      .post("/productionTaskDetailRecord/listByTaskDetailId", {
+        id: row.businessId,
+      })
+      .then((res) => {
+        if (res && res.length > 0) {
+          proxy
+            .post("/fileInfo/getList", { businessIdList: [res[0].id] })
+            .then((fileObj) => {
+              if (fileObj[res[0].id] && fileObj[res[0].id].length > 0) {
+                formData.data.fileList = fileObj[res[0].id].map((item) => {
+                  return {
+                    raw: item,
+                    name: item.fileName,
+                    url: item.fileUrl,
+                  };
+                });
+              }
+            });
+        }
+      });
+  }
+};
+const onPreviewFile = (file) => {
+  window.open(file.raw.fileUrl, "_blank");
 };
 </script>
 

部分文件因文件數量過多而無法顯示