Browse Source

进口、财务细节调整

qinbai 4 years ago
parent
commit
c6177576db

+ 8 - 0
src/api/importTrade/purchase.js

@@ -52,3 +52,11 @@ export function removeData(ids) {
     params: {ids}
   })
 }
+
+export function getSysNo(prefix) {
+  return request({
+    url: '/api/trade-purchase/purchase-order/getSysNo',
+    method: 'get',
+    params: {prefix}
+  })
+}

+ 1 - 0
src/components/port-info/index.vue

@@ -3,6 +3,7 @@
     <div @click="portinfoVisible = true&&!disabled">
       <el-input
         v-model="value"
+        size="small"
         @input="$emit('balabala', value)"
         placeholder="请选择"
         :disabled="disabled"

+ 1 - 0
src/views/financialManagement/payment.vue

@@ -21,6 +21,7 @@
         </el-button>
         <el-button size="small"
                    type="success"
+                   :disabled="true"
                    @click.stop=""
         >复制新单
         </el-button>

+ 42 - 5
src/views/financialManagement/paymentDetailsPage.vue

@@ -7,7 +7,8 @@
         </el-button>
         <el-button type="success"
                    class="el-button--small-yh add-customer-btn-two"
-                   @click.stop="addMainProject">复制新单
+                   :disabled="true"
+                   @click.stop="">复制新单
         </el-button>
         <el-button class="el-button--small-yh add-customer-btn" type="primary"
                    @click.stop="editFinance"
@@ -22,12 +23,20 @@
           <el-row>
             <el-col v-for="(item, index) in basicData.column" :span="item.span?item.span:8" :key="index">
               <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
-                <el-date-picker v-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]" size="small" type="date" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
+                <el-date-picker v-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]" size="small" type="date" :disabled="item.disabled?true:false" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
                 <el-select v-else-if="item.type === 'select'" style="width: 100%" size="small" placeholder="请选择"  clearable filterable></el-select>
                 <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :configuration="configuration"/>
                 <el-select v-else-if="item.prop === 'currency'" style="width: 100%"   v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
                   <el-option v-for="(item,index) in currencyDic" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
                 </el-select>
+                <el-select v-else-if="item.prop === 'financeStatus'" style="width: 100%"   v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
+                  <el-option
+                    v-for="item in financeStatusDic"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value">
+                  </el-option>
+                </el-select>
                 <el-input type="age" v-else-if="item.prop === 'exchangeRate'" v-model="form[item.prop]"   size="small" autocomplete="off" placeholder="请输入">
                   <template   slot="append">%</template>
                 </el-input>
@@ -95,6 +104,8 @@
   import option from "./configuration/detailsPage.json";
   import { getDetail,editFinance } from "@/api/financialManagement/financialManagement"
   import {detailListData } from "@/api/importTrade/purchase";
+  import {getSysNo} from "@/api/importTrade/purchase";
+  import { getUserInfo } from "@/api/system/user";
 
   export default {
     data() {
@@ -121,12 +132,20 @@
           placeholder:'请点击右边按钮选择',
           dicData:[]
         },
+        financeStatusDic:[{
+          label:'正常',
+          value:0
+        },{
+          label:'停用',
+          value:1
+        }],
         //顶部from数据
         basicData: {
           column: [
             {
               label: '系统号',
               prop: 'sysNo',
+              disabled:true,
               rules: [
                 {
                   required: true,
@@ -247,10 +266,10 @@
             {
               label: '单据状态',
               prop: 'financeStatus',
-              type:'select'
             }, {
               label: '制单人',
               prop: 'createUserName',
+              disabled:true,
               rules: [
                 {
                   required: false,
@@ -262,6 +281,7 @@
               label: '制单日期',
               prop: 'createTime',
               type:"date",
+              disabled:true,
               rules: [
                 {
                   required: false,
@@ -294,13 +314,19 @@
       if (this.$route.query.id) {
         this.id = BigInt(this.$route.query.id);//字符串转数字  超长用BigInt
         getDetail(this.id).then(res => {
-          console.log()
           this.form = res.data.data;
+          this.configuration.dicData = res.data.data.customerModel;
           this.dataList = res.data.data.itemsList
         })
+      }else{
+        this.assignment()
       }
+
       if(this.$route.query.params){
         detailListData(this.$route.query.params.id).then(res =>{
+          this.form.corpId =  res.data.data.corpId;
+          this.form.srcOrderno =  res.data.data.orderNo;
+          this.configuration.dicData = res.data.data.corpsName;
           res.data.data.itemsVOList.forEach((item,index) =>{
             this.$route.query.params.orderItemIds.forEach((e,i) =>{
               if(e ==  index){
@@ -313,16 +339,27 @@
                 this.$refs.crud.rowCellAdd(params);
                 this.$refs.crud.rowCell(params,this.dataList.length - 1)
               }
-              this.form.corpId =  res.data.data.corpId;
             })
           })
         })
+        this.assignment()
       }
     },
     mounted() {
       option.height = window.innerHeight - 640 ;
     },
     methods: {
+      assignment(){
+        getSysNo("CW-FK").then(res =>{
+          this.$set(this.form,"sysNo", res.data.data)
+          let date = new Date();
+          let strDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
+          this.$set(this.form,"createTime",strDate)
+        })
+        getUserInfo().then(res =>{
+          this.$set(this.form,"createUserName", res.data.data.name)
+        })
+      },
       searchReset() {
         console.log('1')
       },

+ 1 - 0
src/views/financialManagement/receipt.vue

@@ -21,6 +21,7 @@
         </el-button>
         <el-button size="small"
                    type="success"
+                   :disabled="true"
                    @click.stop=""
         >复制新单
         </el-button>

+ 66 - 40
src/views/financialManagement/receiptDetailsPage.vue

@@ -7,7 +7,8 @@
         </el-button>
         <el-button type="success"
                    class="el-button--small-yh add-customer-btn-two"
-                   @click.stop="addMainProject">复制新单
+                   :disabled="true"
+                   @click.stop="">复制新单
         </el-button>
         <el-button class="el-button--small-yh add-customer-btn" type="primary"
                    @click.stop="editFinance "
@@ -22,17 +23,25 @@
           <el-row>
             <el-col v-for="(item, index) in basicData.column" :span="item.span?item.span:8" :key="index">
               <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
-                <el-date-picker v-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]" size="small" type="date" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
+                <el-date-picker v-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]" size="small" :disabled="item.disabled?true:false" type="date" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
                 <el-select v-else-if="item.type === 'select'" style="width: 100%" size="small" placeholder="请选择" clearable filterable></el-select>
                 <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :configuration="configuration"/>
                 <el-select v-else-if="item.prop === 'currency'" style="width: 100%"   v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
                   <el-option v-for="(item,index) in currencyDic" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
                 </el-select>
+                <el-select v-else-if="item.prop === 'financeStatus'" style="width: 100%"   v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
+                  <el-option
+                    v-for="item in financeStatusDic"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value">
+                  </el-option>
+                </el-select>
                 <el-input type="age" v-else-if="item.prop === 'exchangeRate'" v-model="form[item.prop]"   size="small" autocomplete="off" placeholder="请输入">
                   <template   slot="append">%</template>
                 </el-input>
                 <el-input type="textarea" v-else-if="(item.prop === 'remark')" v-model="form[item.prop]"   size="small" autocomplete="off" placeholder="请输入"></el-input>
-                <el-input type="age" v-else v-model="form[item.prop]" size="small" autocomplete="off" placeholder="请输入"></el-input>
+                <el-input type="age" v-else v-model="form[item.prop]" size="small" :disabled="item.disabled?true:false" autocomplete="off" placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
           </el-row>
@@ -94,6 +103,8 @@
 <script>
   import option from "./configuration/detailsPage.json";
   import { getDetail,editFinance } from "@/api/financialManagement/financialManagement"
+  import {getSysNo} from "@/api/importTrade/purchase";
+  import { getUserInfo } from "@/api/system/user";
 
   export default {
     data() {
@@ -119,14 +130,23 @@
           placeholder:'请点击右边按钮选择',
           dicData:[]
         },
+        financeStatusDic:[{
+          value: '正常',
+          label: '正常'
+        },
+          {
+            value: '停用',
+            label: '停用'
+          }],
         basicData: {
           column: [
             {
               label: '系统号',
               prop: 'sysNo',
+              disabled:true,
               rules: [
                 {
-                  required: false,
+                  required: true,
                   message: ' ',
                   trigger: 'blur'
                 }
@@ -136,12 +156,12 @@
               prop: 'srcOrderno',
               rules: [
                 {
-                  required: false,
+                  required: true,
                   message: ' ',
                   trigger: 'blur'
                 }
               ]
-            }, {
+            },{
               label: '客户名称',
               prop: 'corpId',
               rules: [
@@ -151,38 +171,6 @@
                   trigger: 'blur'
                 }
               ]
-            },{
-              label: '制单人',
-              prop: 'createUserName',
-              rules: [
-                {
-                  required: false,
-                  message: ' ',
-                  trigger: 'blur'
-                }
-              ]
-            },{
-              label: '制单日期',
-              prop: 'createTime',
-              type:'date',
-              rules: [
-                {
-                  required: false,
-                  message: ' ',
-                  trigger: 'blur'
-                }
-              ]
-            }, {
-              label: '收款日期',
-              prop: 'settlementDate',
-              type:'date',
-              rules: [
-                {
-                  required: false,
-                  message: ' ',
-                  trigger: 'blur'
-                }
-              ]
             }, {
               label: '金额',
               prop: 'amount',
@@ -248,8 +236,20 @@
                 }
               ]
             }, {
-              label: '单据状态',
-              prop: 'financeStatus',
+              label: '收款日期',
+              prop: 'settlementDate',
+              type:'date',
+              rules: [
+                {
+                  required: false,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            }, {
+              label: '制单人',
+              prop: 'createUserName',
+              disabled:true,
               rules: [
                 {
                   required: false,
@@ -257,6 +257,21 @@
                   trigger: 'blur'
                 }
               ]
+            },{
+              label: '制单日期',
+              prop: 'createTime',
+              disabled:true,
+              type:'date',
+              rules: [
+                {
+                  required: false,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            }, {
+              label: '单据状态',
+              prop: 'financeStatus',
             },
             {
               label: '备注',
@@ -283,8 +298,19 @@
         this.id = BigInt(this.$route.query.id);//字符串转数字  超长用BigInt
         getDetail(this.id).then(res => {
           this.form = res.data.data;
+          this.configuration.dicData = res.data.data.customerModel;
           this.dataList = res.data.data.itemsList
         })
+      }else{
+        getSysNo("CW-SK").then(res =>{
+          this.$set(this.form,"sysNo", res.data.data)
+          let date = new Date();
+          let strDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
+          this.$set(this.form,"createTime",strDate)
+        })
+        getUserInfo().then(res =>{
+          this.$set(this.form,"createUserName", res.data.data.name)
+        })
       }
     },
     mounted() {

+ 22 - 54
src/views/importTrade/invoice/config/customerContact.json

@@ -22,7 +22,7 @@
       "label": "提单号",
       "prop": "billNo",
       "index": 1,
-      "width":100,
+      "width":150,
       "cell": true,
       "rules": [
         {
@@ -34,8 +34,8 @@
     },{
       "label": "合同号",
       "prop": "contractNumber",
-      "index": 1,
-      "width":100,
+      "index": 2,
+      "width":150,
       "cell": true,
       "rules": [
         {
@@ -47,9 +47,8 @@
     },{
       "label": "货物品种",
       "prop": "priceCategory",
-      "index": 2,
-      "width":100,
-      "cell": true,
+      "index": 3,
+      "width":120,
       "rules": [
         {
           "required": false,
@@ -60,21 +59,8 @@
     },{
       "label": "货物详情",
       "prop": "cname",
-      "index": 3,
-      "width":100,
-      "cell": true,
-      "rules": [
-        {
-          "required": false,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
-    },{
-      "label": "件数",
-      "prop": "actualQuantity",
       "index": 4,
-      "width":100,
+      "width":120,
       "cell": true,
       "rules": [
         {
@@ -87,7 +73,7 @@
       "label": "发票净重(吨)",
       "prop": "invoiceWeight",
       "index": 5,
-      "width":100,
+      "width":120,
       "cell": true,
       "rules": [
         {
@@ -100,7 +86,7 @@
       "label": "码单重量(吨)",
       "prop": "billWeight",
       "index": 6,
-      "width":100,
+      "width":120,
       "cell": true,
       "rules": [
         {
@@ -110,49 +96,31 @@
         }
       ]
     },{
+      "label": "件数",
+      "prop": "actualQuantity",
+      "index": 7,
+      "width":120
+    },{
       "label": "单价",
       "prop": "price",
-      "index": 6,
-      "width":100,
-      "cell": true,
-      "rules": [
-        {
-          "required": false,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
+      "index": 8,
+      "width":100
     },{
       "label": "合同金额",
       "prop": "contractAmount",
-      "index": 6,
-      "width":100,
-      "cell": true,
-      "rules": [
-        {
-          "required": false,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
+      "index": 9,
+      "width":120
     },{
       "label": "税率",
       "prop": "taxRate",
-      "index": 6,
-      "width":110,
-      "cell": true,
-      "rules": [
-        {
-          "required": false,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
+      "index": 10,
+      "width":100,
+      "cell": true
     },{
       "label": "备注",
       "prop": "remarks",
-      "index": 7,
-      "width":100,
+      "index": 11,
+      "width":120,
       "cell": true,
       "rules": [
         {

+ 1 - 13
src/views/importTrade/invoice/config/mainList.json

@@ -3,7 +3,7 @@
     "tip": false,
     "simplePage": true,
     "searchShow": true,
-    "searchMenuSpan": 24,
+    "searchMenuSpan": 6,
   "searchMenuPosition": "right",
     "dialogWidth": "60%",
     "tree": true,
@@ -43,18 +43,6 @@
         "index": 4,
         "width":120
       },{
-        "label": "销售公司",
-        "prop": "salesCompany",
-        "search": true,
-        "index": 5,
-        "width":150
-      },{
-        "label": "工厂/贸易商名称",
-        "prop": "corpId",
-        "search": true,
-        "index": 6,
-        "width":150
-      },{
         "label": "仓库名称",
         "prop": "storageId",
         "search": true,

+ 133 - 49
src/views/importTrade/invoice/detailsPageEdit.vue

@@ -6,6 +6,11 @@
                    @click="backToList">返回列表
         </el-button>
       </div>
+      <el-button type="success"
+                 class="el-button--small-yh add-customer-btn-two"
+                 :disabled="true"
+                 @click.stop="">复制新单
+      </el-button>
       <el-button
         class="el-button--small-yh add-customer-btn"
         type="primary"
@@ -21,16 +26,10 @@
           <el-row>
             <el-col v-for="(item,index) in basicData.column" :key="index" :span="item.span?item.span:8">
               <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
-                <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
-                <el-select v-else-if="item.type === 'select'" style="width: 100%" v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
-                  <el-option
-                    v-for="(data, index) in item.dicData"
-                    :key="index"
-                    :label="data.label"
-                    :value="data.value"
-                  ></el-option>
-                </el-select>
-                <el-input type="age" v-else v-model="form[item.prop]" size="small" autocomplete="off"></el-input>
+                <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" size="small" type="date" placeholder="请选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
+                <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :configuration="configuration"/>
+                <selectComponent v-else-if="item.prop === 'salesCompany'" v-model="form[item.prop]" :configuration="sConfiguration"/>
+                <el-input type="age" v-else v-model="form[item.prop]" :disabled="item.disabled?true:false" placeholder="请输入"  size="small" autocomplete="off"></el-input>
               </el-form-item>
             </el-col>
           </el-row>
@@ -47,9 +46,31 @@
             @row-update="rowUpdate"
             @row-del="rowDel"
           >
-            <template slot="code" slot-scope="{row,index}">
-              <span style="float: left;padding-top: 2px">{{ row.code }}</span>
-              <el-button type="text" size="mini" style="float: right" @click="commodityChoice(row)">选择</el-button>
+            <template slot="price" slot-scope="{ row }">
+              <el-input
+                v-if="row.$cellEdit"
+                v-model="row.price"
+                placeholder="请输入"
+                size="small"
+                oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+                @input="priceChange(row)"
+              ></el-input>
+              <span v-else>{{ row.price }}</span>
+            </template>
+            <template slot="actualQuantity" slot-scope="{ row }">
+              <el-input
+                v-if="row.$cellEdit"
+                v-model="row.actualQuantity"
+                placeholder="请输入"
+                size="small"
+                oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+                @input="quantityChange(row)"
+              ></el-input>
+              <span v-else>{{ row.actualQuantity }}</span>
+            </template>
+            <template slot="priceCategory" slot-scope="{row,index}">
+              <span style="margin-left: 12px;padding-top: 2px">{{ row.priceCategoryNames }}</span>
+              <el-button v-if="row.$cellEdit" type="text" size="mini" style="float: right" @click="choice(row)">选择</el-button>
             </template>
             <template slot-scope="{row,index}" slot="menu">
               <el-button
@@ -117,8 +138,9 @@
       </el-row>
       <span slot="footer" class="dialog-footer">
           <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="importGoods" v-if="commodityData !== true">导入</el-button>
-          <el-button type="primary" @click="importChoice" v-if="commodityData === true"
+           <el-button type="primary" @click="commodityConfirm" v-if="selectKind != -1"  :disabled="tableData.length !== 1">确定</el-button>
+          <el-button type="primary" @click="importGoods" v-if="commodityData !== true  && selectKind == -1">导入</el-button>
+          <el-button type="primary" @click="importChoice" v-if="commodityData === true  && selectKind == -1"
                      :disabled="tableData.length !== 1">导入</el-button>
         </span>
     </el-dialog>
@@ -130,17 +152,11 @@ import customerContact from "./config/customerContact.json"
 import {detailInvoiceList,
   submitInvoiceList,
   removeGoodsItem,} from "@/api/importTrade/invoice"
-import {getDeptLazyTree, customerList} from "@/api/basicData/basicFeesDesc";
+import {getDeptLazyTree } from "@/api/basicData/basicFeesDesc";
 import commodity from "./config/commodity.json"
-import {
-  typeSave, detail,
-  corpstypeTree,
-  corpsattn,
-  corpsbank,
-  corpsitem,
-  getList
-} from "@/api/basicData/deliveryNotice"
+import {corpsbank, getList} from "@/api/basicData/deliveryNotice"
 import upLoadOption from "../../exportTrade/purchaseContract/config/uploadList.json";
+import {getSysNo} from "@/api/importTrade/purchase";
 
 export default {
   name: "detailsPageEdit",
@@ -151,24 +167,37 @@ export default {
       customerContact: customerContact,
       contactsForm: {},
       contactsData: [],
+      selectKind:-1,
+      configuration:{
+        multipleChoices:false,
+        multiple:false,
+        disabled:false,
+        searchShow:false,
+        collapseTags:false,
+        placeholder:'请点击右边按钮选择',
+        dicData:[]
+      },
+      sConfiguration:{
+        multipleChoices:false,
+        multiple:false,
+        disabled:false,
+        searchShow:false,
+        collapseTags:false,
+        placeholder:'请点击右边按钮选择',
+        dicData:[]
+      },
       basicData: {
         column: [
           {
             label: '系统号',
             prop: 'sysNo',
-            rules: [
-              {
-                required: false,
-                message: ' ',
-                trigger: 'blur'
-              }
-            ]
+            disabled:true,
           }, {
             label: '合同号',
             prop: 'orderNo',
             rules: [
               {
-                required: false,
+                required: true,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -187,7 +216,6 @@ export default {
           }, {
             label: '业务员',
             prop: 'saleman',
-            // type:'select',
             dicData: [],
             rules: [
               {
@@ -199,7 +227,7 @@ export default {
           }, {
             label: '销售公司',
             prop: 'salesCompany',
-            // type:'select',
+            type:'component',
             dicData: [],
             rules: [
               {
@@ -211,7 +239,7 @@ export default {
           }, {
             label: '工厂/贸易商名称',
             prop: 'corpId',
-            // type:'select',
+            type:'component',
             dicData: [],
             rules: [
               {
@@ -223,7 +251,6 @@ export default {
           }, {
             label: '仓库名称',
             prop: 'storageId',
-            // type:'select',
             dicData: [],
             rules: [
               {
@@ -299,16 +326,58 @@ export default {
       let id = this.$route.query.id.replace(/\"/g, "")
       detailInvoiceList(id).then(res => {
         this.form = res.data.data;
+        this.configuration.dicData = this.form.companyName
+        this.sConfiguration.dicData = this.form.salesCompanyNameList
         this.contactsData = this.form.deliveryItemsList
       })
-    }else if (this.$route.query.form){
+    }else {
+      getSysNo("JK-FH").then(res => {
+        this.$set(this.form, "sysNo", res.data.data)
+      })
+    }
+    if (this.$route.query.form) {
       this.form = JSON.parse(this.$route.query.form);
       this.form.id = null
       this.contactsData = this.form.orderItemsList
       delete this.form.orderItemsList
+      getSysNo("JK-FH").then(res => {
+        this.$set(this.form, "sysNo", res.data.data)
+      })
     }
   },
   methods: {
+    //单价
+    priceChange(row) {
+      if (!row.price) {
+        row.price = "";
+        row.contractAmount = 0
+      } else {
+        row.contractAmount = (row.actualQuantity * row.price).toFixed(2);
+      }
+    },
+    //件数
+    quantityChange(row) {
+      if (!row.actualQuantity) {
+        row.actualQuantity = "";
+        row.contractAmount = 0
+      } else {
+        row.contractAmount = (row.actualQuantity * row.price).toFixed(2);
+      }
+    },
+    //选择货物品种
+    choice(row){
+      this.dialogVisible = true;
+      this.selectKind = row.$index;
+    },
+    //选择货品
+    commodityConfirm(){
+      if(this.tableData){
+        this.contactsData[this.selectKind].priceCategory = this.tableData[0].id;
+        this.$set(this.contactsData[this.selectKind],'priceCategoryNames',this.tableData[0].cname)
+        this.dialogVisible = !this.dialogVisible
+        this.selectKind = -1
+      }
+    },
     //新增商品信息保存触发
     rowSave(row, done, loading) {
       console.log(row)
@@ -357,6 +426,14 @@ export default {
     //修改提交触发
     editCustomer() {
       this.$refs["form"].validate((valid) => {
+        for (let i = 0; i < this.contactsData.length; i++) {
+          if (this.contactsData[i].billNo == null) {
+            return this.$message.error(`请输入第${i + 1}行的提单号`);
+          }
+          if (this.contactsData[i].contractNumber == null) {
+            return this.$message.error(`请输入第${i + 1}行的合同号`);
+          }
+        }
         if (valid) {
           let submitDto = {
             ...this.form,
@@ -365,6 +442,12 @@ export default {
           submitInvoiceList(submitDto).then(res => {
             if(res.data.success){
               this.$message.success("操作成功!")
+              detailInvoiceList(res.data.data.id).then(res => {
+                this.form = res.data.data;
+                this.configuration.dicData = this.form.companyName
+                this.sConfiguration.dicData = this.form.salesCompanyNameList
+                this.contactsData = this.form.deliveryItemsList
+              })
             }
           })
         } else {
@@ -432,7 +515,6 @@ export default {
     },
     //选中触发
     selectionChange(list) {
-      console.log(list);
       this.tableData = list
     },
     //确认导入触发
@@ -440,15 +522,14 @@ export default {
       // this.contactsData = this.contactsData.concat(this.tableData)
       if (this.tableData.length > 0) {
         for (let item in this.tableData) {
-          console.log(this.tableData[item])
-          this.tableData[item].itemId = this.tableData[item].id
-          this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
-          delete this.tableData[item].goodsTypeName
-          delete this.tableData[item].id
-          delete this.tableData[item].status
-          delete this.tableData[item].isDeleted
-          this.$refs.crudContact.rowCellAdd(this.tableData[item]);
-          this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
+          const params = {
+            priceCategory: this.tableData[item].code,
+            priceCategoryNames: this.tableData[item].cname,
+            itemId: this.tableData[item].id,
+            cname: this.tableData[item].cname
+          }
+          this.$refs.crudContact.rowCellAdd(params);
+          this.$refs.crudContact.rowCell(params, this.contactsData.length - 1)
         }
       }
       this.tableData = []
@@ -471,7 +552,6 @@ export default {
     onLoad(page, params = {}) {
       this.loading = true;
       getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
-        console.log(res)
         const data = res.data.data;
         this.page.total = data.total;
         this.data = data.records;
@@ -511,7 +591,11 @@ export default {
   color: #323233;
   font-weight: 400;
 }
-
+.add-customer-btn-two {
+  position: fixed;
+  right: 150px;
+  top: 115px;
+}
 .back-icon {
   line-height: 64px;
   font-size: 20px;

+ 13 - 2
src/views/importTrade/invoice/index.vue

@@ -17,6 +17,19 @@
                @size-change="sizeChange"
                @refresh-change="refreshChange"
                @on-load="onLoad">
+      <template slot="menuLeft">
+        <el-button size="small"
+                   type="success"
+                   :disabled="true"
+                   @click.stop=""
+        >复制新单
+        </el-button>
+        <el-button size="small"
+                   type="info"
+                   @click.stop=""
+        >报表
+        </el-button>
+      </template>
       <template slot-scope="scope" slot="menu">
         <el-button
           type="text"
@@ -131,7 +144,6 @@ export default {
     },
     //新增跳转页面
     beforeOpen(row, index) {
-      console.log(row)
       this.$router.push({
         path: "/importInvoice_detailsPage",
         query: {id: JSON.stringify(row.id)},
@@ -153,7 +165,6 @@ export default {
     },
     //点击搜索按钮触发
     searchChange(params, done) {
-      console.log(params)
       this.page.currentPage = 1;
       this.onLoad(this.page, params);
       done()

+ 10 - 14
src/views/importTrade/receipt/config/customerContact.json

@@ -51,7 +51,6 @@
       "prop": "priceCategory",
       "index": 2,
       "width":120,
-      "cell": true,
       "rules": [
         {
           "required": false,
@@ -73,8 +72,8 @@
         }
       ]
     },{
-      "label": "件数",
-      "prop": "actualQuantity",
+      "label": "发票净重(吨)",
+      "prop": "invoiceWeight",
       "index": 4,
       "width":120,
       "cell": true,
@@ -86,8 +85,8 @@
         }
       ]
     },{
-      "label": "发票净重(吨)",
-      "prop": "invoiceWeight",
+      "label": "码单重量(吨)",
+      "prop": "billWeight",
       "index": 5,
       "width":120,
       "cell": true,
@@ -99,11 +98,10 @@
         }
       ]
     },{
-      "label": "码单重量(吨)",
-      "prop": "billWeight",
+      "label": "件数",
+      "prop": "actualQuantity",
       "index": 6,
       "width":120,
-      "cell": true,
       "rules": [
         {
           "required": false,
@@ -114,9 +112,8 @@
     },{
       "label": "单价",
       "prop": "price",
-      "index": 6,
+      "index": 7,
       "width":120,
-      "cell": true,
       "rules": [
         {
           "required": false,
@@ -127,9 +124,8 @@
     },{
       "label": "合同金额",
       "prop": "contractAmount",
-      "index": 6,
+      "index": 8,
       "width":120,
-      "cell": true,
       "rules": [
         {
           "required": false,
@@ -140,7 +136,7 @@
     },{
       "label": "税率",
       "prop": "taxRate",
-      "index": 6,
+      "index": 9,
       "width":120,
       "cell": true,
       "rules": [
@@ -153,7 +149,7 @@
     },{
       "label": "备注",
       "prop": "remarks",
-      "index": 7,
+      "index": 10,
       "width":150,
       "cell": true,
       "rules": [

+ 1 - 13
src/views/importTrade/receipt/config/mainList.json

@@ -3,7 +3,7 @@
   "tip": false,
   "simplePage": true,
   "searchShow": true,
-  "searchMenuSpan": 24,
+  "searchMenuSpan": 6,
   "searchMenuPosition": "right",
   "align": "center",
   "dialogWidth": "60%",
@@ -44,18 +44,6 @@
       "index": 4,
       "width":120
     },{
-      "label": "销售公司",
-      "prop": "salesCompany",
-      "search": true,
-      "index": 5,
-      "width":150
-    },{
-      "label": "工厂/贸易商名称",
-      "prop": "corpId",
-      "search": true,
-      "index": 6,
-      "width":150
-    },{
       "label": "仓库名称",
       "prop": "storageId",
       "search": true,

+ 137 - 39
src/views/importTrade/receipt/detailsPageEdit.vue

@@ -6,6 +6,11 @@
                    @click="backToList">返回列表
         </el-button>
       </div>
+      <el-button type="success"
+                 class="el-button--small-yh add-customer-btn-two"
+                 :disabled="true"
+                 @click.stop="">复制新单
+      </el-button>
       <el-button
         class="el-button--small-yh add-customer-btn"
         type="primary"
@@ -21,17 +26,11 @@
           <el-row>
             <el-col v-for="(item,index) in basicData.column" :key="index" :span="item.span?item.span:8">
               <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
-                <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" size="small" type="datetime" placeholder=" " value-format="yyyy-MM-dd HH:mm:ss"/>
-                <el-select v-else-if="item.type === 'select'" style="width: 100%" v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
-                  <el-option
-                    v-for="(data, index) in item.dicData"
-                    :key="index"
-                    :label="data.label"
-                    :value="data.value"
-                  ></el-option>
-                </el-select>
-                <el-input type="textarea" v-else-if="(item.prop === 'deliveryRemarks')" v-model="form[item.prop]"   size="small" autocomplete="off" placeholder=" "></el-input>
-                <el-input v-else v-model="form[item.prop]" size="small" autocomplete="off"></el-input>
+                <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" size="small" type="date" placeholder="请选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
+                <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :configuration="configuration"/>
+                <selectComponent v-else-if="item.prop === 'salesCompany'" v-model="form[item.prop]" :configuration="sConfiguration"/>
+                <el-input type="textarea" v-else-if="(item.prop === 'deliveryRemarks')" v-model="form[item.prop]"   size="small" autocomplete="off" placeholder="请输入"></el-input>
+                <el-input v-else v-model="form[item.prop]" size="small" :disabled="item.disabled?true:false" placeholder="请输入" autocomplete="off"></el-input>
               </el-form-item>
             </el-col>
           </el-row>
@@ -48,9 +47,31 @@
             @row-update="rowUpdate"
             @row-del="rowDel"
           >
-            <template slot="code" slot-scope="{row,index}">
-              <span style="float: left;padding-top: 2px">{{ row.code }}</span>
-              <el-button type="text" size="mini" style="float: right" @click="commodityChoice(row)">选择</el-button>
+            <template slot="price" slot-scope="{ row }">
+              <el-input
+                v-if="row.$cellEdit"
+                v-model="row.price"
+                placeholder="请输入"
+                size="small"
+                oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+                @input="priceChange(row)"
+              ></el-input>
+              <span v-else>{{ row.price }}</span>
+            </template>
+            <template slot="actualQuantity" slot-scope="{ row }">
+              <el-input
+                v-if="row.$cellEdit"
+                v-model="row.actualQuantity"
+                placeholder="请输入"
+                size="small"
+                oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+                @input="quantityChange(row)"
+              ></el-input>
+              <span v-else>{{ row.actualQuantity }}</span>
+            </template>
+            <template slot="priceCategory" slot-scope="{row,index}">
+              <span style="margin-left: 12px;padding-top: 2px">{{ row.priceCategoryNames }}</span>
+              <el-button v-if="row.$cellEdit" type="text" size="mini" style="float: right" @click="choice(row)">选择</el-button>
             </template>
             <template slot-scope="{row,index}" slot="menu">
               <el-button
@@ -118,8 +139,9 @@
       </el-row>
       <span slot="footer" class="dialog-footer">
           <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="importGoods" v-if="commodityData !== true">导入</el-button>
-          <el-button type="primary" @click="importChoice" v-if="commodityData === true"
+           <el-button type="primary" @click="commodityConfirm" v-if="selectKind != -1"  :disabled="tableData.length !== 1">确定</el-button>
+          <el-button type="primary" @click="importGoods" v-if="commodityData !== true  && selectKind == -1">导入</el-button>
+          <el-button type="primary" @click="importChoice" v-if="commodityData === true  && selectKind == -1"
                      :disabled="tableData.length !== 1">导入</el-button>
         </span>
     </el-dialog>
@@ -129,6 +151,7 @@
 <script>
 import customerContact from "./config/customerContact.json"
 import commodity from "../invoice/config/commodity.json";
+import {getSysNo} from "@/api/importTrade/purchase";
 import {getDeptLazyTree, customerList} from "@/api/basicData/basicFeesDesc";
 import {detailReceiptList,
   submitReceiptList,
@@ -148,14 +171,34 @@ export default {
       customerContact: customerContact,
       contactsForm: {},
       contactsData: [],
+      selectKind:-1,
+      configuration:{
+        multipleChoices:false,
+        multiple:false,
+        disabled:false,
+        searchShow:false,
+        collapseTags:false,
+        placeholder:'请点击右边按钮选择',
+        dicData:[]
+      },
+      sConfiguration:{
+        multipleChoices:false,
+        multiple:false,
+        disabled:false,
+        searchShow:false,
+        collapseTags:false,
+        placeholder:'请点击右边按钮选择',
+        dicData:[]
+      },
       basicData: {
         column: [
           {
             label: '系统号',
             prop: 'sysNo',
+            disabled:true,
             rules: [
               {
-                required: false,
+                required: true,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -165,7 +208,7 @@ export default {
             prop: 'orderNo',
             rules: [
               {
-                required: false,
+                required: true,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -184,7 +227,6 @@ export default {
           }, {
             label: '销售公司',
             prop: 'salesCompany',
-            // type:'select',
             dicData: [],
             rules: [
               {
@@ -195,7 +237,7 @@ export default {
             ]
           }, {
             label: '工厂/贸易商名称',
-            // type:'select',
+            prop: 'corpId',
             dicData: [],
             rules: [
               {
@@ -218,7 +260,6 @@ export default {
           },{
             label: '仓库名称',
             prop: 'storageId',
-            // type:'select',
             dicData: [],
             rules: [
               {
@@ -294,14 +335,24 @@ export default {
       let id = this.$route.query.id.replace(/\"/g, "")
       detailReceiptList(id).then(res => {
         this.form = res.data.data;
+        this.configuration.dicData = this.form.companyName
+        this.sConfiguration.dicData = this.form.salesCompanyNameList
         this.contactsData = this.form.deliveryItemsList
       })
+    }else{
+      getSysNo("JK-SH").then(res =>{
+        this.$set(this.form,"sysNo", res.data.data)
+      })
     }
     if(this.$route.query.params){
       detailListData(this.$route.query.params.id).then(res =>{
+        this.form.orderNo =  res.data.data.orderNo;
         res.data.data.itemsVOList.forEach((item,index) =>{
           this.$route.query.params.orderItemIds.forEach((e,i) =>{
             if(e ==  index){
+              item.contractNumber =  res.data.data.orderNo;
+              item.actualQuantity =  item.purchaseQuantity;
+              item.contractAmount =  item.amount;
               this.$refs.crudContact.rowCellAdd(item);
               this.$refs.crudContact.rowCell(item,this.contactsData.length - 1)
             }
@@ -309,23 +360,40 @@ export default {
         })
         res.data.data.orderNo = this.form.orderNo
       })
+      getSysNo("JK-SH").then(res =>{
+        this.$set(this.form,"sysNo", res.data.data)
+      })
     }
   },
   methods: {
+    //单价
+    priceChange(row) {
+      if (!row.price) {
+        row.price = "";
+        row.contractAmount = 0
+      } else {
+        row.contractAmount = (row.actualQuantity * row.price).toFixed(2);
+      }
+    },
+    //件数
+    quantityChange(row) {
+      if (!row.actualQuantity) {
+        row.actualQuantity = "";
+        row.contractAmount = 0
+      } else {
+        row.contractAmount = (row.actualQuantity * row.price).toFixed(2);
+      }
+    },
     //新增商品信息保存触发
     rowSave(row, done, loading) {
-      console.log(row)
-      console.log(this.contactsData)
       // this.contactsData.push(row)
       done()
     },
     //点击行可编辑
     handleRowClick(row, event, column) {
-      console.log(row.$index)
     },
     //商品编辑
     rowCell(row, index) {
-      console.log(row)
       this.$refs.crudContact.rowCell(row, index)
     },
     //修改商品信息触发
@@ -360,6 +428,14 @@ export default {
     //修改提交触发
     editCustomer() {
       this.$refs["form"].validate((valid) => {
+        for (let i = 0; i < this.contactsData.length; i++) {
+          if (this.contactsData[i].billNo == null) {
+            return this.$message.error(`请输入第${i + 1}行的提单号`);
+          }
+          if (this.contactsData[i].contractNumber == null) {
+            return this.$message.error(`请输入第${i + 1}行的合同号`);
+          }
+        }
         if (valid) {
           let submitDto = {
             ...this.form,
@@ -369,6 +445,12 @@ export default {
           submitReceiptList(submitDto).then(res => {
             if(res.data.success){
               this.$message.success("操作成功!")
+              detailReceiptList(res.data.data.id).then(res => {
+                this.form = res.data.data;
+                this.configuration.dicData = this.form.companyName
+                this.sConfiguration.dicData = this.form.salesCompanyNameList
+                this.contactsData = this.form.deliveryItemsList
+              })
             }
           })
         } else {
@@ -411,6 +493,20 @@ export default {
         }
       })
     },
+    //选择货物品种
+    choice(row){
+      this.dialogVisible = true;
+      this.selectKind = row.$index;
+    },
+    //选择货品
+    commodityConfirm(){
+      if(this.tableData){
+        this.importInventoryData[this.selectKind].priceCategory = this.tableData[0].id;
+        this.$set(this.importInventoryData[this.selectKind],'priceCategoryNames',this.tableData[0].cname)
+        this.dialogVisible = !this.dialogVisible
+        this.selectKind = -1
+      }
+    },
     //点击商品明细选择触发
     commodityChoice(row) {
       this.dialogVisible = !this.dialogVisible
@@ -436,27 +532,24 @@ export default {
     },
     //选中触发
     selectionChange(list) {
-      console.log(list);
       this.tableData = list
     },
     //确认导入触发
     importGoods() {
-      // this.contactsData = this.contactsData.concat(this.tableData)
       if (this.tableData.length > 0) {
         for (let item in this.tableData) {
-          console.log(this.tableData[item])
-          this.tableData[item].itemId = this.tableData[item].id
-          this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
-          delete this.tableData[item].goodsTypeName
-          delete this.tableData[item].id
-          delete this.tableData[item].status
-          delete this.tableData[item].isDeleted
-          this.$refs.crudContact.rowCellAdd(this.tableData[item]);
-          this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
+          const params = {
+            priceCategory: this.tableData[item].code,
+            priceCategoryNames: this.tableData[item].cname,
+            itemId: this.tableData[item].id,
+            cname: this.tableData[item].cname
+          }
+          this.$refs.crudContact.rowCellAdd(params);
+          this.$refs.crudContact.rowCell(params, this.contactsData.length - 1)
         }
+        this.tableData = []
+        this.dialogVisible = false
       }
-      this.tableData = []
-      this.dialogVisible = false
     },
     //导入商品触发
     importChoice() {
@@ -475,7 +568,6 @@ export default {
     onLoad(page, params = {}) {
       this.loading = true;
       getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
-        console.log(res)
         const data = res.data.data;
         this.page.total = data.total;
         this.data = data.records;
@@ -532,6 +624,12 @@ export default {
   margin-bottom: 0;
 }
 
+.add-customer-btn-two {
+  position: fixed;
+  right: 150px;
+  top: 115px;
+}
+
 .el-dialogDeep {
   ::v-deep .el-dialog {
     margin: 1vh auto 0 !important;

+ 13 - 0
src/views/importTrade/receipt/index.vue

@@ -17,6 +17,19 @@
                @size-change="sizeChange"
                @refresh-change="refreshChange"
                @on-load="onLoad">
+      <template slot="menuLeft">
+        <el-button size="small"
+                   type="success"
+                   :disabled="true"
+                   @click.stop=""
+        >复制新单
+        </el-button>
+        <el-button size="small"
+                   type="info"
+                   @click.stop=""
+        >报表
+        </el-button>
+      </template>
       <template slot-scope="scope" slot="menu">
         <el-button
           type="text"

+ 10 - 73
src/views/purchase/contract/config/customerContact.json

@@ -22,7 +22,7 @@
   "column":[
     {
       "label": "提单号",
-      "prop": "billNO",
+      "prop": "billNo",
       "index": 1,
       "width":150,
       "cell": true,
@@ -73,22 +73,9 @@
         }
       ]
     },{
-      "label": "件数",
-      "prop": "purchaseQuantity",
-      "index": 5,
-      "width":120,
-      "cell": true,
-      "rules": [
-        {
-          "required": false,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
-    },{
       "label": "发票净重(吨)",
       "prop": "invoiceWeight",
-      "index": 6,
+      "index": 5,
       "width":120,
       "cell": true,
       "rules": [
@@ -101,35 +88,24 @@
     },{
       "label": "码单重量(吨)",
       "prop": "billWeight",
-      "index": 7,
+      "index": 6,
       "width":120,
-      "cell": true,
-      "rules": [
-        {
-          "required": false,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
+      "cell": true
+    },{
+      "label": "件数",
+      "prop": "purchaseQuantity",
+      "index": 7,
+      "width":120
     },{
       "label": "单价",
       "prop": "price",
       "index": 8,
-      "width":120,
-      "cell": true,
-      "rules": [
-        {
-          "required": false,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
+      "width":120
     },{
       "label": "合同金额",
       "prop": "amount",
       "index": 9,
       "width":120,
-      "cell": true,
       "rules": [
         {
           "required": false,
@@ -150,45 +126,6 @@
           "trigger": "blur"
         }
       ]
-    }, {
-      "label": "币别",
-      "prop": "currency",
-      "index": 11,
-      "width":120,
-      "cell": true,
-      "rules": [
-        {
-          "required": false,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
-    }, {
-      "label": "汇率",
-      "prop": "exchangeRate",
-      "index": 12,
-      "width":120,
-      "cell": true,
-      "rules": [
-        {
-          "required": false,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
-    }, {
-      "label": "备注",
-      "prop": "remarks",
-      "index": 13,
-      "width":150,
-      "cell": true,
-      "rules": [
-        {
-          "required": false,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
     }
   ]
 }

+ 1 - 14
src/views/purchase/contract/config/mainList.json

@@ -3,7 +3,7 @@
   "tip": false,
   "simplePage": true,
   "searchShow": true,
-  "searchMenuSpan": 12,
+  "searchMenuSpan": 24,
   "dialogWidth": "60%",
   "align": "center",
   "searchMenuPosition": "right",
@@ -41,19 +41,6 @@
       "width":150
     },
     {
-      "label": "供应商",
-      "prop": "corpId",
-      "search": true,
-      "index": 3,
-
-      "width":100
-    },{
-      "label": "采购商",
-      "prop": "purchaserId",
-      "search": true,
-      "index": 4,
-      "width":100
-    },{
       "label": "付款日期/开证日期",
       "prop": "accountsCollectionDate",
       "type": "date",

+ 78 - 7
src/views/purchase/contract/detailsPage.vue

@@ -6,6 +6,11 @@
                    @click="backToList">返回列表
         </el-button>
       </div>
+      <el-button type="success"
+                 class="el-button--small-yh add-customer-btn-two"
+                 :disabled="true"
+                 @click.stop="">复制新单
+      </el-button>
       <el-button
         class="el-button--small-yh add-customer-btn"
         type="primary"
@@ -30,7 +35,8 @@
                     :value="data.value"
                   ></el-option>
                 </el-select>
-                <selectComponent v-else-if="item.type === 'component'" v-model="form[item.prop]" :configuration="configuration"/>
+                <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :configuration="configuration"/>
+                <selectComponent v-else-if="item.prop === 'purchaserId'" v-model="form[item.prop]" :configuration="pConfiguration"/>
                 <el-select v-else-if="item.prop === 'orderType'"  style="width: 100%"  v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
                   <el-option v-for="(item,index) in contractTypeDic" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
                 </el-select>
@@ -60,6 +66,28 @@
             @row-update="rowUpdate"
             @row-del="rowDel"
           >
+            <template slot="price" slot-scope="{ row }">
+              <el-input
+                v-if="row.$cellEdit"
+                v-model="row.price"
+                placeholder="请输入"
+                size="small"
+                oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+                @input="priceChange(row)"
+              ></el-input>
+              <span v-else>{{ row.price }}</span>
+            </template>
+            <template slot="purchaseQuantity" slot-scope="{ row }">
+              <el-input
+                v-if="row.$cellEdit"
+                v-model="row.purchaseQuantity"
+                placeholder="请输入"
+                size="small"
+                oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+                @input="quantityChange(row)"
+              ></el-input>
+              <span v-else>{{ row.purchaseQuantity }}</span>
+            </template>
             <template slot-scope="{row,index}" slot="menu">
               <el-button
                 type="text"
@@ -151,7 +179,7 @@
           <el-button type="primary" @click="commodityConfirm" v-if="selectKind != -1"  :disabled="tableData.length !== 1">确定</el-button>
           <el-button type="primary" @click="importGoods" v-if="commodityData !== true && selectKind == -1">导入</el-button>
           <el-button type="primary" @click="importChoice" v-if="commodityData === true  && selectKind == -1"
-                     :disabled="tableData.length !== 1">导入{{selectKind}}<</el-button>
+                     :disabled="tableData.length !== 1">导入<</el-button>
         </span>
     </el-dialog>
   </div>
@@ -163,7 +191,7 @@ import uploadList from './config/uploadList.json'
 import advantageProject from "./config/advantageProject.json"
 import {getDeptLazyTree,customerList} from "@/api/basicData/basicFeesDesc";
 import optionTwoCost from "./config/mainListCost.json"
-import {detailListData, submitData,} from "@/api/importTrade/purchase";
+import {detailListData, submitData,getSysNo} from "@/api/importTrade/purchase";
 import commodity from "./config/commodity.json"
 import feeInfo from "@/components/fee-info/main";
 import uploadFile from "@/components/upload-file/main";
@@ -231,6 +259,15 @@ export default {
         placeholder:'请点击右边按钮选择',
         dicData:[]
       },
+      pConfiguration:{
+        multipleChoices:false,
+        multiple:false,
+        disabled:false,
+        searchShow:false,
+        collapseTags:false,
+        placeholder:'请点击右边按钮选择',
+        dicData:[]
+      },
       // 合同上传数据
       uploadList: uploadList,
       // 合同数据
@@ -295,7 +332,6 @@ export default {
           }, {
             label: '供应商',
             prop: 'corpId',
-            type:'component',
             dicData: [],
             rules: [
               {
@@ -307,7 +343,6 @@ export default {
           }, {
             label: '采购商',
             prop: 'purchaserId',
-            type:'component',
             dicData: [],
             rules: [
               {
@@ -514,13 +549,15 @@ export default {
     this.getWorkDicts("contractType").then(res =>{
       this.contractTypeDic = res.data.data
     })
-    this.getWorkDicts("affair_payment_term").then(res =>{
+    this.getWorkDicts("payment_term").then(res =>{
       this.paymentTypeDic = res.data.data
     })
     if (this.$route.query.id) {
       let id = this.$route.query.id.replace(/\"/g, "")
       detailListData(id).then(res => {
         this.form = res.data.data;
+        this.configuration.dicData = this.form.corpsName
+        this.pConfiguration.dicData = this.form.purchaserName
         if(res.data.data.itemsVOList){
           this.contactsData = res.data.data.itemsVOList
         }
@@ -531,6 +568,10 @@ export default {
           this.orderFilesList = res.data.data.orderFilesList
         }
       })
+    }else{
+      getSysNo("JK-CG").then(res =>{
+        this.$set(this.form,"sysNo", res.data.data)
+      })
     }
   },
   components: {
@@ -538,6 +579,24 @@ export default {
     uploadFile
   },
   methods: {
+    //单价
+    priceChange(row) {
+      if (!row.price) {
+        row.price = "";
+        row.amount = 0
+      } else {
+        row.amount = (row.purchaseQuantity * row.price).toFixed(2);
+      }
+    },
+    //件数
+    quantityChange(row) {
+      if (!row.purchaseQuantity) {
+        row.purchaseQuantity = "";
+        row.amount = 0
+      } else {
+        row.amount = (row.purchaseQuantity * row.price).toFixed(2);
+      }
+    },
     //修改提交触发
     editCustomer() {
       this.$refs["form"].validate((valid) => {
@@ -555,6 +614,12 @@ export default {
             }
           }
           const orderFilesList = this.$refs.uploadFile.submitData();
+          for (let j = 0; j < this.contactsData.length; j++) {
+            if (this.contactsData[j].billNo == null) {
+              return this.$message.error(`请输入第${j + 1}行的提单号`);
+            }
+          }
+          console.log(this.contactsData)
           let submitDto = {
             ...this.form,
             tradeType:"JK",
@@ -569,6 +634,8 @@ export default {
               this.$message.success("操作成功!")
               detailListData(this.form.id).then(res => {
                 this.form = res.data.data;
+                this.configuration.dicData = this.form.corpsName
+                this.pConfiguration.dicData = this.form.purchaserName
                 if(res.data.data.itemsVOList){
                   this.contactsData = res.data.data.itemsVOList
                 }
@@ -932,7 +999,11 @@ export default {
   color: #323233;
   font-weight: 400;
 }
-
+.add-customer-btn-two {
+  position: fixed;
+  right: 150px;
+  top: 115px;
+}
 .add-customer-btn {
   position: fixed;
   right: 36px;

+ 4 - 3
src/views/purchase/contract/index.vue

@@ -23,8 +23,8 @@
           <el-table-column   align="center"  width="60"></el-table-column>
           <el-table-column   type="selection" align="center"  width="50"></el-table-column>
           <el-table-column  label="序号" type="index" align="center"  width="50"></el-table-column>
-          <el-table-column  label="提单号" prop="billNO" align="center" show-overflow-tooltip width="200"></el-table-column>
-          <el-table-column  label="货物品种" prop="priceCategory" align="center" show-overflow-tooltip width="180"></el-table-column>
+          <el-table-column  label="提单号" prop="billNo" align="center" show-overflow-tooltip width="200"></el-table-column>
+          <el-table-column  label="货物品种" prop="priceCategoryNames" align="center" show-overflow-tooltip width="180"></el-table-column>
           <el-table-column  label="件数" prop="purchaseQuantity" align="center" show-overflow-tooltip width="120"></el-table-column>
           <el-table-column  label="毛重(KG)" prop="grossWeight" align="center" show-overflow-tooltip width="120"></el-table-column>
           <el-table-column  label="净重(KG)" prop="netWeight" align="center" show-overflow-tooltip width="120"></el-table-column>
@@ -36,6 +36,7 @@
       <template slot="menuLeft">
         <el-button size="small"
                    type="success"
+                   :disabled="true"
                    @click.stop=""
         >复制新单
         </el-button>
@@ -230,7 +231,7 @@ export default {
     expandChange(row, expendList) {
       if(row.hasItem){
         getItemByPid(row.id).then(res =>{
-          this.dataList[row.$index].insideList = res.data.data;
+          this.$set(this.dataList[row.$index],"insideList", res.data.data)
           row.loading = false
         })
       }else{

+ 13 - 24
src/views/salesManagement/salesContract/config/importInventory.json

@@ -27,7 +27,7 @@
       "cell": true,
       "rules": [
         {
-          "required": false,
+          "required": true,
           "message": "请输入提单号",
           "trigger": "blur"
         }
@@ -40,7 +40,7 @@
       "cell": true,
       "rules": [
         {
-          "required": false,
+          "required": true,
           "message": "请输入合同号",
           "trigger": "blur"
         }
@@ -49,21 +49,13 @@
       "label": "货物品种",
       "prop": "priceCategory",
       "index": 3,
-      "width":120,
-      "cell": false,
-      "rules": [
-        {
-          "required": false,
-          "message": "请输入货物品种",
-          "trigger": "blur"
-        }
-      ]
+      "width":120
     },{
       "label": "货物详情",
       "prop": "cname",
       "index": 4,
       "width":120,
-      "cell": false,
+      "cell": true,
       "rules": [
         {
           "required": false,
@@ -72,41 +64,40 @@
         }
       ]
     },{
-      "label": "件数",
-      "prop": "actualQuantity",
+      "label": "发票净重(吨)",
+      "prop": "invoiceWeight",
       "index": 5,
       "width":120,
       "cell": true,
       "rules": [
         {
           "required": false,
-          "message": "请输入件数",
+          "message": "请输入发票净重(吨)",
           "trigger": "blur"
         }
       ]
     },{
-      "label": "发票净重(吨)",
-      "prop": "invoiceWeight",
+      "label": "码单重量(吨)",
+      "prop": "billWeight",
       "index": 6,
       "width":120,
       "cell": true,
       "rules": [
         {
           "required": false,
-          "message": "请输入发票净重(吨)",
+          "message": "请输入码单重量(吨)",
           "trigger": "blur"
         }
       ]
     },{
-      "label": "码单重量(吨)",
-      "prop": "billWeight",
+      "label": "件数",
+      "prop": "actualQuantity",
       "index": 7,
       "width":120,
-      "cell": true,
       "rules": [
         {
           "required": false,
-          "message": "请输入码单重量(吨)",
+          "message": "请输入件数",
           "trigger": "blur"
         }
       ]
@@ -115,7 +106,6 @@
       "prop": "price",
       "index": 8,
       "width":120,
-      "cell": true,
       "rules": [
         {
           "required": false,
@@ -128,7 +118,6 @@
       "prop": "amount",
       "index": 9,
       "width":120,
-      "cell": true,
       "rules": [
         {
           "required": false,

+ 1 - 13
src/views/salesManagement/salesContract/config/mainList.json

@@ -3,7 +3,7 @@
   "tip": false,
   "simplePage": true,
   "searchShow": true,
-  "searchMenuSpan": 18,
+  "searchMenuSpan": 6,
   "searchMenuPosition": "right",
   "dialogWidth": "60%",
   "tree": true,
@@ -35,18 +35,6 @@
       "index": 2,
       "width":150
     },{
-      "label": "销售公司",
-      "prop": "belongToCorpId",
-      "search": true,
-      "index": 3,
-      "width":120
-    },{
-      "label": "工厂/贸易商名称",
-      "prop": "corpId",
-      "search": true,
-      "index": 4,
-      "width":150
-    },{
       "label": "合同金额",
       "prop": "orderAmount",
       "search": false,

+ 148 - 174
src/views/salesManagement/salesContract/detailsPage.vue

@@ -6,6 +6,11 @@
                    @click="backToList">返回列表
         </el-button>
       </div>
+      <el-button type="success"
+                 class="el-button--small-yh add-customer-btn-two"
+                 :disabled="true"
+                 @click.stop="">复制新单
+      </el-button>
       <el-button
         class="el-button--small-yh add-customer-btn"
         type="primary"
@@ -30,6 +35,20 @@
                     :value="data.value"
                   ></el-option>
                 </el-select>
+                <el-select v-else-if="item.prop === 'currency'" style="width: 100%"   v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
+                  <el-option v-for="(item,index) in currencyDic" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
+                </el-select>
+                <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :configuration="configuration"/>
+                <selectComponent v-else-if="item.prop === 'belongToCorpId'" v-model="form[item.prop]" :configuration="bConfiguration"/>
+                <port-info  v-else-if="(item.prop === 'portOfDestination' || item.prop === 'portOfLoad'  )"  v-model="form[item.prop]"></port-info>
+                <el-input
+                  size="small"
+                  v-else-if="(item.prop === 'exchangeRate')"
+                  v-model="form[item.prop]"
+                  oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+                  @change="rateChange"
+                  placeholder="请输入"
+                ><template slot="append">%</template></el-input>
                 <el-input type="textarea" v-else-if="(item.prop === 'orderRemark')" v-model="form[item.prop]"   size="small" autocomplete="off" placeholder="请输入"></el-input>
                 <el-input type="age" v-else v-model="form[item.prop]" size="small" :disabled="item.disabled?true:false" autocomplete="off" placeholder="请输入"></el-input>
               </el-form-item>
@@ -49,6 +68,32 @@
             @row-del="rowDelList"
             @selection-change="productSelection"
           >
+            <template slot="price" slot-scope="{ row }">
+              <el-input
+                v-if="row.$cellEdit"
+                v-model="row.price"
+                placeholder="请输入"
+                size="small"
+                oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+                @input="priceChange(row)"
+              ></el-input>
+              <span v-else>{{ row.price }}</span>
+            </template>
+            <template slot="actualQuantity" slot-scope="{ row }">
+              <el-input
+                v-if="row.$cellEdit"
+                v-model="row.actualQuantity"
+                placeholder="请输入"
+                size="small"
+                oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+                @input="quantityChange(row)"
+              ></el-input>
+              <span v-else>{{ row.actualQuantity }}</span>
+            </template>
+            <template slot="priceCategory" slot-scope="{row,index}">
+              <span style="margin-left: 12px;padding-top: 2px">{{ row.priceCategoryNames }}</span>
+              <el-button v-if="row.$cellEdit" type="text" size="mini" style="float: right" @click="choice(row)">选择</el-button>
+            </template>
             <template slot="menuLeft" slot-scope="{size}">
               <el-button type="primary"
                          icon="el-icon-plus"
@@ -63,6 +108,7 @@
               </el-button>
               <el-button type="info"
                          size="small"
+                         :disabled="importInventoryData.length < 1"
               >收款记录
               </el-button>
             </template>
@@ -73,12 +119,6 @@
                 @click="rowCell(row,index)"
               >{{ row.$cellEdit ? '保存' : '修改' }}
               </el-button>
-              <el-button
-                type="text"
-                size="small"
-                v-if="!row.$cellEdit"
-                @click="sendHandle"
-              >发货</el-button>
             </template>
           </avue-crud>
         </basic-container>
@@ -131,8 +171,9 @@
       </el-row>
       <span slot="footer" class="dialog-footer">
           <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="importGoods" v-if="commodityData !== true">导入</el-button>
-          <el-button type="primary" @click="importChoice" v-if="commodityData === true"
+           <el-button type="primary" @click="commodityConfirm" v-if="selectKind != -1"  :disabled="tableData.length !== 1">确定</el-button>
+          <el-button type="primary" @click="importGoods" v-if="commodityData !== true  && selectKind == -1">导入</el-button>
+          <el-button type="primary" @click="importChoice" v-if="commodityData === true  && selectKind == -1"
                      :disabled="tableData.length !== 1">导入</el-button>
         </span>
     </el-dialog>
@@ -146,16 +187,7 @@ import advantageProject from "./config/advantageProject.json";
 import optionTwoCost from "./config/mainListCost.json";
 import {getDeptLazyTree,getDeptLazyTreeTwo, customerList} from "@/api/basicData/basicFeesDesc";
 import commodity from "./config/commodity.json"
-import {
-  typeSave, detail, deleteDetails,
-  corpstypeTree,
-  corpsattn,
-  corpsbank,
-  corpsfiles,
-  corpsitem,
-  getList,
-  detailList
-} from "@/api/basicData/configuration"
+import { getList } from "@/api/basicData/configuration"
 import {detailSaleList,
   submitData,
   goodsListRemove,
@@ -163,7 +195,9 @@ import {detailSaleList,
   updateListRemove,
   generateShipment} from "@/api/importTrade/salesContract"
 import feeInfo from "@/components/fee-info/main";
+import {getSysNo} from "@/api/importTrade/purchase";
 import uploadFile from "@/components/upload-file/main";
+import _ from "lodash";
 
 export default {
   name: "detailsPage",
@@ -175,15 +209,36 @@ export default {
       form: {},
       orderFeesList:[],
       orderFilesList:[],
+      currencyDic:[],
+      selectKind:-1,
+      configuration:{
+        multipleChoices:false,
+        multiple:false,
+        disabled:false,
+        searchShow:false,
+        collapseTags:false,
+        placeholder:'请点击右边按钮选择',
+        dicData:[]
+      },
+      bConfiguration:{
+        multipleChoices:false,
+        multiple:false,
+        disabled:false,
+        searchShow:false,
+        collapseTags:false,
+        placeholder:'请点击右边按钮选择',
+        dicData:[]
+      },
       //  基础信息
       basicData: {
         column: [
           {
             label: '系统号',
             prop: 'sysNo',
+            disabled:true,
             rules: [
               {
-                required: false,
+                required: true,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -191,10 +246,9 @@ export default {
           }, {
             label: '订单号',
             prop: 'orderNo',
-            disabled:true,
             rules: [
               {
-                required: false,
+                required: true,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -226,7 +280,6 @@ export default {
           }, {
             label: '销售公司',
             prop: 'belongToCorpId',
-            // type:'select',
             dicData: [],
             rules: [
               {
@@ -238,7 +291,6 @@ export default {
           }, {
             label: '工厂/贸易商名称',
             prop: 'corpId',
-            // type:'select',
             dicData: [],
             rules: [
               {
@@ -262,7 +314,7 @@ export default {
             prop: 'orderAmount',
             rules: [
               {
-                required: false,
+                pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -272,7 +324,7 @@ export default {
             prop: 'settlmentAmount',
             rules: [
               {
-                required: false,
+                pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -280,24 +332,10 @@ export default {
           }, {
             label: '起运港',
             prop: 'portOfLoad',
-            rules: [
-              {
-                required: false,
-                message: ' ',
-                trigger: 'blur'
-              }
-            ]
           },
           {
             label: '目的港',
             prop: 'portOfDestination',
-            rules: [
-              {
-                required: false,
-                message: ' ',
-                trigger: 'blur'
-              }
-            ]
           },
           {
             label: '包装要求',
@@ -338,7 +376,7 @@ export default {
             prop: 'advancePayment',
             rules: [
               {
-                required: false,
+                pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -391,13 +429,6 @@ export default {
           },  {
             label: '币别',
             prop: 'currency',
-            rules: [
-              {
-                required: false,
-                message: ' ',
-                trigger: 'blur'
-              }
-            ]
           }, {
             label: '汇率',
             prop: 'exchangeRate',
@@ -530,10 +561,16 @@ export default {
     }
   },
   created() {
+    //币别
+    this.getWorkDicts("currency").then(res =>{
+      this.currencyDic = res.data.data
+    })
     if (this.$route.query.id) {
       let id = this.$route.query.id.replace(/\"/g, "")
       detailSaleList(id).then(res => {
         this.form = res.data.data;
+        this.configuration.dicData = this.form.corpName
+        this.bConfiguration.dicData = this.form.belongToCorpList
         this.importInventoryData = this.form.orderItemsList
         if(this.form.orderFeesList){
           this.orderFeesList = this.form.orderFeesList
@@ -543,6 +580,10 @@ export default {
         }
         this.bankOfDepositData = this.form.orderFilesList
       })
+    }else{
+      getSysNo("JK-XS").then(res =>{
+        this.$set(this.form,"sysNo", res.data.data)
+      })
     }
   },
   components: {
@@ -550,6 +591,24 @@ export default {
     uploadFile
   },
   methods: {
+    //单价
+    priceChange(row) {
+      if (!row.price) {
+        row.price = "";
+        row.amount = 0
+      } else {
+        row.amount = (row.actualQuantity * row.price).toFixed(2);
+      }
+    },
+    //件数
+    quantityChange(row) {
+      if (!row.actualQuantity) {
+        row.actualQuantity = "";
+        row.amount = 0
+      } else {
+        row.amount = (row.actualQuantity * row.price).toFixed(2);
+      }
+    },
     editCustomer() {
       this.$refs["form"].validate((valid) => {
         let orderFeesList = this.$refs.feeInfo.submitData();
@@ -564,18 +623,29 @@ export default {
             return this.$message.error(`请正确输入第${i + 1}行的数量`);
           }
         }
-        // let orderUpLoadList = this.$refs.uploadFile.submitData();
+        let orderUpLoadList = this.$refs.uploadFile.submitData();
+        for (let j = 0; j < this.importInventoryData.length; j++) {
+          if (this.importInventoryData[j].billNo == null) {
+            return this.$message.error(`请输入商品明细第${j + 1}行的提单号`);
+          }
+          if (this.importInventoryData[j].orgOrderNo == null) {
+            return this.$message.error(`请输入商品明细第${j + 1}行的合同号`);
+          }
+        }
         if (valid) {
           let submitDto = {
             ...this.form,
             orderItemsList: this.importInventoryData,
             orderFeesList: orderFeesList,
+            orderUpLoadList:orderUpLoadList,
           };
           submitData(submitDto).then(res => {
             if(res.data.success){
               this.$message.success("操作成功!")
               detailSaleList(res.data.data.id).then(res => {
                 this.form = res.data.data;
+                this.configuration.dicData = this.form.corpName
+                this.bConfiguration.dicData = this.form.belongToCorpList
                 this.importInventoryData = this.form.orderItemsList
                 if(this.form.orderFeesList){
                   this.orderFeesList = this.form.orderFeesList
@@ -634,13 +704,11 @@ export default {
     },
     //商品编辑
     rowCell(row, index) {
-      console.log(row)
       // row.$cellEdit = !row.$cellEdit
       this.$refs.importInventory.rowCell(row, index)
     },
     //其他费用编辑
     rowCellTwo(row, index) {
-      console.log(row)
       this.$refs.crudProject.rowCell(row, index)
     },
     //其他费用新增触发
@@ -653,7 +721,6 @@ export default {
       this.loadingCost = true;
       let queryParams = Object.assign({}, params, {pageSize: page.pageSize, pageNum: page.currentPage,parentId:0,feesTypeId:this.treeDeptIdCost})
       customerList(queryParams).then(res => {
-        console.log(res)
         const data = res.data.data;
         this.pageCost.total = data.total;
         this.dataCost = data.records;
@@ -664,23 +731,31 @@ export default {
     onLoad(page, params = {}) {
       this.loading = true;
       getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
-        console.log(res)
         const data = res.data.data;
         this.page.total = data.total;
         this.data = data.records;
         this.loading = false;
       });
     },
-    //点击费用明细选择触发
+    rateChange(row) {
+      if (row >= 100) {
+        this.$set(this.form,"exchangeRate", 0)
+        this.$message.error("汇率不能超过100%");
+      }
+    },
+    //选择货物品种
     choice(row){
-      this.dialogCost = !this.dialogCost
-      this.choiceData = true
-      this.choiceIndex = row.$index
+      this.dialogVisible = true;
+      this.selectKind = row.$index;
     },
-    nodeClickCost(data){
-      this.treeDeptIdCost = data.id;
-      this.pageCost.currentPage = 1;
-      this.onLoadCost(this.pageCost);
+    //选择货品
+    commodityConfirm(){
+      if(this.tableData){
+        this.importInventoryData[this.selectKind].priceCategory = this.tableData[0].id;
+        this.$set(this.importInventoryData[this.selectKind],'priceCategoryNames',this.tableData[0].cname)
+        this.dialogVisible = !this.dialogVisible
+        this.selectKind = -1
+      }
     },
     //刷新触发
     refreshChange() {
@@ -692,54 +767,29 @@ export default {
     selectionChange(list) {
       this.tableData = list
     },
-    //费用刷新触发
-    refreshChangeCost() {
-      this.treeDeptIdCost = '';
-      this.pageCost.currentPage = 1;
-      this.onLoadCost(this.pageCost);
-    },
     //确认导入触发
     importGoods() {
       if (this.tableData.length > 0) {
         for (let item in this.tableData) {
-          console.log(this.tableData[item])
-          this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
-          delete this.tableData[item].goodsTypeName
-          this.tableData[item].itemId = this.tableData[item].id
-          delete this.tableData[item].id
-          this.$refs.importInventory.rowCellAdd(this.tableData[item]);
-          this.$refs.importInventory.rowCell(this.tableData[item], this.importInventoryData.length - 1)
+          const params ={
+            priceCategory:this.tableData[item].code,
+            priceCategoryNames:this.tableData[item].cname,
+            itemId:this.tableData[item].id,
+            cname:this.tableData[item].cname
+          }
+          this.$refs.importInventory.rowCellAdd(params);
+          this.$refs.importInventory.rowCell(params,this.importInventoryData.length - 1)
         }
       }
       this.tableData = []
       this.dialogVisible = false
     },
-    //费用选中触发
-    selectionChangeCost(list){
-      this.tableDataCost = list
-    },
     //导入页左商品类型查询
     nodeClick(data) {
       this.treeDeptId = data.id;
       this.page.currentPage = 1;
       this.onLoad(this.page);
     },
-    //费用导入触发
-    importCost(){
-      // this.advantageProjectForm = this.advantageProjectForm.concat(this.tableDataCost)
-      if (this.tableDataCost.length>0){
-        for(let item in this.tableDataCost){
-          console.log(this.tableDataCost[item])
-          this.tableDataCost[item].itemId = this.tableDataCost[item].id
-          this.tableDataCost[item].feeName = this.tableDataCost[item].cname
-          delete this.tableDataCost[item].id
-          this.$refs.crudProject.rowCellAdd(this.tableDataCost[item]);
-          this.$refs.crudProject.rowCell(this.tableDataCost[item], this.advantageProjectForm.length-1)
-        }
-      }
-      this.tableDataCost = []
-      this.dialogCost = false
-    },
     //导入商品触发
     importChoice() {
       if (this.tableData.length === 1) {
@@ -753,49 +803,6 @@ export default {
       this.dialogVisible = !this.dialogVisible
       this.commodityData = false
     },
-    //费用编辑导入触发
-    choiceCost(){
-      if (this.tableDataCost.length === 1){
-        this.advantageProjectData[this.choiceIndex].feeName = this.tableDataCost[0].cname
-        this.advantageProjectData[this.choiceIndex].itemId = this.tableDataCost[0].id
-        this.advantageProjectData[this.choiceIndex].code = this.tableDataCost[0].code
-      }
-      this.dialogCost = !this.dialogCost
-      this.choiceData = false
-    },
-    //新增附件上传保存触发
-    rowSaveBankOfDeposit(row, done, loading){
-      this.bankOfDepositData.push(row)
-      done()
-    },
-    //修改附件上传触发
-    rowUpdateBankOfDeposit(row, index, done, loading) {
-      done(row);
-    },
-    //删除附件上传触发
-    rowDelBankOfDeposit(row, index, donerowDel) {
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(() => {
-        if (row.id){
-          updateListRemove(row.id).then(res=>{
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-            this.bankOfDepositData.splice(index, 1);
-          })
-        }else {
-          this.$message({
-            type: "success",
-            message: "操作成功!"
-          });
-          this.bankOfDepositData.splice(index, 1);
-        }
-      })
-    },
     //新增明细保存触发
     rowSaveList(row, done, loading){
       // this.advantageProjectData.push(row)
@@ -829,43 +836,6 @@ export default {
         }
       })
     },
-    //新增明细保存触发
-    rowSaveProject(row, done, loading){
-      // this.advantageProjectData.push(row)
-      done()
-    },
-    //修改明细触发
-    rowUpdateProject(row, index, done, loading) {
-      done(row);
-    },
-    //删除明细触发
-    rowDelProject(row, index, donerowDel) {
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(() => {
-        if (row.id){
-          feesListRemove(row.id).then(res=>{
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-            this.advantageProjectData.splice(index, 1);
-          })
-        }else {
-          this.$message({
-            type: "success",
-            message: "操作成功!"
-          });
-          this.advantageProjectData.splice(index, 1);
-        }
-      })
-    },
-    // 发货
-    sendHandle() {
-      this.$message.success('发货成功')
-    },
     backToList() {
       this.$router.$avueRouter.closeTag();
       this.$router.push({
@@ -890,7 +860,11 @@ export default {
   /* display: flex;
   justify-content: left; */
 }
-
+.add-customer-btn-two {
+  position: fixed;
+  right: 150px;
+  top: 115px;
+}
 .customer-back {
   cursor: pointer;
   line-height: 62px;

+ 2 - 1
src/views/salesManagement/salesContract/index.vue

@@ -38,12 +38,13 @@
       <template slot="menuLeft">
         <el-button size="small"
                    type="success"
+                   :disabled="true"
                    @click.stop=""
         >复制新单
         </el-button>
         <el-button size="small"
                    type="info"
-                   @click.stop="openReport()"
+                   @click.stop=""
         >报表
         </el-button>
       </template>