2024-04-02 12:24:08 +08:00
|
|
|
import 'package:flutter/material.dart';
|
2024-04-01 17:35:34 +08:00
|
|
|
import 'package:get/get.dart';
|
2024-04-02 12:24:08 +08:00
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
|
|
|
import 'package:sk_base_mobile/models/base_search_more.dart';
|
2024-04-01 17:35:34 +08:00
|
|
|
import 'package:sk_base_mobile/models/sale_quotation.model.dart';
|
2024-04-02 12:24:08 +08:00
|
|
|
import 'package:sk_base_mobile/screens/sale_quotation/components/sale_quotation_group_search.dart';
|
|
|
|
import 'package:sk_base_mobile/widgets/core/sk_single_search_more.dart';
|
|
|
|
import 'package:sk_base_mobile/util/modal.util.dart';
|
|
|
|
import 'package:sk_base_mobile/util/screen_adaper_util.dart';
|
2024-04-01 17:35:34 +08:00
|
|
|
|
|
|
|
class SaleQuotationController extends GetxController {
|
|
|
|
static SaleQuotationController get to => Get.find();
|
|
|
|
final RxList editingcell = RxList([null, null, null]);
|
|
|
|
RxList<SaleQuotationItemModel> products = RxList([
|
|
|
|
SaleQuotationItemModel(name: '矿用本安型支架控制器', unit: '台', spec: 'ZDYZ-Z'),
|
|
|
|
SaleQuotationItemModel(name: '矿用本安型电磁阀驱动器'),
|
|
|
|
SaleQuotationItemModel(name: '矿用隔爆兼本安型电源'),
|
|
|
|
SaleQuotationItemModel(name: '矿用本安型隔离耦合器'),
|
|
|
|
SaleQuotationItemModel(name: '钢丝编织橡胶护套连接器'),
|
|
|
|
SaleQuotationItemModel(name: '钢丝编织橡胶护套连接器', remark: '控制器-控制器'),
|
|
|
|
SaleQuotationItemModel(name: '钢丝编织橡胶护套连接器', remark: '控制器-驱动器'),
|
|
|
|
SaleQuotationItemModel(name: '钢丝编织橡胶护套连接器', remark: '控制器-隔离耦合器'),
|
|
|
|
SaleQuotationItemModel(name: '矿用本安型支架无线遥控器'),
|
|
|
|
SaleQuotationItemModel(name: '矿用隔爆兼本安型电源'),
|
|
|
|
SaleQuotationItemModel(name: '电液换向阀(10功能10接口)', remark: '中间过渡架主阀组'),
|
|
|
|
SaleQuotationItemModel(name: '电液换向阀(20功能20接口)', remark: '端头架主阀组'),
|
|
|
|
SaleQuotationItemModel(name: '自动反冲洗过滤装置', remark: '流量:900L/min,过滤精度25μm'),
|
|
|
|
SaleQuotationItemModel(name: '全自动反冲洗过滤器电缆', remark: '控制器-自动反冲洗'),
|
|
|
|
SaleQuotationItemModel(name: '矿用本安型位移传感器'),
|
|
|
|
SaleQuotationItemModel(name: '矿用本安型压力传感器'),
|
|
|
|
SaleQuotationItemModel(name: '矿用本安型红外发射器'),
|
|
|
|
SaleQuotationItemModel(name: '矿用本安型LED信号灯'),
|
|
|
|
SaleQuotationItemModel(name: '倾角传感器'),
|
|
|
|
SaleQuotationItemModel(name: '各类安装附件'),
|
|
|
|
]);
|
|
|
|
RxList<SaleQuotationModel> groups = RxList<SaleQuotationModel>([]);
|
2024-04-02 12:24:08 +08:00
|
|
|
|
2024-04-01 17:35:34 +08:00
|
|
|
@override
|
|
|
|
void onReady() {
|
2024-04-02 12:24:08 +08:00
|
|
|
// groups.assignAll();
|
|
|
|
// SaleQuotationModel(name: '中间过渡架电控部分', items: products),
|
|
|
|
// SaleQuotationModel(name: '端头架电控部分', items: products),
|
|
|
|
// SaleQuotationModel(name: '主阀部分', items: products),
|
|
|
|
// SaleQuotationModel(name: '自动反冲洗过滤器部分', items: products),
|
|
|
|
// SaleQuotationModel(name: '位移测量部分', items: products),
|
|
|
|
// SaleQuotationModel(name: '压力检测部分', items: products),
|
|
|
|
// SaleQuotationModel(name: '煤机定位部分', items: products),
|
|
|
|
// SaleQuotationModel(name: '姿态检测部分', items: products),
|
2024-04-01 17:35:34 +08:00
|
|
|
super.onReady();
|
|
|
|
}
|
2024-04-02 12:24:08 +08:00
|
|
|
|
|
|
|
Future<void> addGroup() async {
|
|
|
|
final controller = Get.put(GroupSearchMoreController());
|
|
|
|
// 选择组件 选择分组
|
|
|
|
ModalUtil.showGeneralDialog(
|
|
|
|
content: SkSingleSearchMore<SaleQuotationModel>(
|
|
|
|
controller: controller,
|
|
|
|
enablePullUp: false,
|
|
|
|
enablePullDown: true,
|
|
|
|
itemBuilder: (_, index) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
Get.back();
|
|
|
|
groups.add(controller.list[index]);
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenAdaper.width(5),
|
|
|
|
vertical: ScreenAdaper.height(10)),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
controller.list[index].name,
|
|
|
|
style: TextStyle(fontSize: ScreenAdaper.height(25)),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
));
|
|
|
|
},
|
|
|
|
),
|
|
|
|
width: Get.width - ScreenAdaper.width(50))
|
|
|
|
.then((value) => Get.delete<GroupSearchController>());
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> removeGroup(int index) async {
|
|
|
|
groups.removeAt(index);
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> addItems() async {
|
|
|
|
final controller = Get.put(ItemSearchMoreController());
|
|
|
|
// 选择产品
|
|
|
|
ModalUtil.showGeneralDialog(
|
|
|
|
content: SkSingleSearchMore<SaleQuotationItemModel>(
|
|
|
|
controller: controller,
|
|
|
|
enablePullUp: false,
|
|
|
|
enablePullDown: true,
|
|
|
|
isDialog: true,
|
|
|
|
itemBuilder: (_, index) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
Get.back();
|
|
|
|
// if (beforeSelectedCheck != null)
|
|
|
|
// {
|
|
|
|
// if (beforeSelectedCheck!(controller.list[index]))
|
|
|
|
// {onSelected!(controller.list[index])}
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {onSelected!(controller.list[index])}
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenAdaper.width(5),
|
|
|
|
vertical: ScreenAdaper.height(10)),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
controller.list[index].name,
|
|
|
|
style: TextStyle(fontSize: ScreenAdaper.height(25)),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
));
|
|
|
|
},
|
|
|
|
// onSelected: (SaleQuotationItemModel info) {
|
|
|
|
// Get.back();
|
|
|
|
// // groups.add(info);
|
|
|
|
// },
|
|
|
|
),
|
|
|
|
width: Get.width - ScreenAdaper.width(50))
|
|
|
|
.then((value) => Get.delete<ItemSearchMoreController>());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class GroupSearchMoreController extends GetxController
|
|
|
|
with BaseSearchMore<SaleQuotationModel> {
|
|
|
|
@override
|
|
|
|
Future<List<SaleQuotationModel>> getData({bool isRefresh = false}) async {
|
|
|
|
List<SaleQuotationModel> newList = [
|
|
|
|
SaleQuotationModel(name: '中间过渡架电控部分', items: []),
|
|
|
|
SaleQuotationModel(name: '端头架电控部分', items: []),
|
|
|
|
SaleQuotationModel(name: '主阀部分', items: []),
|
|
|
|
SaleQuotationModel(name: '自动反冲洗过滤器部分', items: []),
|
|
|
|
SaleQuotationModel(name: '位移测量部分', items: []),
|
|
|
|
SaleQuotationModel(name: '压力检测部分', items: []),
|
|
|
|
SaleQuotationModel(name: '煤机定位部分', items: []),
|
|
|
|
SaleQuotationModel(name: '姿态检测部分', items: []),
|
|
|
|
];
|
|
|
|
list.assignAll(newList);
|
|
|
|
return newList;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class ItemSearchMoreController extends GetxController
|
|
|
|
with BaseSearchMore<SaleQuotationItemModel> {
|
|
|
|
@override
|
|
|
|
Future<List<SaleQuotationItemModel>> getData({bool isRefresh = false}) async {
|
|
|
|
List<SaleQuotationItemModel> newList = [
|
|
|
|
SaleQuotationItemModel(name: '矿用本安型支架控制器', unit: '台', spec: 'ZDYZ-Z'),
|
|
|
|
SaleQuotationItemModel(name: '矿用本安型电磁阀驱动器'),
|
|
|
|
SaleQuotationItemModel(name: '矿用隔爆兼本安型电源'),
|
|
|
|
SaleQuotationItemModel(name: '矿用本安型隔离耦合器'),
|
|
|
|
SaleQuotationItemModel(name: '钢丝编织橡胶护套连接器'),
|
|
|
|
SaleQuotationItemModel(name: '钢丝编织橡胶护套连接器', remark: '控制器-控制器'),
|
|
|
|
SaleQuotationItemModel(name: '钢丝编织橡胶护套连接器', remark: '控制器-驱动器'),
|
|
|
|
SaleQuotationItemModel(name: '钢丝编织橡胶护套连接器', remark: '控制器-隔离耦合器'),
|
|
|
|
SaleQuotationItemModel(name: '矿用本安型支架无线遥控器'),
|
|
|
|
SaleQuotationItemModel(name: '矿用隔爆兼本安型电源'),
|
|
|
|
SaleQuotationItemModel(name: '电液换向阀(10功能10接口)', remark: '中间过渡架主阀组'),
|
|
|
|
SaleQuotationItemModel(name: '电液换向阀(20功能20接口)', remark: '端头架主阀组'),
|
|
|
|
SaleQuotationItemModel(name: '自动反冲洗过滤装置', remark: '流量:900L/min,过滤精度25μm'),
|
|
|
|
SaleQuotationItemModel(name: '全自动反冲洗过滤器电缆', remark: '控制器-自动反冲洗'),
|
|
|
|
SaleQuotationItemModel(name: '矿用本安型位移传感器'),
|
|
|
|
SaleQuotationItemModel(name: '矿用本安型压力传感器'),
|
|
|
|
SaleQuotationItemModel(name: '矿用本安型红外发射器'),
|
|
|
|
SaleQuotationItemModel(name: '矿用本安型LED信号灯'),
|
|
|
|
SaleQuotationItemModel(name: '倾角传感器'),
|
|
|
|
SaleQuotationItemModel(name: '各类安装附件'),
|
|
|
|
];
|
|
|
|
list.assignAll(newList);
|
|
|
|
return newList;
|
|
|
|
}
|
2024-04-01 17:35:34 +08:00
|
|
|
}
|