浏览代码

feature(*): 1、合同和工单模块优化功能
2、合同、发票金额格式调整

likai 1 年之前
父节点
当前提交
57cbbebd77

+ 2 - 2
src/utils/index.js

@@ -271,9 +271,9 @@ export function resetForm(refName) {
  * @param currency {String} 币种 CNY 人民币;USD 美元;EUR 欧元
  * @returns {String} 格式化后的字符串
  */
-export function formatPrice(price, currency = 'CNY') {
+export function formatPrice(price, currency = 'CNY', maximumFractionDigits = 0) {
   if (!price) price = 0
-  return price.toLocaleString('zh-CN', { style: 'currency', currency, maximumFractionDigits: 0 })
+  return price.toLocaleString('zh-CN', { style: 'currency', currency, maximumFractionDigits: maximumFractionDigits })
 }
 
 // 回显数据字典

+ 1 - 1
src/views/collection/plan.vue

@@ -99,7 +99,7 @@
             @click="handleContractDetail(row)">
             {{ row.contractCode }}
           </el-button>
-          <span v-else-if="item.prop == 'planAmount'">{{ formatPrice(row.planAmount) }}</span>
+          <span v-else-if="item.prop == 'planAmount'">{{ formatPrice(row.planAmount, 'CNY', 2) }}</span>
           <span v-else-if="item.prop == 'cashedAmount'">{{ formatPrice(row.cashedAmount) }}</span>
           <span v-else-if="item.label == '未回款金额'">
             {{ formatPrice(row.planAmount - row.cashedAmount) }}

+ 3 - 1
src/views/contract/components/DetailsCollection.vue

@@ -41,7 +41,9 @@
             <span v-else-if="item.prop == 'planScale'">
               {{ row.planScale + '%' }}
             </span>
-            <span v-else-if="item.prop == 'planAmount'">{{ formatPrice(row.planAmount) }}</span>
+            <span v-else-if="item.prop == 'planAmount'">
+              {{ formatPrice(row.planAmount, 'CNY', 2) }}
+            </span>
             <span v-else>{{ row[item.prop] }}</span>
           </template>
         </el-table-column>

+ 1 - 1
src/views/contract/components/DetailsInvoice.vue

@@ -63,7 +63,7 @@
             {{ row.bank + '、' + row.accountNo }}
           </span>
           <span v-else-if="item.prop == 'invoiceAmount'">
-            {{ formatPrice(row.invoiceAmount) }}
+            {{ formatPrice(row.invoiceAmount, 'CNY', 2) }}
           </span>
           <span v-else>{{ row[item.prop] }}</span>
         </template>

+ 2 - 0
src/views/contract/components/EditInvoice.vue

@@ -167,6 +167,7 @@
         let params = { ...this.editForm }
         const [valid] = await to(this.$refs.editForm.validate())
         if (valid == false) return
+        params['invoiceAmount'] = parseFloat(params['invoiceAmount'])
         const [err, res] = await to(invoiceApi.addInvoice(params))
         if (err) return
         if (res.code == 200) this.$message.success(res.msg)
@@ -179,6 +180,7 @@
         let params = { ...this.editForm }
         const [valid] = await to(this.$refs.editForm.validate())
         if (valid == false) return
+        params['invoiceAmount'] = parseFloat(params['invoiceAmount'])
         const [err, res] = await to(invoiceApi.updateInvoice(params))
         if (err) return
         if (res.code == 200) this.$message.success(res.msg)

+ 2 - 0
src/views/contract/components/EditPlan.vue

@@ -138,6 +138,7 @@
         const [valid] = await to(this.$refs.editForm.validate())
         if (valid == false) return
         params.planScale = Number(params.planScale)
+        params['planAmount'] = parseFloat(params['planAmount'])
         const [err, res] = await to(collectionPlanApi.addCollectionPlan(params))
         if (err) return
         if (res.code == 200) this.$message.success(res.msg)
@@ -151,6 +152,7 @@
         const [valid] = await to(this.$refs.editForm.validate())
         if (valid == false) return
         params.planScale = Number(params.planScale)
+        params['planAmount'] = parseFloat(params['planAmount'])
         const [err, res] = await to(collectionPlanApi.updateCollectionPlan(params))
         if (err) return
         if (res.code == 200) this.$message.success(res.msg)

+ 1 - 1
src/views/contract/invoice.vue

@@ -81,7 +81,7 @@
             {{ row.bank + '、' + row.accountNo }}
           </span>
           <span v-else-if="item.prop == 'invoiceAmount'">
-            {{ formatPrice(row.invoiceAmount) }}
+            {{ formatPrice(row.invoiceAmount, 'CNY', 2) }}
           </span>
           <span v-else>{{ row[item.prop] }}</span>
         </template>

+ 53 - 8
src/views/work/deliver/components/detailWork.vue

@@ -28,6 +28,11 @@
               {{ parseTime(theDeliverOrder.requiredDeliveryTime, '{y}-{m}-{d}') }}
             </el-form-item>
           </el-col>
+          <el-col v-if="theProgress && theProgress.deliverStatus >= 30" :span="12">
+            <el-form-item label="实际发货时间:" style="margin: 0px">
+              {{ parseTime(theDeliverOrder.realDeliveryTime, '{y}-{m}-{d}') }}
+            </el-form-item>
+          </el-col>
           <el-col v-if="theProgress.progressType != '' && theProgress.progressType != '40'" :span="12">
             <el-form-item label="收货信息:" style="margin: 0px">
               {{ theDeliverOrder.receivingInfo }}
@@ -163,6 +168,31 @@
               {{ parseTime(theProgress.productSigningTime, '{y}-{m}-{d}') }}
             </el-form-item>
           </el-col>
+          <el-col v-if="form.progressType == '40'" :span="12">
+            <el-form-item label="实际验收时间:" style="margin: 0px">
+              {{ parseTime(theProgress.softwareCheckTime, '{y}-{m}-{d}') }}
+            </el-form-item>
+          </el-col>
+          <el-col v-if="form.progressType == '40'" :span="12">
+            <el-form-item label="已完成工作内容:" style="margin: 0px">
+              {{ theProgress.completedContent }}
+            </el-form-item>
+          </el-col>
+          <el-col v-if="form.progressType == '40'" :span="12">
+            <el-form-item label="已完成工作量:" style="margin: 0px">
+              {{ theProgress.completedWork }}
+            </el-form-item>
+          </el-col>
+          <el-col v-if="form.progressType == '40'" :span="12">
+            <el-form-item label="未完成工作内容:" style="margin: 0px">
+              {{ theProgress.uncompletedContent }}
+            </el-form-item>
+          </el-col>
+          <el-col v-if="form.progressType == '40'" :span="12">
+            <el-form-item label="未完成工作量:" style="margin: 0px">
+              {{ theProgress.uncompletedWork }}
+            </el-form-item>
+          </el-col>
           <el-col :span="24" style="margin-top: 10px">
             <el-button
               v-if="theProgress && theProgress.assembleFileName != ''"
@@ -185,6 +215,13 @@
               @click="showFile(theProgress.installCheckFileUrl, theProgress.installCheckFileName)">
               安装验收单:{{ theProgress.installCheckFileName }}
             </el-button>
+            <el-button
+              v-if="theProgress && theProgress.softwareCheckFileName != ''"
+              size="mini"
+              type="primary"
+              @click="showFile(theProgress.softwareCheckFileUrl, theProgress.softwareCheckFileName)">
+              验收报告:{{ theProgress.softwareCheckFileName }}
+            </el-button>
           </el-col>
           <el-col :span="24">
             <el-form-item label="备注:" style="margin: 0px">
@@ -313,16 +350,24 @@
           this.allProducts = res.data.product
           progressProducts = res.data.progressProducts ? res.data.progressProducts : []
         }
-        for (let p of progressProducts) {
-          p = JSON.parse(JSON.stringify(p))
-          // 10发货任务单/20组装任务单/30部署安装单
-          if (
-            (p.deliverProgressId == this.workId && this.form.progressType == '10') ||
-            (p.assembleProgressId == this.workId && this.form.progressType == '20') ||
-            (p.installProgressId == this.workId && this.form.progressType == '30')
-          ) {
+        // 10发货任务单、20组装任务单、30部署安装单、40软件交付验收任务单
+        if (this.form.progressType == '40') {
+          for (let p of this.allProducts) {
+            p = JSON.parse(JSON.stringify(p))
             this.products.push(p)
           }
+        } else {
+          for (let p of progressProducts) {
+            p = JSON.parse(JSON.stringify(p))
+            // 10发货任务单、20组装任务单、30部署安装单、40软件交付验收任务单
+            if (
+              (p.deliverProgressId == this.workId && this.form.progressType == '10') ||
+              (p.assembleProgressId == this.workId && this.form.progressType == '20') ||
+              (p.installProgressId == this.workId && this.form.progressType == '30')
+            ) {
+              this.products.push(p)
+            }
+          }
         }
       },
       // 保存产品信息

+ 17 - 8
src/views/work/deliver/components/editWork.vue

@@ -400,16 +400,24 @@
           p = JSON.parse(JSON.stringify(p))
           this.deliverProducts.push(p)
         }
-        for (let p of progressProducts) {
-          p = JSON.parse(JSON.stringify(p))
-          // 10发货任务单/20组装任务单/30部署安装单
-          if (
-            (p.deliverProgressId == this.workId && this.form.progressType == '10') ||
-            (p.assembleProgressId == this.workId && this.form.progressType == '20') ||
-            (p.installProgressId == this.workId && this.form.progressType == '30')
-          ) {
+        // 10发货任务单、20组装任务单、30部署安装单、40软件交付验收任务单
+        if (this.form.progressType == '40') {
+          for (let p of this.allProducts) {
+            p = JSON.parse(JSON.stringify(p))
             this.selfProducts.push(p)
           }
+        } else {
+          for (let p of progressProducts) {
+            p = JSON.parse(JSON.stringify(p))
+            // 10发货任务单、20组装任务单、30部署安装单、40软件交付验收任务单
+            if (
+              (p.deliverProgressId == this.workId && this.form.progressType == '10') ||
+              (p.assembleProgressId == this.workId && this.form.progressType == '20') ||
+              (p.installProgressId == this.workId && this.form.progressType == '30')
+            ) {
+              this.selfProducts.push(p)
+            }
+          }
         }
         this.$forceUpdate()
         if (this.workId != 0) {
@@ -422,6 +430,7 @@
             this.products = this.selfProducts
           }
         }
+        console.info(this.products)
       },
     },
   }

+ 3 - 3
src/views/work/deliver/components/softwareComplete.vue

@@ -22,7 +22,7 @@
           </el-form-item>
         </el-col>
         <el-col :span="24">
-          <el-form-item label="选择验收时间" prop="softwareCheckTime">
+          <el-form-item label="实际验收时间" prop="softwareCheckTime">
             <el-date-picker
               v-model="form.softwareCheckTime"
               placeholder="请选择日期"
@@ -57,8 +57,8 @@
           </el-form-item>
         </el-col>
         <el-col :span="24">
-          <el-form-item label="完成工作量" prop="uncompletedWork">
-            <el-input v-model="form.uncompletedWork" placeholder="请输入完成工作量" />
+          <el-form-item label="完成工作量" prop="uncompletedWork">
+            <el-input v-model="form.uncompletedWork" placeholder="请输入完成工作量" />
           </el-form-item>
         </el-col>
       </el-row>

+ 2 - 2
src/views/work/deliver/plan.vue

@@ -378,8 +378,8 @@
   import AuditInstall from '@/views/work/deliver/components/auditInstall'
   import productSign from '@/views/work/deliver/components/productSign'
   import softwareComplete from '@/views/work/deliver/components/softwareComplete'
-  import detailsRecords from './components/detailsRecords'
-  import changeDeliverTime from './components/changeDeliverTime'
+  import detailsRecords from '@/views/work/deliver/components/detailsRecords'
+  import changeDeliverTime from '@/views/work/deliver/components/changeDeliverTime'
   import { mapGetters } from 'vuex'
 
   export default {

+ 48 - 9
src/views/work/deliver/progress.vue

@@ -109,13 +109,7 @@
           </el-button>
           <!-- 非部署安装任务的开始 -->
           <el-button
-            v-if="
-              row.progressStatus == 10 &&
-              workOrderStatus != 20 &&
-              curPlanStatus != 30 &&
-              row.progressType != '30' &&
-              userId == row.principalPersonId
-            "
+            v-if="row.progressStatus == 10 && row.progressType != '30' && userId == row.principalPersonId"
             type="text"
             @click="handleStartWork(row)">
             开始
@@ -125,8 +119,6 @@
           <!-- <el-button
             v-if="
               row.progressStatus == 10 &&
-              workOrderStatus != 20 &&
-              curPlanStatus != 30 &&
               row.progressType == '30' &&
               userId == saleId
             "
@@ -158,6 +150,17 @@
             @click="handleInspectGoods(row)">
             验收
           </el-button> -->
+          <el-button
+            v-if="
+              row.deliverStatus >= 30 &&
+              row.progressType == '10' &&
+              row.isSign != '20' &&
+              userId == row.principalPersonId
+            "
+            type="text"
+            @click="handleProductSign(row)">
+            签收
+          </el-button>
           <el-button
             v-if="
               row.progressStatus == 20 &&
@@ -198,6 +201,18 @@
             @click="handleComplete(row)">
             完成
           </el-button>
+          <el-button
+            v-if="row.progressStatus == 20 && row.progressType == '40' && userId == row.principalPersonId"
+            type="text"
+            @click="handleSoftwareComplete(row)">
+            完成
+          </el-button>
+          <el-button
+            v-if="row.progressStatus == 20 && row.progressType == '40' && userId == row.principalPersonId"
+            type="text"
+            @click="handleChangeDeliverTime(row)">
+            变更交付时间
+          </el-button>
           <!-- 部署安装任务审核 -->
           <el-button
             v-show="row.progressStatus == 30 && row.progressType == '30'"
@@ -238,6 +253,12 @@
     <ConfirmInstall ref="ConfirmInstall" @fetch-data="fetchData" />
     <!-- 安装审核 -->
     <AuditInstall ref="AuditInstall" @fetch-data="fetchData" />
+    <!-- 签收 -->
+    <productSign ref="productSign" @fetch-data="fetchData" />
+    <!-- 软件完成 -->
+    <softwareComplete ref="softwareComplete" @fetch-data="fetchData" />
+    <!-- 变更要求交付时间 -->
+    <changeDeliverTime ref="changeDeliverTime" @fetch-data="fetchData" />
   </div>
 </template>
 
@@ -254,6 +275,9 @@
   import StartInstall from '@/views/work/deliver/components/startInstall'
   import ConfirmInstall from '@/views/work/deliver/components/confirmInstall'
   import AuditInstall from '@/views/work/deliver/components/auditInstall'
+  import productSign from '@/views/work/deliver/components/productSign'
+  import softwareComplete from '@/views/work/deliver/components/softwareComplete'
+  import changeDeliverTime from '@/views/work/deliver/components/changeDeliverTime'
 
   export default {
     name: 'Progress',
@@ -267,6 +291,9 @@
       StartInstall,
       ConfirmInstall,
       AuditInstall,
+      productSign,
+      softwareComplete,
+      changeDeliverTime,
     },
     data() {
       return {
@@ -465,6 +492,14 @@
       handleComplete(row) {
         this.$refs.complete.open(row)
       },
+      // 软件交付完成
+      handleSoftwareComplete(row) {
+        this.$refs.softwareComplete.open(row)
+      },
+      // 变更要求交付时间
+      handleChangeDeliverTime(row) {
+        this.$refs.changeDeliverTime.open(row)
+      },
       // 发货
       handleDeliverGoods(row) {
         this.$refs.deliver.open(row)
@@ -473,6 +508,10 @@
       handleInspectGoods(row) {
         this.$refs.inspect.open(row)
       },
+      // 签收
+      handleProductSign(row) {
+        this.$refs.productSign.open(row)
+      },
       // 确认到货
       async handleConfirmArrival(row) {
         this.$prompt('你确定货物已到达吗', '提示', {