123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498 |
- <template>
- <div class="BidsList">
- <FullPage
- title="深化单"
- :list="set_list"
- @init="init"
- :loading="loading"
- @searchData="init"
- @selectTable="selectTable"
- @changePage="changePage"
- @changeSize="changeSize"
- :tableColums="tableColums"
- :showPage="false"
- :tableData="tableData"
- :page_index="page_index"
- :total="total"
- >
- <div slot="titleButton" style="display: flex">
- <Upload
- name="your_file"
- :show-upload-list="false"
- :headers="headers"
- :on-error="uploadError"
- :on-success="uploadSuccess"
- :action="$store.state.ip + '/api/order_area_product_import'"
- >
- <Button type="success" ghost icon="md-exit" style="margin-right: 10px"
- >导入</Button
- >
- </Upload>
- <Button
- @click="exportData"
- type="warning"
- ghost
- icon="md-return-left"
- style="margin-right: 10px"
- >导出</Button
- >
- </div>
- <!-- <div slot='navButton'
- style="display:flex;">
- <Button v-if='persimissionData["表头设置"]||persimissionData.all'
- @click="setupTableHeader"
- type="primary"
- ghost
- icon='ios-cog'>表头设置</Button>
- </div> -->
- <template slot="basicTypeSet" slot-scope="{ row }">
- <div>
- <span
- v-for="item in warningList"
- :key="item.id"
- :style="{ color: item.color }"
- v-show="item.id == row.warning_state"
- >{{ item.title }}</span
- >
- </div>
- </template>
- <template slot="set" slot-scope="{ row, index }">
- <div>
- <a
- style="margin: 0 5px"
- :disabled="row.sub_status != 1"
- @click="handleSet(row, index, 1)"
- >下拆单</a
- >
- <a
- style="margin: 0 5px"
- :disabled="row.sub_status != 1"
- @click="handleSet(row, index, 2)"
- >编辑</a
- >
- <a style="margin: 0 5px" @click="handleSet(row, index, 3)">详情</a>
- <a
- style="margin: 0 5px"
- :disabled="row.sub_status != 1"
- @click="handleSet(row, index, 4)"
- >变更</a
- >
- <a
- style="margin: 0 5px; color: orange"
- @click="handleSet(row, index, 5)"
- >变更记录</a
- >
- <a style="margin: 0 5px" @click="handleSet(row, index, 6)"
- >数据对比</a
- >
- </div>
- </template>
- <template slot="pageSlot">
- <div class="pageSlotStyle">
- <Page
- :page-size-opts="[10, 20, 30, 40, 100, 1000]"
- @on-page-size-change="changeSize"
- @on-change="changePage"
- :current="page_index"
- show-total
- :total="total"
- show-sizer
- :page-size="page_size"
- />
- </div>
- </template>
- </FullPage>
- <Modal v-model="processModal" title="确认?">
- <div>
- <div class="process_modal">
- <span>拆单人员:</span>
- <Select v-model="process_man" style="width: 150px">
- <Option
- v-for="item in processManList"
- :key="item.id"
- :label="item.nickname"
- :value="item.id"
- ></Option>
- </Select>
- </div>
- <div class="process_modal">
- <span>选择时间:</span>
- <DatePicker
- type="date"
- v-model="process_start_time"
- placeholder="年/月/日"
- style="width: 150px"
- ></DatePicker>
- 至
- <DatePicker
- type="date"
- v-model="process_end_time"
- placeholder="年/月/日"
- style="width: 150px"
- ></DatePicker>
- </div>
- </div>
- <div slot="footer">
- <Button
- @click="processModal = false"
- type="primary"
- style="margin-right: 10px"
- >取消</Button
- >
- <Button @click="handleProcess" type="primary" style="margin-right: 10px"
- >确定</Button
- >
- </div>
- </Modal>
- </div>
- </template>
- <script>
- // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
- // 例如:import 《组件名称》 from '《组件路径》';
- export default {
- name: "BidSystemContractList",
- data() {
- // 这里存放数据
- return {
- tableColums: [
- {
- type: "selection",
- align: "center",
- key: "selection",
- minWidth: 100,
- fixed: "left",
- title: "全选",
- },
- { title: "订单号", align: "center", key: "order_no", minWidth: 150 },
- {
- title: "小区名称",
- align: "center",
- key: "residential_name",
- minWidth: 120,
- },
- { title: "详细地址", align: "center", key: "address", minWidth: 200 },
- // {
- // title: '订单类型', align: 'center', key: 'renovation_type', minWidth: 100,
- // render: (h, params) => h('span', {}, params.row.renovation_type == 1 ? '工装' : '家装')
- // },
- {
- title: "客户姓名",
- align: "center",
- key: "client_name",
- minWidth: 120,
- },
- { title: "手机号", align: "center", key: "mobile", minWidth: 150 },
- {
- title: "紧急程度",
- align: "center",
- key: "warning_state",
- minWidth: 100,
- slot: "basicTypeSet",
- },
- {
- title: "收款",
- align: "center",
- key: "pay_state",
- minWidth: 80,
- render: (h, params) =>
- h("span", {}, params.row.pay_state == 1 ? "已收款" : "未收款"),
- },
- { title: "业务员", align: "center", key: "salesman", minWidth: 100 },
- {
- title: "开始日期",
- align: "center",
- key: "start_time",
- minWidth: 150,
- render: (h, params) =>
- h("span", {}, this.func.replaceDateNoHMS(params.row.start_time)),
- },
- {
- title: "交付日期",
- align: "center",
- key: "end_time",
- minWidth: 150,
- render: (h, params) =>
- h("span", {}, this.func.replaceDateNoHMS(params.row.end_time)),
- },
- {
- title: "订单状态",
- align: "center",
- key: "state",
- minWidth: 100,
- render: (h, params) =>
- h(
- "span",
- {},
- params.row.state == 0
- ? "待审核"
- : params.row.warning_state == 1
- ? "待拆单"
- : params.row.warning_state == 2
- ? "待生产"
- : "已完成"
- ),
- },
- {
- title: "下单日期",
- align: "center",
- key: "crt_time",
- minWidth: 150,
- render: (h, params) =>
- h("span", {}, this.func.replaceDateNoHMS(params.row.crt_time)),
- },
- {
- title: "操作",
- align: "center",
- key: "set",
- slot: "set",
- fixed: "right",
- minWidth: 350,
- fixed: "right",
- },
- ],
- tableData: [],
- page_index: 1,
- page_size: 10,
- total: 0,
- loading: false,
- proxyObj: {},
- headers: { Authorization: localStorage.getItem("token") },
- selects: [],
- processModal: false,
- process_man: "",
- processManList: [],
- process_start_time: "",
- process_end_time: "",
- order_no: "",
- warningList: [],
- };
- },
- // 生命周期 - 创建完成(可以访问当前this实例)
- created() {
- // 获取紧急程度
- this.axios.get("/api/warning_list").then((res) => {
- this.warningList = res.data.data;
- });
- // 获取用户列表
- this.axios({ method: "get", url: "/api/user" }).then((res) => {
- this.processManList = res.data.data;
- });
- },
- // 生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {},
- methods: {
- handleProcess() {
- if (
- this.process_man &&
- this.process_end_time &&
- this.process_start_time
- ) {
- this.axios({
- method: "get",
- url: "/api/order_area_pull",
- params: {
- order_no: this.order_no,
- sub_status: 2,
- process_man: this.process_man,
- process_start_time: this.func.replaceDateNoHMS(
- this.process_start_time
- ),
- process_end_time: this.func.replaceDateNoHMS(this.process_end_time),
- },
- }).then((res) => {
- this.$Message.success(res.msg);
- this.getData(this.proxyObj);
- });
- } else {
- this.$Message.warning("信息请填写完整");
- }
- },
- //1下拆单 2编辑 3详情 4变更 5变更记录 6数据对比
- handleSet(row, index, type) {
- switch (type) {
- case 1:
- this.processModal = true;
- this.order_no = row.order_no;
- // this.$Modal.confirm({
- // title: '确认拆单?',
- // content: '确认后订单将下至拆单,请确认!',
- // onOk: () => {
- // this.axios({
- // method: 'get',
- // url: '/api/order_area_pull',
- // params: {
- // order_no: row.order_no,
- // sub_status:2
- // }
- // }).then((res) => {
- // this.$Message.success(res.msg)
- // this.getData(this.proxyObj)
- // }).catch((err) => {
- // });
- // },
- // onCancel: () => {}
- // })
- break;
- // 转详情页
- case 2:
- case 3:
- this.$router.push({
- path: "/cms/BidSystem/DeepeningOrder/detail",
- query: {
- type,
- order_no: row.order_no,
- },
- });
- break;
- case 4:
- break;
- case 5:
- break;
- case 6:
- this.$router.push({
- path: "/cms/BidSystem/DeepeningOrder/compare",
- query: {
- type,
- order_no: row.order_no,
- },
- });
- break;
- }
- },
- init(row) {
- this.page_index = 1;
- //1 深化
- row.sub_status = 1;
- row.page_index = this.page_index;
- row.page_size = this.page_size;
- this.proxyObj = row;
- this.getData(row);
- },
- getData(row) {
- this.loading = true;
- this.axios("/api/order_area", { params: row }).then((res) => {
- this.loading = false;
- this.tableData = res.data.data;
- this.total = res.data.total;
- this.tableheaders = res.data.tableSet || [];
- });
- },
- changePage(e) {
- this.page_index = e;
- this.proxyObj.page_index = this.page_index;
- this.getData(this.proxyObj);
- },
- changeSize(e) {
- this.page_size = e;
- this.proxyObj.page_size = this.page_size;
- this.getData(this.proxyObj);
- },
- async exportData() {
- const res = await this.axios("/api/measure_orders_export", {
- params: { ...this.proxyObj },
- });
- if (res.code == 200) {
- let url = `${this.$store.state.ip}/api/storage/${res.data.file}`;
- location.href = url;
- }
- },
- uploadSuccess(res) {
- if (res.code == 200) {
- this.$Message.success(res.msg || "上传成功");
- } else {
- this.$Message.warning(res.msg || "上传失败");
- }
- this.getData(this.proxyObj);
- },
- uploadError(err) {
- this.$Message.error(err.msg || "上传失败");
- },
- selectTable(e) {
- this.selects = e;
- },
- },
- // 监听属性 类似于data概念
- computed: {
- set_list() {
- return [
- {
- title: "订单编号",
- serverName: "order_no",
- name: "Input",
- value: "",
- placeholder: "请输入订单号",
- },
- {
- title: "小区名字",
- name: "Input",
- placeholder: "请输入",
- value: "",
- serverName: "residential_name",
- },
- {
- title: "客户昵称",
- name: "Input",
- placeholder: "请输入",
- value: "",
- serverName: "client_name",
- },
- {
- title: "手机号",
- name: "Input",
- placeholder: "请输入",
- value: "",
- serverName: "mobile",
- },
- {
- title: "订单状态",
- name: "Select",
- placeholder: "请选择",
- serverName: "state",
- value: "",
- option: [
- { label: "待审核", value: 0 },
- { label: "待拆单", value: 1 },
- { label: "待生产", value: 2 },
- { label: "已完成", value: 3 },
- ],
- },
- {
- title: "紧急程度",
- name: "Select",
- serverName: "warning_state",
- placeholder: "请选择",
- value: "",
- optionName: "title",
- optionValue: "id",
- option: this.warningList,
- },
- ];
- },
- },
- // 监控data中的数据变化
- watch: {},
- beforeCreate() {}, // 生命周期 - 创建之前
- beforeMount() {}, // 生命周期 - 挂载之前
- beforeUpdate() {}, // 生命周期 - 更新之前
- updated() {}, // 生命周期 - 更新之后
- beforeDestroy() {}, // 生命周期 - 销毁之前
- destroyed() {}, // 生命周期 - 销毁完成
- activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
- };
- </script>
- <style lang='scss' scoped>
- .pageSlotStyle {
- display: flex;
- justify-content: center;
- margin-top: 40px;
- }
- .process_modal {
- display: flex;
- justify-content: center;
- align-items: center;
- padding: 10px;
- }
- </style>
|