Browse Source

点价确认单,查看编辑

zxz 3 years ago
parent
commit
647bf25dc1

+ 11 - 0
src/api/V2/contract/index.js

@@ -28,3 +28,14 @@ export const API_GET_STAFF = '/staff/query/getStaffListByCompId'
 //运输任务-添加-根据仓库类型选库名
 export const API_GET_TRAN_TASK_WAREHOUSE = '/tranTaskInfo/selectWarehouseList'
 
+//查看点价确认单
+export const API_GET_SELECTCONFIRMATIONSHEET = '/priceConfirmationSheet/selectConfirmationSheet'
+
+//编辑点价确认单
+export const API_POST_CONFIRMATIONSHEET_EDIT = '/priceConfirmationSheet/api/editPriceConfirmationSheet'
+
+//创建点价确认单
+export const API_POST_CONFIRMATIONSHEET_ADD = '/priceConfirmationSheet/api/addPriceConfirmationSheet'
+
+//删除点价确认单
+export const API_POST_CONFIRMATIONSHEET_DELETE = '/priceConfirmationSheet/api/deletePriceConfirmationSheet'

+ 16 - 0
src/model/contarct/index.js

@@ -16,6 +16,10 @@ import {
     API_POST_EDITINFO,
     API_POST_CONTRACT_DELETE,
     API_GET_TRAN_TASK_WAREHOUSE,
+    API_GET_SELECTCONFIRMATIONSHEET,
+    API_POST_CONFIRMATIONSHEET_EDIT,
+    API_POST_CONFIRMATIONSHEET_ADD,
+    API_POST_CONFIRMATIONSHEET_DELETE,
     API_GET_STAFF
 } from '@/api/V2/contract'
 // 列表
@@ -46,4 +50,16 @@ export const getstaff = appRx.get(API_GET_STAFF, errorCatcher, errorHandle, filt
 //运输任务-添加-根据仓库类型选库名
 export const getwarehousename = appRx.get(API_GET_TRAN_TASK_WAREHOUSE, errorCatcher, errorHandle, filter)
 
+//查看点价确认单
+export const selectConfirmationSheet = appRx.get(API_GET_SELECTCONFIRMATIONSHEET, errorCatcher, errorHandle, filter)
+
+//编辑点价确认单
+export const editPriceConfirmationSheet = appRx.post(API_POST_CONFIRMATIONSHEET_EDIT, errorCatcher, errorHandle, filter)
+
+//创建点价确认单
+export const addPriceConfirmationSheet = appRx.post(API_POST_CONFIRMATIONSHEET_ADD, errorCatcher, errorHandle, filter)
+
+//删除点价确认单
+export const deletePriceConfirmationSheet = appRx.post(API_POST_CONFIRMATIONSHEET_DELETE, errorCatcher, errorHandle, filter)
+
 

+ 164 - 175
src/views/contractManagement/priceConfirmationSheet.vue

@@ -25,7 +25,7 @@
       <h3>所属合同</h3>
       <p>
         &nbsp;&nbsp;采购合同(
-        <template>{{ this.deptBudgetList.contractNo }}</template>
+        <template>{{ contractNo }}</template>
         )
       </p>
       <div class="tianjiaanniu">
@@ -50,111 +50,127 @@
         >
       </div>
     </div>
-    <div class="dianjiadanbianhao">
-      <h3>点价单编号</h3>
-      <p>
-        <template>CG20210329-02{{ this.deptBudgetList.priceListNo }}</template>
-      </p>
-      <div class="fujian">
-        <template slot-scope="scope" >
-          <img
-            width="18"
-            height="20"
-            style="vertical-align: text-top; position: relative; top: -1px"
-            src="../../../public/img/fujian.png"
-            @click="fujian(scope.row)"
-            alt=""
-          />
-          <span v-if="(scope.row.enclosureTypeFlag = '0')"
-            >&nbsp;&nbsp;&nbsp;未上传</span
+    <div  v-for="(item,index) in deptBudgetList" :key="index">
+      <div class="dianjiadanbianhao">
+        <h3>点价单编号</h3>
+        <p>
+          <template>{{ item.priceListNo }}</template>
+        </p>
+        <div class="fujian">
+          <el-upload
+            class="upload-demo"
+            action="https://www.zthymaoyi.com/upload/admin"
+            :on-success="
+              (res, file) => {
+                uploadSuccessHandle(res)
+              }
+            "
+            multiple
+            :limit="3"
+            :file-list="fileList"
           >
-          <span v-if="(scope.row.enclosureTypeFlag = '1')"
-            >&nbsp;&nbsp;&nbsp;已上传</span
+            <el-button size="small" type="primary">附件</el-button>
+          </el-upload>
+          <div class="shangchuan">
+            <template>
+              <span v-if="item.enclosureTypeFlag == '0'">未上传</span>
+              <span v-if="item.enclosureTypeFlag == '1'">已上传</span>
+            </template>
+          </div>
+        </div>
+        <div class="caozuoanniu">
+          <el-button class="find" type="primary" @click="sheetEdit(item)"
+            >编辑</el-button
           >
-        </template>
+          <el-button class="find" type="primary" @click="sheetDelete()"
+            >删除</el-button
+          >
+        </div>
       </div>
-      <div class="caozuoanniu">
-        <el-button class="find" type="primary" @click="sheetEdit()"
-          >编辑</el-button
-        >
-        <el-button class="find" type="primary" @click="sheetDelete()"
-          >删除</el-button
+      <div class="center">
+        <ws-form
+          ref="deptBudgetList"
+          :model="deptBudgetList"
         >
+          <!--基本信息-->
+          <ws-info-table>
+            <ws-form-item
+              label="品种合约及方向"
+              span="1"
+              prop="varietyContractDirection"
+            >
+              <div class="unchanged">
+                {{ item.varietyContractDirection }}
+              </div>
+            </ws-form-item>
+            <ws-form-item label="买方联络人" span="1" prop="buyer">
+              <div class="unchanged">
+                {{ item.buyer }}
+              </div>
+            </ws-form-item>
+            <ws-form-item
+              label="成交数量"
+              span="1"
+              prop="transactionsNumberHand"
+            >
+              <div class="unchanged">
+                {{
+                  item.transactionsNumberHand
+                }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;手
+                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                即&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{
+                  item.transactionsNumber
+                }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;吨
+              </div>
+            </ws-form-item>
+            <ws-form-item label="买方联络人电话" span="1" prop="buyerPhone">
+              <div class="unchanged">
+                {{ item.buyerPhone }}
+              </div>
+            </ws-form-item>
+            <ws-form-item
+              label="成交价格(元/吨)"
+              span="1"
+              prop="transactionPrice"
+            >
+              <div class="unchanged">
+                {{ item.transactionPrice }}
+              </div>
+            </ws-form-item>
+            <ws-form-item label="卖方联络人" span="1" prop="seller">
+              <div class="unchanged">
+                {{ item.seller }}
+              </div>
+            </ws-form-item>
+            <ws-form-item label="成交日期" span="1" prop="transactionDate">
+              <div class="unchanged">
+                {{ item.transactionDate }}
+              </div>
+            </ws-form-item>
+            <ws-form-item label="卖方联络人电话" span="1" prop="sellerPhone">
+              <div class="unchanged">
+                {{ item.sellerPhone }}
+              </div>
+            </ws-form-item>
+            <ws-form-item label="备注" span="1" prop="remarks">
+              <div class="unchanged">
+                {{ item.remarks }}
+              </div>
+            </ws-form-item>
+          </ws-info-table>
+        </ws-form>
       </div>
     </div>
-    <div class="center">
-      <ws-form ref="deptBudgetList" :model="deptBudgetList">
-        <!--基本信息-->
-        <ws-info-table>
-          <ws-form-item
-            label="品种合约及方向"
-            span="1"
-            prop="varietyContractDirection"
-          >
-            <div class="unchanged">
-              {{ deptBudgetList.varietyContractDirection }}
-            </div>
-          </ws-form-item>
-          <ws-form-item label="买方联络人" span="1" prop="buyer">
-            <div class="unchanged">
-              {{ deptBudgetList.buyer }}
-            </div>
-          </ws-form-item>
-          <ws-form-item label="成交数量" span="1" prop="transactionsNumberHand">
-            <div class="unchanged">
-              {{
-                deptBudgetList.transactionsNumberHand
-              }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;手
-              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-              即&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{
-                deptBudgetList.transactionsNumber
-              }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;吨
-            </div>
-          </ws-form-item>
-          <ws-form-item label="买方联络人电话" span="1" prop="buyerPhone">
-            <div class="unchanged">
-              {{ deptBudgetList.buyerPhone }}
-            </div>
-          </ws-form-item>
-          <ws-form-item
-            label="成交价格(元/吨)"
-            span="1"
-            prop="transactionPrice"
-          >
-            <div class="unchanged">
-              {{ deptBudgetList.transactionPrice }}
-            </div>
-          </ws-form-item>
-          <ws-form-item label="卖方联络人" span="1" prop="seller">
-            <div class="unchanged">
-              {{ deptBudgetList.seller }}
-            </div>
-          </ws-form-item>
-          <ws-form-item label="成交日期" span="1" prop="transactionDate">
-            <div class="unchanged">
-              {{ deptBudgetList.transactionDate }}
-            </div>
-          </ws-form-item>
-          <ws-form-item label="卖方联络人电话" span="1" prop="sellerPhone">
-            <div class="unchanged">
-              {{ deptBudgetList.sellerPhone }}
-            </div>
-          </ws-form-item>
-          <ws-form-item label="备注" span="1" prop="remarks">
-            <div class="unchanged">
-              {{ deptBudgetList.remarks }}
-            </div>
-          </ws-form-item>
-        </ws-info-table>
-      </ws-form>
-    </div>
   </div>
 </template>
 <script>
-import { xiala, addxiala, editxiala, delxiala } from '@/model/contarct/index'
+import {
+  selectConfirmationSheet,
+  deletePriceConfirmationSheet,
+} from '@/model/contarct/index'
 import WsUpload from '@/components/WsUpload'
 import { EventBus } from 'base-core-lib'
-import { regionData,  } from 'element-china-area-data'
+import { regionData } from 'element-china-area-data'
 
 export default {
   name: 'viewSpareMoney',
@@ -163,7 +179,7 @@ export default {
   },
   watch: {
     vesselId(val) {
-      this.getVesselData()
+      this.getUnitList()
     },
     isShow(val) {
       this.showType = val
@@ -187,42 +203,18 @@ export default {
       selectedOptions1: [],
       // 提交类型
       submitType: true,
-      tableData: [{ date: 1111, name: 'qqqq', address: 'errrtt' }],
-      trainingMethods: {},
-      packtypeList: [],
-      compId: sessionStorage.getItem('ws-pf_compId'),
-      contractNo: '',
-      mainReportAdd: {},
-      appendixIdsAdd: '',
+      contractNo: 'JYNCG20210423-21',
       size: 10,
       unitList: [],
-      goodnameList: [],
-      gradeList: [],
-      ChapterTwoList: [],
       addressUrls: [],
       addressUrl: '',
-      deptBudgetList: {},
-      pickerBeginDateBefore: {
-        disabledDate: (time) => {
-          return time.getTime() > Date.now()
-        },
-      },
-      ruleDeptBudget: {
-        contractNo: [
-          { required: true, message: '请输入活动名称', trigger: 'blur' },
-          {
-            min: 6,
-            max: 20,
-            message: '长度在 6 到 20 个字符',
-            trigger: 'blur',
-          },
-        ],
-      },
-      selectIntendedShip: {},
-      interviewTypeList: {},
-      fileList: [],
+      deptBudgetList: [],
     }
   },
+  activated() {
+    this.getUnitList()
+    this.showType = this.isShow
+  },
   methods: {
     close(index) {
       this.addressUrls.splice(index, 1)
@@ -245,45 +237,44 @@ export default {
       this.$router.push({ path: 'priceConfirmationSheetAdd' })
     },
     // 编辑点价确认单
-    sheetEdit() {
-        this.$router.push({ path: 'priceConfirmationSheetEdit' })
+    sheetEdit(row) {
+      this.$router.push({ path: 'priceConfirmationSheetEdit' ,
+        query: { contractNo: row.contractNo ,priceListNo: row.priceListNo}})
     },
     // 删除点价确认单
     sheetDelete(item, index) {
-    //   this.$confirm(`确认单删除后不可恢复,是否确定删除?`, '提示', {
-    //     confirmButtonText: '确定',
-    //     cancelButtonText: '取消',
-    //     type: 'warning',
-    //   })
-    //     .then(() => {
-    //       delDriver({ id: row.id })
-    //         .toPromise()
-    //         .then((response) => {
-    //           this.$notify.success({
-    //             title: '成功',
-    //             message: '删除成功',
-    //           })
-    //           this.getUnitList()
-    //           this.pleaseChoose = ''
-    //         })
-    //         .catch((response) => {
-    //           console.log(response)
-    //           EventBus.$emit('error', response.message)
-    //         })
-    //     })
-    //     .catch(() => {
-    //       return false
-    //     })
-    
-    //   if (Object.is(item.constKey, 1)) {
-    //     return
-    //   }
-    //   if (!item.constValue) {
-    //     this.unitList.splice(index, 1)
-    //     return
-    //   }
-    //   delxiala({ id: this.unitList[index].id })
-        
+      //   this.$confirm(`确认单删除后不可恢复,是否确定删除?`, '提示', {
+      //     confirmButtonText: '确定',
+      //     cancelButtonText: '取消',
+      //     type: 'warning',
+      //   })
+      //     .then(() => {
+      //       delDriver({ id: row.id })
+      //         .toPromise()
+      //         .then((response) => {
+      //           this.$notify.success({
+      //             title: '成功',
+      //             message: '删除成功',
+      //           })
+      //           this.getUnitList()
+      //           this.pleaseChoose = ''
+      //         })
+      //         .catch((response) => {
+      //           console.log(response)
+      //           EventBus.$emit('error', response.message)
+      //         })
+      //     })
+      //     .catch(() => {
+      //       return false
+      //     })
+      //   if (Object.is(item.constKey, 1)) {
+      //     return
+      //   }
+      //   if (!item.constValue) {
+      //     this.unitList.splice(index, 1)
+      //     return
+      //   }
+      //   delxiala({ id: this.unitList[index].id })
     },
     fujian(row) {
       if (row.addressUrl === null || row.addressUrl === '') {
@@ -297,24 +288,16 @@ export default {
       this.appendixIdss = row.addressUrl.split(',')
     },
     getUnitList() {
-      xiala({
-        compId: sessionStorage.getItem('ws-pf_compId'),
-        constCode: 'TYPEYAN',
+      selectConfirmationSheet({
+        contractNo: this.contractNo,
       })
         .toPromise()
         .then((response) => {
           this.unitList = response
-          let currItem
+          this.deptBudgetList = response
           this.unitList.forEach((item, index, arr) => {
             item.flag = 'delete'
-            if (this.vModel == item.constKey) {
-              currItem = item
-            }
           })
-          //
-          if (currItem) {
-            this.selectContract(currItem.constValue)
-          }
         })
     },
     resetForm(deptBudgetList) {
@@ -440,11 +423,12 @@ export default {
 }
 .caozuoanniu {
   margin-left: 83%;
-  margin-top: -49px;
+  margin-top: -53px;
   margin-bottom: 20px;
 }
 .fujian {
-  margin-left: 20px;
+  margin-left: 250px;
+  margin-top: -49px;
 }
 .wenzi {
   width: 68%;
@@ -527,6 +511,11 @@ export default {
     }
   }
 }
+.shangchuan {
+  margin-left: 100px;
+  margin-top: -27px;
+  margin-bottom: 30px;
+}
 /deep/.ws-info-table .el-form-item .el-form-item__label {
   width: 148px;
 }

+ 48 - 95
src/views/contractManagement/priceConfirmationSheetAdd.vue

@@ -46,7 +46,6 @@
               placeholder="请输入点价单编号"
               maxlength="20"
               size="small"
-              :rules="ruleDeptBudget"
             />
           </ws-form-item>
 
@@ -62,16 +61,15 @@
               "
               multiple
               :limit="3"
-              :file-list="fileList"
             >
               <el-button size="small" type="primary">附件</el-button>
             </el-upload>
             <div class="shangchuan">
               <template>
-                <span v-if="deptBudgetList.enclosureTypeFlag == '0'"
+                <span v-if="deptBudgetList.enclosureTypeFlag == 0"
                   >未上传</span
                 >
-                <span v-if="deptBudgetList.enclosureTypeFlag == '1'"
+                <span v-if="deptBudgetList.enclosureTypeFlag == 1"
                   >已上传</span
                 >
               </template>
@@ -136,7 +134,11 @@
           </ws-form-item>
 
           <!--成交价格(元/吨)-->
-          <ws-form-item label="成交价格(元/吨)" span="1" prop="transactionPrice">
+          <ws-form-item
+            label="成交价格(元/吨)"
+            span="1"
+            prop="transactionPrice"
+          >
             <ws-input
               v-model="deptBudgetList.transactionPrice"
               placeholder="请输入成交价格"
@@ -188,28 +190,16 @@
       </ws-form>
     </div>
     <div style="text-align: right; padding: 10px" class="center">
-      <el-button
-        class="bg-bottom"
-        type="primary"
-        size="small"
-        @click="submit(deptBudgetList)"
+      <el-button class="bg-bottom" type="primary" size="small" @click="submit()"
         >提交</el-button
       >
     </div>
   </div>
 </template>
 <script>
-//  import { getVesselOne } from '@/model/procurement/basic'
-//  import { dayjs } from 'base-core-lib'
-import {
-  addList,
-  xiala,
-  addxiala,
-  editxiala,
-  delxiala,
-} from '@/model/contarct/index'
+import { addPriceConfirmationSheet } from '@/model/contarct/index'
 import WsUpload from '@/components/WsUpload'
-import { regionData, CodeToText } from 'element-china-area-data'
+import { regionData } from 'element-china-area-data'
 
 export default {
   name: 'viewSpareMoney',
@@ -242,48 +232,27 @@ export default {
       selectedOptions1: [],
       // 提交类型
       submitType: true,
-      tableData: [{ date: 1111, name: 'qqqq', address: 'errrtt' }],
-      trainingMethods: {},
-      packtypeList: [],
-      mainReportAdd: {},
-      appendixIdsAdd: '',
       size: 10,
-
-      compId: sessionStorage.getItem('ws-pf_compId'),
-      enclosureTypeFlag: '0',
       unitList: [],
-      goodnameList: [],
-      gradeList: [],
-      ChapterTwoList: [],
-      addressUrls: [],
-      deptBudgetList: {
-        deliverType: '1',
-        finalTradingVolume: 0,
-        contractGoodsInfo: {
-          goodsName: '',
-        },
-        contractProcessInfo: {},
+      priceConfirmationSheet: {
+        contractNo: 'JYNCG20210423-21',
+        contractType: '2',
+        enclosureTypeFlag: '0',
+        varietyContractDirection: '',
+        buyer: '',
+        seller: '',
+        sellerPhone: '',
+        buyerPhone: '',
+        transactionsNumberHand: '',
+        transactionsNumber: '',
+        transactionPrice: '',
+        transactionDate: '',
+        remarks: '',
+        priceListNo: '',
         addressUrl: '',
       },
-      pickerBeginDateBefore: {
-        disabledDate: (time) => {
-          return time.getTime() > Date.now()
-        },
-      },
-      ruleDeptBudget: {
-        contractNo: [
-          { required: true, message: '请输入活动名称', trigger: 'blur' },
-          {
-            min: 6,
-            max: 20,
-            message: '长度在 6 到 20 个字符',
-            trigger: 'blur',
-          },
-        ],
-      },
-      selectIntendedShip: {},
-      interviewTypeList: {},
-      fileList: [],
+      addressUrls: [],
+      deptBudgetList: {},
     }
   },
   methods: {
@@ -317,30 +286,8 @@ export default {
     },
     //计算成交数量(吨)
     transactionsNumberHandChange(e) {
-        this.deptBudgetList.transactionsNumber = e * 10      
-    },
-    getUnitList() {
-      xiala({
-        compId: sessionStorage.getItem('ws-pf_compId'),
-        constCode: 'TYPEYAN',
-      })
-        .toPromise()
-        .then((response) => {
-          this.unitList = response
-          let currItem
-          this.unitList.forEach((item, index, arr) => {
-            item.flag = 'delete'
-            if (this.vModel == item.constKey) {
-              currItem = item
-            }
-          })
-          //
-          if (currItem) {
-            this.selectContract(currItem.constValue)
-          }
-        })
+      this.deptBudgetList.transactionsNumber = e * 10
     },
-
     submit() {
       if (!this.deptBudgetList.priceListNo) {
         this.$message({
@@ -521,6 +468,26 @@ export default {
         })
         return
       }
+      this.deptBudgetList.contractType = '2'
+      this.deptBudgetList.contractNo = 'JYNCG20210423-21'
+      this.deptBudgetList.enclosureTypeFlag = '0'
+      this.priceConfirmationSheet = this.deptBudgetList
+      this.$confirm(`确定提交确认单信息`, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+      })
+      .then(() => {
+      addPriceConfirmationSheet(this.priceConfirmationSheet)
+        .toPromise()
+        .then((response) => {
+          this.$message.success('添加成功')
+          this.$router.push({ path: 'priceConfirmationSheet' })
+        })
+        })
+        .catch(() => {
+          return false
+        })
     },
     resetForm(deptBudgetList) {
       this.$refs[deptBudgetList].resetFields()
@@ -704,20 +671,6 @@ export default {
 /deep/.ws-info-table .el-form-item .el-form-item__label {
   width: 130px;
 }
-//*号
-.unchangeable {
-  position: absolute;
-  width: 9px;
-  height: 22px;
-  font-size: 16px;
-  font-family: PingFangSC-Medium, PingFang SC;
-  font-weight: 500;
-  color: #ff2727;
-  line-height: 22px;
-  display: inline-block;
-  right: 14px;
-}
-/deep/.el-input,
 /deep/.el-date-editor {
   font-size: 13px;
 }

+ 252 - 255
src/views/contractManagement/priceConfirmationSheetEdit.vue

@@ -30,7 +30,12 @@
       </p>
     </div>
     <div class="center">
-      <ws-form ref="deptBudgetList" :model="deptBudgetList">
+      <ws-form
+        ref="deptBudgetList"
+        :model="deptBudgetList"
+        v-for="(item, index) in deptBudgetList"
+        :key="index"
+      >
         <!--基本信息-->
 
         <ws-info-table>
@@ -42,11 +47,10 @@
             class="readonly"
           >
             <ws-input
-              v-model="deptBudgetList.priceListNo"
+              v-model="item.priceListNo"
               placeholder="请输入点价单编号"
               maxlength="20"
               size="small"
-              :rules="ruleDeptBudget"
             />
           </ws-form-item>
 
@@ -62,18 +66,13 @@
               "
               multiple
               :limit="3"
-              :file-list="fileList"
             >
               <el-button size="small" type="primary">附件</el-button>
             </el-upload>
             <div class="shangchuan">
               <template>
-                <span v-if="deptBudgetList.enclosureTypeFlag == '0'"
-                  >未上传</span
-                >
-                <span v-if="deptBudgetList.enclosureTypeFlag == '1'"
-                  >已上传</span
-                >
+                <span v-if="item.enclosureTypeFlag == '0'">未上传</span>
+                <span v-if="item.enclosureTypeFlag == '1'">已上传</span>
               </template>
             </div>
           </ws-form-item>
@@ -86,7 +85,7 @@
             class="readonly"
           >
             <ws-input
-              v-model="deptBudgetList.varietyContractDirection"
+              v-model="item.varietyContractDirection"
               placeholder="请输入品种合约及方向"
               maxlength="100"
               size="small"
@@ -96,7 +95,7 @@
           <!--买方联络人-->
           <ws-form-item label="买方联络人" span="1" prop="buyer">
             <ws-input
-              v-model="deptBudgetList.buyer"
+              v-model="item.buyer"
               placeholder="请输入买方联络人"
               maxlength="120"
               size="small"
@@ -111,14 +110,14 @@
           >
             <ws-input
               @input="transactionsNumberHandChange"
-              v-model="deptBudgetList.transactionsNumberHand"
+              v-model="item.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="deptBudgetList.transactionsNumber"
+              v-model="item.transactionsNumber"
               placeholder="自动计算"
               maxlength="100"
               size="small"
@@ -128,7 +127,7 @@
           <!--买方联络人电话-->
           <ws-form-item label="买方联络人电话" span="1" prop="buyerPhone">
             <ws-input
-              v-model="deptBudgetList.buyerPhone"
+              v-model="item.buyerPhone"
               placeholder="请输入买方联络人电话"
               maxlength="120"
               size="small"
@@ -136,9 +135,13 @@
           </ws-form-item>
 
           <!--成交价格(元/吨)-->
-          <ws-form-item label="成交价格(元/吨)" span="1" prop="transactionPrice">
+          <ws-form-item
+            label="成交价格(元/吨)"
+            span="1"
+            prop="transactionPrice"
+          >
             <ws-input
-              v-model="deptBudgetList.transactionPrice"
+              v-model="item.transactionPrice"
               placeholder="请输入成交价格"
               maxlength="120"
               size="small"
@@ -148,7 +151,7 @@
           <!--卖方联络人-->
           <ws-form-item label="卖方联络人" span="1" prop="seller">
             <ws-input
-              v-model="deptBudgetList.seller"
+              v-model="item.seller"
               placeholder="请输入卖方联络人"
               maxlength="120"
               size="small"
@@ -158,7 +161,7 @@
           <!--成交日期-->
           <ws-form-item label="成交日期" span="1" prop="transactionDate">
             <ws-date-picker
-              v-model="deptBudgetList.transactionDate"
+              v-model="item.transactionDate"
               type="date"
               placeholder="请选择成交日期"
               value-format="yyyy-MM-dd"
@@ -168,7 +171,7 @@
           <!--卖方联络人电话-->
           <ws-form-item label="卖方联络人电话" span="1" prop="sellerPhone">
             <ws-input
-              v-model="deptBudgetList.sellerPhone"
+              v-model="item.sellerPhone"
               placeholder="请输入卖方联络人电话"
               maxlength="100"
               size="small"
@@ -178,7 +181,7 @@
           <!--备注-->
           <ws-form-item label="备注" span="1" prop="remarks">
             <ws-input
-              v-model="deptBudgetList.remarks"
+              v-model="item.remarks"
               placeholder="请输入备注,不超过200字"
               maxlength="120"
               size="small"
@@ -199,17 +202,12 @@
   </div>
 </template>
 <script>
-//  import { getVesselOne } from '@/model/procurement/basic'
-//  import { dayjs } from 'base-core-lib'
 import {
-  addList,
-  xiala,
-  addxiala,
-  editxiala,
-  delxiala,
+  editPriceConfirmationSheet,
+  selectConfirmationSheet,
 } from '@/model/contarct/index'
 import WsUpload from '@/components/WsUpload'
-import { regionData, CodeToText } from 'element-china-area-data'
+import { regionData } from 'element-china-area-data'
 
 export default {
   name: 'viewSpareMoney',
@@ -218,7 +216,7 @@ export default {
   },
   watch: {
     vesselId(val) {
-      this.getVesselData()
+      this.loaddata()
     },
     isShow(val) {
       this.showType = val
@@ -242,50 +240,25 @@ export default {
       selectedOptions1: [],
       // 提交类型
       submitType: true,
-      tableData: [{ date: 1111, name: 'qqqq', address: 'errrtt' }],
-      trainingMethods: {},
-      packtypeList: [],
-      mainReportAdd: {},
-      appendixIdsAdd: '',
       size: 10,
-
-      compId: sessionStorage.getItem('ws-pf_compId'),
-      enclosureTypeFlag: '0',
       unitList: [],
-      goodnameList: [],
-      gradeList: [],
-      ChapterTwoList: [],
-      addressUrls: [],
-      deptBudgetList: {
-        deliverType: '1',
-        finalTradingVolume: 0,
-        contractGoodsInfo: {
-          goodsName: '',
-        },
-        contractProcessInfo: {},
-        addressUrl: '',
-      },
-      pickerBeginDateBefore: {
-        disabledDate: (time) => {
-          return time.getTime() > Date.now()
-        },
-      },
-      ruleDeptBudget: {
-        contractNo: [
-          { required: true, message: '请输入活动名称', trigger: 'blur' },
-          {
-            min: 6,
-            max: 20,
-            message: '长度在 6 到 20 个字符',
-            trigger: 'blur',
-          },
-        ],
+      priceConfirmationSheet: {
+        contractNo: 'JYNCG20210423-21',
+        contractType: '2',
+        enclosureTypeFlag: '0',
+
+        priceListNo: '',
       },
-      selectIntendedShip: {},
-      interviewTypeList: {},
-      fileList: [],
+      addressUrls: [],
+      deptBudgetList: {},
     }
   },
+  activated() {
+    this.loaddata()
+    this.editPriceConfirmationSheet()
+    this.showType = this.isShow
+    this.showType = this.isShow
+  },
   methods: {
     close(index) {
       this.addressUrls.splice(index, 1)
@@ -315,217 +288,241 @@ export default {
         console.log(files)
       })
     },
-    //计算成交数量(吨)
-    transactionsNumberHandChange(e) {
-      this.deptBudgetList.transactionsNumber = e * 10 
-    },
-    getUnitList() {
-      xiala({
-        compId: sessionStorage.getItem('ws-pf_compId'),
-        constCode: 'TYPEYAN',
+    //数据回显
+    loaddata() {
+      // 数据
+      selectConfirmationSheet({
+        contractNo: this.$route.query.contractNo,
       })
         .toPromise()
         .then((response) => {
+          console.log('fasduh')
           this.unitList = response
-          let currItem
+          this.deptBudgetList = response
           this.unitList.forEach((item, index, arr) => {
             item.flag = 'delete'
-            if (this.vModel == item.constKey) {
-              currItem = item
-            }
           })
-          //
-          if (currItem) {
-            this.selectContract(currItem.constValue)
-          }
         })
     },
-
+    //计算成交数量(吨)
+    transactionsNumberHandChange(e) {
+      this.deptBudgetList.transactionsNumber = e * 10
+    },
     submit() {
-      if (!this.deptBudgetList.priceListNo) {
-        this.$message({
-          message: '点价单编号不能为空!',
-          type: 'warning',
-        })
-        return
-      }
-      if (
-        this.deptBudgetList.priceListNo.length < 1 ||
-        this.deptBudgetList.priceListNo.length > 20
-      ) {
-        this.$message({
-          message: '点价单编号输入错误!',
-          type: 'warning',
-        })
-        return
-      }
-      if (!this.deptBudgetList.varietyContractDirection) {
-        this.$message({
-          message: '品种合约及方向不能为空!',
-          type: 'warning',
-        })
-        return
-      }
-      if (
-        this.deptBudgetList.varietyContractDirection.length < 1 ||
-        this.deptBudgetList.varietyContractDirection.length > 20
-      ) {
-        this.$message({
-          message: '品种合约及方向输入错误!',
-          type: 'warning',
-        })
-        return
-      }
-      if (!this.deptBudgetList.buyer) {
-        this.$message({
-          message: '买方联络人不能为空!',
-          type: 'warning',
-        })
-        return
-      }
-      if (
-        this.deptBudgetList.buyer.length < 2 ||
-        this.deptBudgetList.buyer.length > 20
-      ) {
-        this.$message({
-          message: '买方联络人姓名输入错误!',
-          type: 'warning',
-        })
-        return
-      }
-      if (!this.deptBudgetList.buyerPhone) {
-        this.$message({
-          message: '买方联络人电话不能为空!',
-          type: 'warning',
-        })
-        return
-      }
-      if (
-        this.deptBudgetList.buyerPhone.length < 7 ||
-        this.deptBudgetList.buyerPhone.length > 20
-      ) {
-        this.$message({
-          message: '买方联络人电话输入错误!',
-          type: 'warning',
-        })
-        return
-      }
-      if (isNaN(this.deptBudgetList.buyerPhone)) {
-        this.$message({
-          message: '卖方联络人电话输入有误!',
-          type: 'warning',
-        })
-        return
-      }
-      if (!this.deptBudgetList.seller) {
-        this.$message({
-          message: '卖方联络人不能为空!',
-          type: 'warning',
-        })
-        return
-      }
-      if (
-        this.deptBudgetList.seller.length < 2 ||
-        this.deptBudgetList.seller.length > 20
-      ) {
-        this.$message({
-          message: '卖方联络人姓名输入错误!',
-          type: 'warning',
-        })
-        return
-      }
+      for (var i = 0; i < this.deptBudgetList.length; i++) {
+        if (!this.deptBudgetList[i].priceListNo) {
+          this.$message({
+            message: '点价单编号不能为空!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList[i].priceListNo.length < 1 ||
+          this.deptBudgetList[i].priceListNo.length > 20
+        ) {
+          this.$message({
+            message: '点价单编号输入错误!',
+            type: 'warning',
+          })
+          return
+        }
+        if (!this.deptBudgetList[i].varietyContractDirection) {
+          this.$message({
+            message: '品种合约及方向不能为空!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList[i].varietyContractDirection.length < 1 ||
+          this.deptBudgetList[i].varietyContractDirection.length > 20
+        ) {
+          this.$message({
+            message: '品种合约及方向输入错误!',
+            type: 'warning',
+          })
+          return
+        }
+        if (!this.deptBudgetList[i].buyer) {
+          this.$message({
+            message: '买方联络人不能为空!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList[i].buyer.length < 2 ||
+          this.deptBudgetList[i].buyer.length > 20
+        ) {
+          this.$message({
+            message: '买方联络人姓名输入错误!',
+            type: 'warning',
+          })
+          return
+        }
+        if (!this.deptBudgetList[i].buyerPhone) {
+          this.$message({
+            message: '买方联络人电话不能为空!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList[i].buyerPhone.length < 7 ||
+          this.deptBudgetList[i].buyerPhone.length > 20
+        ) {
+          this.$message({
+            message: '买方联络人电话输入错误!',
+            type: 'warning',
+          })
+          return
+        }
+        if (isNaN(this.deptBudgetList[i].buyerPhone)) {
+          this.$message({
+            message: '卖方联络人电话输入有误!',
+            type: 'warning',
+          })
+          return
+        }
+        if (!this.deptBudgetList[i].seller) {
+          this.$message({
+            message: '卖方联络人不能为空!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList[i].seller.length < 2 ||
+          this.deptBudgetList[i].seller.length > 20
+        ) {
+          this.$message({
+            message: '卖方联络人姓名输入错误!',
+            type: 'warning',
+          })
+          return
+        }
 
-      if (!this.deptBudgetList.sellerPhone) {
-        this.$message({
-          message: '卖方联络人电话不能为空!',
-          type: 'warning',
-        })
-        return
-      }
-      if (isNaN(this.deptBudgetList.sellerPhone)) {
-        this.$message({
-          message: '卖方联络人电话输入有误!',
-          type: 'warning',
-        })
-        return
-      }
-      if (
-        this.deptBudgetList.sellerPhone.length < 7 ||
-        this.deptBudgetList.sellerPhone.length > 20
-      ) {
-        this.$message({
-          message: '卖方联络人电话输入有误!',
-          type: 'warning',
-        })
-        return
-      }
-      if (!this.deptBudgetList.transactionsNumberHand) {
-        this.$message({
-          message: '成交数量不能为空!',
-          type: 'warning',
-        })
-        return
-      }
+        if (!this.deptBudgetList[i].sellerPhone) {
+          this.$message({
+            message: '卖方联络人电话不能为空!',
+            type: 'warning',
+          })
+          return
+        }
+        if (isNaN(this.deptBudgetList[i].sellerPhone)) {
+          this.$message({
+            message: '卖方联络人电话输入有误!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList[i].sellerPhone.length < 7 ||
+          this.deptBudgetList[i].sellerPhone.length > 20
+        ) {
+          this.$message({
+            message: '卖方联络人电话输入有误!',
+            type: 'warning',
+          })
+          return
+        }
+        if (!this.deptBudgetList[i].transactionsNumberHand) {
+          this.$message({
+            message: '成交数量不能为空!',
+            type: 'warning',
+          })
+          return
+        }
 
-      if (
-        isNaN(this.deptBudgetList.transactionsNumberHand) ||
-        (String(this.deptBudgetList.transactionsNumberHand).indexOf('.') !=
-          -1 &&
-          String(this.deptBudgetList.transactionsNumberHand).length -
-            (String(this.deptBudgetList.transactionsNumberHand).indexOf('.') +
-              1) >
-            2) ||
-        this.deptBudgetList.transactionsNumberHand < 1 ||
-        this.deptBudgetList.transactionsNumberHand > 10000
-      ) {
-        this.$message({
-          message: '输入成交数量有误!',
-          type: 'warning',
-        })
-        return
-      }
-      if (
-        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)
-      ) {
-        this.$message({
-          message: '成交价格输入错误',
-          type: 'warning',
-        })
-        return
-      }
-      if (this.deptBudgetList.transactionPrice) {
-        if (isNaN(this.deptBudgetList.transactionPrice)) {
+        if (
+          isNaN(this.deptBudgetList[i].transactionsNumberHand) ||
+          (String(this.deptBudgetList[i].transactionsNumberHand).indexOf('.') !=
+            -1 &&
+            String(this.deptBudgetList[i].transactionsNumberHand).length -
+              (String(this.deptBudgetList[i].transactionsNumberHand).indexOf(
+                '.'
+              ) +
+                1) >
+              2) ||
+          this.deptBudgetList[i].transactionsNumberHand < 1 ||
+          this.deptBudgetList[i].transactionsNumberHand > 10000
+        ) {
           this.$message({
-            message: '成交价格输入错误!',
+            message: '输入成交数量有误!',
+            type: 'warning',
+          })
+          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('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '成交价格输入错误',
+            type: 'warning',
+          })
+          return
+        }
+        if (this.deptBudgetList[i].transactionPrice) {
+          if (isNaN(this.deptBudgetList[i].transactionPrice)) {
+            this.$message({
+              message: '成交价格输入错误!',
+              type: 'warning',
+            })
+            return
+          }
+        }
+        if (!this.deptBudgetList[i].transactionPrice) {
+          this.$message({
+            message: '成交价格不能为空!',
+            type: 'warning',
+          })
+          return
+        }
+        if (!this.deptBudgetList[i].transactionDate) {
+          this.$message({
+            message: '成交日期不能为空!',
             type: 'warning',
           })
           return
         }
       }
-      if (!this.deptBudgetList.transactionPrice) {
-        this.$message({
-          message: '成交价格不能为空!',
-          type: 'warning',
+
+      this.deptBudgetList.contractType = '2'
+      this.deptBudgetList.contractNo = this.contractNo
+      this.deptBudgetList.enclosureTypeFlag = '0'
+      this.priceConfirmationSheet.deptBudgetList = this.deptBudgetList
+      this.$confirm(`确定提交确认单信息`, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+      })
+        .then(() => {
+          editPriceConfirmationSheet(this.priceConfirmationSheet)
+            .toPromise()
+            .then((response) => {
+              this.$message.success('编辑成功')
+              this.priceConfirmationSheet = {}
+              this.$router.push({ path: 'priceConfirmationSheet' })
+            })
         })
-        return
-      }
-      if (!this.deptBudgetList.transactionDate) {
-        this.$message({
-          message: '成交日期不能为空!',
-          type: 'warning',
+        .catch(() => {
+          return false
         })
-        return
-      }
     },
     resetForm(deptBudgetList) {
       this.$refs[deptBudgetList].resetFields()
     },
   },
+  //   editPriceConfirmationSheet() {
+  //   editPriceConfirmationSheet({})
+  // },
 }
 </script>
 

+ 1 - 3
src/views/warehouse/warehouseManagementPut.vue

@@ -151,10 +151,9 @@
               placeholder="请输入车牌号"
               maxlength="7"
               size="small"
-              onkeyup="value=value.replace(/[^\A-\Z0-9\u4E00-\u9FA5\.]/g,'')"
             />
           </ws-form-item>
-
+              <!-- onkeyup="value=value.replace(/[^\A-\Z0-9\u4E00-\u9FA5\.]/g,'')" -->
           <!--合同编号-->
           <ws-form-item label="合同编号" span="1" prop="contractNo">
             <ws-select
@@ -529,7 +528,6 @@ export default {
         })
         return
       }
-
       if (!this.deptBudgetList.carNo) {
         this.$message({
           message: '车牌号不能为空',