Browse Source

Merge remote-tracking branch 'origin/mergeBranch' into mergeBranch

qymljy 2 years ago
parent
commit
851a3a1f06

+ 1 - 1
src/HDrpManagement/toolBorrowingMag/detail/index.vue

@@ -144,7 +144,7 @@ export default {
     pageChange (id,rowindex,tabIndex) {
       this.flag = false
       tabIndex = this.$route.query.tabIndex
-      this.$router.replace({path:'/customerDetail',query:{id:id,rowindex:rowindex,tabIndex:tabIndex}})
+      this.$router.replace({path:'/toolBorrowingMagDetail',query:{id:id,rowindex:rowindex,tabIndex:tabIndex}})
       this.queryMainData(id)
     },
     onSuccess(){

+ 15 - 0
src/SDrpManagement/performanceGoals/index.vue

@@ -0,0 +1,15 @@
+<template>
+  <div>
+    <normalLayout>
+    </normalLayout>
+  </div>
+</template>
+
+<script>
+export default {
+
+}
+
+</script>
+<style>
+</style>

+ 170 - 0
src/SDrpManagement/salerToolBorrowing/detail/index.vue

@@ -0,0 +1,170 @@
+<template>
+  <div>
+    <basicDetails
+      ref="details"
+      :titleText="`单号:${mainData.sonum}`"
+      :oldFormPath="{edit:'SDrpManagement/salerToolBorrowing/modules'}"
+      :editData="mainData"
+      :mainAreaData="mainAreaData"
+      turnPageId="20230114105002"
+      idname="sa_orderid"
+      ownertable="sa_order"
+      delApiId="20230116100002"
+      :statusCheck="[{key:'status',value:'审核'},{key:'status',value:'交期待确认'},{key:'status',value:'提交'},{key:'status',value:'交期确认'}]"
+      :tabs="['借用单明细']"
+      @pageChange="pageChange"
+      @onEditSuccess="queryMainData($route.query.id)">
+      <div slot="customOperation" class="inline-16">
+          <el-button v-if="tool.checkAuth($route.name,'confirmDate')" :disabled="mainData.status !== '交期待确认'" type="primary" size="mini" @click="confirmdate">确认交期</el-button>
+          <el-button v-if="tool.checkAuth($route.name,'submit')" :disabled="mainData.status !== '新建'"  type="primary" size="mini" @click="onSubmit('提交')">提 交</el-button>
+      </div>
+      <div slot="slot0" >
+        <toolList></toolList>
+      </div>
+      <div slot="slot1" >
+      </div>
+    </basicDetails>
+  </div>
+</template>
+
+<script>
+import toolList from './tabs/toolList.vue'
+import confirmDate from '../modules/confirmDate.vue'
+
+export default {
+  name: "detail",
+  data() {
+    return {
+      mainData:{},
+      mainAreaData:{},
+      options:[],
+      value:''
+    }
+  },
+  components:{
+    toolList,
+    confirmDate
+  },
+  methods:{
+    async orderreviewtype () {
+      const res = await this.$store.dispatch('optiontypeselect','orderreviewtype')
+      this.options = res.data
+      this.value = res.data[0].value
+    },
+    async queryMainData(id) {
+      const res = await this.$api.requested({
+        "id":20230114140402,
+        "content": {
+          "sa_orderid": this.$route.query.id
+        }
+      })
+      this.mainData = res.data
+      this.changeDataStructure()
+      this.orderreviewtype()
+    },
+    changeDataStructure() {
+      this.mainAreaData = [
+        {
+          label:'单据日期',
+          value:this.mainData.billdate
+        },
+        {
+          label:'经销商',
+          value:this.mainData.enterprisename
+        },
+        {
+          label:'状态',
+          value:this.mainData.status
+        },
+        {
+          label:'合同',
+          value:this.mainData.contract_title?this.mainData.contract_title:'无合同'
+        },
+        {
+          label:'合计数量',
+          value:this.mainData.qty * this.mainData.toolcount
+        },
+        {
+          label:'金额',
+          value:this.mainData.amount
+        },
+        {
+          label:'收货人',
+          value:this.mainData.name
+        },
+        {
+          label:'收货地址',
+          value:this.mainData.province + this.mainData.city + this.mainData.county + this.mainData.address
+        },
+        {
+          label:'审核日期',
+          value:this.mainData.checkdate
+        },
+        {
+          label:'备注',
+          value:this.mainData.remarks
+        }
+      ]
+    },
+    // 监听切换数据,上一页,下一页
+    pageChange (id,rowindex,tabIndex) {
+      this.$refs['details'].param.content.isManage = 0
+      tabIndex = this.$route.query.tabIndex
+      this.$router.replace({path:'/toolBorrowingMagDetail',query:{id:id,rowindex:rowindex,tabIndex:tabIndex}})
+      this.queryMainData(id)
+    },
+    onSuccess(){
+      this.visible = false
+      this.queryMainData(this.$route.query.id)
+      this.$emit('onSuccess')
+    },
+    // 提交审核订单
+    onSubmit (type) {
+      this.$confirm(`是否${type}该订单`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        const res = await this.$api.requested({
+          "id": type === '审核'?20230114161402:20230114160002,
+          "content": {
+            "sa_orderid": this.mainData.sa_orderid,
+            "sys_enterpriseid": this.mainData.sys_enterpriseid,
+            "sa_accountclassid": this.mainData.accountclass.sa_accountclassid,
+            "reviewtype":type === '审核'?this.value:''
+          },
+        })
+        this.tool.showMessage(res,async ()=>{
+          this.visible = false
+          this.queryMainData()
+        })
+      }).catch((err) => {
+        this.$message({
+          type: 'info',
+          message: '取消'
+        });          
+      });
+    },
+    async confirmdate () {
+      const res = await this.$api.requested({
+        "id": 20230129154102,
+        "content": {
+          "sa_orderid": this.$route.query.id
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.queryMainData()
+      })
+    },
+  },
+  mounted () {
+    this.queryMainData(this.$route.query.id)
+  },
+  created() {
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 0 - 0
src/SDrpManagement/toolBorrowingAgent/detail/tabs/toolList.vue → src/SDrpManagement/salerToolBorrowing/detail/tabs/toolList.vue


+ 58 - 0
src/SDrpManagement/salerToolBorrowing/index.vue

@@ -0,0 +1,58 @@
+
+<template>
+  <div>
+    <basicLayout 
+      ref="basicLayout" 
+      :oldFormPath="{
+        add:'SDrpManagement/salerToolBorrowing/modules'
+      }"
+      tableName="toolBorrowing_saler" 
+      idName="sa_orderid" 
+      :apiId="{query:20230114105002,del:20230116100002}"
+      :autoQuery="false"
+      :detailPath="{
+        path:'/toolBorrowing_salerDetail'
+      }">
+      <div slot="custom">
+      </div>
+      <template v-slot:tbList="scope">
+        <div v-if="scope.data.column.columnname === 'address'">
+          {{scope.data.column.data.province}}{{scope.data.column.data.city}}{{scope.data.column.data.county}}{{scope.data.column.data.address}}
+        </div>
+        <div v-else>
+          {{scope.data.column.data[[scope.data.column.columnname]]}}
+        </div>
+      </template>
+      <template v-slot:tbOpreation="scope">
+      </template>
+    </basicLayout>
+  </div>
+</template>
+
+<script>
+/**
+ * @basicLayout 提供this.$ref['basicLayout'].listData()方法查询列表信息
+ * @param {string} formPath 新建,编辑组件所在文件夹名称,以后所有列表新增修改文件统一放入Form文件夹下面,并创建与开发应用相同的名称的子文件夹
+ * @param {string} tableName 开发端配置的表格名称
+ * @param {String} idName 数据主id名称
+ * @param {object} apiId:{query:查询的接口id,del:删除的接口id} 
+ * @param {Array} options:{label:描述,value:值} 
+ */
+export default {
+  data () {
+    return {
+      options:[]
+      
+    }
+  },
+  methods:{
+  },
+  mounted () {
+    this.$refs['basicLayout'].param.content.isManage = 0
+    this.$refs['basicLayout'].listData()
+  }
+}
+
+</script>
+<style>
+</style>

+ 4 - 0
src/SDrpManagement/toolBorrowingAgent/modules/add.vue → src/SDrpManagement/salerToolBorrowing/modules/add.vue

@@ -143,6 +143,10 @@ export default {
       this.drawer = true
       this.pageData()
       this.specordermx()
+      this.$nextTick(()=>{
+        this.$refs['contract'].listData()
+      })
+      
     },
     submitForm() {
       this.$refs['form'].validate(async valid => {

+ 0 - 0
src/SDrpManagement/toolBorrowingAgent/modules/confirmDate.vue → src/SDrpManagement/salerToolBorrowing/modules/confirmDate.vue


+ 2 - 2
src/SDrpManagement/toolBorrowingAgent/modules/edit.vue → src/SDrpManagement/salerToolBorrowing/modules/edit.vue

@@ -163,14 +163,14 @@
         <p><small>开票地址:&nbsp;</small>{{defaultData.fin_info.address}}</p>
         <p><small>开户行:&nbsp;</small> {{defaultData.fin_info.bank}} &emsp;<small>开户账号:&nbsp;</small> {{defaultData.fin_info.bankcardno}}</p>
       </div>
-      <div v-if="!data.sa_contractid" class="mt-10">
+      <!-- <div v-if="!data.sa_contractid" class="mt-10">
         <p class="normal-title inline-16">领域明细</p>
       </div>
       <div v-if="!data.sa_contractid" class="mt-10 flex-align-center">
         <div v-for="item in data.subvalues" :key="item.index" :style="defaultData.tradefieldmx === item?{background:'#d9ecff'}:{background:'#fff'}" class="reveive__panel normal-margin inline-16" @click="defaultData.tradefieldmx = item">
           <p>{{item}}</p>
         </div>
-      </div>
+      </div> -->
       
       <div class="mt-10">
         <p class="normal-title inline-16">订单备注</p>

+ 170 - 0
src/SDrpManagement/toolBorrowing/detail/index.vue

@@ -0,0 +1,170 @@
+<template>
+  <div>
+    <basicDetails
+      ref="details"
+      :titleText="`单号:${mainData.sonum}`"
+      :oldFormPath="{edit:'SDrpManagement/toolBorrowing/modules'}"
+      :editData="mainData"
+      :mainAreaData="mainAreaData"
+      turnPageId="20230114105002"
+      idname="sa_orderid"
+      ownertable="sa_order"
+      delApiId="20230116100002"
+      :statusCheck="[{key:'status',value:'审核'},{key:'status',value:'交期待确认'},{key:'status',value:'提交'},{key:'status',value:'交期确认'}]"
+      :tabs="['借用单明细']"
+      @pageChange="pageChange"
+      @onEditSuccess="queryMainData($route.query.id)">
+      <div slot="customOperation" class="inline-16">
+          <el-button v-if="tool.checkAuth($route.name,'confirmDate')" :disabled="mainData.status !== '交期待确认'" type="primary" size="mini" @click="confirmdate">确认交期</el-button>
+          <el-button v-if="tool.checkAuth($route.name,'submit')" :disabled="mainData.status !== '新建'"  type="primary" size="mini" @click="onSubmit('提交')">提 交</el-button>
+      </div>
+      <div slot="slot0" >
+        <toolList></toolList>
+      </div>
+      <div slot="slot1" >
+      </div>
+    </basicDetails>
+  </div>
+</template>
+
+<script>
+import toolList from './tabs/toolList.vue'
+import confirmDate from '../modules/confirmDate.vue'
+
+export default {
+  name: "detail",
+  data() {
+    return {
+      mainData:{},
+      mainAreaData:{},
+      options:[],
+      value:''
+    }
+  },
+  components:{
+    toolList,
+    confirmDate
+  },
+  methods:{
+    async orderreviewtype () {
+      const res = await this.$store.dispatch('optiontypeselect','orderreviewtype')
+      this.options = res.data
+      this.value = res.data[0].value
+    },
+    async queryMainData(id) {
+      const res = await this.$api.requested({
+        "id":20230114140402,
+        "content": {
+          "sa_orderid": this.$route.query.id
+        }
+      })
+      this.mainData = res.data
+      this.changeDataStructure()
+      this.orderreviewtype()
+    },
+    changeDataStructure() {
+      this.mainAreaData = [
+        {
+          label:'单据日期',
+          value:this.mainData.billdate
+        },
+        {
+          label:'经销商',
+          value:this.mainData.enterprisename
+        },
+        {
+          label:'状态',
+          value:this.mainData.status
+        },
+        {
+          label:'合同',
+          value:this.mainData.contract_title?this.mainData.contract_title:'无合同'
+        },
+        {
+          label:'合计数量',
+          value:this.mainData.qty * this.mainData.toolcount
+        },
+        {
+          label:'金额',
+          value:this.mainData.amount
+        },
+        {
+          label:'收货人',
+          value:this.mainData.name
+        },
+        {
+          label:'收货地址',
+          value:this.mainData.province + this.mainData.city + this.mainData.county + this.mainData.address
+        },
+        {
+          label:'审核日期',
+          value:this.mainData.checkdate
+        },
+        {
+          label:'备注',
+          value:this.mainData.remarks
+        }
+      ]
+    },
+    // 监听切换数据,上一页,下一页
+    pageChange (id,rowindex,tabIndex) {
+      this.$refs['details'].param.content.isManage = 0
+      tabIndex = this.$route.query.tabIndex
+      this.$router.replace({path:'/toolBorrowingDetail',query:{id:id,rowindex:rowindex,tabIndex:tabIndex}})
+      this.queryMainData(id)
+    },
+    onSuccess(){
+      this.visible = false
+      this.queryMainData(this.$route.query.id)
+      this.$emit('onSuccess')
+    },
+    // 提交订单
+    onSubmit (type) {
+      this.$confirm(`是否${type}该订单`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        const res = await this.$api.requested({
+          "id": type === '审核'?20230114161402:20230114160002,
+          "content": {
+            "sa_orderid": this.mainData.sa_orderid,
+            "sys_enterpriseid": this.mainData.sys_enterpriseid,
+            "sa_accountclassid": this.mainData.accountclass.sa_accountclassid,
+            "reviewtype":type === '审核'?this.value:''
+          },
+        })
+        this.tool.showMessage(res,async ()=>{
+          this.visible = false
+          this.queryMainData()
+        })
+      }).catch((err) => {
+        this.$message({
+          type: 'info',
+          message: '取消'
+        });          
+      });
+    },
+    async confirmdate () {
+      const res = await this.$api.requested({
+        "id": 20230129154102,
+        "content": {
+          "sa_orderid": this.$route.query.id
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.queryMainData()
+      })
+    },
+  },
+  mounted () {
+    this.queryMainData(this.$route.query.id)
+  },
+  created() {
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 313 - 0
src/SDrpManagement/toolBorrowing/detail/tabs/toolList.vue

@@ -0,0 +1,313 @@
+<template>
+  <div>
+    <el-table
+      ref="multipleTable"
+      :data="tableData"
+      height="500px"
+      style="width: 100%;"
+      size="small"
+      stripe
+      border>
+      <el-table-column
+        prop="itemname"
+        label="产品名称"
+        width="180">
+      </el-table-column>
+      <el-table-column
+        prop="itemno"
+        label="产品编号"
+        width="180">
+      </el-table-column>
+      <el-table-column
+        label="型号/规格"
+        width="150">
+        <template slot-scope="scope">
+          <p><span>{{scope.row.model}}</span>&nbsp;/&nbsp;<span>{{scope.row.spec}}</span></p>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="数量"
+        width="180">
+        <template slot-scope="scope">
+          <el-input-number :controls="true" controls-position='right' :step-strictly="true" v-if="type === 'edit'" size="mini" v-model="scope.row.qty" :min="scope.row.orderminqty" :step="scope.row.orderaddqty" label="输入数量" @change="rowChange(scope.row,scope.$index)"></el-input-number>
+          <span v-else>{{scope.row.qty}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="needdate"
+        label="需求日期"
+        width="180">
+        <template slot="header" slot-scope="scope">
+          <div>
+            <el-date-picker
+              style="width:150px"
+              v-if="type === 'edit'"
+              v-model="value2"
+              value-format="yyyy-MM-dd"
+              slot="reference"
+              align="right"
+              type="date"
+              size="mini"
+              placeholder="一键交期"
+              @change="dateChangeNeed">
+            </el-date-picker>
+            <span v-else>需求日期</span>
+          </div>
+        </template>
+        <template slot-scope="scope">
+          <el-date-picker
+            v-if="scope.row.delivery > 0 && type === 'edit'"
+            v-model="scope.row.needdate"
+            type="date"
+            placeholder="选择日期"
+            value-format="yyyy-MM-dd"
+            size="mini"
+            style="width:150px"
+            :picker-options="pickerOptions"
+            @change="rowChange(scope.row)"
+            @focus="setPickerOptions(scope.row)">
+          </el-date-picker>
+          <div v-else>
+            <p v-if="scope.row.delivery === 0 ">不管控交期</p>
+            <p v-else>{{scope.row.needdate}}</p>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="回复交期"
+        width="200">
+        <template slot="header" slot-scope="scope">
+          <div>
+            <el-date-picker
+              style="width:180px"
+              v-if="type === 'confirmdate'"
+              v-model="value2"
+              value-format="yyyy-MM-dd"
+              slot="reference"
+              align="right"
+              type="date"
+              size="mini"
+              placeholder="一键交期"
+              @change="dateChange">
+            </el-date-picker>
+            <span v-else>回复交期</span>
+          </div>
+        </template>
+        <template slot-scope="scope">
+          <el-date-picker
+            v-if="scope.row.delivery > 0 && type === 'confirmdate'"
+            v-model="scope.row.deliverydate"
+            type="date"
+            placeholder="选择日期"
+            value-format="yyyy-MM-dd"
+            size="mini"
+            style="width:150px"
+            :picker-options="pickerOptions"
+            @change="onDateChange(scope.row)"
+            @focus="setPickerOptions(scope.row)">
+          </el-date-picker>
+          <div v-else>
+            <p v-if="scope.row.delivery === 0 ">不管控交期</p>
+            <p v-else>{{scope.row.deliverydate}}</p>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="unit"
+        label="计量单位"
+        width="90">
+        <template slot-scope="scope">
+          <el-tag size="mini" type="info" effect="plain">{{scope.row.unit}}</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="price"
+        label="价格"
+        width="100">
+        <template slot-scope="scope">
+          <p style="color:red;font-weight:500">¥&nbsp;{{tool.formatAmount(scope.row.price,2)}}</p>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="小计">
+        <template slot-scope="scope">
+          <p style="color:red;font-weight:500">¥&nbsp;{{tool.formatAmount(scope.row.price * scope.row.qty,2)}}</p>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="备注"
+        width="300">
+        <template slot-scope="scope">
+          <el-input v-if="type === 'edit'" v-model="scope.row.remarks" placeholder="输入订单备注" size="mini" @change="rowChange(scope.row,scope.$index)"></el-input>
+          <p v-else>{{scope.row.remarks}}</p>
+        </template>
+      </el-table-column>
+      <el-table-column v-if="type === 'edit' && !data.sa_contractid" width="90" fixed="right">
+        <template slot-scope="scope">
+          <el-button type="text" size="mini" @click="deleteOrderProduct(scope.row)">删 除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div style="margin-top:16px;text-align:right">
+      <el-pagination
+        background
+        small
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="currentPage"
+        :page-size="param.content.pageSize"
+        layout="total, prev, pager, next, jumper"
+        :total="total">
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  props:['data','type'],
+  data () {
+    return {
+      dataRefresh:true,
+      tableData:[],
+      param:{
+        "id": 20230116104102,
+        "content": {
+          "sa_orderid": 0, //订单ID
+          "pageNumber": 1,
+          "pageSize": 20,
+          "where": {
+            "condition": ""
+          }
+        },
+      },
+      pickerOptions: {
+        disabledDate(time) {
+          return time.getTime() < (Date.now() - 24 * 3600 * 1000);
+        },
+      },
+      total:0,
+      currentPage:0,
+      time: null,
+      value2:''
+    }
+  },
+  methods:{
+    async listData () {
+      this.param.content.sa_orderid = this.$route.query.id
+      const res = await this.$api.requested(this.param)
+      this.tableData = res.data
+      this.total = res.total
+      this.currentPage = res.pageNumber
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.params.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.params.content.pageNumber = val
+      this.listData()
+    },
+    async deleteOrderProduct (row) {
+      const res = await this.$api.requested({
+        "id": 20221109093702,
+        "content": {
+          "sa_orderid":this.$route.query.id,
+          "sa_orderitemsids": [row.sa_orderitemsid]
+        },
+      })
+      this.tool.showMessage(res,()=>{
+        this.listData()
+        this.$emit('onSuccess')
+      })
+    },
+    rowChange (val,index) {
+      let that = this
+      this.$set(this.tableData,index,val)
+      // // 防抖
+      if(this.time !== null){
+        clearTimeout(this.time);
+      }
+      this.time = setTimeout(() => {
+        that.updateOrder({
+          "sa_orderid": this.data.sa_orderid, //订单ID
+          "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
+          "sa_contractid": this.data.contacts.contactsid, //合同ID
+          "type": this.data.type, //订单类型
+          "items": [{
+            "sa_orderitemsid": val.sa_orderitemsid,//0表示新增
+            "itemid": val.itemid, //商品ID
+            "qty": val.qty, //数量
+            "needdate": val.needdate,//可以不传,修改交期
+            "price":val.price,
+            "remarks":val.remarks
+          }]
+        })
+      },500)
+    },
+    onDateChange (val){
+      let that = this
+      that.updateOrder({
+        "sa_orderid": this.data.sa_orderid, //订单ID
+        "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
+        "sa_contractid": this.data.contacts.contactsid, //合同ID
+        "type": this.data.type, //订单类型
+        "items": [{
+          "sa_orderitemsid": val.sa_orderitemsid,//0表示新增
+          "itemid": val.itemid, //商品ID
+          "qty": val.qty, //数量
+          "deliverydate": val.deliverydate//可以不传,修改交期
+        }]
+      })
+    },
+    async dateChangeNeed(val){
+      // const res = await this.$api.requested({
+      //   "id": 20230104143802,
+      //   "content": {
+      //     "sa_orderid": this.data.sa_orderid, 
+      //     "needdate": this.value2
+      //   },
+      // })
+    },
+    async updateOrder (val) {
+      const res  = await this.$api.requested({
+        "id": 20221109093602,
+        "content": val
+      })
+    },
+    setPickerOptions (val) {
+      var startDate = val.deliverydate
+      startDate = startDate.replace(new RegExp("-","gm"),"/")
+      var startDateM = (new Date(startDate)).getTime()
+      this.pickerOptions = {
+        disabledDate(time) {
+          return time.getTime() < startDateM;
+        },
+      }
+    },
+    async dateChange (row) {
+      this.tableData = this.tableData.filter(e=>{
+        if (e.delivery > 0) {
+          e.deliverydate = this.value2
+        }
+        return e
+      })
+      const res = await this.$api.requested({
+       "id": 20230104143102,
+        "content": {
+          "sa_orderid": this.$route.query.id, 
+          "deliverydate": this.value2
+        },
+      })
+    },
+  },
+  mounted () {
+    this.listData()
+  }
+}
+
+</script>
+<style>
+</style>

+ 3 - 3
src/SDrpManagement/toolBorrowingAgent/index.vue → src/SDrpManagement/toolBorrowing/index.vue

@@ -4,14 +4,14 @@
     <basicLayout 
       ref="basicLayout" 
       :oldFormPath="{
-        add:'SDrpManagement/toolBorrowingAgent/modules'
+        add:'SDrpManagement/toolBorrowing/modules'
       }"
       tableName="toolBorrowingTable" 
       idName="sa_orderid" 
       :apiId="{query:20230114105002,del:20230116100002}"
       :autoQuery="false"
       :detailPath="{
-        path:'/toolBorrowingMagDetail'
+        path:'/toolBorrowingDetail'
       }">
       <div slot="custom">
       </div>
@@ -48,7 +48,7 @@ export default {
   methods:{
   },
   mounted () {
-    this.$refs['basicLayout'].param.content.isManage = 1
+    this.$refs['basicLayout'].param.content.isManage = 0
     this.$refs['basicLayout'].listData()
   }
 }

+ 245 - 0
src/SDrpManagement/toolBorrowing/modules/add.vue

@@ -0,0 +1,245 @@
+<template>
+  <div>
+    <el-button type="primary" size="small" @click="handleCommand">新 建</el-button>
+    <el-drawer
+      title="新建借用单"
+      :visible.sync="drawer"
+      direction="rtl"
+      :show-close="false"
+      append-to-body
+      size="800px"
+      @close="refresh">
+      <div class="drawer__panel">
+        <el-row :gutter="15">
+          <el-form size="small" ref="form" :model="form" :rules="rules" label-width="100px" :status-icon="false">
+            <!-- <el-col :span="12">
+              <el-form-item label="企业信息" prop="sys_enterpriseid">
+                <enterprise @rowClick="rowClick"></enterprise>
+              </el-form-item>
+            </el-col> -->
+            <el-col :span="12">
+              <el-form-item label="工具合同">
+                <el-popover
+                  placement="bottom"
+                  trigger="click"
+                  v-model="visible">
+                  <toolCanUseContract ref="contract" @rowClick="contractClick"></toolCanUseContract>
+                  <el-input readonly v-model="form.contractname" slot="reference" placeholder="选择合同"></el-input>
+                </el-popover>
+              </el-form-item>
+            </el-col>
+            <!-- <el-col v-if="form.type === '特殊订单'" :span="12">
+              <el-form-item label="子分类" prop="typemx">
+                <el-select v-model="form.typemx" placeholder="请选择选子分类" clearable :style="{width: '100%'}">
+                  <el-option v-for="(item, index) in typemxlist" :key="index" :label="item.value"
+                    :value="item.value"></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col> -->
+            <el-col :span="12" v-if="!form.sa_contractid">
+              <el-form-item label="选择品牌" prop="sa_brandid">
+                <el-select v-model="form.sa_brandid" placeholder="请选择选择品牌" clearable :style="{width: '100%'}">
+                  <el-option v-for="(item, index) in sa_brandidOptions" :key="index" :label="item.brandname"
+                    :value="item.sa_brandid" :disabled="item.disabled"></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12" v-if="!form.sa_contractid">
+              <el-form-item label="选择领域" prop="tradefield">
+                <el-select v-model="form.tradefield" placeholder="请选择选择领域" clearable :style="{width: '100%'}">
+                  <el-option v-for="(item, index) in tradefieldOptions" :key="index" :label="item.tradefield"
+                    :value="item.tradefield" @click.native="setChildField(item)"></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12" v-if="!form.sa_contractid">
+              <el-form-item label="领域明细">
+                <el-select v-model="form.tradefieldmx" placeholder="请选择领域明细" clearable :style="{width: '100%'}">
+                  <el-option v-for="(item, index) in childField" :key="index" :label="item"
+                    :value="item"></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button class="normal-btn-width" type="primary" size="small" @click="submitForm">创 建</el-button>
+        <el-button class="normal-btn-width" size="small" @click="resetForm">重 置</el-button>
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import enterprise from '@/template/enterprise/index.vue'
+import toolCanUseContract from '@/template/toolBorrowingCanUseContract/index.vue'
+
+export default {
+  data () {
+    return {
+      drawer:false,
+      visible:false,
+      visible1:false,
+      form:{
+        "sa_orderid": 0,
+        "sys_enterpriseid": 0, //订货企业id,可不传,默认取当前账号的
+        "sa_accountclassid": 0, //营销账户类型ID
+        "sa_brandid": "", //品牌ID
+        "sa_contractid": null, //合同ID,标准订单不传
+        "sa_projectid": 0, //工程项目表ID,标准订单不传
+        "sys_enterprise_financeid": 0, //合作企业财务信息ID(开票信息)
+        "sa_logiscompid": 0, //物流公司档案ID
+        "rec_contactsid": 0, //合作企业联系人表ID(收货信息)
+        "type": "", //订单类型
+        "typemx": "", //明细分类,可选
+        "remarks": "", //可选
+        "tradefield":"",//必选
+        "pay_enterpriseid": 0, //结算单位
+        "rebate_used":0,//默认0,是否使用返利金
+        "billdate":"",//单据日期,默认创建日期
+        "signbacknum":"",
+        "promname":""
+      },
+      rules: {
+        sa_brandid: [{
+          required: true,
+          message: '请选择选择品牌',
+          trigger: 'change'
+        }],
+        tradefield: [{
+          required: true,
+          message: '请选择选择领域',
+          trigger: 'change'
+        }],
+        typemx: [{
+          required: true,
+          message: '请选择选子分类',
+          trigger: 'change'
+        }],
+        sys_enterpriseid:[{
+          required: true,
+          message: '订货企业不能为空',
+          trigger: 'blur'
+        }],
+        promname:[{
+          required: true,
+          message: '活动不能为空',
+          trigger: 'blur'
+        }],
+      },
+      sa_brandidOptions: [],
+      tradefieldOptions: [],
+      typemxlist:[],
+      childField:[]
+    }
+  },
+  components:{
+    enterprise,
+    toolCanUseContract
+  },
+  methods:{
+    handleCommand (command) {
+      this.drawer = true
+      this.pageData()
+      this.specordermx()
+      this.$nextTick(()=>{
+        this.$refs['contract'].listData()
+      })
+      
+    },
+    submitForm() {
+      this.$refs['form'].validate(async valid => {
+        if (!valid) return
+        const res = await this.$api.requested({
+          "id": 20230116092702,
+          "content":this.form
+        })
+        this.tool.showMessage(res,()=>{
+          if (this.form.sa_contractid) {
+            this.addContractTool(res.data.sa_orderid)
+          }
+
+          this.drawer = false
+         
+          this.$store.dispatch('changeDetailDrawer',true)
+          this.$router.push({path:'/toolBorrowingMagDetail',query:{id:res.data.sa_orderid,rowindex:res.data.rowindex}})
+        })
+      })
+    },
+    async addContractTool (sa_orderid) {
+      const res = await this.$api.requested({
+        "id": 20230116142602,
+        "content": {
+          "sa_orderid":sa_orderid,
+          "sys_enterpriseid": this.form.sys_enterpriseid,
+          "sa_contractid":this.form.sa_contractid
+        },
+      })
+    },
+    async specordermx () {
+      const res = await this.$store.dispatch('optiontypeselect','specordermx')
+      this.typemxlist = res.data
+    },
+    resetForm() {
+      this.$refs['form'].resetFields()
+    },
+    async pageData () {
+      const res = await this.$api.requested({
+        "id": 20220924163702,
+        "content": {
+          "pageSize": 999,
+        }
+      })
+      this.sa_brandidOptions = res.data
+
+      const res1 = await this.$api.requested({
+        "id": 20221223141802,
+        "content": {
+          "pageSize": 999,
+        }
+      })
+      this.tradefieldOptions = res1.data
+    },
+    // rowClick (row) {
+    //   this.form.sys_enterpriseid = row.sys_enterpriseid
+    //   this.$refs['contract'].listData(row.sys_enterpriseid)
+    // },
+    contractClick (row) {
+      this.form.sa_contractid = row.sa_contractid
+      this.form.sa_projectid = row.sa_projectid
+      this.form.contractname = row.title === ''?'未知':row.title
+      this.visible = false
+    },
+    setChildField (item) {
+      this.childField = item.subvalues
+    },
+    refresh () {
+      this.form = {
+        "sa_orderid": 0,
+        "sys_enterpriseid": 0, //订货企业id,可不传,默认取当前账号的
+        "sa_accountclassid": 0, //营销账户类型ID
+        "sa_brandid": "", //品牌ID
+        "sa_contractid": 0, //合同ID,标准订单不传
+        "sa_projectid": 0, //工程项目表ID,标准订单不传
+        "sys_enterprise_financeid": 0, //合作企业财务信息ID(开票信息)
+        "sa_logiscompid": 0, //物流公司档案ID
+        "rec_contactsid": 0, //合作企业联系人表ID(收货信息)
+        "type": "", //订单类型
+        "typemx": "", //明细分类,可选
+        "remarks": "", //可选
+        "saler_hrid":0,//销售人员hrid,业务员hrid
+        "tradefield":"",//必选
+        "pay_enterpriseid": 0, //结算单位
+        "rebate_used":0,//默认0,是否使用返利金
+        "billdate":"",//单据日期,默认创建日期
+        "signbacknum":""
+      }
+      this.visible1 = false
+    }
+  }
+}
+
+</script>
+<style>
+</style>

+ 57 - 0
src/SDrpManagement/toolBorrowing/modules/confirmDate.vue

@@ -0,0 +1,57 @@
+<template>
+<div>
+    <el-button type="primary" size="mini" @click="onShow(drawer = true)">回复交期</el-button>
+    <el-drawer
+    :visible.sync="drawer"
+    direction="rtl"
+    append-to-body
+    size="80%"
+    :show-close="false"
+    :withHeader="false">
+    <div class="drawer__panel">
+      <tool-list ref="prolist" :data="data" :type="'confirmdate'"></tool-list>
+    </div>
+    <div class="fixed__btn__panel">
+      <el-button size="small" @click="drawer = false" class="normal-btn-width">取 消</el-button>
+      <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">保存修改</el-button>
+    </div>
+  </el-drawer>
+  </div>
+</template>
+
+<script>
+import previewImage from '@/components/previewImage/index.vue'
+import toolList from '../detail/tabs/toolList.vue'
+export default {
+  props:['data'],
+  components:{
+    previewImage,
+    toolList,
+  },
+  data () {
+    return {
+      drawer:false
+    }
+  },
+  methods:{
+    onShow () {
+
+    },
+    async onSubmit () {
+      const res = await this.$api.requested({
+        "id": 20230114152602,
+        "content": {
+          "sa_orderid": this.$route.query.id
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.drawer = false
+        this.$emit('onSuccess')
+      })
+    }
+  }
+}
+
+</script>
+<style>
+</style>

+ 429 - 0
src/SDrpManagement/toolBorrowing/modules/edit.vue

@@ -0,0 +1,429 @@
+<template>
+  <div>
+    <el-button :disabled="data.status !=='新建' && data.status !=='提交'" type="primary" size="mini" @click="onShow(drawer = true)">编 辑</el-button>
+    <el-drawer
+    :visible.sync="drawer"
+    direction="rtl"
+    append-to-body
+    size="80%">
+    <div slot="title">
+      <div class="flex-align-center">
+        <p><span style="font-size:14px">合计:</span><span style="color:red;font-size:16px;"><b>¥&nbsp;{{tool.formatAmount(data.amount,2)}}</b></span></p>
+      </div>
+    </div>
+    <div class="drawer__panel">
+      <div v-if="data.sa_contractid" class="normal-margin">
+        <p class="normal-title mt-10">合同信息</p>
+        <div class="reveive__panel">
+          <p>{{data.contract_title}}</p>
+        </div>
+      </div>
+      <div class="normal-margin">
+        <p class="normal-title mt-10">单据日期</p>
+        <el-date-picker
+          v-model="defaultData.billdate"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择日期"
+          size="mini">
+        </el-date-picker>
+      </div>
+      <div class="flex-align-center normal-margin">
+        <div style="flex:1;margin-right:10px">
+          <div class="mt-10">
+            <p class="normal-title inline-16">收货信息</p>
+            <el-popover
+              placement="bottom"
+              title="选择地址"
+              trigger="click"
+              v-model="visible">
+              <el-table
+                :data="receiveAddresslist"
+                style="width: 100%"
+                size="mini">
+                <el-table-column
+                  prop="name"
+                  label="联系人"
+                  width="90">
+                </el-table-column>
+                <el-table-column
+                  prop="phonenumber"
+                  label="电话"
+                  width="120">
+                </el-table-column>
+                <el-table-column
+                  label="地址"
+                  width="360">
+                  <template slot-scope="scope">
+                    {{scope.row.province}}{{scope.row.city}}{{scope.row.county}}{{scope.row.address}}
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  label="操作"
+                  width="90">
+                  <template slot-scope="scope">
+                    <el-button type="text" @click="(defaultData.re_info = scope.row,visible = false)" size="mini">选 择</el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+              <el-button slot="reference" type="text" size="mini">选择其他地址</el-button>
+            </el-popover>
+          </div>
+          <div class="reveive__panel normal-margin">
+            <p><span class="inline-16"><b>{{defaultData.re_info.name}}</b></span><small>{{defaultData.re_info.phonenumber}}</small></p>
+            <small>{{defaultData.re_info.province}}{{defaultData.re_info.city}}{{defaultData.re_info.county}}{{defaultData.re_info.address?defaultData.re_info.address:'--'}}</small>
+          </div>
+        </div>
+        <div style="flex:1">
+          <div class="mt-10">
+            <p class="normal-title inline-16">选择账户</p>
+            <el-popover
+              placement="bottom"
+              title="选择账户"
+              trigger="click"
+              v-model="visible3">
+              <el-table
+                :data="accountlist"
+                style="width: 100%"
+                size="mini">
+                <el-table-column
+                  prop="accountname"
+                  label="账户名称"
+                  width="120">
+                </el-table-column>
+                <el-table-column
+                  prop="balance"
+                  label="账户余额"
+                  width="120">
+                  <template slot-scope="scope">
+                    ¥{{tool.formatAmount(scope.row.balance,2)}}
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  label="操作"
+                  width="90">
+                  <template slot-scope="scope">
+                    <el-button type="text" @click="(defaultData.accountclass = scope.row,visible3 = false)" size="mini">选 择</el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+              <el-button slot="reference" type="text" size="mini">选择其他账户</el-button>
+            </el-popover>
+          </div>
+          <div class="reveive__panel normal-margin">
+            <p><b>¥{{tool.formatAmount(defaultData.accountclass.balance,2)}}</b></p>
+            <small>{{defaultData.accountclass.accountname}}</small>
+          </div>
+        </div>
+      </div>
+      <div class="mt-10">
+        <p class="normal-title inline-16">选择财务信息</p>
+        <el-popover
+          placement="bottom"
+          title="选择财务信息"
+          trigger="click"
+          v-model="visible2">
+          <el-table
+            :data="financiallist"
+            style="width: 100%"
+            size="mini">
+            <el-table-column
+              prop="enterprisename"
+              label="公司抬头"
+              width="120">
+            </el-table-column>
+            <el-table-column
+              prop="address"
+              label="开票地址"
+              width="120">
+            </el-table-column>
+            <el-table-column
+              prop="bank"
+              label="开户行"
+              width="120">
+            </el-table-column>
+            <el-table-column
+              prop="bankcardno"
+              label="开户账号"
+              width="120">
+            </el-table-column>
+            <el-table-column
+              label="操作"
+              width="90">
+              <template slot-scope="scope">
+                <el-button type="text" @click="(defaultData.fin_info = scope.row,visible2 = false)" size="mini">选 择</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+          <el-button slot="reference" type="text" size="mini">选择其他</el-button>
+        </el-popover>
+      </div>
+      <div class="reveive__panel normal-margin">
+        <p><small>抬头:&nbsp;</small><span class="inline-16"><b>{{defaultData.fin_info.enterprisename}}</b></span></p>
+        <p><small>开票地址:&nbsp;</small>{{defaultData.fin_info.address}}</p>
+        <p><small>开户行:&nbsp;</small> {{defaultData.fin_info.bank}} &emsp;<small>开户账号:&nbsp;</small> {{defaultData.fin_info.bankcardno}}</p>
+      </div>
+      <!-- <div v-if="!data.sa_contractid" class="mt-10">
+        <p class="normal-title inline-16">领域明细</p>
+      </div>
+      <div v-if="!data.sa_contractid" class="mt-10 flex-align-center">
+        <div v-for="item in data.subvalues" :key="item.index" :style="defaultData.tradefieldmx === item?{background:'#d9ecff'}:{background:'#fff'}" class="reveive__panel normal-margin inline-16" @click="defaultData.tradefieldmx = item">
+          <p>{{item}}</p>
+        </div>
+      </div> -->
+      
+      <div class="mt-10">
+        <p class="normal-title inline-16">订单备注</p>
+      </div>
+      <div class="mt-10">
+        <el-input v-model="defaultData.remarks" type="textarea" :autosize="{minRows:5,maxRows:10}" placeholder="请输入订单备注"></el-input>
+      </div>
+      <div v-if="data.sa_contractid" class="normal-margin">
+        <p class="normal-title mt-10">购买套数</p>
+        <el-input-number v-model="defaultData.toolcount" label="购买套数"></el-input-number>
+      </div>
+      <div>
+        <div class="mt-10">
+          <p class="normal-title inline-16">订单产品</p>
+          <el-button v-if="!data.sa_contractid" type="text" size="mini" @click="addMoreProduct">{{setcol === 12?'关闭选择':'添加产品'}}</el-button>
+        </div>
+        <el-row :gutter="10">
+          <el-col :span="setcol">
+            <tool-list ref="prolist" :data="data" :type="data.status === '提交'?'':'edit'" @onSuccess="onDelSuccess"></tool-list>
+          </el-col>
+          <el-col :span="24 - setcol">
+            <add-product ref="addpro" :data="data" @onConfirm="onConfirm"></add-product>
+          </el-col>
+        </el-row>
+      </div>
+    </div>
+    <div class="fixed__btn__panel">
+      <el-button size="small" @click="drawer = false" class="normal-btn-width">取 消</el-button>
+      <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">保存修改</el-button>
+    </div>
+  </el-drawer>
+  </div>
+</template>
+
+<script>
+import previewImage from '@/components/previewImage/index.vue'
+import toolList from '../detail/tabs/toolList.vue'
+import addProduct from '@/template/toolBorrowingCanUseProduct/index.vue'
+export default {
+  props:['data'],
+  components:{
+    previewImage,
+    toolList,
+    addProduct
+  },
+  data () {
+    return {
+      visible:false,
+      visible1:false,
+      visible2:false,
+      visible3:false,
+      drawer:false,
+      receiveAddresslist:[],
+      accountlist:[],
+      logisticcomlist:[],
+      financiallist:[],
+      defaultData:{
+        toolcount:0,
+        re_info:{},
+        logist_info:{},
+        fin_info:{},
+        accountclass:{},
+        account_index:0,
+        remarks:this.data.remarks,
+        freightstatus:'到付',
+        tradefieldmx:'',
+        billdate:''
+      },
+      agnetInfo:{},
+      total:0,
+      setcol:24
+    }
+  },
+  methods:{
+    onShow () {
+      this.queryAgentiInfo()
+      this.defaultData.freightstatus = this.data.freightstatus
+      this.defaultData.tradefieldmx = this.data.tradefieldmx
+      this.defaultData.billdate = this.data.billdate
+      this.defaultData.toolcount = this.data.toolcount
+    },
+    async queryAgentiInfo () {
+      const res = await this.$api.requested({
+        "id": "20221022165203",
+        "content": {
+          sys_enterpriseid:this.data.sys_enterpriseid
+        }
+      })
+      this.agnetInfo = res.data
+
+      this.receiveAddress()
+
+      this.queryAccount()
+
+      this.queryLogisticcom()
+
+      this.queryFinancial()
+    },
+    // 收货信息:合作企业联系人
+    async receiveAddress () {
+      const res = await this.$api.requested({
+        "id": "20221009155803",
+        "content": {
+        "sys_enterpriseid":this.agnetInfo.sys_enterpriseid,
+          "where":{
+            "condition":"",
+            "workaddress":0
+          }
+        }
+      })
+      this.receiveAddresslist = res.data
+      this.defaultData.re_info = res.data[0]
+    },
+
+    // 账号信息
+    async queryAccount () {
+      const res = await this.$api.requested({
+        "id": "20221008134803",
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 100,
+          "where":{
+            "isused":1
+          }
+        }
+      })
+      this.accountlist = res.data
+      this.defaultData.accountclass = this.data.accountclass
+    },
+
+    // 物流企业
+    async queryLogisticcom () {
+      const res = await this.$api.requested({
+        "id": "20221121135804",
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 100
+        }
+      })
+      this.logisticcomlist = res.data
+      this.defaultData.logist_info = this.data.logiscomp
+    },
+    // 财务信息
+    async queryFinancial () {
+      const res = await this.$api.requested({
+        "id": "20221013160602",
+        "content": {
+          "sys_enterpriseid":this.agnetInfo.sys_enterpriseid,
+          "pageNumber": 1,
+          "pageSize": 100
+        }
+      })
+      this.financiallist = res.data
+      this.defaultData.fin_info = this.data.finance
+    },
+    async onSubmit() {
+      const res = await this.$api.requested({
+        "id": 20230116092702,
+        "content": {
+          "sa_orderid": this.$route.query.id,
+          "sys_enterpriseid": this.data.sys_enterpriseid, //订货企业id
+          "sa_accountclassid": this.defaultData.accountclass.sa_accountclassid, //营销账户类型ID
+          "sa_brandid": this.data.sa_brandid, //品牌ID
+          "sa_contractid":this.data.sa_contractid, //合同ID,标准订单不传
+          "sa_projectid": this.data.sa_projectid, //工程项目表ID,标准订单不传
+          "sys_enterprise_financeid": this.defaultData.fin_info.sys_enterprise_financeid, //合作企业财务信息ID(开票信息)
+          "sa_logiscompid": this.defaultData.logist_info.sa_logiscompid, //物流公司档案ID
+          "rec_contactsid": this.defaultData.re_info.contactsid, //合作企业联系人表ID(收货信息)
+          "type": this.data.type, //订单类型
+          "typemx":this.data.typemx, //明细分类,可选
+          "remarks": this.defaultData.remarks, //可选
+          // "saler_hrid":this.data.saler_hrid//销售人员hrid,业务员hrid
+          "pay_enterpriseid":this.data.pay_enterpriseid,
+          "tradefield":this.data.tradefield,
+          "freightstatus":this.defaultData.freightstatus,
+          "billdate":this.defaultData.billdate,
+          "toolcount":this.defaultData.toolcount,
+        },
+      })
+      this.tool.showMessage(res,()=>{
+        console.log(this.data)
+        this.$emit('onSuccess')
+        // this.onConfirm()
+        this.drawer = false
+      })
+    },
+    onDelSuccess () {
+      this.$refs.addpro.listData()
+    },
+    addMoreProduct () {
+      this.setcol === 12?this.setcol = 24 : this.setcol = 12
+    },
+    // 订单添加商品
+    async onConfirm (data) {
+      const res = await this.$api.requested({
+        "id": 20221109093602,
+        "content": {
+          "sa_orderid": this.$route.query.id, //订单ID
+          "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
+          "type": "标准订单", //订单类型
+          "items": data.map(e=>{
+            return {
+              sa_orderitemsid:0,
+              itemid:e.itemid,
+              qty:e.orderminqty,
+              needdate:e.deliverydate
+            }
+          })
+        },
+      })
+      this.tool.showMessage(res,()=>{
+        this.setcol = 24
+        this.$refs['prolist'].listData()
+      })
+    }
+  },
+  mounted () {
+  }
+}
+
+</script>
+<style>
+</style>
+<style scoped>
+.reveive__panel{
+  font-size: 14px;
+  line-height: 30px;
+  padding: 10px;
+  background: #d9ecff;
+  border: 1px dashed #0676e7;
+  cursor: pointer;
+}
+.account__panel small,.reveive__panel small{
+  color:#666
+}
+.account__panel{
+  width: calc(25% - 26px);
+  padding: 10px;
+  margin-bottom:10px;
+  border: 1px dashed #666;
+}
+.act{
+  background: #d9ecff;
+  border: 1px dashed #0676e7;
+}
+.image {
+  width:40px;height:40px;margin:0px auto;
+}
+.order__note__input{
+  border: none;
+  outline: none;
+  /* margin-left: 10px; */
+  /* border-bottom: 1px solid #f1f2f3; */
+  flex:1
+}
+</style>

+ 0 - 266
src/SDrpManagement/toolBorrowingAgent/detail/index.vue

@@ -1,266 +0,0 @@
-<template>
-  <div>
-    <basicDetails
-      ref="details"
-      :titleText="`单号:${mainData.sonum}`"
-      :oldFormPath="{edit:'SDrpManagement/toolBorrowingAgent/modules'}"
-      :editData="mainData"
-      :mainAreaData="mainAreaData"
-      turnPageId="20230114105002"
-      idname="sa_orderid"
-      ownertable="sa_order"
-      delApiId="20230116100002"
-      :statusCheck="[{key:'status',value:'审核'},{key:'status',value:'交期待确认'},{key:'status',value:'提交'},{key:'status',value:'交期确认'}]"
-      :tabs="['借用单明细']"
-      @pageChange="pageChange"
-      @onEditSuccess="queryMainData($route.query.id)">
-      <div slot="customOperation" class="inline-16">
-          <el-button v-if="tool.checkAuth($route.name,'confirmDate')" :disabled="mainData.status !== '交期待确认'" class="inline-16"  type="primary" size="mini" @click="confirmdate">确认交期</el-button>
-          <confirmDate v-if="tool.checkAuth($route.name,'replyDate')" class="inline-16" :data="mainData" @onSuccess="queryMainData"></confirmDate>
-          <el-popover
-            placement="top"
-            v-model="visible">
-            <p  class="mt-10 normal-title">选择评审类型</p>
-            <el-select class="mt-10" v-model="value" placeholder="请选择" size="mini">
-              <el-option
-                v-for="item in options"
-                :key="item.value"
-                :label="item.value"
-                :value="item.value">
-              </el-option>
-            </el-select>
-            <div style="text-align: right; margin: 0">
-              <el-button size="mini" type="text" @click="visible = false">取消</el-button>
-              <el-button  type="primary" size="mini" @click="onSubmit('审核')">确定</el-button>
-            </div>
-            <el-button class="inline-16" v-if="tool.checkAuth($route.name,'examine')"  :disabled="mainData.status !== '提交' && mainData.status !== '交期确认'" type="primary" size="mini" slot="reference">审 核</el-button>
-          </el-popover>
-          
-          <el-button v-if="tool.checkAuth($route.name,'examine')" :disabled="mainData.status !== '审核'" type="primary" size="mini" @click="onReturnCheck">反审核</el-button>
-          <el-button v-if="tool.checkAuth($route.name,'reback')"  type="primary" size="mini" @click="dialogVisible = true">退 回</el-button>
-          <el-button v-if="tool.checkAuth($route.name,'submit')" :disabled="mainData.status !== '新建'"  type="primary" size="mini" @click="onSubmit('提交')">提 交</el-button>
-          <!-- <el-button v-if="tool.checkAuth($route.name,'close')" :disabled="mainData.status !== '审核'" type="primary" size="mini" @click="closeOrder">关 闭</el-button> -->
-          <!-- <el-button v-if="tool.checkAuth($route.name,'insert')"  type="primary" size="mini" @click="onCopy">复 制</el-button> -->
-      </div>
-      <div slot="slot0" >
-        <toolList></toolList>
-      </div>
-      <div slot="slot1" >
-      </div>
-    </basicDetails>
-    <el-dialog append-to-body title="退回原因" :visible.sync="dialogVisible" width="400px">
-      <el-input v-model="backreason" type="textarea" placeholder="请输入退回原因"></el-input>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false" size="small">取 消</el-button>
-        <el-button type="primary" @click="onRebanck" size="small">确 定</el-button>
-      </span>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import toolList from './tabs/toolList.vue'
-import confirmDate from '../modules/confirmDate.vue'
-
-export default {
-  name: "detail",
-  data() {
-    return {
-      mainData:{},
-      mainAreaData:{},
-      backreason:'',
-      options:[],
-      dialogVisible:false,
-      visible:false,
-      value:''
-    }
-  },
-  components:{
-    toolList,
-    confirmDate
-  },
-  methods:{
-    async orderreviewtype () {
-      const res = await this.$store.dispatch('optiontypeselect','orderreviewtype')
-      this.options = res.data
-      this.value = res.data[0].value
-    },
-    async queryMainData(id) {
-      const res = await this.$api.requested({
-        "id":20230114140402,
-        "content": {
-          "sa_orderid": this.$route.query.id
-        }
-      })
-      this.mainData = res.data
-      this.changeDataStructure()
-      this.orderreviewtype()
-    },
-    changeDataStructure() {
-      this.mainAreaData = [
-        {
-          label:'单据日期',
-          value:this.mainData.billdate
-        },
-        {
-          label:'经销商',
-          value:this.mainData.enterprisename
-        },
-        {
-          label:'状态',
-          value:this.mainData.status
-        },
-        {
-          label:'合同',
-          value:this.mainData.contract_title?this.mainData.contract_title:'无合同'
-        },
-        {
-          label:'合计数量',
-          value:this.mainData.qty * this.mainData.toolcount
-        },
-        {
-          label:'金额',
-          value:this.mainData.amount
-        },
-        {
-          label:'收货人',
-          value:this.mainData.name
-        },
-        {
-          label:'收货地址',
-          value:this.mainData.province + this.mainData.city + this.mainData.county + this.mainData.address
-        },
-        {
-          label:'审核日期',
-          value:this.mainData.checkdate
-        },
-        {
-          label:'备注',
-          value:this.mainData.remarks
-        }
-      ]
-    },
-    // 监听切换数据,上一页,下一页
-    pageChange (id,rowindex,tabIndex) {
-      this.flag = false
-      tabIndex = this.$route.query.tabIndex
-      this.$router.replace({path:'/customerDetail',query:{id:id,rowindex:rowindex,tabIndex:tabIndex}})
-      this.queryMainData(id)
-    },
-    onSuccess(){
-      this.visible = false
-      this.queryMainData(this.$route.query.id)
-      this.$emit('onSuccess')
-    },
-    // 提交审核订单
-    onSubmit (type) {
-      this.$confirm(`是否${type}该订单`, '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(async () => {
-        const res = await this.$api.requested({
-          "id": type === '审核'?20230114161402:20230114160002,
-          "content": {
-            "sa_orderid": this.mainData.sa_orderid,
-            "sys_enterpriseid": this.mainData.sys_enterpriseid,
-            "sa_accountclassid": this.mainData.accountclass.sa_accountclassid,
-            "reviewtype":type === '审核'?this.value:''
-          },
-        })
-        this.tool.showMessage(res,async ()=>{
-          this.visible = false
-          this.queryMainData()
-        })
-      }).catch((err) => {
-        this.$message({
-          type: 'info',
-          message: '取消提交'
-        });          
-      });
-    },
-    // 反审核订单
-    onReturnCheck () {
-      this.$confirm(`是否反审核该订单`, '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(async () => {
-        const res = await this.$api.requested({
-          "id": 20230114161502,
-          "content": {
-            "sa_orderid": this.mainData.sa_orderid,
-          },
-        })
-        this.tool.showMessage(res,()=>{
-          this.$store.dispatch('changeDetailDrawer',false)
-        })
-      }).catch((err) => {
-        this.$message({
-          type: 'info',
-          message: err
-        });          
-      });
-    },
-    async onRebanck () {
-      const res = await this.$api.requested({
-        "id": 20230116085902,
-        "content": {
-          "sys_enterpriseid":this.mainData.sys_enterpriseid,
-          "sa_accountclassid":this.mainData.accountclass.sa_accountclassid,
-          "sa_orderid": this.mainData.sa_orderid,
-          "backreason": this.backreason //退回原因,可选
-        },
-      })
-      this.tool.showMessage(res,()=>{
-        this.queryMainData()
-        this.dialogVisible = false
-        this.$store.dispatch('changeDetailDrawer',false)
-      })
-    },
-    async closeOrder () {
-      const res = await this.$api.requested({
-        "id": 20221108164502,
-        "content": {
-          "sa_orderids":[this.$route.query.id]
-        },
-      })
-      this.tool.showMessage(res,()=>{
-        this.queryMainData()
-        this.dialogVisible = false
-      })
-    },
-    async confirmdate () {
-      const res = await this.$api.requested({
-        "id": 20230129154102,
-        "content": {
-          "sa_orderid": this.$route.query.id
-        }
-      })
-      this.tool.showMessage(res,()=>{
-        this.queryMainData()
-      })
-    },
-    async onCopy () {
-      const res = await this.$api.requested({
-        "id": 20230102144502,
-        "content": {
-          "sa_orderid": this.$route.query.id
-        }
-      })
-      this.tool.showMessage(res,()=>{
-        this.tool.showMessage(res)
-      })
-    },
-  },
-  mounted () {
-    this.queryMainData(this.$route.query.id)
-  },
-  created() {
-  }
-}
-</script>
-
-<style scoped>
-
-</style>

+ 2 - 2
src/components/normal-basic-layout/details/index.vue

@@ -50,7 +50,7 @@
           <taskTemp v-if="activeApp.isdatateam" :ownertable="ownertable?ownertable:idname.slice(0, this.idname.length - 2)">
             <el-button slot="collapse" type="text" icon="el-icon-s-unfold" class="inline-16" @click="onCollapse"></el-button>
           </taskTemp>
-          <group v-if="activeApp.isdatateam" ref="group" style="margin-bottom:10px" :ownertable="ownertable?ownertable:idname.slice(0, this.idname.length - 2)" @onSuccess="onSuccess">
+          <group v-if="activeApp.isdatateam" ref="group" style="margin-bottom:10px" :justsaler="justsaler" :ownertable="ownertable?ownertable:idname.slice(0, this.idname.length - 2)" @onSuccess="onSuccess">
             <el-button slot="collapse" type="text" icon="el-icon-s-unfold" class="inline-16" @click="onCollapse"></el-button>
           </group>
           <follow-up v-if="activeApp.isdatafollowup" ref="follow" :ownertable="ownertable?ownertable:idname.slice(0, this.idname.length - 2)">
@@ -77,7 +77,7 @@ import taskTemp from './modules/task/index.vue'
 import reportCenter from '../reportCenter/index'
 import {mapGetters} from 'vuex'
 export default {
-  props:['titleText','mainAreaData','turnPageId','delApiId','idname','ownertable','formPath','oldFormPath','editData','tags','tabs','statusCheck','pageChange'],
+  props:['titleText','mainAreaData','turnPageId','delApiId','idname','ownertable','formPath','oldFormPath','editData','tags','tabs','statusCheck','pageChange','justsaler'],
   data () {
     return {
       routerName:'',

+ 3 - 1
src/components/normal-basic-layout/details/modules/group/group.vue

@@ -63,7 +63,7 @@
 <script>
 import member from '@/template/menber/index.vue'
 export default {
-  props:['ownertable'],
+  props:['ownertable','justsaler'],
   components:{
     member
   },
@@ -86,6 +86,7 @@ export default {
           "ownerid":this.$route.query.id,
           "pageSize":20,
           "where":{
+            "justsaler":0,
             "condition":"",
             "withoutselect":0,
           }
@@ -97,6 +98,7 @@ export default {
   },
   methods:{
     async queryGroup () {
+      this.param.content.justsaler = this.justsaler?this.justsaler:0
       const res = await this.$api.requested({
         "id": 20220930103501,
         "content": {

+ 2 - 2
src/main.js

@@ -27,8 +27,8 @@ import tagPanl from '@/components/tagPanl/tagPanl'
 
 import sort from './components/sort'
 import '@/style/theme/font-icon/iconfont.css'
-import {hiPrintPlugin} from './index'
-Vue.use(hiPrintPlugin)
+// import {hiPrintPlugin} from './index'
+// Vue.use(hiPrintPlugin)
 Vue.prototype.$api = api
 
 Vue.prototype.$baseUrl = 'http://61.164.207.46:8000'

+ 40 - 9
src/router/SDrpManagement.js

@@ -169,27 +169,58 @@ const SDrpManagement = [
     ]
   },
   {
-    path: '/toolBorrowingAgent',
-    name:'toolBorrowingAgent',
+    path: '/toolBorrowing',
+    name:'toolBorrowing',
     meta: {
-      title: '工具借用单(经)',
+      title: '工具借用',
       ast_nav: true,
       keeproute: true,
     },
-    component: () => import(/* webpackChunkName: "about" */ '@/SDrpManagement/toolBorrowingAgent/index'),
+    component: () => import(/* webpackChunkName: "about" */ '@/SDrpManagement/toolBorrowing/index'),
     children: [
       {
-        path: '/toolBorrowingAgentDetail',
-        name:'toolBorrowingAgent',
+        path: '/toolBorrowingDetail',
+        name:'toolBorrowing',
         meta: {
-          title: '工具借用',
+          title: '工具借用',
           ast_nav: true,
           keeproute: true,
         },
-        component: () => import(/* webpackChunkName: "about" */ '@/SDrpManagement/toolBorrowingAgent/detail')
+        component: () => import(/* webpackChunkName: "about" */ '@/SDrpManagement/toolBorrowing/detail')
       },
     ]
   },
-
+  {
+    path: '/toolBorrowing_saler',
+    name:'toolBorrowing_saler',
+    meta: {
+      title: '工具借用',
+      ast_nav: true,
+      keeproute: true,
+    },
+    component: () => import(/* webpackChunkName: "about" */ '@/SDrpManagement/salerToolBorrowing/index'),
+    children: [
+      {
+        path: '/toolBorrowing_salerDetail',
+        name:'toolBorrowing_saler',
+        meta: {
+          title: '工具借用',
+          ast_nav: true,
+          keeproute: true,
+        },
+        component: () => import(/* webpackChunkName: "about" */ '@/SDrpManagement/salerToolBorrowing/detail')
+      },
+    ]
+  },
+  {
+    path: '/performanceGoals',
+    name:'performanceGoals',
+    meta: {
+      title: '工具借用',
+      ast_nav: true,
+      keeproute: true,
+    },
+    component: () => import(/* webpackChunkName: "about" */ '@/SDrpManagement/performanceGoals/index')
+  },
 ]
 export default SDrpManagement

+ 4 - 1
src/views/login/login.vue

@@ -140,7 +140,10 @@ export default {
         sessionStorage.setItem('account_list',JSON.stringify(res.account_list))
 
         sessionStorage.setItem('active_account',JSON.stringify(res.account_list[0]))
-        this.$router.push('/main')
+        this.basicData.query_userauth().then(()=>{
+          this.basicData.querySite_Parameter()
+          this.$router.push({path:'/main'})
+        })
       } else {
         this.$notify({
           title: '失败',