소스 검색

点价确认单编辑删除(附件功能还没做)

zxz 3 년 전
부모
커밋
2bb7561186

+ 4 - 1
src/api/V2/contract/index.js

@@ -38,4 +38,7 @@ export const API_POST_CONFIRMATIONSHEET_EDIT = '/priceConfirmationSheet/api/edit
 export const API_POST_CONFIRMATIONSHEET_ADD = '/priceConfirmationSheet/api/addPriceConfirmationSheet'
 
 //删除点价确认单
-export const API_POST_CONFIRMATIONSHEET_DELETE = '/priceConfirmationSheet/api/deletePriceConfirmationSheet'
+export const API_POST_CONFIRMATIONSHEET_DELETE = '/priceConfirmationSheet/api/deletePriceConfirmationSheet'
+
+//编辑时查看点价确认单
+export const API_GET_GETINFO = '/priceConfirmationSheet/getInfo'

+ 3 - 1
src/model/contarct/index.js

@@ -19,6 +19,7 @@ import {
     API_GET_SELECTCONFIRMATIONSHEET,
     API_POST_CONFIRMATIONSHEET_EDIT,
     API_POST_CONFIRMATIONSHEET_ADD,
+    API_GET_GETINFO,
     API_POST_CONFIRMATIONSHEET_DELETE,
     API_GET_STAFF
 } from '@/api/V2/contract'
@@ -62,4 +63,5 @@ export const addPriceConfirmationSheet = appRx.post(API_POST_CONFIRMATIONSHEET_A
 //删除点价确认单
 export const deletePriceConfirmationSheet = appRx.post(API_POST_CONFIRMATIONSHEET_DELETE, errorCatcher, errorHandle, filter)
 
-
+//编辑时查看点价确认单
+export const getInfo = appRx.get(API_GET_GETINFO, errorCatcher, errorHandle, filter)

+ 14 - 13
src/views/contractManagement/priceConfirmationSheet.vue

@@ -85,7 +85,7 @@
           <el-button class="find" type="primary" @click="sheetEdit(item)"
             >编辑</el-button
           >
-          <el-button class="find" type="primary" @click="sheetDelete()"
+          <el-button class="find" type="primary" @click="sheetDelete(item)"
             >删除</el-button
           >
         </div>
@@ -208,6 +208,7 @@ export default {
       submitType: true,
       contractNo: '',
       contractType:'',
+      id:'',
       size: 10,
       unitList: [],
       addressUrls: [],
@@ -234,14 +235,14 @@ export default {
       this.selectedOptions1 = value
     },
     returnsales() {
-      if(this.$route.query.contractType == '1'){
-        this.$router.push({ path: 'futuresSalesContractExamine',
-        query: { contractNo: this.deptBudgetList.contractNo , contractType: this.deptBudgetList.contractType } })
-      }else{
-        this.$router.push({ path: 'futuresPurchaseContractExamine',
-        query: { contractNo: this.deptBudgetList.contractNo , contractType: this.deptBudgetList.contractType } })
-      }
-      
+      // if(this.$route.query.contractType == '1'){
+      //   this.$router.push({ path: 'futuresSalesContractExamine',
+      //   query: { contractNo: this.deptBudgetList.contractNo , contractType: this.deptBudgetList.contractType } })
+      // }else{
+      //   this.$router.push({ path: 'futuresPurchaseContractExamine',
+      //   query: { contractNo: this.deptBudgetList.contractNo , contractType: this.deptBudgetList.contractType } })
+      // }
+      this.$router.go(-1)
     },
     //创建点价确认单
     sheetAdd() {
@@ -251,17 +252,18 @@ export default {
     // 编辑点价确认单
     sheetEdit(item) {
       this.$router.push({ path: 'priceConfirmationSheetEdit' ,
-        query: { contractNo: this.$route.query.contractNo , contractType: this.$route.query.contractType ,priceListNo:item.priceListNo}})
+        query: { contractNo: this.$route.query.contractNo , contractType: this.$route.query.contractType ,id:item.id}})
     },
     // 删除点价确认单
-    sheetDelete(row) {
+    sheetDelete(item) {
         this.$confirm(`确认单删除后不可恢复,是否确定删除?`, '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning',
         })
           .then(() => {
-            deletePriceConfirmationSheet({ id: row.id })
+            this.id = 
+            deletePriceConfirmationSheet({ id: item.id })
               .toPromise()
               .then((response) => {
                 this.$notify.success({
@@ -269,7 +271,6 @@ export default {
                   message: '删除成功',
                 })
                 this.getUnitList()
-                this.pleaseChoose = ''
               })
               .catch((response) => {
                 console.log(response)

+ 57 - 64
src/views/contractManagement/priceConfirmationSheetEdit.vue

@@ -9,7 +9,7 @@
           class="bg-bottom"
           type="primary"
           size="small"
-          @click="returnsales()"
+          @click="returnsales(item)"
           ><img
             width="6"
             height="10"
@@ -36,8 +36,6 @@
       <ws-form
         ref="deptBudgetList"
         :model="deptBudgetList"
-        v-for="(item, index) in deptBudgetList"
-        :key="index"
       >
         <!--基本信息-->
 
@@ -50,7 +48,7 @@
             class="readonly"
           >
             <ws-input
-              v-model="item.priceListNo"
+              v-model="deptBudgetList.priceListNo"
               placeholder="请输入点价单编号"
               maxlength="20"
               size="small"
@@ -74,8 +72,8 @@
             </el-upload>
             <div class="shangchuan">
               <template>
-                <span v-if="item.enclosureTypeFlag == '0'">未上传</span>
-                <span v-if="item.enclosureTypeFlag == '1'">已上传</span>
+                <span v-if="deptBudgetList.enclosureTypeFlag == '0'">未上传</span>
+                <span v-if="deptBudgetList.enclosureTypeFlag == '1'">已上传</span>
               </template>
             </div>
           </ws-form-item>
@@ -88,7 +86,7 @@
             class="readonly"
           >
             <ws-input
-              v-model="item.varietyContractDirection"
+              v-model="deptBudgetList.varietyContractDirection"
               placeholder="请输入品种合约及方向"
               maxlength="100"
               size="small"
@@ -98,7 +96,7 @@
           <!--买方联络人-->
           <ws-form-item label="买方联络人" span="1" prop="buyer">
             <ws-input
-              v-model="item.buyer"
+              v-model="deptBudgetList.buyer"
               placeholder="请输入买方联络人"
               maxlength="120"
               size="small"
@@ -113,14 +111,14 @@
           >
             <ws-input
               @input="transactionsNumberHandChange"
-              v-model="item.transactionsNumberHand"
+              v-model="deptBudgetList.transactionsNumberHand"
               placeholder="请输入"
               maxlength="100"
               size="small"
             />&nbsp;&nbsp;&nbsp;手&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;即&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
             <ws-input
               readonly="readonly"
-              v-model="item.transactionsNumber"
+              v-model="deptBudgetList.transactionsNumber"
               placeholder="自动计算"
               maxlength="100"
               size="small"
@@ -130,7 +128,7 @@
           <!--买方联络人电话-->
           <ws-form-item label="买方联络人电话" span="1" prop="buyerPhone">
             <ws-input
-              v-model="item.buyerPhone"
+              v-model="deptBudgetList.buyerPhone"
               placeholder="请输入买方联络人电话"
               maxlength="120"
               size="small"
@@ -144,7 +142,7 @@
             prop="transactionPrice"
           >
             <ws-input
-              v-model="item.transactionPrice"
+              v-model="deptBudgetList.transactionPrice"
               placeholder="请输入成交价格"
               maxlength="120"
               size="small"
@@ -154,7 +152,7 @@
           <!--卖方联络人-->
           <ws-form-item label="卖方联络人" span="1" prop="seller">
             <ws-input
-              v-model="item.seller"
+              v-model="deptBudgetList.seller"
               placeholder="请输入卖方联络人"
               maxlength="120"
               size="small"
@@ -164,7 +162,7 @@
           <!--成交日期-->
           <ws-form-item label="成交日期" span="1" prop="transactionDate">
             <ws-date-picker
-              v-model="item.transactionDate"
+              v-model="deptBudgetList.transactionDate"
               type="date"
               placeholder="请选择成交日期"
               value-format="yyyy-MM-dd"
@@ -174,7 +172,7 @@
           <!--卖方联络人电话-->
           <ws-form-item label="卖方联络人电话" span="1" prop="sellerPhone">
             <ws-input
-              v-model="item.sellerPhone"
+              v-model="deptBudgetList.sellerPhone"
               placeholder="请输入卖方联络人电话"
               maxlength="100"
               size="small"
@@ -184,7 +182,7 @@
           <!--备注-->
           <ws-form-item label="备注" span="1" prop="remarks">
             <ws-input
-              v-model="item.remarks"
+              v-model="deptBudgetList.remarks"
               placeholder="请输入备注,不超过200字"
               maxlength="120"
               size="small"
@@ -207,7 +205,7 @@
 <script>
 import {
   editPriceConfirmationSheet,
-  selectConfirmationSheet,
+  getInfo,
 } from '@/model/contarct/index'
 import WsUpload from '@/components/WsUpload'
 import { regionData } from 'element-china-area-data'
@@ -248,8 +246,7 @@ export default {
             priceConfirmationSheet: {
          contractNo: this.$route.query.contractNo,
          contractType :this.$route.query.contractType,
-         priceListNo: this.$route.query.priceListNo
-        // enclosureTypeFlag: '0',
+         id: this.$route.query.id,
      
       },
       addressUrls: [],
@@ -276,9 +273,9 @@ export default {
     handleChange1(value) {
       this.selectedOptions1 = value
     },
-    returnsales() {
+    returnsales(item) {
       this.$router.push({ path: 'priceConfirmationSheet',
-      query: { contractNo: this.$route.query.contractNo , contractType: this.$route.query.contractType } })
+      query: { contractNo: this.$route.query.contractNo , contractType: this.$route.query.contractType ,id:item.id } })
     },
 
     // 上传附件
@@ -295,13 +292,10 @@ export default {
     //数据回显
     loaddata() {
       // 数据
-      selectConfirmationSheet({
+      getInfo({
         contractNo: this.$route.query.contractNo,
          contractType: this.$route.query.contractType,
-         priceListNo: this.$route.query.priceListNo
-
-
-
+         id: this.$route.query.id,
       })
         .toPromise()
         .then((response) => {
@@ -318,7 +312,7 @@ export default {
     },
     submit() {
       for (var i = 0; i < this.deptBudgetList.length; i++) {
-        if (!this.deptBudgetList[i].priceListNo) {
+        if (!this.deptBudgetList.priceListNo) {
           this.$message({
             message: '点价单编号不能为空!',
             type: 'warning',
@@ -326,8 +320,8 @@ export default {
           return
         }
         if (
-          this.deptBudgetList[i].priceListNo.length < 1 ||
-          this.deptBudgetList[i].priceListNo.length > 20
+          this.deptBudgetList.priceListNo.length < 1 ||
+          this.deptBudgetList.priceListNo.length > 20
         ) {
           this.$message({
             message: '点价单编号输入错误!',
@@ -335,7 +329,7 @@ export default {
           })
           return
         }
-        if (!this.deptBudgetList[i].varietyContractDirection) {
+        if (!this.deptBudgetList.varietyContractDirection) {
           this.$message({
             message: '品种合约及方向不能为空!',
             type: 'warning',
@@ -343,8 +337,8 @@ export default {
           return
         }
         if (
-          this.deptBudgetList[i].varietyContractDirection.length < 1 ||
-          this.deptBudgetList[i].varietyContractDirection.length > 20
+          this.deptBudgetList.varietyContractDirection.length < 1 ||
+          this.deptBudgetList.varietyContractDirection.length > 20
         ) {
           this.$message({
             message: '品种合约及方向输入错误!',
@@ -352,7 +346,7 @@ export default {
           })
           return
         }
-        if (!this.deptBudgetList[i].buyer) {
+        if (!this.deptBudgetList.buyer) {
           this.$message({
             message: '买方联络人不能为空!',
             type: 'warning',
@@ -360,8 +354,8 @@ export default {
           return
         }
         if (
-          this.deptBudgetList[i].buyer.length < 2 ||
-          this.deptBudgetList[i].buyer.length > 20
+          this.deptBudgetList.buyer.length < 2 ||
+          this.deptBudgetList.buyer.length > 20
         ) {
           this.$message({
             message: '买方联络人姓名输入错误!',
@@ -369,7 +363,7 @@ export default {
           })
           return
         }
-        if (!this.deptBudgetList[i].buyerPhone) {
+        if (!this.deptBudgetList.buyerPhone) {
           this.$message({
             message: '买方联络人电话不能为空!',
             type: 'warning',
@@ -377,8 +371,8 @@ export default {
           return
         }
         if (
-          this.deptBudgetList[i].buyerPhone.length < 7 ||
-          this.deptBudgetList[i].buyerPhone.length > 20
+          this.deptBudgetList.buyerPhone.length < 7 ||
+          this.deptBudgetList.buyerPhone.length > 20
         ) {
           this.$message({
             message: '买方联络人电话输入错误!',
@@ -386,14 +380,14 @@ export default {
           })
           return
         }
-        if (isNaN(this.deptBudgetList[i].buyerPhone)) {
+        if (isNaN(this.deptBudgetList.buyerPhone)) {
           this.$message({
             message: '卖方联络人电话输入有误!',
             type: 'warning',
           })
           return
         }
-        if (!this.deptBudgetList[i].seller) {
+        if (!this.deptBudgetList.seller) {
           this.$message({
             message: '卖方联络人不能为空!',
             type: 'warning',
@@ -401,8 +395,8 @@ export default {
           return
         }
         if (
-          this.deptBudgetList[i].seller.length < 2 ||
-          this.deptBudgetList[i].seller.length > 20
+          this.deptBudgetList.seller.length < 2 ||
+          this.deptBudgetList.seller.length > 20
         ) {
           this.$message({
             message: '卖方联络人姓名输入错误!',
@@ -411,14 +405,14 @@ export default {
           return
         }
 
-        if (!this.deptBudgetList[i].sellerPhone) {
+        if (!this.deptBudgetList.sellerPhone) {
           this.$message({
             message: '卖方联络人电话不能为空!',
             type: 'warning',
           })
           return
         }
-        if (isNaN(this.deptBudgetList[i].sellerPhone)) {
+        if (isNaN(this.deptBudgetList.sellerPhone)) {
           this.$message({
             message: '卖方联络人电话输入有误!',
             type: 'warning',
@@ -426,8 +420,8 @@ export default {
           return
         }
         if (
-          this.deptBudgetList[i].sellerPhone.length < 7 ||
-          this.deptBudgetList[i].sellerPhone.length > 20
+          this.deptBudgetList.sellerPhone.length < 7 ||
+          this.deptBudgetList.sellerPhone.length > 20
         ) {
           this.$message({
             message: '卖方联络人电话输入有误!',
@@ -435,7 +429,7 @@ export default {
           })
           return
         }
-        if (!this.deptBudgetList[i].transactionsNumberHand) {
+        if (!this.deptBudgetList.transactionsNumberHand) {
           this.$message({
             message: '成交数量不能为空!',
             type: 'warning',
@@ -444,17 +438,17 @@ export default {
         }
 
         if (
-          isNaN(this.deptBudgetList[i].transactionsNumberHand) ||
-          (String(this.deptBudgetList[i].transactionsNumberHand).indexOf('.') !=
+          isNaN(this.deptBudgetList.transactionsNumberHand) ||
+          (String(this.deptBudgetList.transactionsNumberHand).indexOf('.') !=
             -1 &&
-            String(this.deptBudgetList[i].transactionsNumberHand).length -
-              (String(this.deptBudgetList[i].transactionsNumberHand).indexOf(
+            String(this.deptBudgetList.transactionsNumberHand).length -
+              (String(this.deptBudgetList.transactionsNumberHand).indexOf(
                 '.'
               ) +
                 1) >
               2) ||
-          this.deptBudgetList[i].transactionsNumberHand < 1 ||
-          this.deptBudgetList[i].transactionsNumberHand > 10000
+          this.deptBudgetList.transactionsNumberHand < 1 ||
+          this.deptBudgetList.transactionsNumberHand > 10000
         ) {
           this.$message({
             message: '输入成交数量有误!',
@@ -463,11 +457,11 @@ export default {
           return
         }
         if (
-          this.deptBudgetList[i].transactionPrice < 0 ||
-          this.deptBudgetList[i].transactionPrice > 100000000 ||
-          (String(this.deptBudgetList[i].transactionPrice).indexOf('.') != -1 &&
-            String(this.deptBudgetList[i].transactionPrice).length -
-              (String(this.deptBudgetList[i].transactionPrice).indexOf('.') +
+          this.deptBudgetList.transactionPrice < 0 ||
+          this.deptBudgetList.transactionPrice > 100000000 ||
+          (String(this.deptBudgetList.transactionPrice).indexOf('.') != -1 &&
+            String(this.deptBudgetList.transactionPrice).length -
+              (String(this.deptBudgetList.transactionPrice).indexOf('.') +
                 1) >
               2)
         ) {
@@ -477,8 +471,8 @@ export default {
           })
           return
         }
-        if (this.deptBudgetList[i].transactionPrice) {
-          if (isNaN(this.deptBudgetList[i].transactionPrice)) {
+        if (this.deptBudgetList.transactionPrice) {
+          if (isNaN(this.deptBudgetList.transactionPrice)) {
             this.$message({
               message: '成交价格输入错误!',
               type: 'warning',
@@ -486,14 +480,14 @@ export default {
             return
           }
         }
-        if (!this.deptBudgetList[i].transactionPrice) {
+        if (!this.deptBudgetList.transactionPrice) {
           this.$message({
             message: '成交价格不能为空!',
             type: 'warning',
           })
           return
         }
-        if (!this.deptBudgetList[i].transactionDate) {
+        if (!this.deptBudgetList.transactionDate) {
           this.$message({
             message: '成交日期不能为空!',
             type: 'warning',
@@ -503,9 +497,8 @@ export default {
       }
       this.deptBudgetList.contractType = this.$route.query.contractType,
       this.deptBudgetList.contractNo = this.$route.query.contractNo,
-      this.deptBudgetList.enclosureTypeFlag = '0'
+      // this.deptBudgetList.enclosureTypeFlag = '0'
       this.priceConfirmationSheet = this.deptBudgetList
-      // for()
       this.$confirm(`确定提交确认单信息`, {
         cancelButtonText: '取消',
         confirmButtonText: '确定',

+ 1 - 1
vue.config.js

@@ -145,7 +145,7 @@ module.exports = {
         // target: 'http://standard-dev.winsea.com/', //目标地址
         // target: 'http://localhost:8090/',
         // target: 'http://192.168.1.121:8090/',
-        target: 'http://192.168.1.121:8090/',
+        target: 'http://192.168.1.120:8090/',
         // target: 'http://192.168.1.119:8090/',
         // target: 'http://192.168.24.5:8098',//目标地址
         // target: 'http://product-server.winsea.com/',