Explorar o código

fix:订单、发票问题修改

snow hai 1 ano
pai
achega
aeb8d178dc

+ 1 - 1
src/apis/service/operate/supplier/index.js

@@ -11,7 +11,7 @@ export default {
   // 更新
   update: (data, params) => http(api + 'edit', data, 'post', params),
   // 修改状态
-  status: (data, params) => http(api + 'supplerstatus', data, 'post', params),
+  status: (data, params) => http(api + 'status', data, 'post', params),
   // 详情
   detail: (data, params) => http(api + 'info', data, 'post', params),
   // 详情

+ 119 - 12
src/components/approval-node/src/uploadInvoice/index.vue

@@ -1,17 +1,47 @@
 <template>
   <div v-loading="loading">
-    <div style="display:flex;justify-content:flex-end">
-      <el-button
-        v-if="isApproval && tableData.length > 0"
-        size="mini"
-        type="primary"
-        @click="handleBatch"
-      >批量审批发票</el-button>
-
-      <template v-if="!readonly">
-        <el-button size="mini" @click="onDownloadTemplate">下载发票模板</el-button>
-        <el-button v-if="isUpload" size="mini" type="primary" @click="xlsxVisible = true">上传发票信息</el-button>
-      </template>
+    <div style="display:flex;justify-content:space-between;">
+      <div style="font-size:14px;display:flex;align-items:center">
+        <el-popover placement="top" trigger="hover">
+          <ex-table
+            size="mini"
+            :columns="invColumns"
+            :table="table"
+            :data="invData"
+            :noPagination="true"
+          >
+            <template #checked="{ scope }">
+              <span v-if="scope.row[scope.column.property] === '--'" style="color:#909399">--</span>
+              <i
+                v-else-if="scope.row[scope.column.property]"
+                class="el-icon-check"
+                style="color:#67C23A"
+              />
+              <i v-else class="el-icon-close" style="color:#F56C6C" />
+            </template>
+          </ex-table>
+
+          <template #reference>
+            <i class="el-icon-info" style="font-size:22px; cursor:pointer; margin-right:3px" />
+          </template>
+        </el-popover>
+
+        <span>点我查看 : 发票类型必填字段说明</span>
+      </div>
+
+      <div>
+        <el-button
+          v-if="isApproval && tableData.length > 0"
+          size="mini"
+          type="primary"
+          @click="handleBatch"
+        >批量审批发票</el-button>
+
+        <template v-if="!readonly">
+          <el-button size="mini" @click="onDownloadTemplate">下载发票模板</el-button>
+          <el-button v-if="isUpload" size="mini" type="primary" @click="xlsxVisible = true">上传发票信息</el-button>
+        </template>
+      </div>
     </div>
 
     <el-table
@@ -168,6 +198,83 @@ export default {
         { id: "0", label: "已驳回", type: "danger" },
         { id: "1", label: "待审核", type: "info" },
         { id: "2", label: "已通过", type: "success" }
+      ],
+      table: {
+        stripe: true,
+        border: true,
+        "max-height": "800px"
+      },
+      invData: [
+        {
+          type: "发票代码",
+          zNormal: true,
+          zSpecal: true,
+          dNormal: true,
+          dSpecal: true,
+          fdNormal: "--",
+          fdSpecal: "--"
+        },
+        {
+          type: "发票税前金额",
+          zNormal: true,
+          zSpecal: true,
+          dNormal: true,
+          dSpecal: true,
+          fdNormal: false,
+          fdSpecal: false
+        },
+        {
+          type: "校验码",
+          zNormal: true,
+          zSpecal: false,
+          dNormal: true,
+          dSpecal: false,
+          fdNormal: "--",
+          fdSpecal: "--"
+        }
+      ],
+      invColumns: [
+        {
+          label: "字段",
+          prop: "type",
+          width: "110px"
+        },
+        {
+          prop: "zNormal",
+          label: "纸质普通发票",
+          _slot_: "checked",
+          width: "100px"
+        },
+        {
+          prop: "zSpecal",
+          label: "纸质专用发票",
+          _slot_: "checked",
+          width: "100px"
+        },
+        {
+          prop: "dNormal",
+          label: "电子普通发票",
+          _slot_: "checked",
+          width: "100px"
+        },
+        {
+          prop: "dSpecal",
+          label: "电子专用发票",
+          _slot_: "checked",
+          width: "100px"
+        },
+        {
+          prop: "fdNormal",
+          label: "电子发票(增值税普通发票)",
+          _slot_: "checked",
+          width: "170px"
+        },
+        {
+          prop: "fdSpecal",
+          label: "电子发票(增值税专用发票)",
+          _slot_: "checked",
+          width: "170px"
+        }
       ]
     };
   },

+ 1 - 88
src/components/approval-node/src/uploadInvoice/xlsxUploadModal.vue

@@ -7,25 +7,6 @@
     :close-on-click-modal="false"
     @close="handleClose"
   >
-    <ex-table
-      :columns="invColumns"
-      size="mini"
-      :table="table"
-      :data="invData"
-      :noPagination="true"
-      style="margin-bottom:10px;margin-top:-20px"
-    >
-      <template #checked="{ scope }">
-        <span v-if="scope.row[scope.column.property] === '--'" style="color:#909399">--</span>
-        <i
-          v-else-if="scope.row[scope.column.property]"
-          class="el-icon-check"
-          style="color:#67C23A"
-        />
-        <i v-else class="el-icon-close" style="color:#F56C6C" />
-      </template>
-    </ex-table>
-
     <div v-if="tableData && tableData.length > 0" class="tr" style="padding: 10px 0 0 0">
       <el-button :size="'mini'" @click="() => tableData = []">取消</el-button>
       <el-button type="primary" :size="'mini'" @click="onSubmit" :loading="loading">提交</el-button>
@@ -65,75 +46,7 @@ export default {
         stripe: true,
         border: true,
         "max-height": "800px"
-      },
-      invData: [
-        {
-          type: "发票代码",
-          zNormal: true,
-          zSpecal: true,
-          dNormal: true,
-          dSpecal: true,
-          fdNormal: "--",
-          fdSpecal: "--"
-        },
-        {
-          type: "发票税前金额",
-          zNormal: true,
-          zSpecal: true,
-          dNormal: true,
-          dSpecal: true,
-          fdNormal: false,
-          fdSpecal: false
-        },
-        {
-          type: "校验码",
-          zNormal: true,
-          zSpecal: false,
-          dNormal: true,
-          dSpecal: false,
-          fdNormal: "--",
-          fdSpecal: "--"
-        }
-      ],
-      invColumns: [
-        {
-          label: "字段",
-          prop: "type",
-          width: "110px"
-        },
-        {
-          prop: "zNormal",
-          label: "纸质普通发票",
-          _slot_: "checked"
-        },
-        {
-          prop: "zSpecal",
-          label: "纸质专用发票",
-          _slot_: "checked"
-        },
-        {
-          prop: "dNormal",
-          label: "电子普通发票",
-          _slot_: "checked"
-        },
-        {
-          prop: "dSpecal",
-          label: "电子专用发票",
-          _slot_: "checked"
-        },
-        {
-          prop: "fdNormal",
-          label: "电子发票(增值税普通发票)",
-          _slot_: "checked",
-          width: "170px"
-        },
-        {
-          prop: "fdSpecal",
-          label: "电子发票(增值税专用发票)",
-          _slot_: "checked",
-          width: "170px"
-        }
-      ]
+      }
     };
   },
   computed: {

+ 243 - 219
src/components/manage/src/letter/index.vue

@@ -2,13 +2,20 @@
   <div>
     <div style="display:flex; justify-content:space-between; align-items:center; margin-top:5px">
       <p v-if="type !== 'settlement'">{{mapTitle[type || 'budget']}}</p>
-  
-      <div  v-if="!readonly">
-        <el-button size="mini" type="success" @click="handleSelectLetter" v-if="type === 'project'">已有评估函在线编辑</el-button>
+
+      <div v-if="!readonly">
+        <el-button
+          size="mini"
+          type="success"
+          @click="handleSelectLetter"
+          v-if="type === 'project'"
+        >已有评估函在线编辑</el-button>
         <el-button size="mini" @click="onDownloadTemplate" v-if="type !== 'activity'">下载模板</el-button>
-        <el-button size="mini" type="primary" @click="handleUploadModalVisible">{{
-          type === 'activity' ? '上传活动方案' : '上传数据'  
-        }}</el-button>
+        <el-button size="mini" type="primary" @click="handleUploadModalVisible">
+          {{
+          type === 'activity' ? '上传活动方案' : '上传数据'
+          }}
+        </el-button>
       </div>
     </div>
 
@@ -38,40 +45,41 @@
       :data="tableData"
       style="margin: 8px 0 0 0"
     >
-
       <template #letter="{scope}">
-        <a v-if="scope.row.plan_file" :href="scope.row.plan_file">{{getFileNameWithUrl(scope.row.plan_file)}}</a>
+        <a
+          v-if="scope.row.plan_file"
+          :href="scope.row.plan_file"
+        >{{getFileNameWithUrl(scope.row.plan_file)}}</a>
         <p v-else>--</p>
       </template>
-      
+
       <template #is_check="{scope}">
-        <el-tag size="mini" :type="Number(scope.row.is_check) === mapCheck[type || 'budget'].ok ? '' :'warning'">
-         {{ Number(scope.row.is_check) === mapCheck[type || 'budget'].ok  ?  "已选择" : "未选择" }}
-        </el-tag>
+        <el-tag
+          size="mini"
+          :type="Number(scope.row.is_check) === mapCheck[type || 'budget'].ok ? '' :'warning'"
+        >{{ Number(scope.row.is_check) === mapCheck[type || 'budget'].ok ? "已选择" : "未选择" }}</el-tag>
       </template>
 
       <template #status="{scope}">
-        <el-tag size="mini" :type="Number(scope.row.status) === 2 ? '' :'info'">
-          {{(statusOptions.find(({value}) => Number(scope.row.status) === value) || {}).label || '--'}}
-        </el-tag>
+        <el-tag
+          size="mini"
+          :type="Number(scope.row.status) === 2 ? '' :'info'"
+        >{{(statusOptions.find(({value}) => Number(scope.row.status) === value) || {}).label || '--'}}</el-tag>
       </template>
 
       <template #supplier="{ scope }">
-           <el-popover placement="top" trigger="hover">
-              供应商编号:{{scope.row.supplierNo}}
-            <template #reference>
-              <i class="el-icon-warning-outline" />
-            </template>
-          </el-popover>
-          <span style="margin-right:5px">{{scope.row.supplierName}}</span>
+        <el-popover placement="top" trigger="hover">
+          供应商编号:{{scope.row.supplierNo}}
+          <template #reference>
+            <i class="el-icon-warning-outline" />
+          </template>
+        </el-popover>
+        <span style="margin-right:5px">{{scope.row.supplierName}}</span>
       </template>
 
-
-        <!-- ...( ? [] : []) -->
-
+      <!-- ...( ? [] : []) -->
 
       <template #action="{ scope }">
-
         <!-- <el-button
           v-if="readonly"
           size="mini"
@@ -79,8 +87,8 @@
           @click="linkToLetterDetail(scope.row.id)"
         >
           查看
-        </el-button> -->
-        
+        </el-button>-->
+
         <!-- 选中时不能取消发布 -->
         <!-- <el-button 
           v-if="!readonly && type !== 'activity'"
@@ -88,48 +96,34 @@
           type="text" 
           @click="onPublish(scope.row)">
           {{Number(scope.row.status) === 1 ? '发布' : '取消发布'}}
-        </el-button> -->
+        </el-button>-->
 
         <el-tooltip
           effect="dark"
           content="发布"
           placement="top"
-           v-if="(!readonly && type !== 'activity')&& Number(scope.row.status) === 1"
-              >
-                <i
-                  class="el-icon-video-play tb-icon"
-                  size="mini"
-                  @click="onPublish(scope.row)"
-          ></i>
-          </el-tooltip>
+          v-if="(!readonly && type !== 'activity')&& Number(scope.row.status) === 1"
+        >
+          <i class="el-icon-video-play tb-icon" size="mini" @click="onPublish(scope.row)"></i>
+        </el-tooltip>
 
         <el-tooltip
           effect="dark"
           content="取消发布"
           placement="top"
-           v-if="(!readonly && type !== 'activity')&& Number(scope.row.status) !== 1"
-              >
-                <i
-                  class="el-icon-video-pause tb-icon"
-                  size="mini"
-                  @click="onPublish(scope.row)"
-          ></i>
-          </el-tooltip>
+          v-if="(!readonly && type !== 'activity')&& Number(scope.row.status) !== 1"
+        >
+          <i class="el-icon-video-pause tb-icon" size="mini" @click="onPublish(scope.row)"></i>
+        </el-tooltip>
 
         <el-tooltip
           effect="dark"
           content="查看"
           placement="top"
-           v-if="((!readonly && type !== 'activity')&& Number(scope.row.status) !== 1) || readonly"
-              >
-                <i
-                  class="el-icon-view tb-icon"
-                  size="mini"
-                  @click="linkToLetterDetail(scope.row.id)"
-          ></i>
-          </el-tooltip>
-
-        
+          v-if="((!readonly && type !== 'activity')&& Number(scope.row.status) !== 1) || readonly"
+        >
+          <i class="el-icon-view tb-icon" size="mini" @click="linkToLetterDetail(scope.row.id)"></i>
+        </el-tooltip>
 
         <!-- 发布或选中的函无法删除编辑 -->
         <!-- <el-button 
@@ -140,7 +134,7 @@
             type="text" 
           size="mini" 
           @click="linkToLetterUpdate(scope.row)"
-        >编辑</el-button> -->
+        >编辑</el-button>-->
 
         <el-tooltip
           effect="dark"
@@ -149,39 +143,30 @@
           v-if="
             ((type !== 'activity' 
             && (Number(scope.row.is_check) !== mapCheck[type].ok) 
-            && Number(scope.row.status) !== 2) || type === 'settlement') && !readonly" 
-              >
-                <i
-                  class="el-icon-edit tb-icon"
-                  size="mini"
-                  @click="linkToLetterUpdate(scope.row)"
-          ></i>
-          </el-tooltip>
+            && Number(scope.row.status) !== 2) || type === 'settlement') && !readonly"
+        >
+          <i class="el-icon-edit tb-icon" size="mini" @click="linkToLetterUpdate(scope.row)"></i>
+        </el-tooltip>
 
         <!-- <el-button 
           v-if="(type === 'budget' && Number(scope.row.is_check) !== mapCheck[type].ok && Number(scope.row.status) !== 2) && !readonly" 
           type="text" 
           size="mini" 
           @click="deleteItem(scope.row)"
-        >删除</el-button> -->
-
+        >删除</el-button>-->
 
         <el-tooltip
           effect="dark"
           content="删除"
           placement="top"
-          v-if="(Number(scope.row.is_check) !== mapCheck[type].ok && Number(scope.row.status) !== 2) && !readonly" 
-              >
-                <i
-                  class="el-icon-delete tb-icon"
-                  size="mini"
-                 @click="deleteItem(scope.row)"
-          ></i>
-          </el-tooltip>
+          v-if="(Number(scope.row.is_check) !== mapCheck[type].ok && Number(scope.row.status) !== 2) && !readonly"
+        >
+          <i class="el-icon-delete tb-icon" size="mini" @click="deleteItem(scope.row)"></i>
+        </el-tooltip>
       </template>
     </ex-table>
 
-    <excel-upload-modal 
+    <excel-upload-modal
       :requsetMethod="requsetMethod"
       :visible.sync="xlsxVisible"
       @submit="handleSubmit"
@@ -189,108 +174,134 @@
       @activitySubmit="file => onUpdateLetter(file)"
       @abnormal="abnormal"
       :isFile="isFile"
-      :title="title" 
+      :title="title"
       :type="type"
       :id="id"
     />
 
-    <preview-modal 
-      :sitem="sitem"
-      :visible.sync="previewVisible"
-    />
+    <preview-modal :sitem="sitem" :visible.sync="previewVisible" />
 
-    <selection-modal 
-      :visible.sync="visible"
-      :id="id"
-    />
+    <selection-modal :visible.sync="visible" :id="id" @refresh="refresh" />
   </div>
 </template>
 
 
 <script>
-import { mapColumns, mapCheck, mapTitle } from "./_columns"
-import ExcelUploadModal from "./xlsxUploadModal.vue"
-import asyncRequest from "@/apis/components/letter"
-import PreviewModal from "./previewModal.vue"
-import { template ,mapLetterToType } from "./_template"
+import { mapColumns, mapCheck, mapTitle } from "./_columns";
+import ExcelUploadModal from "./xlsxUploadModal.vue";
+import asyncRequest from "@/apis/components/letter";
+import PreviewModal from "./previewModal.vue";
+import { template, mapLetterToType } from "./_template";
 import mixinPage from "@/mixins/elPaginationHandle";
 import { writeFile, utils } from "xlsx";
 
-import SelectionModal from "./selectionModal.vue"
+import SelectionModal from "./selectionModal.vue";
 
 export default {
-  name:'Letter',
-  mixins:[mixinPage],
+  name: "Letter",
+  mixins: [mixinPage],
   /* type:budget预算函  activity活动方案  project计划 **/
-  props:['title', 'requsetMethod', 'status', 'id', 'isSelection', 'readonly','type', 'beforeModalVisible', 'isFile', 'updateLoading'],
-  components:{ ExcelUploadModal, PreviewModal, SelectionModal },
-  data(){
+  props: [
+    "title",
+    "requsetMethod",
+    "status",
+    "id",
+    "isSelection",
+    "readonly",
+    "type",
+    "beforeModalVisible",
+    "isFile",
+    "updateLoading"
+  ],
+  components: { ExcelUploadModal, PreviewModal, SelectionModal },
+  data() {
     return {
       table: {
         stripe: true,
         border: true,
-        'max-height': '800px'
+        "max-height": "800px"
       },
-      statusOptions:[
-        { value:1,label:'草稿'},
-        { value:2,label:'已发布'}
+      statusOptions: [
+        { value: 1, label: "草稿" },
+        { value: 2, label: "已发布" }
       ],
-      noPagination:false,
-      parmValue:{
+      noPagination: false,
+      parmValue: {
         page: 1, // 页码
-        size: 15, // 每页显示条数
+        size: 15 // 每页显示条数
       },
       pageInfo: {
         size: 15,
         curr: 1,
-        total: 0,
+        total: 0
       },
       sitem: {},
       mapCheck,
       mapTitle,
       mapColumns,
-      tableData:[],
+      tableData: [],
       xlsxVisible: false,
       previewVisible: false,
       visible: false
-    }
+    };
   },
-  watch:{
-    id:{
-      handler(val){
-        if(!val) return
-        this.searchList()
+  watch: {
+    id: {
+      handler(val) {
+        if (!val) return;
+        this.searchList();
       },
-      immediate:true
+      immediate: true
     }
   },
-  methods:{
-    handleSelectLetter(){
-      this.visible = true
+  methods: {
+    handleSelectLetter() {
+      this.visible = true;
     },
-    linkToLetterDetail(id){
-      this.$router.push(`/customerService/letterEditing?id=${id}&&readonly=1`)
+    linkToLetterDetail(id) {
+      this.$router.push(`/customerService/letterEditing?id=${id}&&readonly=1`);
     },
-    async onUpdateLetter(fileUrl){
-      if(this.beforeModalVisible && !this.beforeModalVisible()){
-        return
+    async onUpdateLetter(fileUrl) {
+      if (this.beforeModalVisible && !this.beforeModalVisible()) {
+        return;
       }
 
-      this.updateLoading(true)
-      const { form, id } = this.beforeModalVisible()
-      const { code, data } = await asyncRequest.detail({id})
-      
-      if(code !== 1) {
-        this.updateLoading(false)
-        return
+      this.updateLoading(true);
+      const { form, id } = this.beforeModalVisible();
+      const { code, data } = await asyncRequest.detail({ id });
+
+      if (code !== 1) {
+        this.updateLoading(false);
+        return;
       }
 
       const { planinfo = [], req_id, store_id, plan_file } = data;
 
-      const plan_info =  planinfo.map(
-        ({ name,service_cat,unit,price,num,remark,total_fee,tax,pay_fee,tax_fee  }) =>
-        ({ name,service_cat,unit,price,num,remark,total_fee,tax,pay_fee,tax_fee  })
-      )
+      const plan_info = planinfo.map(
+        ({
+          tax,
+          num,
+          name,
+          unit,
+          price,
+          remark,
+          service_cat,
+          total_fee,
+          pay_fee,
+          tax_fee
+        }) => ({
+          name,
+          service_cat,
+          unit,
+          price,
+          num,
+          remark,
+          total_fee,
+          tax,
+          pay_fee,
+          tax_fee
+        })
+      );
 
       const letter = await asyncRequest.create({
         plan_type: mapLetterToType[form],
@@ -298,134 +309,147 @@ export default {
         plan_info,
         store_id,
         req_id
-      })
+      });
 
-      this.updateLoading(false)
+      this.updateLoading(false);
 
-      if(letter.code === 0){
-        this.abnormal()
+      if (letter.code === 0) {
+        this.abnormal();
       }
 
-      if(fileUrl){
-        this.searchList()
-        return
+      if (fileUrl) {
+        this.searchList();
+        return;
       }
 
-      if(letter.code !== 1) return
+      if (letter.code !== 1) return;
       //创建获取获取新id进入编辑页...
-      this.$router.push(`/customerService/letterEditing?id=${letter.data.id}&from=${form}&type=create`)
+      this.$router.push(
+        `/customerService/letterEditing?id=${letter.data.id}&from=${form}&type=create`
+      );
     },
-    refresh(){
-      this.searchList()
-      this.$emit('refresh')
+    refresh() {
+      this.searchList();
+      this.$emit("refresh");
     },
-    handleSelection({list}){
-      this.$emit('selection', list)
+    handleSelection({ list }) {
+      this.$emit("selection", list);
     },
-    deleteItem(row){
-      this.$confirm(`确认删除评估预算函 ${row.planCode}?`,{
-        type:'warning'
+    deleteItem(row) {
+      this.$confirm(`确认删除评估预算函 ${row.planCode}?`, {
+        type: "warning"
       }).then(async () => {
-        this.loading = true
-        const { code } = await asyncRequest.delete({id:row.id})
-        this.loading = false
-        if(code !== 1) return
-        this.searchList()
-      })
+        this.loading = true;
+        const { code } = await asyncRequest.delete({ id: row.id });
+        this.loading = false;
+        if (code !== 1) return;
+        this.searchList();
+      });
     },
-    openModal(row){
-      this.sitem = row
-      this.previewVisible = true
+    openModal(row) {
+      this.sitem = row;
+      this.previewVisible = true;
     },
-    onDownloadTemplate(){
-      const workBook = utils.book_new()
-      const workSheet = utils.json_to_sheet(template)
-      utils.book_append_sheet(workBook,workSheet,"sheet")
-      writeFile(workBook,`${mapTitle[this.type]}模板.xlsx`,{
-        bookType:'xlsx'
-      })
+    onDownloadTemplate() {
+      const workBook = utils.book_new();
+      const workSheet = utils.json_to_sheet(template);
+      utils.book_append_sheet(workBook, workSheet, "sheet");
+      writeFile(workBook, `${mapTitle[this.type]}模板.xlsx`, {
+        bookType: "xlsx"
+      });
     },
-    linkToLetterUpdate(row){
-      this.$router.push('/customerService/letterEditing?id=' + row.id)
+    linkToLetterUpdate(row) {
+      this.$router.push("/customerService/letterEditing?id=" + row.id);
     },
-    getFileNameWithUrl(url){
-      const chunks = url.split('/')
-      const fullFileName = chunks[chunks.length - 1]
-      const [ fileName, suffix ] = fullFileName.split('.')
-      return (fileName.length > 10 ? fileName[0] + fileName[1]  + '...' + fileName[fileName.length -1] : fileName) + '.' + suffix
+    getFileNameWithUrl(url) {
+      const chunks = url.split("/");
+      const fullFileName = chunks[chunks.length - 1];
+      const [fileName, suffix] = fullFileName.split(".");
+      return (
+        (fileName.length > 10
+          ? fileName[0] + fileName[1] + "..." + fileName[fileName.length - 1]
+          : fileName) +
+        "." +
+        suffix
+      );
     },
-    handleUploadModalVisible(){
-      if(this.type !== 'project' && (this.beforeModalVisible && !this.beforeModalVisible())){
-        return
+    handleUploadModalVisible() {
+      if (
+        this.type !== "project" &&
+        this.beforeModalVisible &&
+        !this.beforeModalVisible()
+      ) {
+        return;
       }
 
-      this.xlsxVisible = true
+      this.xlsxVisible = true;
     },
 
-    abnormal(){
-      this.$emit('abnormal')
+    abnormal() {
+      this.$emit("abnormal");
     },
-    async onPublish(row){
-      if(Number(row.is_check) === 1 && this.type !== 'settlement'){
-        this.$message.warning('当前预算函已经被选中,无法取消发布!')
-        return
+    async onPublish(row) {
+      if (Number(row.is_check) === 1 && this.type !== "settlement") {
+        this.$message.warning("当前预算函已经被选中,无法取消发布!");
+        return;
       }
 
-      const { status, id } = row
-      this.loading = true
+      const { status, id } = row;
+      this.loading = true;
+
+      const baseMsg = `${mapTitle[this.type]} ${row.planCode}`;
 
-      const baseMsg = `${mapTitle[this.type]} ${row.planCode}`
-      
-      const message = Number(status) === 1 
-      ? `确认发布${baseMsg}?`
-      : `确认将${baseMsg} 恢复为草稿`
+      const message =
+        Number(status) === 1
+          ? `确认发布${baseMsg}?`
+          : `确认将${baseMsg} 恢复为草稿`;
 
-      this.$confirm(message,{
-        type:'warning'
+      this.$confirm(message, {
+        type: "warning"
       }).then(async () => {
-        this.loading = true
+        this.loading = true;
         const { code } = await asyncRequest.status({
-          id:[id],
-          status:Number(status) === 1 ? 2 : 1
-        })
-        this.loading = false
+          id: [id],
+          status: Number(status) === 1 ? 2 : 1
+        });
+        this.loading = false;
 
-        if(code !== 1) return
+        if (code !== 1) return;
 
-        const message = Number(status) === 1 
-          ? `${baseMsg} 发布成功`
-          : `${baseMsg} 恢复草稿成功`
+        const message =
+          Number(status) === 1
+            ? `${baseMsg} 发布成功`
+            : `${baseMsg} 恢复草稿成功`;
 
-        
-        if(Number(status) === 1){
-          this.$emit('publish-ok')
+        if (Number(status) === 1) {
+          this.$emit("publish-ok");
         }
 
-      this.$message.success(message)
+        this.$message.success(message);
 
-        this.searchList()
-      })
+        this.searchList();
+      });
     },
 
-    async searchList(){
-      this.loading = true
-      const { code, data } = await asyncRequest.list({ 
-          plan_type :this.status, 
-          req_id: this.id ,
-          ...this.parmValue
-        })
-      this.loading = false
-      if(code !== 1) return
-      this.tableData = data.list
-      this.noPagination = Number(data.count) <= 15
-      this.pageInfo.total = Number(data.count)
+    async searchList() {
+      this.loading = true;
+      const { code, data } = await asyncRequest.list({
+        plan_type: this.status,
+        req_id: this.id,
+        ...this.parmValue
+      });
+      this.loading = false;
+      if (code !== 1) return;
+      this.tableData = data.list;
+      this.noPagination = Number(data.count) <= 15;
+      this.pageInfo.total = Number(data.count);
     }
   }
-}
+};
 </script>
 
 <style lang="scss" scoped>
-a{
-  color: #409EFF !important;
+a {
+  color: #409eff !important;
 }
 </style>

+ 140 - 110
src/components/manage/src/letter/selectionModal.vue

@@ -1,29 +1,33 @@
 <template>
-  <el-dialog title="选择活动方案" :close-on-click-modal="false" :visible="innerVisible" width="1024px" @close="handleClose" center>
+  <el-dialog
+    title="选择活动方案"
+    :close-on-click-modal="false"
+    :visible="innerVisible"
+    width="1024px"
+    @close="handleClose"
+    center
+  >
     <div class="flex-between" style="margin-top:-20px;margin-bottom:10px">
       <div class="flex-between">
         <p style="line-height:28px">
           <!-- 预计结算日期为活动结束后 :  -->
           活动结束后&nbsp;&nbsp;
         </p>
-        
+
         <digital-input
-            style="width:200px;margin-right:10px"
-            :values="settle_day"
-            :min="0"
-            :max="100000000000"
-            :position="'right'"
-            :precision="0"
-            :size="'mini'"
-            :controls="false"
-            :append="'天'"
-            @reschange="number_change($event)"
-          />
-        
+          style="width:200px;margin-right:10px"
+          :values="settle_day"
+          :min="0"
+          :max="100000000000"
+          :position="'right'"
+          :precision="0"
+          :size="'mini'"
+          :controls="false"
+          :append="'天'"
+          @reschange="number_change($event)"
+        />
 
-        <p style="line-height:28px">
-         内结算。
-        </p>
+        <p style="line-height:28px">内结算。</p>
       </div>
 
       <el-button type="primary" :size="'mini'" @click="onActivitySubmit">提交</el-button>
@@ -50,33 +54,36 @@
       :table="table"
       :data="tableData"
     >
-
       <template #letter="{scope}">
-        <a v-if="scope.row.plan_file" :href="scope.row.plan_file">{{getFileNameWithUrl(scope.row.plan_file)}}</a>
+        <a
+          v-if="scope.row.plan_file"
+          :href="scope.row.plan_file"
+        >{{getFileNameWithUrl(scope.row.plan_file)}}</a>
         <p v-else>--</p>
       </template>
-      
+
       <template #is_check="{scope}">
-        <el-tag size="mini" :type="Number(scope.row.is_check) === mapCheck[type || 'budget'].ok ? '' :'warning'">
-         {{ Number(scope.row.is_check) === mapCheck[type || 'budget'].ok  ?  "已选择" : "未选择" }}
-        </el-tag>
+        <el-tag
+          size="mini"
+          :type="Number(scope.row.is_check) === mapCheck[type || 'budget'].ok ? '' :'warning'"
+        >{{ Number(scope.row.is_check) === mapCheck[type || 'budget'].ok ? "已选择" : "未选择" }}</el-tag>
       </template>
 
       <template #supplier="{ scope }">
-           <el-popover placement="top" trigger="hover">
-              供应商编号:{{scope.row.supplierNo}}
-            <template #reference>
-              <i class="el-icon-warning-outline" />
-            </template>
-          </el-popover>
-          <span style="margin-right:5px">{{scope.row.supplierName}}</span>
+        <el-popover placement="top" trigger="hover">
+          供应商编号:{{scope.row.supplierNo}}
+          <template #reference>
+            <i class="el-icon-warning-outline" />
+          </template>
+        </el-popover>
+        <span style="margin-right:5px">{{scope.row.supplierName}}</span>
       </template>
 
-
       <template #status="{scope}">
-        <el-tag size="mini" :type="Number(scope.row.status) === 2 ? '' :'info'">
-          {{(statusOptions.find(({value}) => Number(scope.row.status) === value) || {}).label || '--'}}
-        </el-tag>
+        <el-tag
+          size="mini"
+          :type="Number(scope.row.status) === 2 ? '' :'info'"
+        >{{(statusOptions.find(({value}) => Number(scope.row.status) === value) || {}).label || '--'}}</el-tag>
       </template>
     </ex-table>
 
@@ -85,142 +92,165 @@
 </template>
 
 <script>
-import { mapColumns, mapCheck, mapTitle } from "./_columns"
-import asyncRequest from "@/apis/components/letter"
-import SettleDayModal from "./settleDayModel.vue"
+import { mapColumns, mapCheck, mapTitle } from "./_columns";
+import asyncRequest from "@/apis/components/letter";
+import SettleDayModal from "./settleDayModel.vue";
 
 export default {
-  props: ['visible', 'title', 'requsetMethod', 'isFile', 'type', 'id'],
-  components:{ SettleDayModal },
+  props: ["visible", "title", "requsetMethod", "isFile", "type", "id"],
+  components: { SettleDayModal },
   data() {
     return {
       table: {
         stripe: true,
         border: true,
-        'max-height': '800px'
+        "max-height": "800px"
       },
-      statusOptions:[
-        { value:1,label:'草稿'},
-        { value:2,label:'已发布'}
+      statusOptions: [
+        { value: 1, label: "草稿" },
+        { value: 2, label: "已发布" }
       ],
-      noPagination:false,
-      parmValue:{
+      noPagination: false,
+      parmValue: {
         page: 1, // 页码
-        size: 15, // 每页显示条数
+        size: 15 // 每页显示条数
       },
       selected: [],
       pageInfo: {
         size: 15,
         curr: 1,
-        total: 0,
+        total: 0
       },
       sitem: {},
       mapCheck,
       mapTitle,
       mapColumns,
-      tableData:[],
+      tableData: [],
       dayVisible: false,
       loading: false,
-      settle_day:0
-    }
+      settle_day: 0
+    };
   },
   computed: {
     innerVisible: {
       get() {
-        return this.visible
+        return this.visible;
       },
       set(newVal) {
-        this.$emit('update:visible', newVal)
+        this.$emit("update:visible", newVal);
       }
     }
   },
-  watch:{
-    visible(){
-      if(!this.visible) return
-      this.searchList()
+  watch: {
+    visible() {
+      if (!this.visible) return;
+      this.searchList();
     }
   },
   methods: {
-    handleClose(){
-      this.tableData = []
-      this.loading = false
-      this.file_url = ""
-      this.innerVisible = false
-      this.settle_day = 0
+    handleClose() {
+      this.tableData = [];
+      this.loading = false;
+      this.file_url = "";
+      this.innerVisible = false;
+      this.settle_day = 0;
     },
-    handleSelection({list}){
-      this.selected = list
+    handleSelection({ list }) {
+      this.selected = list;
     },
-    number_change(day){
-      this.settle_day = Number(day)
+    number_change(day) {
+      this.settle_day = Number(day);
     },
-    async handleChange(){
-      const { id } = this.selected[0]
-      const { code, data } = await asyncRequest.detail({id})
-      
-      if(code !== 1) {
-        this.loading = false
-        return
+    async handleChange() {
+      const { id } = this.selected[0];
+      const { code, data } = await asyncRequest.detail({ id });
+
+      if (code !== 1) {
+        this.loading = false;
+        return;
       }
 
       const { planinfo = [], req_id, store_id, plan_file } = data;
 
-      const plan_info =  planinfo.map(
-        ({ name,service_cat,unit,price,num,remark,total_fee,tax,pay_fee,tax_fee  }) =>
-        ({ name,service_cat,unit,price,num,remark,total_fee,tax,pay_fee,tax_fee  })
-      )
+      const plan_info = planinfo.map(
+        ({
+          name,
+          service_cat,
+          unit,
+          price,
+          num,
+          remark,
+          total_fee,
+          tax,
+          pay_fee,
+          tax_fee
+        }) => ({
+          name,
+          service_cat,
+          unit,
+          price,
+          num,
+          remark,
+          total_fee,
+          tax,
+          pay_fee,
+          tax_fee
+        })
+      );
 
       const letter = await asyncRequest.create({
         plan_type: 3,
-        file:plan_file,
-        settle_day:this.settle_day,
+        file: plan_file,
+        settle_day: this.settle_day,
         plan_info,
         store_id,
         req_id
-      })
+      });
 
-      this.loading = false
+      this.loading = false;
 
-      if(letter.code === 0){
-        this.$emit('abnormal')
+      if (letter.code === 0) {
+        this.$emit("abnormal");
       }
 
-      if(letter.code !== 1) return
+      if (letter.code !== 1) return;
+      this.innerVisible = false;
+      this.$emit("refresh");
       //创建获取获取新id进入编辑页...
-      this.$router.push(`/customerService/letterEditing?id=${letter.data.id}&from=${3}&type=create`)
+      // this.$router.push(`/customerService/letterEditing?id=${letter.data.id}&from=${3}&type=create`)
     },
-    async onActivitySubmit(){
-      if(this.selected.length === 0){
-        this.$message.warning('请选择一个活动方案')
-        return
+    async onActivitySubmit() {
+      if (this.selected.length === 0) {
+        this.$message.warning("请选择一个活动方案");
+        return;
       }
 
-      if(this.selected.length > 1){
-        this.$message.warning('只能选择一个活动方案')
-        return
+      if (this.selected.length > 1) {
+        this.$message.warning("只能选择一个活动方案");
+        return;
       }
 
-      if(Number(this.settle_day) === 0){
-        this.$message.warning('结算天数不能为零!')
-        return
+      if (Number(this.settle_day) === 0) {
+        this.$message.warning("结算天数不能为零!");
+        return;
       }
 
-      this.handleChange()
+      this.handleChange();
     },
-    async searchList(){
-      this.loading = true
-      const { code, data } = await asyncRequest.list({ 
-          plan_type: 2, 
-          req_id: this.id ,
-          is_check:1,
-          ...this.parmValue
-        })
-      this.loading = false
-      if(code !== 1) return
-      this.tableData = data.list
-      this.noPagination = Number(data.count) <= 15
-      this.pageInfo.total = Number(data.count)
+    async searchList() {
+      this.loading = true;
+      const { code, data } = await asyncRequest.list({
+        plan_type: 2,
+        req_id: this.id,
+        is_check: 1,
+        ...this.parmValue
+      });
+      this.loading = false;
+      if (code !== 1) return;
+      this.tableData = data.list;
+      this.noPagination = Number(data.count) <= 15;
+      this.pageInfo.total = Number(data.count);
     }
   }
-}
+};
 </script>

+ 44 - 2
src/components/manage/src/letter/xlsxUploadModal.vue

@@ -53,7 +53,13 @@
               <p style="margin-right:10px">
                 <span style="color:red">*</span>店铺:
               </p>
-              <search-store size="mini" :value.sync="storeId" :openOptionDisbaled="true" />
+
+              <search-store
+                size="mini"
+                :stores="stores"
+                :value.sync="storeId"
+                :openOptionDisbaled="true"
+              />
             </div>
 
             <div
@@ -125,7 +131,7 @@ import {
   getTableProperty,
   mapFields
 } from "./_template";
-import { add_sum, accMul } from "../../../../utils/validate";
+import { add_sum, accMul } from "@/utils/validate";
 
 export default {
   mixins: [companyHelper],
@@ -141,6 +147,7 @@ export default {
       isInit: true,
       settle_day: 0,
       mapTitle,
+      stores: null,
       table: {
         stripe: true,
         border: true,
@@ -148,6 +155,14 @@ export default {
       }
     };
   },
+  watch: {
+    visible: {
+      handler() {
+        if (!this.visible) return;
+        this.getStores();
+      }
+    }
+  },
   computed: {
     innerVisible: {
       get() {
@@ -172,6 +187,33 @@ export default {
       // 使用正则表达式进行匹配
       return pattern.test(input);
     },
+    async getStores() {
+      if (this.type !== "project") {
+        this.stores = null;
+        return;
+      }
+
+      const { code, data } = await asyncRequest.list({
+        plan_type: "1",
+        is_check: "1",
+        size: 1000,
+        req_id: this.id
+      });
+
+      if (code !== 1) return;
+      const map = {};
+      const newList = [];
+      data.list.forEach(({ store_id, store_name }) => {
+        if (!map[store_id]) {
+          newList.push({ id: store_id, store_name });
+          map[store_id] = 1;
+        }
+      });
+
+      this.stores = newList.filter(({ store_name }) => store_name);
+
+      console.log(this.stores);
+    },
     downloadTemplate() {
       const workBook = utils.book_new();
       const workSheet = utils.json_to_sheet(template);

+ 26 - 26
src/components/search/src/store.vue

@@ -1,8 +1,8 @@
 <template>
   <el-select
     v-model="_value"
-    :size="size" 
-    remote
+    :size="size"
+    :remote="!stores"
     :remote-method="onFetch"
     placeholder="请选择店铺"
     :loading="loading"
@@ -10,45 +10,45 @@
     filterable
     clearable
   >
-    <el-option 
-      :key="id" 
-      :value="id" 
-      :label="store_name" 
-      v-for="{ id, store_name, status } in list" 
+    <el-option
+      :key="id"
+      :value="id"
+      :label="store_name"
+      v-for="{ id, store_name, status } in stores ? stores :list"
       :disabled="openOptionDisbaled && Number(status) === 0"
     />
   </el-select>
 </template>
 <script>
-import asyncRequest from "@/apis/components/search"
+import asyncRequest from "@/apis/components/search";
 
 export default {
-  name:'SearchStore',
-  props:['size', 'value','openOptionDisbaled'],
-  data(){
+  name: "SearchStore",
+  props: ["size", "value", "openOptionDisbaled", "stores"],
+  data() {
     return {
       loading: false,
       list: []
-    }
+    };
   },
-  computed:{
-    _value:{
-      get(){
-        return this.value
+  computed: {
+    _value: {
+      get() {
+        return this.value;
       },
-      set(newVal){
-        const current = this.list.find(({id}) => id === newVal)
-        this.$emit('update:value', newVal)
-        this.$emit('change', current)
+      set(newVal) {
+        const current = this.list.find(({ id }) => id === newVal);
+        this.$emit("update:value", newVal);
+        this.$emit("change", current);
       }
     }
   },
-  methods:{
-    async onFetch(keyword){
-      const {code, data} = await asyncRequest.store({store_name: keyword})
-      if(code !== 1) return
-      this.list = data.list
+  methods: {
+    async onFetch(keyword) {
+      const { code, data } = await asyncRequest.store({ store_name: keyword });
+      if (code !== 1) return;
+      this.list = data.list;
     }
   }
-}
+};
 </script>

+ 212 - 210
src/views/customerService/invoiceApply/components/createInvoiceApply.vue

@@ -1,125 +1,125 @@
 <template>
-  <el-form ref="ruleForm" :rules="rules" :model="ruleForm" label-position="left" label-width="95px" size="mini" v-loading="loading">
-      <el-row>
-        <el-col :span="24">
-          <el-form-item label="需求订单" prop="req_id" v-if="!demandInfo">
-            <el-input 
-              placeholder="请选择需求订单" 
-              @focus="demandVisible = true" 
-            />
-          </el-form-item>
-        </el-col>
-      </el-row>
+  <el-form
+    ref="ruleForm"
+    :rules="rules"
+    :model="ruleForm"
+    label-position="left"
+    label-width="95px"
+    size="mini"
+    v-loading="loading"
+  >
+    <el-row>
+      <el-col :span="24">
+        <el-form-item label="需求订单" prop="req_id" v-if="!demandInfo">
+          <el-input placeholder="请选择需求订单" @focus="demandVisible = true" />
+        </el-form-item>
+      </el-col>
+    </el-row>
 
     <div style="display:flex;margin-bottom:10px" v-if="demandInfo">
       <demand-detail :id="demandInfo.id" />
       <el-tooltip placement="top" content="重新选择需求订单">
-        <i 
-          class="el-icon-circle-close" 
+        <i
+          class="el-icon-circle-close"
           style="font-size:18px;margin:0px 10px;cursor:pointer"
-          @click="handleDemandChange(null)" 
+          @click="handleDemandChange(null)"
         />
       </el-tooltip>
     </div>
 
-      <el-row gutter="20">
-        <el-col :span="12">
-          <el-form-item label="申请总金额"  prop="total_amount">
-            <digital-input
-              :values="ruleForm.total_amount"
-              :placeholder="'采购毛利率'"
-              :position="'right'"
-              :controls="false"
-              :precision="2"
-              :size="'mini'"
-              :append="'元'"
-              :min="0"
-              @reschange="number_change($event)"
-            />
-          </el-form-item>
-
-          <el-form-item label="发票类型" prop="invoice_type">
-            <el-select v-model="ruleForm.invoice_type" style="width:100%" placeholder="发票类型">
-              <el-option 
-                v-for="invoice in openInvoiceTypeList" 
-                :key="invoice.value" 
-                :value="invoice.value" 
-                :label="invoice.label"  
-              />
-            </el-select>
-          </el-form-item>
+    <el-row gutter="20">
+      <el-col :span="12">
+        <el-form-item label="申请总金额" prop="total_amount">
+          <digital-input
+            :values="ruleForm.total_amount"
+            :placeholder="'采购毛利率'"
+            :position="'right'"
+            :controls="false"
+            :precision="2"
+            :size="'mini'"
+            :append="'元'"
+            :min="0"
+            @reschange="number_change($event)"
+          />
+        </el-form-item>
 
+        <el-form-item label="发票类型" prop="invoice_type">
+          <el-select v-model="ruleForm.invoice_type" style="width:100%" placeholder="发票类型">
+            <el-option
+              v-for="invoice in openInvoiceTypeList"
+              :key="invoice.value"
+              :value="invoice.value"
+              :label="invoice.label"
+            />
+          </el-select>
+        </el-form-item>
 
-          <el-form-item label="备注" prop="remark">
-            <el-input placeholder="备注" v-model="ruleForm.remark" style="width:100%" type="textarea" />
-          </el-form-item>
-        </el-col>
+        <el-form-item label="备注" prop="remark">
+          <el-input placeholder="备注" v-model="ruleForm.remark" style="width:100%" type="textarea" />
+        </el-form-item>
+      </el-col>
 
-        <el-col :span="12">
-          <el-form-item 
-            label="发票抬头" 
-            prop="invoice_id"
-          >
-            <el-input 
-              v-if="!invoiceInfo"
-              placeholder="请选择发票抬头" 
-              @focus="titleVisible = true" 
-            />
+      <el-col :span="12">
+        <el-form-item label="发票抬头" prop="invoice_id">
+          <el-input
+            :disabled="!demandInfo || !demandInfo.companyNo"
+            v-if="!invoiceInfo"
+            placeholder="请选择发票抬头"
+            @focus="titleVisible = true"
+          />
 
-          <div style="display:flex;margin-bottom:10px"  v-if="invoiceInfo">
-            <show-data-table 
-            border
-            :sitem="invoiceInfo"
-            style="padding: -5px 0 10px 0"
-            :newTime="newTime"
-            :columns="invoiceColumns"
-          >
-            <template #tel>
-              {{invoiceInfo.address}}{{invoiceInfo.tel}}
-            </template>
+          <div style="display:flex;margin-bottom:10px" v-if="invoiceInfo">
+            <show-data-table
+              border
+              :sitem="invoiceInfo"
+              style="padding: -5px 0 10px 0"
+              :newTime="newTime"
+              :columns="invoiceColumns"
+            >
+              <template #tel>{{invoiceInfo.address}}{{invoiceInfo.tel}}</template>
 
-            <template #bank>
-              {{invoiceInfo.bank_name}}{{invoiceInfo.bank_account}}
-            </template>
-          </show-data-table>
+              <template #bank>{{invoiceInfo.bank_name}}{{invoiceInfo.bank_account}}</template>
+            </show-data-table>
 
-              <el-tooltip placement="top" content="重新选择发票抬头">
-                <i 
-                  class="el-icon-circle-close" 
-                  style="font-size:18px;margin:0px 10px;cursor:pointer"
-                  @click="handleTitleChange(null)" 
-                />
-              </el-tooltip>
+            <el-tooltip placement="top" content="重新选择发票抬头">
+              <i
+                class="el-icon-circle-close"
+                style="font-size:18px;margin:0px 10px;cursor:pointer"
+                @click="handleTitleChange(null)"
+              />
+            </el-tooltip>
           </div>
-          </el-form-item>
-        </el-col>
-      </el-row>
+        </el-form-item>
+      </el-col>
+    </el-row>
 
     <div style="display:flex;justify-content:flex-end;margin-bottom:10px">
       <el-button size="mini" type="primary" @click="onSubmit">保存</el-button>
     </div>
 
-    <demand-modal 
-      :visible.sync="demandVisible" 
-      @change="handleDemandChange" 
-    />
+    <demand-modal :visible.sync="demandVisible" @change="handleDemandChange" />
 
-    <title-modal 
+    <title-modal
       :visible.sync="titleVisible"
+      :companyNo="demandInfo ? demandInfo.companyNo : ''"
       @change="handleTitleChange"
     />
   </el-form>
 </template>
 
 <script>
-import DemandModal from "./demandModal.vue"
-import TitleModal from "./titleModal.vue"
-import { demandDetailColumns } from "./_columns"
+import DemandModal from "./demandModal.vue";
+import TitleModal from "./titleModal.vue";
+import { demandDetailColumns } from "./_columns";
 import demandRequest from "@/apis/service/customerService/demandOrder";
-import { demandStatusOptions, invoiceTypeList, openInvoiceTypeList } from '@/assets/js/statusList'
+import {
+  demandStatusOptions,
+  invoiceTypeList,
+  openInvoiceTypeList
+} from "@/assets/js/statusList";
 import asyncRequest from "@/apis/service/customerService/invoiceApply";
 
-  /** 
+/** 
   * @props
   * req_id 需求订单
     invoice_id /发票抬头
@@ -129,140 +129,142 @@ import asyncRequest from "@/apis/service/customerService/invoiceApply";
   */
 
 export default {
-  name:'CreateInvoiceNode',
-  props:['isApply'],  //isApply 是否为创建开票申请
-  components:{ DemandModal, TitleModal },
-  data(){
-      return {
-        loading: false,
-        demandStatusOptions,
-        openInvoiceTypeList,
-        invoiceTypeList,
-        demandInfo : null,
-        invoiceInfo: null,
-        demandDetailColumns,
-        demandVisible:false,
-        titleVisible:false,
-          invoiceColumns:[
-            {
-              prop: 'title',
-              label: '抬头',
-              span: 24
-            },
-            {
-              prop: 'tax_no',
-              label: '纳税人识别号',
-              span: 24
-            },
-            {
-              prop: 'tel',
-              label: '地址、电话',
-              span: 24,
-              _slot_: 'tel'
-            },
-            {
-              prop: 'bank_account',
-              label: '开户行及账号',
-              span: 24,
-              _slot_:'bank'
-            }
-          ],
-          newTime:"",
-          demandVisible: false,
-          ruleForm:{
-            req_id:"",
-            invoice_id:"", //发票抬头
-            invoice_type:"", //发票类型
-            total_amount:"", //申请总金额
-            remark:"", // 备注
-          },
-          rules:{
-            invoice_id:[
-              {
-                required:true,
-                trigger:'change',
-                message:'请输入发票抬头'
-              }
-            ],
-            req_id:[
-               {
-                required:true,
-                trigger:'change',
-                message:'请选择需求订单'
-              }
-            ],
-            invoice_type:[
-              {
-                required:true,
-                trigger:'change',
-                message:'请选择发票类型'
-              }
-            ],
-            total_amount:[
-              {
-                required:true,
-                trigger:'change',
-                message:'请输入申请总金额'
-              }
-            ],
-            remark:[
-              {
-                required:true,
-                trigger:'change',
-                message:'请输入发票备注'
-              }
-            ]
+  name: "CreateInvoiceNode",
+  props: ["isApply"], //isApply 是否为创建开票申请
+  components: { DemandModal, TitleModal },
+  data() {
+    return {
+      loading: false,
+      demandStatusOptions,
+      openInvoiceTypeList,
+      invoiceTypeList,
+      demandInfo: null,
+      invoiceInfo: null,
+      demandDetailColumns,
+      demandVisible: false,
+      titleVisible: false,
+      invoiceColumns: [
+        {
+          prop: "title",
+          label: "抬头",
+          span: 24
+        },
+        {
+          prop: "tax_no",
+          label: "纳税人识别号",
+          span: 24
+        },
+        {
+          prop: "tel",
+          label: "地址、电话",
+          span: 24,
+          _slot_: "tel"
+        },
+        {
+          prop: "bank_account",
+          label: "开户行及账号",
+          span: 24,
+          _slot_: "bank"
+        }
+      ],
+      newTime: "",
+      demandVisible: false,
+      ruleForm: {
+        req_id: "",
+        invoice_id: "", //发票抬头
+        invoice_type: "", //发票类型
+        total_amount: "", //申请总金额
+        remark: "" // 备注
+      },
+      rules: {
+        invoice_id: [
+          {
+            required: true,
+            trigger: "change",
+            message: "请输入发票抬头"
+          }
+        ],
+        req_id: [
+          {
+            required: true,
+            trigger: "change",
+            message: "请选择需求订单"
+          }
+        ],
+        invoice_type: [
+          {
+            required: true,
+            trigger: "change",
+            message: "请选择发票类型"
+          }
+        ],
+        total_amount: [
+          {
+            required: true,
+            trigger: "change",
+            message: "请输入申请总金额"
           }
+        ],
+        remark: [
+          {
+            required: true,
+            trigger: "change",
+            message: "请输入发票备注"
+          }
+        ]
       }
+    };
   },
-  methods:{
-    async onSubmit(){
+  methods: {
+    async onSubmit() {
       try {
-        await this.$refs.ruleForm.validate()
-        const applyAmount = this.ruleForm.total_amount
-        const winvAmount = this.demandInfo.winv_fee
-        
-        if(Number(applyAmount) > Number(winvAmount)){
-          this.$message.warning('申请总金额不能超过未开票金额')
-          return
+        await this.$refs.ruleForm.validate();
+        const applyAmount = this.ruleForm.total_amount;
+        const winvAmount = this.demandInfo.winv_fee;
+
+        if (Number(applyAmount) > Number(winvAmount)) {
+          this.$message.warning("申请总金额不能超过未开票金额");
+          return;
         }
 
-        this.loading = true
-        const { code } = await asyncRequest.create(this.ruleForm)
-        this.loading = false
-        if(code !== 1) return
-        this.$router.push("/customerService/invoiceApply")
-        }catch(err){
-        console.log(err)
+        this.loading = true;
+        const { code } = await asyncRequest.create(this.ruleForm);
+        this.loading = false;
+        if (code !== 1) return;
+        this.$router.push("/customerService/invoiceApply");
+      } catch (err) {
+        console.log(err);
       }
     },
     number_change(e) {
-      this.ruleForm.total_amount = e || 0
+      this.ruleForm.total_amount = e || 0;
     },
-    async handleTitleChange(invoiceInfo){
-      if(!invoiceInfo){
-        this.invoiceInfo = null
-        this.ruleForm.invoice_id = ""
-        return
+    async handleTitleChange(invoiceInfo) {
+      if (!invoiceInfo) {
+        this.invoiceInfo = null;
+        this.ruleForm.invoice_id = "";
+        return;
       }
 
-      this.invoiceInfo = invoiceInfo
-      this.ruleForm.invoice_id = invoiceInfo.id
+      this.invoiceInfo = invoiceInfo;
+      this.ruleForm.invoice_id = invoiceInfo.id;
     },
-    async handleDemandChange(demandInfo){
-      if(!demandInfo){
-        this.demandInfo = null
-        this.ruleForm.req_id = ""
-        return
+    async handleDemandChange(demandInfo) {
+      if (!demandInfo) {
+        this.demandInfo = null;
+        this.invoiceInfo = null;
+        this.ruleForm.invoice_id = "";
+        this.ruleForm.req_id = "";
+        return;
       }
-      
-      this.demandLoading = true
-      const { data, code } = await demandRequest.detail({ id: demandInfo.id })
-      this.demandLoading = false
-      if(code !== 1) return
-      this.demandInfo = data
-      this.ruleForm.req_id = data.id
-    } 
+
+      this.demandLoading = true;
+      const { data, code } = await demandRequest.detail({ id: demandInfo.id });
+      this.demandLoading = false;
+      if (code !== 1) return;
+      this.demandInfo = data;
+      this.ruleForm.req_id = data.id;
+    }
   }
-}
+};
 </script>

+ 74 - 80
src/views/customerService/invoiceApply/components/titleModal.vue

@@ -1,12 +1,12 @@
 <template>
-  <el-dialog 
+  <el-dialog
     :close-on-click-modal="false"
-    :visible="visible" 
-    title="选择发票抬头" 
-    width="1024px" 
-    top="60px" 
+    :visible="visible"
+    title="选择发票抬头"
+    width="1024px"
+    top="60px"
     center
-    @close="handleClose" 
+    @close="handleClose"
   >
     <div class="demand-order" style="margin-top:-20px">
       <ex-table
@@ -67,14 +67,10 @@
               </el-col>
 
               <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
-                <el-button type="primary" :size="searchSize" @click="searchList">
-                  刷新
-                </el-button>
+                <el-button type="primary" :size="searchSize" @click="searchList">刷新</el-button>
               </el-col>
               <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
-                <el-button type="warning" :size="searchSize" @click="restSearch">
-                  重置
-                </el-button>
+                <el-button type="warning" :size="searchSize" @click="restSearch">重置</el-button>
               </el-col>
             </el-row>
             <el-row>
@@ -121,10 +117,11 @@
             :key="ditem + dindex"
           >
             <span v-for="(cItem, cindex) in ditem" :key="cItem + dindex + cindex">
-              <span v-show="cindex > 0">/</span><span>{{ cItem }}</span>
+              <span v-show="cindex > 0">/</span>
+              <span>{{ cItem }}</span>
             </span>
-            {{ ditem.name }}</el-tag
-          >
+            {{ ditem.name }}
+          </el-tag>
         </template>
         <template #status="{ scope }">
           <el-tag
@@ -139,41 +136,37 @@
       </ex-table>
     </div>
 
-       <div class="flex-end">
-        <el-button 
-          size="mini" 
-          type="primary" 
-          @click="onConfirmDemand"
-        >
-          保存
-        </el-button>
-      </div>
+    <div class="flex-end">
+      <el-button size="mini" type="primary" @click="onConfirmDemand">保存</el-button>
+    </div>
   </el-dialog>
 </template>
 
 <script>
-import pageInfo from "@/mixins/elPaginationHandle"
+import pageInfo from "@/mixins/elPaginationHandle";
 import asyncRequest from "@/apis/service/customerService/demandOrder";
-import { mapGetters } from "vuex"
+import { mapGetters } from "vuex";
 
 export default {
   name: "invoicing",
-  props:['visible'],
+  props: ["visible", "companyNo"],
   mixins: [pageInfo],
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
       const tran =
-        this.$store.getters.btnList.find((item) => item.menu_route == "invoicing") || {};
+        this.$store.getters.btnList.find(
+          item => item.menu_route == "invoicing"
+        ) || {};
       const { action } = tran ?? {};
       return action ?? [];
     },
-     _visible:{
-      get(){
-        return this.visible
+    _visible: {
+      get() {
+        return this.visible;
       },
-      set(value){
-        this.$emit('update:visible', value)
+      set(value) {
+        this.$emit("update:visible", value);
       }
     }
   },
@@ -181,11 +174,11 @@ export default {
     return {
       select: "title",
       sinput: "",
-      statusList:[
-        {code:0, name:'禁用'},
-        {code:1, name:'启用'},
+      statusList: [
+        { code: 0, name: "禁用" },
+        { code: 1, name: "启用" }
       ],
-       selected:[],
+      selected: [],
       sitem: null,
       loading: true,
       showModel: false,
@@ -197,7 +190,7 @@ export default {
         status: "", //
         company_name: "", //创建人部门
         page: 1, // 页码
-        size: 15, // 每页显示条数
+        size: 15 // 每页显示条数
       },
       tableData: [],
       passwordModel: false,
@@ -209,79 +202,79 @@ export default {
       table: {
         stripe: true,
         border: true,
-        _defaultHeader_: ["setcol"],
+        _defaultHeader_: ["setcol"]
       },
       // 表格 - 分页
       pageInfo: {
         size: 15,
         curr: 1,
-        total: 0,
+        total: 0
       },
       // 表格 - 列参数
       columns: [
         {
-          type:'selection',
-          fixed:'left'
+          type: "selection",
+          fixed: "left"
         },
         // {
         //   prop: "title_type",
         //   label: "抬头类型",
         // },
-      {
-          prop:'companyName',
-          label:'客户公司名称',
-          width: "155px",
+        {
+          prop: "companyName",
+          label: "客户公司名称",
+          width: "155px"
         },
         {
           prop: "tax_no",
           label: "统一社会信用代码",
-          width: "155px",
+          width: "155px"
         },
         {
           prop: "title",
           label: "发票抬头",
-          "min-width": "150px",
+          "min-width": "150px"
         },
 
         {
           prop: "tel",
           label: "联系电话",
-          "min-width": "110px",
+          "min-width": "110px"
         },
         {
           prop: "status",
           label: "状态",
           _slot_: "status",
-          width: "70px",
+          width: "70px"
         },
         {
           prop: "create_time",
           label: "创建时间",
-          width: "140px",
-        },
-      ],
+          width: "140px"
+        }
+      ]
     };
   },
-  watch:{
-    visible(value){
-      if(!value) return
-      this.searchList()
+  watch: {
+    visible(value) {
+      if (!value) return;
+      this.searchList();
     }
   },
   methods: {
-    handleClose(){
+    handleClose() {
       this.pageInfo = {
         curr: 1,
         size: 10,
         total: 0
-      }
+      };
 
       this.parmValue = {
         reqCode: "",
         page: 1
-      }
+      };
 
-      this._visible = false
+      this._visible = false;
     },
     // 时间
     async handleTime(e) {
@@ -305,13 +298,13 @@ export default {
         status: "", //
         company_name: "", //创建人部门
         page: 1, // 页码
-        size: 15, // 每页显示条数
+        size: 15 // 每页显示条数
       };
       // 表格 - 分页
       this.pageInfo = {
         size: 15,
         curr: 1,
-        total: 0,
+        total: 0
       };
       this.searchList();
     },
@@ -331,24 +324,24 @@ export default {
       this.passwordModelId = id;
       this.isPasswordDetail = isDetail;
     },
-      onConfirmDemand(){
-      if(this.selected.length === 0){
-        this.$message.warning('请选择一个发票抬头!')
-        return
+    onConfirmDemand() {
+      if (this.selected.length === 0) {
+        this.$message.warning("请选择一个发票抬头!");
+        return;
       }
 
-      if(this.selected.length > 1){
-        this.$message.warning('只能选择一个发票抬头!')
-        return
+      if (this.selected.length > 1) {
+        this.$message.warning("只能选择一个发票抬头!");
+        return;
       }
 
-      if(Number(this.selected[0].status) === 0){
-        this.$message.warning('请选择状态为启用的发票抬头')
-        return
+      if (Number(this.selected[0].status) === 0) {
+        this.$message.warning("请选择状态为启用的发票抬头");
+        return;
       }
 
-      this.$emit('change', this.selected[0])
-      this._visible = false
+      this.$emit("change", this.selected[0]);
+      this._visible = false;
     },
     async searchList() {
       if (
@@ -365,11 +358,12 @@ export default {
       this.parmValue[this.select] = this.sinput;
       const model = {
         ...this.parmValue,
-        limit: this.parmValue.size,
+        code: this.companyNo,
+        limit: this.parmValue.size
       };
       const { code, data } = await asyncRequest.titleList({
         ...model,
-        title_type: '客户抬头'
+        title_type: "客户抬头"
       });
       if (code === 1) {
         const { list, total } = data;
@@ -381,12 +375,12 @@ export default {
       }
       this.loading = false;
     }
-  },
+  }
 };
 </script>
 <style lang="scss" scoped>
-.demand-order{
-  /deep/ .el-pagination{
+.demand-order {
+  /deep/ .el-pagination {
     float: left !important;
   }
 }

+ 65 - 63
src/views/operate/supplier/index.vue

@@ -33,7 +33,7 @@
                 :end="parmValue.end"
                 @timeReturned="handleTime"
               />
-            </el-col> -->
+            </el-col>-->
             <el-col :span="4" style="width: 160px">
               <el-select
                 v-model="parmValue.status"
@@ -92,14 +92,11 @@
                 type="success"
                 style="float: right"
                 @click="routeGoto('supplierDetail', { id: 'add', type: 'add' })"
-              >
-                添加
-              </el-button>
+              >添加</el-button>
             </el-col>
           </el-row>
-      
-        </div></template
-      >
+        </div>
+      </template>
 
       <template #status="{ scope }">
         <el-tag
@@ -115,11 +112,13 @@
       </template>
 
       <template #supplier_type="{ scope }">
-        <el-tag size="mini">{{
+        <el-tag size="mini">
+          {{
           natureOfSupplierList.find(
-            (item) => item.value === String(scope.row.supplier_type)
+          (item) => item.value === String(scope.row.supplier_type)
           ).label
-        }}</el-tag>
+          }}
+        </el-tag>
       </template>
 
       <template #ocr_status="{ scope }">
@@ -155,12 +154,9 @@
 
       <template #operation="{ scope }">
         <el-tooltip effect="dark" content="详情" placement="top">
-          <i
-            class="el-icon-view tb-icon"
-            @click="getRouter('supplierDetail', scope.row.id)"
-          ></i>
+          <i class="el-icon-view tb-icon" @click="getRouter('supplierDetail', scope.row.id)"></i>
         </el-tooltip>
-        <!-- <el-tooltip
+        <el-tooltip
           v-if="powers.some((i) => i == '004') && scope.row.status + '' === '1'"
           effect="dark"
           content="禁用"
@@ -182,7 +178,7 @@
             class="el-icon-video-play tb-icon"
             @click="changeStatus(scope.row.id, scope.row.status)"
           ></i>
-        </el-tooltip> -->
+        </el-tooltip>
         <el-tooltip
           v-if="powers.some((i) => i == '005')"
           effect="dark"
@@ -197,13 +193,10 @@
             class="el-icon-office-building tb-icon"
             @click="onOpenModal('industry', scope.row)"
           ></i>
-        </el-tooltip> -->
+        </el-tooltip>-->
 
         <el-tooltip effect="dark" content="对公收款设置" placement="top">
-          <i
-            class="el-icon-school tb-icon"
-            @click="onOpenModal('toPublic', scope.row)"
-          ></i>
+          <i class="el-icon-school tb-icon" @click="onOpenModal('toPublic', scope.row)"></i>
         </el-tooltip>
 
         <el-tooltip effect="dark" content="设置服务毛利" placement="top">
@@ -216,7 +209,7 @@
           placement="top"
         >
           <i class="el-icon-delete tb-icon" @click="deleteItem(scope.row.id)"></i>
-        </el-tooltip> -->
+        </el-tooltip>-->
       </template>
     </ex-table>
 
@@ -229,11 +222,15 @@
         searchList();
       "
     />
-    <to-public-modal :visible.sync="modalVisible.toPublic" :row="currentRow"  @refresh="
+    <to-public-modal
+      :visible.sync="modalVisible.toPublic"
+      :row="currentRow"
+      @refresh="
         pageInfo.curr = 1;
         parmValue.page = 1;
         searchList();
-      "/>
+      "
+    />
     <supplier-level-modal :visible.sync="modalVisible.level" />
   </div>
 </template>
@@ -270,10 +267,12 @@ export default {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
       const tran =
-        this.$store.getters.btnList.find((item) => item.menu_route == "supplier") || {};
+        this.$store.getters.btnList.find(
+          item => item.menu_route == "supplier"
+        ) || {};
       const { action } = tran ?? {};
       return action ?? [];
-    },
+    }
   },
   data() {
     return {
@@ -288,18 +287,18 @@ export default {
       stype: {},
       is_upgrade_options: [
         { id: "1", label: "已升级" },
-        { id: "0", label: "未升级" },
+        { id: "0", label: "未升级" }
       ],
       selected: [],
       modalVisible: {
         industry: false,
         toPublic: false,
         service: false,
-        level: false,
+        level: false
       },
       natureOfSupplierList: [
         { value: "1", label: "公务公司" },
-        { value: "2", label: "服务商" },
+        { value: "2", label: "服务商" }
       ],
       parmValue: {
         page: 1, // 页码
@@ -309,65 +308,65 @@ export default {
         status: "", // 状态
         name: "", // 供应商名称
         creator: "", // 创建人
-        level: "", // 供应商等级
+        level: "" // 供应商等级
       },
       ocr_status: [
         { id: "0", label: "未上传" },
         { id: "1", label: "识别成功" },
-        { id: "2", label: "识别失败" },
+        { id: "2", label: "识别失败" }
       ],
       // 表格 - 数据
       tableData: [],
       // 表格 - 参数
       table: {
         stripe: true,
-        border: true,
+        border: true
         // _defaultHeader_: ["setcol"],
       },
       // 表格 - 分页
       pageInfo: {
         size: 15,
         curr: 1,
-        total: 0,
+        total: 0
       },
       // 表格 - 列参数
       columns: [
         {
           type: "selection",
-          width: "40px",
+          width: "40px"
         },
         {
           prop: "code",
           label: "供应商编号",
-          width: "160",
+          width: "160"
         },
         {
           prop: "name",
           label: "供应商名称",
-          minWidth: "200",
+          minWidth: "200"
         },
         {
           prop: "supplier_type",
           label: "供应商类型",
           minWidth: "200",
-          _slot_: "supplier_type",
+          _slot_: "supplier_type"
         },
         {
           prop: "status",
           label: "状态",
           minWidth: "200",
-          _slot_: "status",
+          _slot_: "status"
         },
         {
           prop: "ocr_status",
           label: "营业执照识别状态",
           _slot_: "ocr_status",
-          minWidth: "200",
+          minWidth: "200"
         },
         {
           prop: "legaler",
           label: "联系人",
-          minWidth: "80",
+          minWidth: "80"
         },
         // {
         //   prop: "creater",
@@ -377,17 +376,17 @@ export default {
         {
           prop: "addtime",
           label: "创建时间",
-          width: "145",
+          width: "145"
         },
         {
           prop: "",
           label: "操作",
           fixed: "right",
-          width: "150",
+          width: "180",
           _noset_: true,
-          _slot_: "operation",
-        },
-      ],
+          _slot_: "operation"
+        }
+      ]
     };
   },
   mounted() {
@@ -399,7 +398,7 @@ export default {
       this.pageInfo = {
         size: size,
         curr: page,
-        total: 0,
+        total: 0
       };
       //多选条件
     }
@@ -414,13 +413,13 @@ export default {
       if (toRouter && queryId) {
         let model = {
           id: queryId,
-          type: "view",
+          type: "view"
         };
 
         //有多选框的条件
         let routerModel = {
           options: JSON.parse(JSON.stringify(this.parmValue)),
-          router: this.$route.path,
+          router: this.$route.path
         };
         model.preModel = JSON.stringify(routerModel);
 
@@ -434,7 +433,7 @@ export default {
       this.pageInfo = {
         size: 15,
         curr: 1,
-        total: 0,
+        total: 0
       };
       this.parmValue = {
         page: 1, // 页码
@@ -444,7 +443,7 @@ export default {
         status: "", // 状态
         name: "", // 供应商名称
         creator: "", // 创建人
-        level: "", // 供应商等级
+        level: "" // 供应商等级
       };
       this.searchList();
     },
@@ -478,7 +477,7 @@ export default {
       // }
       this.routeGoto("supplierDetail", {
         id: row.id,
-        type: "edit",
+        type: "edit"
       });
     },
     /**
@@ -487,23 +486,26 @@ export default {
      * @param {String} status 0-禁用 1-启用
      */
     async changeStatus(id, status) {
-      await this.$confirm(`确定要改为${status + "" === "1" ? "禁用" : "启用"}?`, {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
+      await this.$confirm(
+        `确定要改为${status + "" === "1" ? "禁用" : "启用"}?`,
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }
+      )
         .then(async () => {
           this.loading = true;
           const model = {
             id: id,
-            status: status + "" === "1" ? "0" : "1",
+            status: status + "" === "1" ? "0" : "1"
           };
           const res = await asyncRequest.status(model);
           this.loading = false;
           if (res && res.code === 1) {
             this.$notify.success({
               title: "状态修改成功!",
-              message: "",
+              message: ""
             });
             await this.searchList();
           }
@@ -516,17 +518,17 @@ export default {
       await this.$confirm("确定要删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
         .then(async () => {
           const model = {
-            id: id,
+            id: id
           };
           const res = await asyncRequest.delete(model);
           if (res && res.code === 1) {
             this.$notify.success({
               title: "删除成功",
-              message: "",
+              message: ""
             });
             this.searchList();
           }
@@ -565,8 +567,8 @@ export default {
         this.pageInfo.total = 0;
       }
       this.loading = false;
-    },
-  },
+    }
+  }
 };
 </script>
 

+ 70 - 76
src/views/platformService/settlement/components/titleModal.vue

@@ -1,12 +1,12 @@
 <template>
-  <el-dialog 
+  <el-dialog
     :close-on-click-modal="false"
-    :visible="visible" 
-    title="选择发票抬头" 
-    width="1024px" 
-    top="60px" 
+    :visible="visible"
+    title="选择发票抬头"
+    width="1024px"
+    top="60px"
     center
-    @close="handleClose" 
+    @close="handleClose"
   >
     <div class="demand-order">
       <ex-table
@@ -67,18 +67,10 @@
               </el-col>
 
               <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
-                <el-button 
-                  type="primary" 
-                  :size="searchSize" 
-                  @click="searchList"
-                >
-                  刷新
-                </el-button>
+                <el-button type="primary" :size="searchSize" @click="searchList">刷新</el-button>
               </el-col>
               <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
-                <el-button type="warning" :size="'mini'" @click="restSearch">
-                  重置
-                </el-button>
+                <el-button type="warning" :size="'mini'" @click="restSearch">重置</el-button>
               </el-col>
             </el-row>
             <el-row>
@@ -125,10 +117,11 @@
             :key="ditem + dindex"
           >
             <span v-for="(cItem, cindex) in ditem" :key="cItem + dindex + cindex">
-              <span v-show="cindex > 0">/</span><span>{{ cItem }}</span>
+              <span v-show="cindex > 0">/</span>
+              <span>{{ cItem }}</span>
             </span>
-            {{ ditem.name }}</el-tag
-          >
+            {{ ditem.name }}
+          </el-tag>
         </template>
         <template #status="{ scope }">
           <el-tag
@@ -143,37 +136,37 @@
       </ex-table>
     </div>
 
-       <div class="flex-end">
-        <el-button size="mini" type="primary"  @click="onConfirmDemand">
-          保存
-        </el-button>
-      </div>
+    <div class="flex-end">
+      <el-button size="mini" type="primary" @click="onConfirmDemand">保存</el-button>
+    </div>
   </el-dialog>
 </template>
 
 <script>
-import pageInfo from "@/mixins/elPaginationHandle"
+import pageInfo from "@/mixins/elPaginationHandle";
 import asyncRequest from "@/apis/service/customerService/demandOrder";
-import { mapGetters } from "vuex"
+import { mapGetters } from "vuex";
 
 export default {
   name: "invoicing",
-  props:['visible'],
+  props: ["visible", "code"],
   mixins: [pageInfo],
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
       const tran =
-        this.$store.getters.btnList.find((item) => item.menu_route == "invoicing") || {};
+        this.$store.getters.btnList.find(
+          item => item.menu_route == "invoicing"
+        ) || {};
       const { action } = tran ?? {};
       return action ?? [];
     },
-     _visible:{
-      get(){
-        return this.visible
+    _visible: {
+      get() {
+        return this.visible;
       },
-      set(value){
-        this.$emit('update:visible', value)
+      set(value) {
+        this.$emit("update:visible", value);
       }
     }
   },
@@ -181,11 +174,11 @@ export default {
     return {
       select: "title",
       sinput: "",
-      statusList:[
-        {code:0, name:'禁用'},
-        {code:1, name:'启用'},
+      statusList: [
+        { code: 0, name: "禁用" },
+        { code: 1, name: "启用" }
       ],
-       selected:[],
+      selected: [],
       sitem: null,
       loading: true,
       showModel: false,
@@ -197,7 +190,7 @@ export default {
         status: "", //
         company_name: "", //创建人部门
         page: 1, // 页码
-        size: 15, // 每页显示条数
+        size: 15 // 每页显示条数
       },
       tableData: [],
       passwordModel: false,
@@ -209,79 +202,79 @@ export default {
       table: {
         stripe: true,
         border: true,
-        _defaultHeader_: ["setcol"],
+        _defaultHeader_: ["setcol"]
       },
       // 表格 - 分页
       pageInfo: {
         size: 15,
         curr: 1,
-        total: 0,
+        total: 0
       },
       // 表格 - 列参数
       columns: [
         {
-          type:'selection',
-          fixed:'left'
+          type: "selection",
+          fixed: "left"
         },
         // {
         //   prop: "title_type",
         //   label: "抬头类型",
         // },
         {
-          prop:'companyName',
-          label:'供应商名称',
-          width: "155px",
+          prop: "companyName",
+          label: "供应商名称",
+          width: "155px"
         },
         {
           prop: "tax_no",
           label: "统一社会信用代码",
-          width: "155px",
+          width: "155px"
         },
         {
           prop: "title",
           label: "发票抬头",
-          "min-width": "150px",
+          "min-width": "150px"
         },
 
         {
           prop: "tel",
           label: "联系电话",
-          "min-width": "110px",
+          "min-width": "110px"
         },
         {
           prop: "status",
           label: "状态",
           _slot_: "status",
-          width: "70px",
+          width: "70px"
         },
         {
           prop: "create_time",
           label: "创建时间",
-          width: "140px",
-        },
-      ],
+          width: "140px"
+        }
+      ]
     };
   },
-  watch:{
-    visible(value){
-      if(!value) return
-      this.searchList()
+  watch: {
+    visible(value) {
+      if (!value) return;
+      this.searchList();
     }
   },
   methods: {
-    handleClose(){
+    handleClose() {
       this.pageInfo = {
         curr: 1,
         size: 10,
         total: 0
-      }
+      };
 
       this.parmValue = {
         reqCode: "",
         page: 1
-      }
+      };
 
-      this._visible = false
+      this._visible = false;
     },
     // 时间
     async handleTime(e) {
@@ -305,13 +298,13 @@ export default {
         status: "", //
         company_name: "", //创建人部门
         page: 1, // 页码
-        size: 15, // 每页显示条数
+        size: 15 // 每页显示条数
       };
       // 表格 - 分页
       this.pageInfo = {
         size: 15,
         curr: 1,
-        total: 0,
+        total: 0
       };
       this.searchList();
     },
@@ -331,19 +324,19 @@ export default {
       this.passwordModelId = id;
       this.isPasswordDetail = isDetail;
     },
-      onConfirmDemand(){
-      if(this.selected.length === 0){
-        this.$message.warning('请选择一个发票抬头!')
-        return
+    onConfirmDemand() {
+      if (this.selected.length === 0) {
+        this.$message.warning("请选择一个发票抬头!");
+        return;
       }
 
-      if(this.selected.length > 1){
-        this.$message.warning('只能选择一个发票抬头!')
-        return
+      if (this.selected.length > 1) {
+        this.$message.warning("只能选择一个发票抬头!");
+        return;
       }
 
-      this.$emit('change', this.selected[0])
-      this._visible = false
+      this.$emit("change", this.selected[0]);
+      this._visible = false;
     },
     async searchList() {
       if (
@@ -360,11 +353,12 @@ export default {
       this.parmValue[this.select] = this.sinput;
       const model = {
         ...this.parmValue,
-        limit: this.parmValue.size,
+        limit: this.parmValue.size
       };
       const { code, data } = await asyncRequest.titleList({
         ...model,
-        title_type: '供应商抬头'
+        code: this.code,
+        title_type: "供应商抬头"
       });
       if (code === 1) {
         const { list, total } = data;
@@ -376,12 +370,12 @@ export default {
       }
       this.loading = false;
     }
-  },
+  }
 };
 </script>
 <style lang="scss" scoped>
-.demand-order{
-  /deep/ .el-pagination{
+.demand-order {
+  /deep/ .el-pagination {
     float: left !important;
   }
 }

+ 140 - 150
src/views/platformService/settlement/components/waitSupplierUpload.vue

@@ -1,70 +1,60 @@
 <template>
-  <el-form ref="ruleForm" :rules="rules" :model="ruleForm" label-position="left" label-width="95px" size="mini" v-loading="loading">
-      <el-row gutter="20">
-        <el-col :span="12">
-          <el-form-item label="发票类型" prop="invoice_type">
-            <el-select 
-              v-model="ruleForm.invoice_type" 
-              placeholder="发票类型"
-              style="width:100%" 
-            >
-              <el-option 
-                v-for="{ value, label } in openInvoiceTypeList" 
-                :value="value" 
-                :label="label"  
-                :key="value" 
-              />
-            </el-select>
-          </el-form-item>
+  <el-form
+    ref="ruleForm"
+    :rules="rules"
+    :model="ruleForm"
+    label-position="left"
+    label-width="95px"
+    size="mini"
+    v-loading="loading"
+  >
+    <el-row gutter="20">
+      <el-col :span="12">
+        <el-form-item label="发票类型" prop="invoice_type">
+          <el-select v-model="ruleForm.invoice_type" placeholder="发票类型" style="width:100%">
+            <el-option
+              v-for="{ value, label } in openInvoiceTypeList"
+              :value="value"
+              :label="label"
+              :key="value"
+            />
+          </el-select>
+        </el-form-item>
 
-          <el-form-item label="备注" prop="remark">
-            <el-input placeholder="备注" v-model="ruleForm.remark" style="width:100%" type="textarea" />
-          </el-form-item>
-        </el-col>
+        <el-form-item label="备注" prop="remark">
+          <el-input placeholder="备注" v-model="ruleForm.remark" style="width:100%" type="textarea" />
+        </el-form-item>
+      </el-col>
 
-        <el-col :span="12">
-          <el-form-item 
-            label="发票抬头" 
-            prop="invoice_id"
-          >
-            <el-input 
-              v-if="!invoiceInfo"
-              placeholder="请选择发票抬头" 
-              @focus="titleVisible = true" 
-            />
+      <el-col :span="12">
+        <el-form-item label="发票抬头" prop="invoice_id">
+          <el-input v-if="!invoiceInfo" placeholder="请选择发票抬头" @focus="titleVisible = true" />
 
-            <div style="display:flex;margin-bottom:10px" v-else>
-              <show-data-table 
+          <div style="display:flex;margin-bottom:10px" v-else>
+            <show-data-table
               :sitem="invoiceInfo"
               style="padding: -5px 0 10px 0"
               :newTime="newTime"
               :columns="invoiceColumns"
             >
-              <template #tel>
-                {{invoiceInfo.address}} {{invoiceInfo.tel}}
-              </template>
+              <template #tel>{{invoiceInfo.address}} {{invoiceInfo.tel}}</template>
 
-              <template #bank>
-                {{invoiceInfo.bank_name}} {{invoiceInfo.bank_account}}
-              </template>
+              <template #bank>{{invoiceInfo.bank_name}} {{invoiceInfo.bank_account}}</template>
             </show-data-table>
 
             <el-tooltip placement="top" content="重新选择发票抬头">
-              <i 
-                class="el-icon-circle-close" 
+              <i
+                class="el-icon-circle-close"
                 style="font-size:18px;margin:0px 10px;cursor:pointer"
-                @click="handleTitleChange(null)" 
+                @click="handleTitleChange(null)"
               />
             </el-tooltip>
           </div>
-          </el-form-item>
-        </el-col>
-      </el-row>
+        </el-form-item>
+      </el-col>
+    </el-row>
 
-      <title-modal 
-        :visible.sync="titleVisible"
-        @change="handleTitleChange"
-      />
+    <title-modal :visible.sync="titleVisible" :code="code" @change="handleTitleChange" />
 
     <div style="display:flex;justify-content:flex-end;margin-bottom:10px">
       <el-button size="mini" type="primary" @click="onSubmit">保存</el-button>
@@ -74,12 +64,12 @@
 
 <script>
 import {
-  demandStatusOptions, 
-  invoiceTypeList, 
-  openInvoiceTypeList 
-} from '@/assets/js/statusList'
+  demandStatusOptions,
+  invoiceTypeList,
+  openInvoiceTypeList
+} from "@/assets/js/statusList";
 
-import TitleModal from "./titleModal.vue"
+import TitleModal from "./titleModal.vue";
 
 /** 
     @props
@@ -91,110 +81,110 @@ import TitleModal from "./titleModal.vue"
   */
 
 export default {
-  name:'CreateInvoiceNode',
-  props:['isApply'],  //isApply 是否为创建开票申请
+  name: "CreateInvoiceNode",
+  props: ["isApply", "code"], //isApply 是否为创建开票申请
   components: { TitleModal },
-  data(){
-      return {
-        loading: false,
-        demandStatusOptions,
-        invoiceTypeList,
-        openInvoiceTypeList,
-        demandInfo : null,
-        invoiceInfo: null,
-        titleVisible: false,
-        demandVisible: false,
-          invoiceColumns:[
-            {
-              prop: 'title',
-              label: '抬头',
-              span:24
-            },
-            {
-              prop: 'tax_no',
-              label: '纳税人识别号',
-              span:24
-            },
-            {
-              prop: 'tel',
-              label: '地址、电话',
-              span:24,
-              _slot_: 'tel'
-            },
-            {
-              prop: 'bank_account',
-              label: '开户行及账号',
-              _slot_:'bank',
-              span:24
-            }
-          ],
-          newTime:"",
-          demandVisible: false,
-          ruleForm:{
-            req_id:"",
-            invoice_id:"", //发票抬头
-            invoice_type:"", //发票类型
-            total_amount:"", //申请总金额
-            remark:"", // 备注
-          },
-          rules:{
-            invoice_id:[
-              {
-                required:true,
-                trigger:'change',
-                message:'请输入发票抬头'
-              }
-            ],
-            req_id:[
-               {
-                required:true,
-                trigger:'change',
-                message:'请选择需求订单'
-              }
-            ],
-            invoice_type:[
-              {
-                required:true,
-                trigger:'change',
-                message:'请选择发票类型'
-              }
-            ],
-            total_amount:[
-              {
-                required:true,
-                trigger:'change',
-                message:'请输入申请总金额'
-              }
-            ],
-            remark:[
-              {
-                required:true,
-                trigger:'change',
-                message:'请输入发票备注'
-              }
-            ]
+  data() {
+    return {
+      loading: false,
+      demandStatusOptions,
+      invoiceTypeList,
+      openInvoiceTypeList,
+      demandInfo: null,
+      invoiceInfo: null,
+      titleVisible: false,
+      demandVisible: false,
+      invoiceColumns: [
+        {
+          prop: "title",
+          label: "抬头",
+          span: 24
+        },
+        {
+          prop: "tax_no",
+          label: "纳税人识别号",
+          span: 24
+        },
+        {
+          prop: "tel",
+          label: "地址、电话",
+          span: 24,
+          _slot_: "tel"
+        },
+        {
+          prop: "bank_account",
+          label: "开户行及账号",
+          _slot_: "bank",
+          span: 24
+        }
+      ],
+      newTime: "",
+      demandVisible: false,
+      ruleForm: {
+        req_id: "",
+        invoice_id: "", //发票抬头
+        invoice_type: "", //发票类型
+        total_amount: "", //申请总金额
+        remark: "" // 备注
+      },
+      rules: {
+        invoice_id: [
+          {
+            required: true,
+            trigger: "change",
+            message: "请输入发票抬头"
+          }
+        ],
+        req_id: [
+          {
+            required: true,
+            trigger: "change",
+            message: "请选择需求订单"
           }
+        ],
+        invoice_type: [
+          {
+            required: true,
+            trigger: "change",
+            message: "请选择发票类型"
+          }
+        ],
+        total_amount: [
+          {
+            required: true,
+            trigger: "change",
+            message: "请输入申请总金额"
+          }
+        ],
+        remark: [
+          {
+            required: true,
+            trigger: "change",
+            message: "请输入发票备注"
+          }
+        ]
       }
+    };
   },
-  methods:{
-    async handleTitleChange(invoiceInfo){
-      if(!invoiceInfo){
-        this.invoiceInfo = null
-        this.ruleForm.invoice_id = ""
-        return
+  methods: {
+    async handleTitleChange(invoiceInfo) {
+      if (!invoiceInfo) {
+        this.invoiceInfo = null;
+        this.ruleForm.invoice_id = "";
+        return;
       }
 
-      this.invoiceInfo = invoiceInfo
-      this.ruleForm.invoice_id = invoiceInfo.id
+      this.invoiceInfo = invoiceInfo;
+      this.ruleForm.invoice_id = invoiceInfo.id;
     },
-    async onSubmit(){
+    async onSubmit() {
       try {
-        await this.$refs.ruleForm.validate()
-        this.$emit('confirm',this.ruleForm)
-        }catch(err){
-        console.log(err)
+        await this.$refs.ruleForm.validate();
+        this.$emit("confirm", this.ruleForm);
+      } catch (err) {
+        console.log(err);
       }
-    },
+    }
   }
-}
+};
 </script>

+ 4 - 4
src/views/platformService/settlement/detail.vue

@@ -109,7 +109,7 @@
               v-loading="Statusloading"
               v-if="Number(sitem.status) === 4"
             >
-              <wait-supplier-upload @confirm="handleUploadInvoiceReq" />
+              <wait-supplier-upload :code="sitem.supplierNo" @confirm="handleUploadInvoiceReq" />
             </el-collapse-item>
 
             <el-collapse-item name="5" title="发票管理" v-if="Number(sitem.status) >= 5">
@@ -148,11 +148,11 @@ export default {
   mixins: [resToken],
   computed: {
     ...mapGetters([
+      "private_field",
       "tablebtnSize",
+      "isSupertube",
       "searchSize",
-      "size",
-      "private_field",
-      "isSupertube"
+      "size"
     ]),
     powers() {
       const { btnList } = this.$store.getters;