|  | @@ -167,14 +167,23 @@
 | 
	
		
			
				|  |  |                ></el-input>
 | 
	
		
			
				|  |  |                <span v-else>{{ row.orderQuantity | IntegerFormat }}</span>
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  | -            <template slot="price" slot-scope="{ row }">
 | 
	
		
			
				|  |  | -              <el-input
 | 
	
		
			
				|  |  | +            <template slot="purchaseAmount" slot-scope="{ row }">
 | 
	
		
			
				|  |  | +              <el-select
 | 
	
		
			
				|  |  |                  v-if="row.$cellEdit"
 | 
	
		
			
				|  |  | -                v-model.trim="row.price"
 | 
	
		
			
				|  |  | -                oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'                size="small"
 | 
	
		
			
				|  |  | -                @input="changeContractAmt(row)"
 | 
	
		
			
				|  |  | -              ></el-input>
 | 
	
		
			
				|  |  | -              <span v-else>{{ row.price }}</span>
 | 
	
		
			
				|  |  | +                v-model="row.purchaseAmount"
 | 
	
		
			
				|  |  | +                @focus="changeContractAmt(row)"
 | 
	
		
			
				|  |  | +                allow-create
 | 
	
		
			
				|  |  | +                filterable
 | 
	
		
			
				|  |  | +                v-input-limit="2"
 | 
	
		
			
				|  |  | +                default-first-option
 | 
	
		
			
				|  |  | +              >
 | 
	
		
			
				|  |  | +                <el-option
 | 
	
		
			
				|  |  | +                  v-for="(item, index) in purchasePriceOption"
 | 
	
		
			
				|  |  | +                  :key="index"
 | 
	
		
			
				|  |  | +                  :label="item.purchasePrice"
 | 
	
		
			
				|  |  | +                  :value="item.purchasePrice"></el-option>
 | 
	
		
			
				|  |  | +              </el-select>
 | 
	
		
			
				|  |  | +              <span v-else>{{ row.purchaseAmount | decimalFormat }}</span>
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  |              <template slot="amount" slot-scope="{ row }">
 | 
	
		
			
				|  |  |                <span>{{ row.amount | decimalFormat }}</span>
 | 
	
	
		
			
				|  | @@ -185,24 +194,6 @@
 | 
	
		
			
				|  |  |              <template slot="storageQuantity" slot-scope="{ row }">
 | 
	
		
			
				|  |  |                <span>{{ row.storageQuantity | IntegerFormat }}</span>
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  | -<!--            <template slot="storageQuantity" slot-scope="{ row }">-->
 | 
	
		
			
				|  |  | -<!--              <el-input-->
 | 
	
		
			
				|  |  | -<!--                v-if="row.$cellEdit"-->
 | 
	
		
			
				|  |  | -<!--                v-model.trim="row.storageQuantity"-->
 | 
	
		
			
				|  |  | -<!--                size="small"-->
 | 
	
		
			
				|  |  | -<!--                oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'-->
 | 
	
		
			
				|  |  | -<!--              ></el-input>-->
 | 
	
		
			
				|  |  | -<!--              <span v-else>{{ row.storageQuantity }}</span>-->
 | 
	
		
			
				|  |  | -<!--            </template>-->
 | 
	
		
			
				|  |  | -<!--            <template slot="actualQuantity" slot-scope="{ row }">-->
 | 
	
		
			
				|  |  | -<!--              <el-input-->
 | 
	
		
			
				|  |  | -<!--                v-if="row.$cellEdit"-->
 | 
	
		
			
				|  |  | -<!--                v-model.trim="row.actualQuantity"-->
 | 
	
		
			
				|  |  | -<!--                size="small"-->
 | 
	
		
			
				|  |  | -<!--                oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'-->
 | 
	
		
			
				|  |  | -<!--              ></el-input>-->
 | 
	
		
			
				|  |  | -<!--              <span v-else>{{ row.actualQuantity }}</span>-->
 | 
	
		
			
				|  |  | -<!--            </template>-->
 | 
	
		
			
				|  |  |              <template slot="code" slot-scope="{row,index}">
 | 
	
		
			
				|  |  |                <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="commodityChoice(row)" :disabled="detailData.seeDisabled || !row.$cellEdit">选择</el-button>
 | 
	
		
			
				|  |  |                <span>{{ row.code }}</span>
 | 
	
	
		
			
				|  | @@ -515,6 +506,7 @@ import reportDialog from "@/components/report-dialog/main";
 | 
	
		
			
				|  |  |  import check from "@/components/check/check";
 | 
	
		
			
				|  |  |  import checkSchedule from "@/components/check/checkSchedule";
 | 
	
		
			
				|  |  |  import { customerList as feeList } from "@/api/basicData/basicFeesDesc";
 | 
	
		
			
				|  |  | +import { getMarketPrice, getPurchasePrice } from "@/api/basicData/fees";
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |    name: "detailsPage",
 | 
	
	
		
			
				|  | @@ -608,7 +600,6 @@ export default {
 | 
	
		
			
				|  |  |          treeLoad: function (node, resolve) {
 | 
	
		
			
				|  |  |            const parentId = (node.level === 0) ? 0 : node.data.id;
 | 
	
		
			
				|  |  |            getDeptLazyTreeS(parentId).then(res => {
 | 
	
		
			
				|  |  | -            console.log(res.data.data)
 | 
	
		
			
				|  |  |              resolve(res.data.data.map(item => {
 | 
	
		
			
				|  |  |                return {
 | 
	
		
			
				|  |  |                  ...item,
 | 
	
	
		
			
				|  | @@ -822,6 +813,7 @@ export default {
 | 
	
		
			
				|  |  |        feesOption: [],
 | 
	
		
			
				|  |  |        applyPaymentList: [],
 | 
	
		
			
				|  |  |        messageVisble: false,
 | 
	
		
			
				|  |  | +      purchasePriceOption: [],
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    mounted() {
 | 
	
	
		
			
				|  | @@ -844,7 +836,6 @@ export default {
 | 
	
		
			
				|  |  |    async created() {
 | 
	
		
			
				|  |  |      this.rowHeight = (window.innerHeight - 130) + 'px'
 | 
	
		
			
				|  |  |      this.customerContact = customerContact
 | 
	
		
			
				|  |  | -    console.log(this.customerContact)
 | 
	
		
			
				|  |  |      // this.customerContact = await this.getColumnData(this.getColumnName(18), customerContact);
 | 
	
		
			
				|  |  |      this.advantageProject = await this.getColumnData(this.getColumnName(19), advantageProject);
 | 
	
		
			
				|  |  |      this.getWorkDicts("payment_term").then(res => {
 | 
	
	
		
			
				|  | @@ -1061,11 +1052,9 @@ export default {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //点击行可编辑
 | 
	
		
			
				|  |  |      handleRowClick(row, event, column) {
 | 
	
		
			
				|  |  | -      console.log(row.$index)
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //商品编辑
 | 
	
		
			
				|  |  |      rowCell(row, index) {
 | 
	
		
			
				|  |  | -      console.log(row)
 | 
	
		
			
				|  |  |        if (row.$cellEdit) {
 | 
	
		
			
				|  |  |          if (Number(row.orderQuantity) < Number(row.actualQuantity)) {
 | 
	
		
			
				|  |  |            return this.$message.error('订货数量不能小于发货数量')
 | 
	
	
		
			
				|  | @@ -1075,7 +1064,6 @@ export default {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //费用编辑
 | 
	
		
			
				|  |  |      rowCellTwo(row, index) {
 | 
	
		
			
				|  |  | -      console.log(row)
 | 
	
		
			
				|  |  |        this.$refs.crudProject.rowCell(row, index)
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //商品选中触发
 | 
	
	
		
			
				|  | @@ -1098,14 +1086,12 @@ export default {
 | 
	
		
			
				|  |  |      choice(row) {
 | 
	
		
			
				|  |  |        this.dialogCost = !this.dialogCost
 | 
	
		
			
				|  |  |        this.choiceData = true
 | 
	
		
			
				|  |  | -      console.log(row)
 | 
	
		
			
				|  |  |        this.choiceIndex = row.$index
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //点击商品明细选择触发
 | 
	
		
			
				|  |  |      commodityChoice(row) {
 | 
	
		
			
				|  |  |        this.dialogVisible = !this.dialogVisible
 | 
	
		
			
				|  |  |        this.commodityData = true
 | 
	
		
			
				|  |  | -      console.log(row)
 | 
	
		
			
				|  |  |        this.choiceIndexT = row.$index
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //导入商品触发
 | 
	
	
		
			
				|  | @@ -1120,6 +1106,13 @@ export default {
 | 
	
		
			
				|  |  |          this.contactsData[this.choiceIndexT].orderQuantity = 0
 | 
	
		
			
				|  |  |          this.contactsData[this.choiceIndexT].price = 0
 | 
	
		
			
				|  |  |          this.contactsData[this.choiceIndexT].amount = 0
 | 
	
		
			
				|  |  | +        getPurchasePrice({code: this.contactsData[this.choiceIndexT].code}).then(res => {
 | 
	
		
			
				|  |  | +          if (res.data.data.length > 0) {
 | 
	
		
			
				|  |  | +            this.$set(this.contactsData[this.choiceIndexT], 'purchaseAmount', res.data.data[0].purchasePrice)
 | 
	
		
			
				|  |  | +          } else {
 | 
	
		
			
				|  |  | +            this.$set(this.contactsData[this.choiceIndexT], 'purchaseAmount', '0')
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  |          selectGoodsNum({
 | 
	
		
			
				|  |  |            goodsId: this.tableData[0].id,
 | 
	
		
			
				|  |  |            itemType: this.tableData[0].typeno
 | 
	
	
		
			
				|  | @@ -1145,7 +1138,6 @@ export default {
 | 
	
		
			
				|  |  |        // 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
 | 
	
		
			
				|  |  |            this.tableDataCost[item].sort = this.maxFeeNum + 1
 | 
	
	
		
			
				|  | @@ -1162,6 +1154,13 @@ export default {
 | 
	
		
			
				|  |  |      importGoods() {
 | 
	
		
			
				|  |  |        if (this.goodsListSave.length > 0) {
 | 
	
		
			
				|  |  |          for (let item in this.goodsListSave) {
 | 
	
		
			
				|  |  | +          getPurchasePrice({code: this.goodsListSave[item].code}).then(res => {
 | 
	
		
			
				|  |  | +            if (res.data.data.length > 0) {
 | 
	
		
			
				|  |  | +              this.$set(this.goodsListSave[item], 'purchaseAmount', res.data.data[0].purchasePrice)
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +              this.$set(this.goodsListSave[item], 'purchaseAmount', '0')
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +          })
 | 
	
		
			
				|  |  |            selectGoodsNum({
 | 
	
		
			
				|  |  |              goodsId: this.goodsListSave[item].id,
 | 
	
		
			
				|  |  |              itemType: this.goodsListSave[item].typeno
 | 
	
	
		
			
				|  | @@ -1185,6 +1184,13 @@ export default {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        } else {
 | 
	
		
			
				|  |  |          for (let item in this.tableData) {
 | 
	
		
			
				|  |  | +          getPurchasePrice({code: this.tableData[item].code}).then(res => {
 | 
	
		
			
				|  |  | +            if (res.data.data.length > 0) {
 | 
	
		
			
				|  |  | +              this.$set(this.tableData[item], 'purchaseAmount', res.data.data[0].purchasePrice)
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +              this.$set(this.tableData[item], 'purchaseAmount', '0')
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +          })
 | 
	
		
			
				|  |  |            selectGoodsNum({
 | 
	
		
			
				|  |  |              goodsId: this.tableData[item].id,
 | 
	
		
			
				|  |  |              itemType: this.tableData[item].typeno
 | 
	
	
		
			
				|  | @@ -1222,12 +1228,10 @@ export default {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //选中触发
 | 
	
		
			
				|  |  |      selectionChange(list) {
 | 
	
		
			
				|  |  | -      console.log(list);
 | 
	
		
			
				|  |  |        this.tableData = list
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //费用选中触发
 | 
	
		
			
				|  |  |      selectionChangeCost(list) {
 | 
	
		
			
				|  |  | -      console.log(list);
 | 
	
		
			
				|  |  |        this.tableDataCost = list
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //导入页左商品类型查询
 | 
	
	
		
			
				|  | @@ -1256,8 +1260,6 @@ export default {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //新增商品信息保存触发
 | 
	
		
			
				|  |  |      rowSave(row, done, loading) {
 | 
	
		
			
				|  |  | -      console.log(row)
 | 
	
		
			
				|  |  | -      console.log(this.contactsData)
 | 
	
		
			
				|  |  |        // this.contactsData.push(row)
 | 
	
		
			
				|  |  |        done()
 | 
	
		
			
				|  |  |      },
 | 
	
	
		
			
				|  | @@ -1331,7 +1333,6 @@ export default {
 | 
	
		
			
				|  |  |          feesTypeId: this.treeDeptIdCost
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  |        customerList(queryParams).then(res => {
 | 
	
		
			
				|  |  | -        console.log(res)
 | 
	
		
			
				|  |  |          const data = res.data.data;
 | 
	
		
			
				|  |  |          this.pageCost.total = data.total;
 | 
	
		
			
				|  |  |          this.dataCost = data.records;
 | 
	
	
		
			
				|  | @@ -1366,9 +1367,12 @@ export default {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      // 计算费用
 | 
	
		
			
				|  |  |      changeContractAmt(row) {
 | 
	
		
			
				|  |  | +      getPurchasePrice({code: row.code}).then(res => {
 | 
	
		
			
				|  |  | +        this.purchasePriceOption = res.data.data
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  |        let orderQuantity = 0;
 | 
	
		
			
				|  |  |        let purchaseAmount = 0;
 | 
	
		
			
				|  |  | -      if (row.price) {
 | 
	
		
			
				|  |  | +      if (row.purchaseAmount) {
 | 
	
		
			
				|  |  |          purchaseAmount = row.purchaseAmount;
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |        if (row.orderQuantity) {
 |