Ver Fonte

bug 以及路由问题

lxf há 2 anos atrás
pai
commit
6d3209eca1

+ 8 - 3
src/components/process/Contract.vue

@@ -316,8 +316,13 @@
           </el-row>
           <el-row style="margin-top: 20px; width: 100%">
             <el-col :span="7">
-              <el-form-item label="保质期 (天)" prop="warranty">
-                <el-input-number v-model="formData.data.warranty" placeholder="请输入保质期" style="width: 100%" :precision="0" :controls="false" :min="0" />
+              <el-form-item label="交货期限 (天)" prop="deliveryTime">
+                <el-date-picker v-model="formData.data.deliveryTime" type="date" placeholder="请选择交货期限" value-format="YYYY-MM-DD" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="7">
+              <el-form-item label="质保期 (天)" prop="warranty">
+                <el-input-number v-model="formData.data.warranty" placeholder="请输入质保期" style="width: 100%" :precision="0" :controls="false" :min="0" />
               </el-form-item>
             </el-col>
           </el-row>
@@ -502,7 +507,7 @@ const rules = ref({
   buyCountryId: [{ required: true, message: "请选择国家", trigger: "change" }],
   buyProvinceId: [{ required: true, message: "请选择省/州", trigger: "change" }],
   buyCityId: [{ required: true, message: "请选择城市", trigger: "change" }],
-  buyAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
+  // buyAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
   buyContactName: [{ required: true, message: "请输入联系人", trigger: ["change", "blur"] }],
   buyContactNumber: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
   productName: [{ required: true, message: "请输入商品名称", trigger: "blur" }],

+ 3 - 3
src/components/process/PriceSheet.vue

@@ -308,8 +308,8 @@
           </el-row>
           <el-row style="margin-top: 20px; width: 100%">
             <el-col :span="7">
-              <el-form-item label="质期 (天)" prop="warranty">
-                <el-input-number v-model="formData.data.warranty" placeholder="请输入质期" style="width: 100%" :precision="0" :controls="false" :min="0" />
+              <el-form-item label="质期 (天)" prop="warranty">
+                <el-input-number v-model="formData.data.warranty" placeholder="请输入质期" style="width: 100%" :precision="0" :controls="false" :min="0" />
               </el-form-item>
             </el-col>
           </el-row>
@@ -410,7 +410,7 @@ const rules = ref({
   buyCountryId: [{ required: true, message: "请选择国家", trigger: "change" }],
   buyProvinceId: [{ required: true, message: "请选择省/州", trigger: "change" }],
   buyCityId: [{ required: true, message: "请选择城市", trigger: "change" }],
-  buyAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
+  // buyAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
   buyContactName: [{ required: true, message: "请输入联系人", trigger: ["change", "blur"] }],
   buyContactNumber: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
   productName: [{ required: true, message: "请输入商品名称", trigger: "blur" }],

+ 1 - 1
src/components/process/ServiceContract.vue

@@ -405,7 +405,7 @@ const rules = ref({
   buyCountryId: [{ required: true, message: "请选择国家", trigger: "change" }],
   buyProvinceId: [{ required: true, message: "请选择省/州", trigger: "change" }],
   buyCityId: [{ required: true, message: "请选择城市", trigger: "change" }],
-  buyAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
+  // buyAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
   buyContactName: [{ required: true, message: "请输入联系人", trigger: ["change", "blur"] }],
   buyContactNumber: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
   productName: [{ required: true, message: "请输入商品名称", trigger: "blur" }],

+ 1 - 0
src/views/salesMange/saleContract/contract/index.vue

@@ -511,6 +511,7 @@ const newContract = () => {
     query: {
       flowKey: "contract_flow",
       flowName: "销售合同审批流程",
+      random: proxy.random(),
     },
   });
 };

+ 2 - 0
src/views/salesMange/saleContract/priceSheet/index.vue

@@ -438,6 +438,7 @@ const newPriceSheet = () => {
     query: {
       flowKey: "sale_quotation_flow",
       flowName: "报价审批流程",
+      random: proxy.random(),
     },
   });
 };
@@ -448,6 +449,7 @@ const clickCopy = (item) => {
       flowKey: "sale_quotation_flow",
       flowName: "报价审批流程",
       id: item.id,
+      random: proxy.random(),
     },
   });
 };

+ 1 - 0
src/views/salesMange/saleContract/serviceContract/index.vue

@@ -375,6 +375,7 @@ const newContract = () => {
     query: {
       flowKey: "service_contract_flow",
       flowName: "服务合同审批流程",
+      random: proxy.random(),
     },
   });
 };

+ 200 - 1
src/views/salesMange/shipmentMange/document/index.vue

@@ -18,10 +18,15 @@
           <div>
             <div style="color: #409eff" v-if="item.acceptCode">{{ item.acceptCarriage }} ({{ item.acceptCode }})</div>
             <div v-else>
-              <el-button @click="clickAddAcceptCode(item)" type="warning">填写</el-button>
+              <el-button type="warning" style="background-color: var(--el-button-bg-color) !important" @click="clickAddAcceptCode(item)">填写</el-button>
             </div>
           </div>
         </template>
+        <template #toView="{ item }">
+          <div>
+            <el-button type="warning" style="background-color: var(--el-button-bg-color) !important" @click="clickToView(item)">查看</el-button>
+          </div>
+        </template>
       </byTable>
     </div>
 
@@ -111,6 +116,134 @@
         <el-button type="primary" @click="submitTwoForm()" size="large">确 定</el-button>
       </template>
     </el-dialog>
+
+    <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="860" v-loading="loadingPrint">
+      <!-- <div id="pdfDom" style="width: 800px; padding: 16px; font-size: 12px !important">
+        <div style="font-size: 18px; text-align: center">{{ getLabel(printDetails.sellCorporationId, corporationList, "nameEn") }}</div>
+        <div style="text-align: center">
+          {{ printDetails.sellCountryId }},{{ printDetails.sellProvinceId }},{{ printDetails.sellCityId }},{{ printDetails.sellAddress }}
+        </div>
+        <div style="font-size: 14px; color: #409eff; text-align: center; padding-top: 16px">QUOTATION</div>
+        <div style="padding-top: 8px">
+          <div>Reference NO. : {{ printDetails.code }}</div>
+          <div style="display: flex">
+            <div style="width: 50%">DATE: {{ moment(printDetails.createTime).format("DD/MMM/yyyy") }}</div>
+            <div style="width: 50%">Valid Date:</div>
+          </div>
+        </div>
+        <div style="border: 1px solid #999; display: flex">
+          <div style="width: 50%; border-right: 1px solid #999">
+            <div style="color: #409eff">VENDOR:</div>
+            <div>{{ getLabel(printDetails.sellCorporationId, corporationList, "nameEn") }}</div>
+            <div style="padding: 16px 0">
+              {{ printDetails.sellCountryId }},{{ printDetails.sellProvinceId }},{{ printDetails.sellCityId }},{{ printDetails.sellAddress }}
+            </div>
+            <div>{{ printDetails.sellContactName }},{{ printDetails.sellContactNumber }}</div>
+          </div>
+          <div style="width: 50%">
+            <div style="color: #409eff">BUYER:</div>
+            <div>{{ getLabel(printDetails.buyCorporationId, customerList, "name") }}</div>
+            <div style="padding: 16px 0">
+              {{ printDetails.buyCountryName }},{{ printDetails.buyProvinceName }},{{ printDetails.buyCityName }},{{ printDetails.buyAddress }}
+            </div>
+            <div>{{ printDetails.buyContactName }},{{ printDetails.buyContactNumber }}</div>
+          </div>
+        </div>
+        <div style="height: 16px"></div>
+        <div style="border: 1px solid #999">
+          <div style="display: flex; width: 100%">
+            <div style="width: 33%; border-bottom: 1px solid #999; border-right: 1px solid #999">
+              <div style="color: #409eff">COUNTRY OF ORIGIN:</div>
+              <div>{{ printDetails.sellCountryId }}</div>
+            </div>
+            <div style="width: 34%; border-bottom: 1px solid #999; border-right: 1px solid #999">
+              <div style="color: #409eff">COUNTRY OF DESTINATION:</div>
+              <div>{{ printDetails.buyCountryName }}</div>
+            </div>
+            <div style="width: 33%; border-bottom: 1px solid #999">
+              <div style="color: #409eff">PLACE OF DISCHARGE:</div>
+              <div>{{ printDetails.transportRemark }}</div>
+            </div>
+          </div>
+          <div style="display: flex; width: 100%">
+            <div style="width: 33%; border-bottom: 1px solid #999; border-right: 1px solid #999">
+              <div style="color: #409eff">TERMS OF DELIVERY:</div>
+              <div>{{ dictValueLabel(printDetails.tradeMethods, tradeMethods) }}</div>
+            </div>
+            <div style="width: 34%; border-bottom: 1px solid #999; border-right: 1px solid #999">
+              <div style="color: #409eff">CURRENCY:</div>
+              <div>{{ dictValueLabel(printDetails.currency, accountCurrency) }}</div>
+            </div>
+            <div style="width: 33%; border-bottom: 1px solid #999">
+              <div style="color: #409eff">EXPORT BY/VIA:</div>
+            </div>
+          </div>
+          <div style="display: flex; width: 100%">
+            <div style="width: 33%; border-right: 1px solid #999">
+              <div style="color: #409eff">DELIVERY TIME:</div>
+            </div>
+            <div style="width: 67%">
+              <div style="color: #409eff">TERMS OF PAYMENT:</div>
+              <div>{{ printDetails.remark }}</div>
+            </div>
+          </div>
+        </div>
+        <div style="height: 16px"></div>
+        <div class="baseRow" style="display: flex; color: #409eff">
+          <div class="contentRow" style="width: 50px; text-align: center">NO.</div>
+          <div class="contentRow" style="width: calc(100% - 450px); text-align: center">COMMODITY, SPECIFICATION</div>
+          <div class="contentRow" style="width: 100px; text-align: center">UNIT</div>
+          <div class="contentRow" style="width: 100px; text-align: center">QUANTITY</div>
+          <div class="contentRow" style="width: 100px; text-align: center">UNIT PRICE</div>
+          <div class="contentRow" style="width: 100px; text-align: center">TOTAL PRICE</div>
+        </div>
+        <div v-if="printDetails.quotationProductList && printDetails.quotationProductList.length > 0">
+          <div class="baseRow" style="display: flex" v-for="(item, index) in printDetails.quotationProductList" :key="item.productId">
+            <div class="contentRow" style="width: 50px; text-align: center">{{ index + 1 }}</div>
+            <div class="contentRow" style="width: calc(100% - 450px); text-align: center">{{ item.productName }}</div>
+            <div class="contentRow" style="width: 100px; text-align: center">{{ item.productUnit }}</div>
+            <div class="contentRow" style="width: 100px; text-align: center">{{ item.quantity }}</div>
+            <div class="contentRow" style="width: 100px; text-align: center">{{ item.price }}</div>
+            <div class="contentRow" style="width: 100px; text-align: center">{{ item.amount }}</div>
+          </div>
+        </div>
+        <div class="baseRow" style="display: flex; color: #409eff">
+          <div class="contentRow" style="width: calc(100% - 400px); text-align: center">SUBTOTAL:</div>
+          <div class="contentRow" style="width: 100px; text-align: center"></div>
+          <div class="contentRow" style="width: 100px; text-align: center">{{ statistics("quantity", 0) }}</div>
+          <div class="contentRow" style="width: 100px; text-align: center"></div>
+          <div class="contentRow" style="width: 100px; text-align: center">{{ statistics("amount", 2) }}</div>
+        </div>
+        <div v-if="printDetails.quotationPayList && printDetails.quotationPayList.length > 0">
+          <div class="baseRow" style="display: flex" v-for="(item, index) in printDetails.quotationPayList" :key="index">
+            <div class="contentRow" style="width: calc(100% - 100px); text-align: right; color: #409eff">{{ item.payName }}:</div>
+            <div class="contentRow" style="width: 100px; text-align: center">{{ item.amount }}</div>
+          </div>
+        </div>
+        <div class="baseRow" style="display: flex">
+          <div class="contentRow" style="width: calc(100% - 100px); text-align: right; color: #409eff">TOTAL PRICE:</div>
+          <div class="contentRow" style="width: 100px; text-align: center">{{ getAllMoney(statistics("amount", 2)) }}</div>
+        </div>
+        <div class="baseRow" style="display: flex; border-bottom: 1px solid #999">
+          <div class="contentRow" style="width: 100%">{{ translateIntoEnglish(printDetails.amount, printDetails.currency) }}</div>
+        </div>
+        <div style="height: 32px"></div>
+        <div style="display: flex">
+          <div style="width: 50%">
+            <div style="color: #409eff">CONFIRMED BY VENDOR:</div>
+            <div>{{ getLabel(printDetails.sellCorporationId, corporationList, "nameEn") }}</div>
+          </div>
+          <div style="width: 50%">
+            <div style="color: #409eff">CONFIRMED BY BUYER:</div>
+            <div>{{ getLabel(printDetails.buyCorporationId, customerList, "name") }}</div>
+          </div>
+        </div>
+      </div> -->
+      <template #footer>
+        <el-button @click="openPrint = false" size="large">取消</el-button>
+        <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -278,6 +411,13 @@ const formConfig = computed(() => {
       label: "目的国",
       required: true,
       data: countryData.value,
+      itemWidth: 40,
+    },
+    {
+      type: "input",
+      prop: "portOfDestination",
+      label: "目的港",
+      itemWidth: 60,
     },
     {
       type: "input",
@@ -465,6 +605,55 @@ const submitTwoForm = () => {
     );
   });
 };
+const clickToView = (item) => {
+  console.log(item);
+};
+const openPrint = ref(false);
+const loadingPrint = ref(false);
+const printDetails = ref({});
+const clickPrint = (row) => {
+  printDetails.value = {};
+  loadingPrint.value = true;
+  openPrint.value = true;
+  proxy.post("/saleQuotation/detail", { id: row.id }).then((res) => {
+    printDetails.value = res;
+  });
+};
+const clickDownload = () => {
+  proxy.getPdf("报价单PDF文件");
+};
+// const statistics = (label, index) => {
+//   let num = 0;
+//   if (printDetails.value.quotationProductList && printDetails.value.quotationProductList.length > 0) {
+//     printDetails.value.quotationProductList.map((item) => {
+//       if (item[label]) {
+//         num = parseFloat(Number(num) + Number(item[label])).toFixed(index);
+//       }
+//     });
+//   }
+//   return num;
+// };
+// const getLabel = (key, list, label) => {
+//   let text = "";
+//   if (list && list.length > 0) {
+//     let data = list.filter((item) => item.id === key);
+//     if (data && data.length > 0) {
+//       text = data[0][label];
+//     }
+//   }
+//   return text;
+// };
+// const getAllMoney = (num) => {
+//   let money = num;
+//   if (printDetails.value.quotationPayList && printDetails.value.quotationPayList.length > 0) {
+//     printDetails.value.quotationPayList.map((item) => {
+//       if (item.amount) {
+//         money = parseFloat(Number(money) + Number(item.amount)).toFixed(2);
+//       }
+//     });
+//   }
+//   return money;
+// };
 </script>
 
 <style lang="scss" scoped>
@@ -474,4 +663,14 @@ const submitTwoForm = () => {
 ::v-deep(.el-input-number .el-input__inner) {
   text-align: left;
 }
+.baseRow {
+  min-height: 24px;
+  border-top: 1px solid #999;
+  border-left: 1px solid #999;
+}
+.contentRow {
+  border-right: 1px solid #999;
+  line-height: 24px;
+  padding-left: 4px;
+}
 </style>